Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
Add copyright header and remove unused interface
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
  • Loading branch information
miurahr committed Mar 17, 2022
1 parent d893750 commit 18c4a99
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 29 deletions.
18 changes: 18 additions & 0 deletions src/main/java/io/github/eb4j/ebview/gui/EBViewerModel.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.gui;

import io.github.eb4j.ebview.data.DictionaryEntry;
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/io/github/eb4j/ebview/gui/IMainMenu.java

This file was deleted.

18 changes: 18 additions & 0 deletions src/main/java/io/github/eb4j/ebview/gui/LinkActionListener.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.gui;

import io.github.eb4j.ebview.gui.dialogs.MoviePlay;
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/io/github/eb4j/ebview/gui/MainWindow.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.gui;

import io.github.eb4j.ebview.data.DictionaryEntry;
Expand Down
21 changes: 19 additions & 2 deletions src/main/java/io/github/eb4j/ebview/gui/MainWindowMenu.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.gui;

import io.github.eb4j.ebview.EBViewer;
import io.github.eb4j.ebview.dictionary.DictionariesManager;
import io.github.eb4j.ebview.gui.dialogs.AboutDialog;
import io.github.eb4j.ebview.gui.preferences.IPreferencesController;
import io.github.eb4j.ebview.gui.preferences.PreferenceController;
import io.github.eb4j.ebview.utils.LStrings;

Expand All @@ -28,7 +45,7 @@

import static io.github.eb4j.ebview.utils.ResourceUtil.APP_ICON_32X32;

public class MainWindowMenu implements ActionListener, MenuListener, IMainMenu {
public class MainWindowMenu implements ActionListener, MenuListener {

private final JFrame app;
private final DictionariesManager manager;
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/io/github/eb4j/ebview/gui/Searcher.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.gui;

import io.github.eb4j.ebview.data.DictionaryEntry;
Expand Down
54 changes: 54 additions & 0 deletions src/main/java/io/github/eb4j/ebview/utils/IPreferences.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
* Copyright (C) 2000-2006 Keith Godfrey, Maxym Mykhalchuk, and Henry Pijffers
* 2007 Zoltan Bartko
* 2008-2009 Didier Briel
* 2010 Wildrich Fourie, Antonio Vilei, Didier Briel
* 2011 John Moran, Didier Briel
* 2012 Martin Fleurke, Wildrich Fourie, Didier Briel, Thomas Cordonnier,
* Aaron Madlon-Kay
* 2013 Aaron Madlon-Kay, Zoltan Bartko
* 2014 Piotr Kulik, Aaron Madlon-Kay
* 2015 Aaron Madlon-Kay, Yu Tang, Didier Briel, Hiroshi Miura
* 2016 Aaron Madlon-Kay*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.utils;

import java.io.IOException;

public interface IPreferences {
String getPreference(String key);

boolean existsPreference(String key);

boolean isPreference(String key);

boolean isPreferenceDefault(String key, boolean defaultValue);

String getPreferenceDefault(String key, String value);

<T extends Enum<T>> T getPreferenceEnumDefault(String key, T defaultValue);

int getPreferenceDefault(String key, int defaultValue);

/**
* Return the old value, or null if not set
*/
Object setPreference(String key, Object value) throws Exception;

void save() throws IOException;
}
18 changes: 18 additions & 0 deletions src/main/java/io/github/eb4j/ebview/utils/ImageUtils.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.utils;

import io.github.eb4j.util.ImageUtil;
Expand Down
25 changes: 21 additions & 4 deletions src/main/java/io/github/eb4j/ebview/utils/LStrings.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.utils;

import java.util.ResourceBundle;
Expand All @@ -7,11 +25,10 @@ public final class LStrings {
private LStrings() {
}

/** Resource bundle that contains all the strings.
*/
private static ResourceBundle bundle = ResourceBundle.getBundle("Bundle");
private static final ResourceBundle bundle = ResourceBundle.getBundle("Bundle");

/** Returns a localized String for a key.
/**
* Returns a localized String for a key.
* @param key query string.
* @return localized string.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/io/github/eb4j/ebview/utils/Platform.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* 2007 - Zoltan Bartko
* 2011 Alex Buloichik*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand Down
26 changes: 11 additions & 15 deletions src/main/java/io/github/eb4j/ebview/utils/Preferences.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
*
* Copyright (C) 2000-2006 Keith Godfrey, Maxym Mykhalchuk, and Henry Pijffers
* 2007 Zoltan Bartko
* 2008-2009 Didier Briel
* 2010 Wildrich Fourie, Antonio Vilei, Didier Briel
* 2011 John Moran, Didier Briel
* 2012 Martin Fleurke, Wildrich Fourie, Didier Briel, Thomas Cordonnier,
* Aaron Madlon-Kay
* 2013 Aaron Madlon-Kay, Zoltan Bartko
* 2014 Piotr Kulik, Aaron Madlon-Kay
* 2015 Aaron Madlon-Kay, Yu Tang, Didier Briel, Hiroshi Miura
* 2016 Aaron Madlon-Kay
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand All @@ -24,7 +34,6 @@
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;

public final class Preferences {

Expand Down Expand Up @@ -101,19 +110,6 @@ public static void save() {
}
}

public interface IPreferences {
String getPreference(String key);
boolean existsPreference(String key);
boolean isPreference(String key);
boolean isPreferenceDefault(String key, boolean defaultValue);
String getPreferenceDefault(String key, String value);
<T extends Enum<T>> T getPreferenceEnumDefault(String key, T defaultValue);
int getPreferenceDefault(String key, int defaultValue);
/** Return the old value, or null if not set */
Object setPreference(String key, Object value) throws Exception;
void save() throws IOException;
}

public static void init() throws JsonProcessingException {
if (didInit) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;

public class PreferencesImpl implements Preferences.IPreferences {
public class PreferencesImpl implements IPreferences {

private final ObjectNode preferences;
private final File preferenceFile;
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/io/github/eb4j/ebview/utils/Stemmer.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
* Copyright (C) 2000-2006 Keith Godfrey, Maxym Mykhalchuk, and Henry Pijffers
* 2007 Didier Briel, Zoltan Bartko
* 2008 Alex Buloichik
* 2015 Didier Briel, Aaron Madlon-Kay*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.utils;

import org.apache.commons.lang3.StringUtils;
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/io/github/eb4j/ebview/utils/WordIterator.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* EBViewer, a dictionary viewer application.
* Copyright (C) 2022 Hiroshi Miura.
* Copyright (C) 2000-2006 Keith Godfrey and Maxym Mykhalchuk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package io.github.eb4j.ebview.utils;

import java.text.BreakIterator;
Expand Down

0 comments on commit 18c4a99

Please sign in to comment.