diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java index 15bcfce642a3f08f6056fdc9fb297cd3fd7e4c87..b48e4112826df75319ab9a35c8faa1e0db9d7900 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java @@ -52,7 +52,6 @@ import static org.cytoscape.work.ServiceProperties.COMMAND_NAMESPACE; import de.hhu.ba.yoshikoWrapper.core.ConfigurationManager; import de.hhu.ba.yoshikoWrapper.core.CyCore; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; -import de.hhu.ba.yoshikoWrapper.core.YoshUtil; import de.hhu.ba.yoshikoWrapper.core.YoshikoLoader; import de.hhu.ba.yoshikoWrapper.swing.components.MainPanel; import de.hhu.ba.yoshikoWrapper.taskFactories.CommandTaskFactory; @@ -94,11 +93,11 @@ public class CyActivator extends AbstractCyActivator { CyCore.rootNetworkManager = getService(context,CyRootNetworkManager.class); //TODO: Not sure how to correctly infer arguments here CyCore.renderingEngineFactory = getService(context,RenderingEngineFactory.class); - CyCore.cloneNetworkTaskFactory = getService(context,CloneNetworkTaskFactory.class); + //CyCore.cloneNetworkTaskFactory = getService(context,CloneNetworkTaskFactory.class); CyCore.commandExecutorTaskFactory = getService(context,CommandExecutorTaskFactory.class); //Store a reference to the Version for easier access - YoshUtil.version = context.getBundle().getVersion(); + //YoshUtil.version = context.getBundle().getVersion(); //Set language according to settings -> Default to enUS LocalizationManager.switchLanguage(cm.getProperties().getProperty("locale", "enUS")); diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java index 0707782327a120d99aae7875d0a09ae0ea03c4e8..a7daab2b2db0bd4924af493749ea57244518bf61 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/CyCore.java @@ -55,7 +55,7 @@ public class CyCore { public static CyApplicationManager cy; public static DialogTaskManager dialogTaskManager; public static ConfigurationManager cm; - public static BundleContext context; + //public static BundleContext context; public static CyServiceRegistrar registrar; public static CyNetworkViewFactory networkViewFactory; public static CyNetworkFactory networkFactory; @@ -68,7 +68,7 @@ public class CyCore { public static VisualMappingFunctionFactory continuousMappingFactory; public static CyRootNetworkManager rootNetworkManager; public static RenderingEngineFactory<CyNetwork> renderingEngineFactory; - public static CloneNetworkTaskFactory cloneNetworkTaskFactory; + //public static CloneNetworkTaskFactory cloneNetworkTaskFactory; public static CommandExecutorTaskFactory commandExecutorTaskFactory; // diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java index 70a972e2b65efacf49b9c85bae09f99cf14e6ee8..7f55098e4ac0cc4f00a45c4ad02d5e01934489fb 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/LocalizationManager.java @@ -1,16 +1,16 @@ /******************************************************************************* * Copyright (C) 2017 Philipp Spohr - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -30,21 +30,21 @@ import java.util.ResourceBundle; * This class should never be initialized */ public class LocalizationManager { - + /** * Default constructor, hidden to prevent invocation */ private LocalizationManager() {}; - + //Locales - + static public final Locale usEnglish = new Locale("en","US"); static public final Locale german = new Locale("de","DE"); static public final Locale serbocroatianLatin = new Locale("hr","HR"); static public final Locale modernGreek = new Locale("el","EL"); //Map - + static private final HashMap<String, Locale> locales; static { @@ -56,12 +56,12 @@ public class LocalizationManager { } - + static private ResourceBundle currentBundle; - + static private Locale currentLocale = usEnglish; - + private static void updateBundle() { currentBundle = ResourceBundle.getBundle("YoshikoStrings",currentLocale); CyCore.cm.getProperties().setProperty( @@ -69,22 +69,22 @@ public class LocalizationManager { currentLocale.getLanguage()+currentLocale.getCountry() ); } - + //https://en.wikipedia.org/wiki/Regional_Indicator_Symbol -> Right now there are not enough fonts support this - public static String localeToUnicodeFlag(Locale locale) { - String countryCode = locale.getCountry(); - int firstLetter = Character.codePointAt(countryCode, 0)-0x41+0x1F1E6; - int secondLetter = Character.codePointAt(countryCode, 1)-0x41+0x1F1E6; - return new String(Character.toChars(firstLetter))+new String(Character.toChars(secondLetter)); - } +// public static String localeToUnicodeFlag(Locale locale) { +// String countryCode = locale.getCountry(); +// int firstLetter = Character.codePointAt(countryCode, 0)-0x41+0x1F1E6; +// int secondLetter = Character.codePointAt(countryCode, 1)-0x41+0x1F1E6; +// return new String(Character.toChars(firstLetter))+new String(Character.toChars(secondLetter)); +// } //SETTER/GETTER methods - + static public Collection<Locale> getLocales(){ return locales.values(); } - + /** * Returns the localized string corresponding to the given key. * This is the main method that should be used for accessing strings and is preferable to any use of constant strings. @@ -97,7 +97,7 @@ public class LocalizationManager { } return currentBundle.getString(key); } - + static public void switchLanguage(Locale lcl) { currentLocale = lcl; updateBundle(); diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshUtil.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshUtil.java deleted file mode 100644 index 9580bd570bd9236e71f08aced0b19b57cc941141..0000000000000000000000000000000000000000 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshUtil.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.hhu.ba.yoshikoWrapper.core; - - -import org.osgi.framework.Version; - -public class YoshUtil { - public static Version version; - - public static final String ABOUT_LINK = "https://spqrph.github.io/cytoscape-tutorials/presentations/yoshiko/yoshiko.html#/title"; -} diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java b/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java index b569a77a709193df99689ed8c66c024c50545aa0..1ef7cc8345a480edecdeadb8803c5e8634e838e4 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java @@ -55,14 +55,14 @@ public class GraphAnalyzer { return false; } - public static boolean isDirected(CyNetwork net) { - for (CyEdge e: net.getEdgeList()) { - if (e.isDirected()) { - return true; - } - } - return false; - } +// public static boolean isDirected(CyNetwork net) { +// for (CyEdge e: net.getEdgeList()) { +// if (e.isDirected()) { +// return true; +// } +// } +// return false; +// } /** * Generates a fitting bitmask by choosing the reduction rules that appear to be the best choice based on current research diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java index bb7a004b480438f9f90e1bc0884b469d0ec2e844..fc2dc1887274ab61b759b955382d35cee3c300ed 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java @@ -4,16 +4,11 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; -import java.io.IOException; -import java.net.URI; -import java.util.HashMap; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JButton; -import javax.swing.JOptionPane; -import org.cytoscape.command.CommandExecutorTaskFactory; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.cytoUtil.CommandExecutor; diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/IntegerInputField.java b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/IntegerInputField.java index 04ffa2f772d4fb3a85a799cceddcdbff4399b690..d7d337652ee5627a088f5eb4d714c69fcdc9e95a 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/IntegerInputField.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/IntegerInputField.java @@ -1,16 +1,16 @@ /******************************************************************************* * Copyright (C) 2017 Philipp Spohr - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -31,21 +31,21 @@ import de.hhu.ba.yoshikoWrapper.swing.FormatHelper; */ @SuppressWarnings("serial") public class IntegerInputField extends JFormattedTextField{ - + private final NumberFormatter formatter; - public IntegerInputField(int minValue, int maxValue) { - super(); - formatter = FormatHelper.getIntegerFormatter(minValue,maxValue); - this.setFormatter(formatter); - this.setColumns(8); - } +// public IntegerInputField(int minValue, int maxValue) { +// super(); +// formatter = FormatHelper.getIntegerFormatter(minValue,maxValue); +// this.setFormatter(formatter); +// this.setColumns(8); +// } public IntegerInputField() { super(); formatter = FormatHelper.getIntegerFormatter(); this.setFormatter(formatter); - this.setColumns(8); + this.setColumns(8); } public int getValueAsInt() { diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetClustersTask.java b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetClustersTask.java index 9975bbaa8b583f5a6947a2bf83a1168b3cf3ca50..0afa05ee33f92ccef1c46a09cdcccb6cfd4ba1c5 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetClustersTask.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetClustersTask.java @@ -34,9 +34,7 @@ public class GetClustersTask implements ObservableTask { } @Override - public void cancel() { - - } + public void cancel() {} @SuppressWarnings("unchecked") @Override diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetSolutionsTask.java b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetSolutionsTask.java index 318cc18dd7188c77c1cee7ce8074b3ac8941cbdb..cac56b267d25cd5290e1f5f3782d009ce487e18e 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetSolutionsTask.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/GetSolutionsTask.java @@ -1,6 +1,5 @@ package de.hhu.ba.yoshikoWrapper.tasks; -import java.util.ArrayList; import java.util.Collection; import org.cytoscape.work.ObservableTask;