From 8e2003764e0f6e76029625fb15ad1aae07126b39 Mon Sep 17 00:00:00 2001 From: Li Huang Date: Sun, 22 Oct 2017 14:49:09 -0400 Subject: [PATCH] Revert "Refs #33: Create sub packages for different classes" This reverts commit aff4a131dddfd0a5ba79de63e57e547c0926bdef. --- .gitignore | 2 +- .../internal/{util => }/Algorithms.java | 2 +- .../path_linker/internal/CyActivator.java | 5 ---- .../{util => }/EdgeWeightSetting.java | 2 +- .../{view => }/PathLinkerAboutMenuDialog.java | 2 +- .../PathLinkerColumnUpdateListener.java | 4 +-- .../{view => }/PathLinkerControlPanel.java | 27 +++++++++---------- .../internal/PathLinkerMenuAction.java | 4 +-- .../internal/{model => }/PathLinkerModel.java | 6 ++--- .../PathLinkerNetworkEventListener.java | 4 +-- .../PathLinkerNodeSelectionListener.java | 4 +-- .../{view => }/PathLinkerResultPanel.java | 6 ++--- .../internal/PathLinkerModelTest.java | 4 +-- 13 files changed, 26 insertions(+), 46 deletions(-) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{util => }/Algorithms.java (99%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{util => }/EdgeWeightSetting.java (80%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{view => }/PathLinkerAboutMenuDialog.java (98%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{event => }/PathLinkerColumnUpdateListener.java (91%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{view => }/PathLinkerControlPanel.java (98%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{model => }/PathLinkerModel.java (99%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{event => }/PathLinkerNetworkEventListener.java (92%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{event => }/PathLinkerNodeSelectionListener.java (94%) rename src/main/java/com/dpgil/pathlinker/path_linker/internal/{view => }/PathLinkerResultPanel.java (99%) diff --git a/.gitignore b/.gitignore index d2b443e..8773fd6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ target/ .repo .uuid -.gitignore/bin/ +.gitignore \ No newline at end of file diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/util/Algorithms.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/Algorithms.java similarity index 99% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/util/Algorithms.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/Algorithms.java index ccbd7b5..d4977ae 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/util/Algorithms.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/Algorithms.java @@ -1,4 +1,4 @@ -package com.dpgil.pathlinker.path_linker.internal.util; +package com.dpgil.pathlinker.path_linker.internal; import java.util.Comparator; import java.util.Collections; diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/CyActivator.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/CyActivator.java index f4db812..8a6fd59 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/CyActivator.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/CyActivator.java @@ -18,11 +18,6 @@ import org.cytoscape.service.util.CyServiceRegistrar; import org.osgi.framework.BundleContext; -import com.dpgil.pathlinker.path_linker.internal.event.PathLinkerColumnUpdateListener; -import com.dpgil.pathlinker.path_linker.internal.event.PathLinkerNetworkEventListener; -import com.dpgil.pathlinker.path_linker.internal.event.PathLinkerNodeSelectionListener; -import com.dpgil.pathlinker.path_linker.internal.view.PathLinkerControlPanel; - /** * // ------------------------------------------------------------------------- * /** CyActivator class for the PathLinker Cytoscape Plugin. Runs when diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/util/EdgeWeightSetting.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/EdgeWeightSetting.java similarity index 80% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/util/EdgeWeightSetting.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/EdgeWeightSetting.java index e8b663b..85d2710 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/util/EdgeWeightSetting.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/EdgeWeightSetting.java @@ -1,4 +1,4 @@ -package com.dpgil.pathlinker.path_linker.internal.util; +package com.dpgil.pathlinker.path_linker.internal; /** * Setting of the edge weight selected by the user diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerAboutMenuDialog.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerAboutMenuDialog.java similarity index 98% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerAboutMenuDialog.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerAboutMenuDialog.java index f1f0f51..d086945 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerAboutMenuDialog.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerAboutMenuDialog.java @@ -1,4 +1,4 @@ -package com.dpgil.pathlinker.path_linker.internal.view; +package com.dpgil.pathlinker.path_linker.internal; import java.awt.BorderLayout; import java.awt.Desktop; diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerColumnUpdateListener.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerColumnUpdateListener.java similarity index 91% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerColumnUpdateListener.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerColumnUpdateListener.java index 3368ebb..7ba5c28 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerColumnUpdateListener.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerColumnUpdateListener.java @@ -1,4 +1,4 @@ -package com.dpgil.pathlinker.path_linker.internal.event; +package com.dpgil.pathlinker.path_linker.internal; import org.cytoscape.model.events.ColumnCreatedEvent; import org.cytoscape.model.events.ColumnCreatedListener; @@ -7,8 +7,6 @@ import org.cytoscape.model.events.ColumnNameChangedEvent; import org.cytoscape.model.events.ColumnNameChangedListener; -import com.dpgil.pathlinker.path_linker.internal.view.PathLinkerControlPanel; - /** * Listener class for _edgeWeightColumnBox in PathLinkerPanel class * Updates the _suidToPathIndexMap and _pathIndexToSuidMap diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerControlPanel.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerControlPanel.java similarity index 98% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerControlPanel.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerControlPanel.java index 4ca2869..3bbcf71 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerControlPanel.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerControlPanel.java @@ -1,9 +1,6 @@ -package com.dpgil.pathlinker.path_linker.internal.view; +package com.dpgil.pathlinker.path_linker.internal; -import com.dpgil.pathlinker.path_linker.internal.event.PathLinkerNodeSelectionListener; -import com.dpgil.pathlinker.path_linker.internal.model.PathLinkerModel; -import com.dpgil.pathlinker.path_linker.internal.util.EdgeWeightSetting; -import com.dpgil.pathlinker.path_linker.internal.util.Algorithms.Path; +import com.dpgil.pathlinker.path_linker.internal.Algorithms.Path; import java.awt.BorderLayout; import java.awt.Color; @@ -83,13 +80,13 @@ public class PathLinkerControlPanel extends JPanel implements CytoPanelComponent private JButton _helpBtn; private JButton _aboutBtn; - public static JButton _loadNodeToSourceButton; - public static JButton _loadNodeToTargetButton; + protected static JButton _loadNodeToSourceButton; + protected static JButton _loadNodeToTargetButton; private JButton _clearSourceTargetPanelButton; private JButton _submitButton; private JButton _closeButton; - public static JComboBox _networkCmb; + protected static JComboBox _networkCmb; protected static JComboBox _edgeWeightColumnBox; private static ButtonGroup _weightedOptionGroup; private static JRadioButton _unweighted; @@ -97,14 +94,14 @@ public class PathLinkerControlPanel extends JPanel implements CytoPanelComponent private static JRadioButton _weightedProbabilities; private JCheckBox _allowSourcesTargetsInPathsOption; - public static JCheckBox _targetsSameAsSourcesOption; + protected static JCheckBox _targetsSameAsSourcesOption; private JCheckBox _includePathScoreTiesOption; private CyServiceRegistrar _serviceRegistrar; /** Cytoscape class for network and view management */ private CySwingApplication _cySwingApp; - public static CyApplicationManager _applicationManager; + protected static CyApplicationManager _applicationManager; private static CyNetworkManager _networkManager; private CyAppAdapter _adapter; @@ -142,11 +139,11 @@ public class PathLinkerControlPanel extends JPanel implements CytoPanelComponent /** The map stores the index-SUID pair of each network inside the networkCmb */ protected static Map _indexToSUIDMap; /** The map stores the SUID-index pair of each network inside the networkCmb */ - public static Map _suidToIndexMap; + protected static Map _suidToIndexMap; /** The map stores the SUID to path index column name pair of each network */ - public static Map _suidToPathIndexMap; + protected static Map _suidToPathIndexMap; /** The map stores path index column name to SUID pair of each network */ - public static Map _pathIndexToSuidMap; + protected static Map _pathIndexToSuidMap; /** Global sync index number to sync network, Path Index, and result names upon creation */ protected static int nameIndex; @@ -435,7 +432,7 @@ public void actionPerformed(ActionEvent e) { * construct/update the combo box items for selecting edge weight * Called by PathLinkerNetworkEventListener and PathLinkerColumnUpdateListener class if event triggered */ - public static void updateEdgeWeightColumn() { + protected static void updateEdgeWeightColumn() { _edgeWeightColumnBox.removeAllItems(); //remove all items for update @@ -461,7 +458,7 @@ public static void updateEdgeWeightColumn() { * Use when the PathLinker starts * when network name is changed */ - public static void initializeNetworkCmb() { + protected static void initializeNetworkCmb() { //make sure combo box and related maps is empty when initializing _networkCmb.removeAllItems(); diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerMenuAction.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerMenuAction.java index 69ecdaf..467a0b8 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerMenuAction.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerMenuAction.java @@ -1,12 +1,10 @@ package com.dpgil.pathlinker.path_linker.internal; +import com.dpgil.pathlinker.path_linker.internal.PathLinkerControlPanel.PanelState; import java.awt.event.ActionEvent; import org.cytoscape.application.CyApplicationManager; import org.cytoscape.application.swing.AbstractCyAction; -import com.dpgil.pathlinker.path_linker.internal.view.PathLinkerControlPanel; -import com.dpgil.pathlinker.path_linker.internal.view.PathLinkerControlPanel.PanelState; - /** * // ------------------------------------------------------------------------- * /** Menu option to open the PathLinker plugin diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/model/PathLinkerModel.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerModel.java similarity index 99% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/model/PathLinkerModel.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerModel.java index 1684184..84a6d89 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/model/PathLinkerModel.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerModel.java @@ -1,4 +1,4 @@ -package com.dpgil.pathlinker.path_linker.internal.model; +package com.dpgil.pathlinker.path_linker.internal; import java.util.ArrayList; import java.util.Arrays; @@ -13,9 +13,7 @@ import org.cytoscape.model.subnetwork.CyRootNetwork; import org.cytoscape.model.subnetwork.CySubNetwork; -import com.dpgil.pathlinker.path_linker.internal.util.Algorithms; -import com.dpgil.pathlinker.path_linker.internal.util.EdgeWeightSetting; -import com.dpgil.pathlinker.path_linker.internal.util.Algorithms.Path; +import com.dpgil.pathlinker.path_linker.internal.Algorithms.Path; /** Back end model for the PathLinker plugin */ public class PathLinkerModel { diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerNetworkEventListener.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerNetworkEventListener.java similarity index 92% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerNetworkEventListener.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerNetworkEventListener.java index b7267d3..5655e14 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerNetworkEventListener.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerNetworkEventListener.java @@ -1,4 +1,4 @@ -package com.dpgil.pathlinker.path_linker.internal.event; +package com.dpgil.pathlinker.path_linker.internal; import org.cytoscape.application.events.SetCurrentNetworkEvent; import org.cytoscape.application.events.SetCurrentNetworkListener; @@ -8,8 +8,6 @@ import org.cytoscape.model.events.NetworkDestroyedEvent; import org.cytoscape.model.events.NetworkDestroyedListener; -import com.dpgil.pathlinker.path_linker.internal.view.PathLinkerControlPanel; - /** * Listener class for _edgeWeightColumnBox * _networkCmb diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerNodeSelectionListener.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerNodeSelectionListener.java similarity index 94% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerNodeSelectionListener.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerNodeSelectionListener.java index a740e3c..c4c1dae 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/event/PathLinkerNodeSelectionListener.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerNodeSelectionListener.java @@ -1,12 +1,10 @@ -package com.dpgil.pathlinker.path_linker.internal.event; +package com.dpgil.pathlinker.path_linker.internal; import org.cytoscape.model.CyNetwork; import org.cytoscape.model.events.RowSetRecord; import org.cytoscape.model.events.RowsSetEvent; import org.cytoscape.model.events.RowsSetListener; -import com.dpgil.pathlinker.path_linker.internal.view.PathLinkerControlPanel; - /** Listener class for _loadNodeToSourceButton and _loadNodeToTargetButton in PathLinkerPanel class */ public class PathLinkerNodeSelectionListener implements RowsSetListener { diff --git a/src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerResultPanel.java b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerResultPanel.java similarity index 99% rename from src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerResultPanel.java rename to src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerResultPanel.java index fa430ce..de58a9e 100644 --- a/src/main/java/com/dpgil/pathlinker/path_linker/internal/view/PathLinkerResultPanel.java +++ b/src/main/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerResultPanel.java @@ -1,4 +1,6 @@ -package com.dpgil.pathlinker.path_linker.internal.view; +package com.dpgil.pathlinker.path_linker.internal; + +import com.dpgil.pathlinker.path_linker.internal.Algorithms.Path; import java.awt.Component; import java.awt.Container; @@ -37,8 +39,6 @@ import org.cytoscape.model.CyNode; import org.cytoscape.model.CyTableUtil; -import com.dpgil.pathlinker.path_linker.internal.util.Algorithms.Path; - /** * // ------------------------------------------------------------------------- * /** Panel that displays the results for the PathLinker CytoScape plugin diff --git a/src/test/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerModelTest.java b/src/test/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerModelTest.java index c52f78f..0738466 100644 --- a/src/test/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerModelTest.java +++ b/src/test/java/com/dpgil/pathlinker/path_linker/internal/PathLinkerModelTest.java @@ -21,9 +21,7 @@ import org.junit.Before; import org.junit.Test; -import com.dpgil.pathlinker.path_linker.internal.model.PathLinkerModel; -import com.dpgil.pathlinker.path_linker.internal.util.EdgeWeightSetting; -import com.dpgil.pathlinker.path_linker.internal.util.Algorithms.Path; +import com.dpgil.pathlinker.path_linker.internal.Algorithms.Path; /** JUnit Test class for the PathLinker */ public class PathLinkerModelTest {