Author: ruschein
Date: 2010-10-27 16:58:53 -0700 (Wed, 27 Oct 2010)
New Revision: 22536
Modified:
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/plugin/QuickFindPlugIn.java
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindConfigDialog.java
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindPanel.java
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context-osgi.xml
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context.xml
Log:
Fixed fallout from refactoring CyNetworkManager.
Modified:
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/plugin/QuickFindPlugIn.java
===================================================================
---
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/plugin/QuickFindPlugIn.java
2010-10-27 23:50:22 UTC (rev 22535)
+++
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/plugin/QuickFindPlugIn.java
2010-10-27 23:58:53 UTC (rev 22536)
@@ -76,7 +76,6 @@
import org.cytoscape.session.events.NetworkViewDestroyedEvent;
import org.cytoscape.session.events.NetworkViewAddedEvent;
import org.cytoscape.session.events.SetCurrentNetworkViewEvent;
-import org.cytoscape.session.CyNetworkManager;
//import cytoscape.view.CySwingApplication;
import org.cytoscape.view.model.CyNetworkView;
@@ -88,7 +87,7 @@
import org.cytoscape.session.events.NetworkViewAddedListener;
import org.cytoscape.session.events.NetworkViewDestroyedListener;
-import org.cytoscape.session.CyNetworkManager;
+import org.cytoscape.session.CyApplicationManager;
import cytoscape.view.CySwingApplication;
import org.cytoscape.work.TaskManager;
@@ -104,15 +103,15 @@
private static final int NODE_SIZE_MULTIPLER = 10;
public static CySwingApplication cytoscapeDesktop;
- public static CyNetworkManager cyNetworkManagerServiceRef;
+ public static CyApplicationManager applicationManager;
public static TaskManager taskManager;
/**
* Constructor.
*/
- public QuickFindPlugIn(CySwingApplication cytoscapeDesktop,
CyNetworkManager cyNetworkManagerServiceRef,
+ public QuickFindPlugIn(CySwingApplication cytoscapeDesktop,
CyApplicationManager applicationManager,
TaskManager taskmgr){
QuickFindPlugIn.cytoscapeDesktop = cytoscapeDesktop;
- QuickFindPlugIn.cyNetworkManagerServiceRef =
cyNetworkManagerServiceRef;
+ QuickFindPlugIn.applicationManager = applicationManager;
QuickFindPlugIn.taskManager = taskmgr;
initListeners();
@@ -144,7 +143,7 @@
CyMenus cyMenus = QuickFindPlugIn.cytoscapeDesktop.getCyMenus();
CyToolBar toolBar = cyMenus.getToolBar();
- quickFindToolBar = new QuickFindPanel(
QuickFindPlugIn.cyNetworkManagerServiceRef,
+ quickFindToolBar = new QuickFindPanel(
QuickFindPlugIn.applicationManager,
QuickFindPlugIn.cytoscapeDesktop,
QuickFindPlugIn.taskManager);
TextIndexComboBox comboBox =
quickFindToolBar.getTextIndexComboBox();
@@ -167,7 +166,7 @@
final QuickFind quickFind =
QuickFindFactory.getGlobalQuickFindInstance();
// If a network already exists within Cytoscape, index it
- final CyNetwork cyNetwork =
this.cyNetworkManagerServiceRef.getCurrentNetwork();
+ final CyNetwork cyNetwork =
this.applicationManager.getCurrentNetwork();
if ((cyNetwork != null) && (cyNetwork.getNodeCount() > 0)) {
// Run Indexer in separate background daemon thread.
@@ -196,7 +195,7 @@
public void handleEvent(NetworkViewAddedEvent event) {
final QuickFind quickFind =
QuickFindFactory.getGlobalQuickFindInstance();
- final CyNetwork cyNetwork =
this.cyNetworkManagerServiceRef.getCurrentNetwork();
+ final CyNetwork cyNetwork =
this.applicationManager.getCurrentNetwork();
// Run Indexer in separate background daemon thread.
Thread thread = new Thread() {
@@ -224,12 +223,12 @@
* If no network view has focus, disable quick find.
*/
private void swapCurrentNetwork(QuickFind quickFind) {
- CyNetwork network =
this.cyNetworkManagerServiceRef.getCurrentNetwork();
+ CyNetwork network = this.applicationManager.getCurrentNetwork();
boolean networkHasFocus = false;
if (network != null) {
//GraphView networkView =
Cytoscape.getNetworkView(network.getIdentifier());
- View networkView =
this.cyNetworkManagerServiceRef.getNetworkView(network.getSUID());
+ View networkView =
this.applicationManager.getNetworkView(network.getSUID());
//if (networkView != Cytoscape.getNullNetworkView()) {
if (networkView != null) {
@@ -281,7 +280,7 @@
*/
public void indexingEnded() {
QuickFind quickFind =
QuickFindFactory.getGlobalQuickFindInstance();
- CyNetwork cyNetwork =
this.cyNetworkManagerServiceRef.getCurrentNetwork();
+ CyNetwork cyNetwork =
this.applicationManager.getCurrentNetwork();
GenericIndex index = quickFind.getIndex(cyNetwork);
quickFindToolBar.setIndex(index);
quickFindToolBar.enableAllQuickFindButtons();
@@ -313,13 +312,13 @@
SwingUtilities.invokeLater(new Runnable() {
public void run() {
QuickFind quickFind =
QuickFindFactory.getGlobalQuickFindInstance();
- final CyNetwork cyNetwork =
QuickFindPlugIn.cyNetworkManagerServiceRef.getCurrentNetwork();
+ final CyNetwork cyNetwork =
QuickFindPlugIn.applicationManager.getCurrentNetwork();
GenericIndex index =
quickFind.getIndex(cyNetwork);
if (index.getIndexType() ==
QuickFind.INDEX_NODES) {
//network.setSelectedNodeState(list, true);
QuickFindPlugIn.setSelectedNodeState(network, list, true);
-
QuickFindPlugIn.this.cyNetworkManagerServiceRef.getCurrentNetworkView().fitSelected();
+
QuickFindPlugIn.this.applicationManager.getCurrentNetworkView().fitSelected();
} else {
//network.setSelectedEdgeState(list, true);
QuickFindPlugIn.setSelectedEdgeState(network, list, true);
@@ -335,7 +334,7 @@
//network..setSelectedNodeState(nodeList, true);
QuickFindPlugIn.setSelectedNodeState(network, nodeList, true);
-
//QuickFindPlugIn.this.cyNetworkManagerServiceRef.fitSelected();
+
//QuickFindPlugIn.this.applicationManager.fitSelected();
}
// If only one node is selected,
auto-adjust zoom factor
@@ -345,20 +344,20 @@
CyNode node = (CyNode)
graphObjects[0];
// Obtain dimensions
of current InnerCanvas
- View graphView =
QuickFindPlugIn.this.cyNetworkManagerServiceRef.getCurrentNetworkView();
+ View graphView =
QuickFindPlugIn.this.applicationManager.getCurrentNetworkView();
//Component innerCanvas
= graphView.getComponent();
- View<CyNode> nodeView =
QuickFindPlugIn.this.cyNetworkManagerServiceRef.getCurrentNetworkView().getNodeView(node);
+ View<CyNode> nodeView =
QuickFindPlugIn.this.applicationManager.getCurrentNetworkView().getNodeView(node);
//double width =
nodeView.getWidth() * NODE_SIZE_MULTIPLER;
//double height =
nodeView.getHeight() * NODE_SIZE_MULTIPLER;
//double scaleFactor =
Math.min(innerCanvas.getWidth() / width,
//
(innerCanvas.getHeight() / height));
-
//QuickFindPlugIn.this.cyNetworkManagerServiceRef.getCurrentNetworkView().setZoom(scaleFactor);
+
//QuickFindPlugIn.this.applicationManager.getCurrentNetworkView().setZoom(scaleFactor);
}
}
-
QuickFindPlugIn.this.cyNetworkManagerServiceRef.getCurrentNetworkView().updateView();
+
QuickFindPlugIn.this.applicationManager.getCurrentNetworkView().updateView();
}
});
}
@@ -476,7 +475,7 @@
}
//cyNetwork.setSelectedNodeState(toBeSelected, true);
//cyNetwork.setSelectedNodeState(toBeUnselected, false);
-
QuickFindPlugIn.cyNetworkManagerServiceRef.getCurrentNetworkView().updateView();
+
QuickFindPlugIn.applicationManager.getCurrentNetworkView().updateView();
}
});
}
@@ -526,7 +525,7 @@
CyEdge e = (CyEdge) it.next();
e.attrs().set("selected",
false);
}
-
QuickFindPlugIn.this.cyNetworkManagerServiceRef.getCurrentNetworkView().updateView();
+
QuickFindPlugIn.this.applicationManager.getCurrentNetworkView().updateView();
}
});
}
@@ -557,7 +556,7 @@
*/
public void actionPerformed(ActionEvent e) {
// Get Current Network
- final CyNetwork currentNetwork =
QuickFindPlugIn.cyNetworkManagerServiceRef.getCurrentNetwork();
+ final CyNetwork currentNetwork =
QuickFindPlugIn.applicationManager.getCurrentNetwork();
// Get Current User Selection
Object o = comboBox.getSelectedItem();
@@ -595,7 +594,7 @@
*/
public void stateChanged(ChangeEvent e) {
QuickFind quickFind =
QuickFindFactory.getGlobalQuickFindInstance();
- final CyNetwork cyNetwork =
QuickFindPlugIn.cyNetworkManagerServiceRef.getCurrentNetwork();
+ final CyNetwork cyNetwork =
QuickFindPlugIn.applicationManager.getCurrentNetwork();
GenericIndex index = quickFind.getIndex(cyNetwork);
NumberRangeModel model = (NumberRangeModel) slider.getModel();
@@ -622,7 +621,7 @@
if (event.getPropertyName() != null) {
if (event.getPropertyName().equals(Cytoscape.NETWORK_MODIFIED)) {
- final CyNetwork cyNetwork =
QuickFindPlugIn.cyNetworkManagerServiceRef.getCurrentNetwork();
+ final CyNetwork cyNetwork =
QuickFindPlugIn.applicationManager.getCurrentNetwork();
if (cyNetwork.getNodeList() != null) {
// this network may not have been added
to quick find -
Modified:
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindConfigDialog.java
===================================================================
---
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindConfigDialog.java
2010-10-27 23:50:22 UTC (rev 22535)
+++
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindConfigDialog.java
2010-10-27 23:58:53 UTC (rev 22536)
@@ -47,7 +47,7 @@
import org.cytoscape.model.CyDataTable;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.GraphObject;
-import org.cytoscape.session.CyNetworkManager;
+import org.cytoscape.session.CyApplicationManager;
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskManager;
import org.cytoscape.work.TaskMonitor;
@@ -131,7 +131,7 @@
/**
* Network manager to get current network
*/
- private final CyNetworkManager netMgr;
+ private final CyApplicationManager applicationManager;
/**
* The Cytoscape desktop
@@ -151,14 +151,14 @@
/**
* Constructor.
*/
- public QuickFindConfigDialog(CyNetworkManager netMgr,
+ public QuickFindConfigDialog(CyApplicationManager applicationManager,
CySwingApplication cyDesktop,
TaskManager taskMgr) {
- this.netMgr = netMgr;
+ this.applicationManager = applicationManager;
this.cyDesktop = cyDesktop;
this.taskMgr = taskMgr;
// Initialize, based on currently selected network
- currentNetwork = netMgr.getCurrentNetwork();
+ currentNetwork = applicationManager.getCurrentNetwork();
QuickFind quickFind =
QuickFindFactory.getGlobalQuickFindInstance();
currentIndex = quickFind.getIndex(currentNetwork);
@@ -597,17 +597,17 @@
if (indexType == QuickFind.INDEX_NODES) {
// FIXME: is this correct?
- attributes =
netMgr.getCurrentNetwork().getCyDataTables("node").get(CyNetwork.DEFAULT_ATTRS);
+ attributes =
applicationManager.getCurrentNetwork().getCyDataTables("node").get(CyNetwork.DEFAULT_ATTRS);
} else {
// FIXME: is this correct?
- attributes =
netMgr.getCurrentNetwork().getCyDataTables("edge").get(CyNetwork.DEFAULT_ATTRS);
+ attributes =
applicationManager.getCurrentNetwork().getCyDataTables("edge").get(CyNetwork.DEFAULT_ATTRS);
}
return attributes;
}
- CyNetworkManager getCyNetworkMgr() {
- return netMgr;
+ CyApplicationManager getCyApplicationManager() {
+ return applicationManager;
}
/**
Modified:
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindPanel.java
===================================================================
---
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindPanel.java
2010-10-27 23:50:22 UTC (rev 22535)
+++
cytoscape3/trunk/quickfind/src/main/java/csplugins/quickfind/view/QuickFindPanel.java
2010-10-27 23:58:53 UTC (rev 22536)
@@ -52,7 +52,7 @@
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
-import org.cytoscape.session.CyNetworkManager;
+import org.cytoscape.session.CyApplicationManager;
import org.cytoscape.work.TaskManager;
import java.awt.*;
@@ -74,17 +74,17 @@
private static final String SEARCH_STRING = "Search: ";
private static final String SELECT_STRING = "Select: ";
- private final CyNetworkManager netMgr;
+ private final CyApplicationManager applicationManager;
private final CySwingApplication cyDesktop;
private final TaskManager taskMgr;
/**
* Constructor.
*/
- public QuickFindPanel(CyNetworkManager netMgr,
+ public QuickFindPanel(CyApplicationManager applicationManager,
CySwingApplication cyDesktop,
TaskManager taskMgr) {
- this.netMgr = netMgr;
+ this.applicationManager = applicationManager;
this.cyDesktop = cyDesktop;
this.taskMgr = taskMgr;
@@ -209,7 +209,7 @@
button.setEnabled(false);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
- new QuickFindConfigDialog(netMgr,
cyDesktop, taskMgr);
+ new
QuickFindConfigDialog(applicationManager, cyDesktop, taskMgr);
}
});
button.setBorderPainted(false);
Modified:
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context-osgi.xml
===================================================================
---
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context-osgi.xml
2010-10-27 23:50:22 UTC (rev 22535)
+++
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context-osgi.xml
2010-10-27 23:58:53 UTC (rev 22536)
@@ -11,7 +11,7 @@
keeping these definitions separate is to facilitate integration
testing of the bundle outside of an OSGi container -->
- <osgi:reference id="cyNetworkManagerServiceRef"
interface="org.cytoscape.session.CyNetworkManager" />
+ <osgi:reference id="cyApplicationManagerServiceRef"
interface="org.cytoscape.session.CyApplicationManager" />
<osgi:reference id="cytoscapeDesktopRef"
interface="cytoscape.view.CySwingApplication" />
<osgi:reference id="taskManagerRef"
interface="org.cytoscape.work.TaskManager"/>
Modified:
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context.xml
===================================================================
---
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context.xml
2010-10-27 23:50:22 UTC (rev 22535)
+++
cytoscape3/trunk/quickfind/src/main/resources/META-INF/spring/bundle-context.xml
2010-10-27 23:58:53 UTC (rev 22536)
@@ -10,7 +10,7 @@
<bean name="QuickFindPlugInBean"
class="org.cytoscape.csplugins.quickfind.plugin.QuickFindPlugIn">
<constructor-arg ref="cytoscapeDesktopRef" />
- <constructor-arg ref="cyNetworkManagerServiceRef" />
+ <constructor-arg ref="cyApplicationManagerServiceRef" />
<constructor-arg ref="taskManagerRef" />
</bean>
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.