From 9bb9c5669dd9eb9569e53d32046bcac4504d694c Mon Sep 17 00:00:00 2001 From: lkrsnik Date: Tue, 19 Mar 2024 09:40:46 +0100 Subject: [PATCH] Updated Java to 21 and pom.xml to shade --- .gitignore | 2 + pom.xml | 130 +++++++++++++++++----------- src/main/java/alg/ngram/Ngrams.java | 3 - src/main/java/gui/CorpusTab.java | 2 - src/main/java/gui/I18N.java | 27 +----- src/main/java/gui/Launcher.java | 8 ++ src/test/java/CorpusTests.java | 17 +--- 7 files changed, 96 insertions(+), 93 deletions(-) create mode 100644 src/main/java/gui/Launcher.java diff --git a/.gitignore b/.gitignore index 349db05..57e7ecb 100755 --- a/.gitignore +++ b/.gitignore @@ -164,3 +164,5 @@ $RECYCLE.BIN/ src/main/resources/translation_external/ src/main/resources/translations_backup/ +shade +TEMP diff --git a/pom.xml b/pom.xml index 17a3e90..be695d8 100755 --- a/pom.xml +++ b/pom.xml @@ -4,9 +4,30 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - thesis - corpus-analyzer - 1.2 + list + list + list + 1.3 + + + + central + Central Repository + https://repo.maven.apache.org/maven2/ + + + central2 + Central Repository2 + https://repo1.maven.org/maven2/ + + + + UTF-8 + 17 + 21 + 12.3.1 + 0.0.8 + @@ -32,7 +53,7 @@ org.controlsfx controlsfx - 8.40.13 + 11.2.0 org.rocksdb @@ -52,71 +73,82 @@ org.kordamp.ikonli ikonli-fontawesome-pack - 1.9.0 + ${ikonli.version} + + + org.openjfx + javafx-controls + ${javafx.version} + + + org.openjfx + javafx-fxml + ${javafx.version} + + + org.openjfx + javafx-graphics + ${javafx.version} + win + + + org.openjfx + javafx-graphics + ${javafx.version} + linux + + + org.openjfx + javafx-graphics + ${javafx.version} + mac org.kordamp.ikonli ikonli-javafx - 1.9.0 + ${ikonli.version} - org.apache.maven.plugins - maven-assembly-plugin + maven-compiler-plugin + 3.11.0 + + + org.openjfx + javafx-maven-plugin + ${javafx.maven.plugin.version} + + gui.GUIController + + + + org.apache.maven.plugins + maven-shade-plugin + 3.2.0 package - single + shade - - - gui.GUIController - - - - jar-with-dependencies - - false - artifact - Corpus_Analyzer_${version} + true + project-classifier + shade\${project.artifactId}.jar + + + gui.Launcher + + - - - com.zenjava - javafx-maven-plugin - 8.8.3 - - gui.GUIController - true - - - - create-jfxjar - package - - build-jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - \ No newline at end of file + diff --git a/src/main/java/alg/ngram/Ngrams.java b/src/main/java/alg/ngram/Ngrams.java index 1065721..1c123ec 100755 --- a/src/main/java/alg/ngram/Ngrams.java +++ b/src/main/java/alg/ngram/Ngrams.java @@ -3,11 +3,8 @@ package alg.ngram; import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.regex.Pattern; import java.util.stream.Collectors; - -import com.sun.xml.internal.bind.v2.runtime.reflect.Lister; import data.*; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; diff --git a/src/main/java/gui/CorpusTab.java b/src/main/java/gui/CorpusTab.java index c8b85cb..76d182d 100755 --- a/src/main/java/gui/CorpusTab.java +++ b/src/main/java/gui/CorpusTab.java @@ -194,8 +194,6 @@ public class CorpusTab { } public void initialize() { - updateTooltipBehavior(0.0, 30000.0,0.0, true); - // add CSS style corpusTabPane.getStylesheets().add("style.css"); corpusTabPane.getStyleClass().add("root"); diff --git a/src/main/java/gui/I18N.java b/src/main/java/gui/I18N.java index 74fb5e6..145f922 100644 --- a/src/main/java/gui/I18N.java +++ b/src/main/java/gui/I18N.java @@ -61,23 +61,13 @@ public final class I18N { public static String get(final String key, final Object... args) { ResourceBundle bundle = ResourceBundle.getBundle("message", getLocale()); String val = bundle.getString(key); - try { - return MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - return val; + return MessageFormat.format(val, args); } public static String getDefaultLocaleItem(final String key, final Object... args) { ResourceBundle bundle = ResourceBundle.getBundle("message", getDefaultLocale()); String val = bundle.getString(key); - try { - return MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - return val; + return MessageFormat.format(val, args); } public static ObservableList getObject(final ArrayList keys, final Object... args) { @@ -86,11 +76,7 @@ public final class I18N { ArrayList results = new ArrayList<>(); for(String key : keys){ String val = bundle.getString(key); - try { - results.add(MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args)); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } + results.add(val); } return FXCollections.observableArrayList(results); @@ -121,12 +107,7 @@ public final class I18N { public static String getIndependent(final String key, Locale locale, final Object... args) { ResourceBundle bundle = ResourceBundle.getBundle("message", locale); String val = bundle.getString(key); - try { - return MessageFormat.format(new String(val.getBytes("ISO-8859-1"), "UTF-8"), args); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - return val; + return MessageFormat.format(val, args); } public static String getRootValue(String oldValue, ArrayList nGramComputeForLetters) { diff --git a/src/main/java/gui/Launcher.java b/src/main/java/gui/Launcher.java new file mode 100644 index 0000000..887bedd --- /dev/null +++ b/src/main/java/gui/Launcher.java @@ -0,0 +1,8 @@ +package gui; + +public class Launcher { + + public static void main(String[] args) { + GUIController.main(args); + } +} diff --git a/src/test/java/CorpusTests.java b/src/test/java/CorpusTests.java index eed40b6..157ee65 100755 --- a/src/test/java/CorpusTests.java +++ b/src/test/java/CorpusTests.java @@ -13,9 +13,7 @@ public class CorpusTests { @Test public void solarTest() { - // File selectedDirectory = new File("/home/luka/Desktop/corpus-analyzer/src/main/resources/Solar"); - // File selectedDirectory = new File("/home/andrej/Desktop/corpus-analyzer/src/main/resources/GOS"); - File selectedDirectory = new File("/home/luka/Development/corpus-analyzer2/src/main/resources/Gigafida_subset/"); + File selectedDirectory = new File("/home/luka/Development/CJVT/list/src/main/resources/Gigafida_subset/"); Settings.resultsFilePath = new File(selectedDirectory.getAbsolutePath().concat(File.separator)); @@ -23,20 +21,7 @@ public class CorpusTests { File f = Settings.corpus.iterator().next(); -// Statistics stats = new Statistics(AnalysisLevel.STRING_LEVEL, 2, 0, CalculateFor.WORD); -// // stats.setCorpusType(CorpusType.GOS); -// stats.setCorpusType(CorpusType.SOLAR); - - // XML_processing.readXMLGos(f.toString(), stats); - // XML_processing.readXML(f.toString(), stats); - // XML_processing.readXMLHeaderTag(f.toString(), "stats"); } -// @Test -// public void test() { -// ObservableList var = GosTaxonomy.getForComboBox(); -// String debug = ""; -// -// } }