Author: pwang
Date: 2012-02-10 17:01:36 -0800 (Fri, 10 Feb 2012)
New Revision: 28241
Modified:
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategoryAction.java
Log:
updated
Modified:
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategoryAction.java
===================================================================
---
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategoryAction.java
2012-02-11 00:54:45 UTC (rev 28240)
+++
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategoryAction.java
2012-02-11 01:01:36 UTC (rev 28241)
@@ -20,8 +20,16 @@
private static final long serialVersionUID =
123456789023451239L;
private static final URL vizmapPropsLocation =
SubnetworkByCategoryAction.class.getResource("/subnetwork_overview_VS.props");
- private VisualStyle overviewVS = null;
+ private static VisualStyle overviewVS;
+ static {
+ // Create visualStyles based on the definition in
property files
+ if (vizmapPropsLocation != null){
+
Cytoscape.firePropertyChange(Cytoscape.VIZMAP_LOADED, null,
vizmapPropsLocation);
+ overviewVS =
Cytoscape.getVisualMappingManager().getCalculatorCatalog().getVisualStyle("subnetwork_overview");
+ }
+ }
+
public SubnetworkByCategoryAction() {
// Give your action a name here
super("Subnetwork by Category");
@@ -30,21 +38,10 @@
// to live in the Plugins menu, so choose whatever
// is appropriate!
setPreferredMenu("Plugins");
-
- // Create visualStyles based on the definition in
property files
- if (vizmapPropsLocation != null){
-
Cytoscape.firePropertyChange(Cytoscape.VIZMAP_LOADED, null,
vizmapPropsLocation);
- overviewVS =
Cytoscape.getVisualMappingManager().getCalculatorCatalog().getVisualStyle("subnetwork_overview");
- }
-
}
public void actionPerformed(ActionEvent e) {
-// String attributeName = "Category";// this is the
default attribute name
- // get attributeName (Type String or int) from user
-
-
String[] attrNames =
Cytoscape.getNodeAttributes().getAttributeNames();
ChooseCategoryAttributeDialog dlg = new
ChooseCategoryAttributeDialog(Cytoscape.getDesktop(), true, attrNames);
@@ -64,8 +61,8 @@
if (view != null){
//Apply VisualStyle
- if (this.overviewVS != null){
-
view.setVisualStyle(this.overviewVS.getName());
+ if (overviewVS != null){
+
view.setVisualStyle(overviewVS.getName());
view.redrawGraph(false, true);
}
--
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.