Author: kono
Date: 2012-08-08 11:07:32 -0700 (Wed, 08 Aug 2012)
New Revision: 30126
Modified:
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2CEditor.java
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2DEditor.java
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/GradientEditor.java
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/legend/ContinuousMappingLegendPanel.java
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/task/ui/LegendDialog.java
Log:
getTable methods are replaced for new API.
Modified:
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2CEditor.java
===================================================================
---
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2CEditor.java
2012-08-08 18:02:21 UTC (rev 30125)
+++
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2CEditor.java
2012-08-08 18:07:32 UTC (rev 30126)
@@ -29,7 +29,13 @@
@SuppressWarnings("unchecked")
Class<? extends CyIdentifiable> type = (Class<? extends
CyIdentifiable>) mapping.getVisualProperty()
.getTargetDataType();
- final CyTable attr =
manager.getTable(appManager.getCurrentNetwork(), type, CyNetwork.DEFAULT_ATTRS);
- this.editorPanel = new C2CMappingEditorPanel<K,
V>(vmm.getCurrentVisualStyle(), mapping, attr, appManager, vmm);
+
+ final String colName = mapping.getMappingColumnName();
+ final CyTable table;
+ if(currentNetwork.getTable(type,
CyNetwork.LOCAL_ATTRS).getColumn(colName)!= null)
+ table = currentNetwork.getTable(type,
CyNetwork.LOCAL_ATTRS);
+ else
+ table=currentNetwork.getTable(type,
CyNetwork.SHARED_ATTRS);
+ this.editorPanel = new C2CMappingEditorPanel<K,
V>(vmm.getCurrentVisualStyle(), mapping, table, appManager, vmm);
}
}
\ No newline at end of file
Modified:
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2DEditor.java
===================================================================
---
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2DEditor.java
2012-08-08 18:02:21 UTC (rev 30125)
+++
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/C2DEditor.java
2012-08-08 18:07:32 UTC (rev 30126)
@@ -32,8 +32,13 @@
@SuppressWarnings("unchecked")
Class<? extends CyIdentifiable> type = (Class<? extends
CyIdentifiable>) mapping.getVisualProperty()
.getTargetDataType();
- final CyTable attr =
manager.getTable(appManager.getCurrentNetwork(), type, CyNetwork.DEFAULT_ATTRS);
- this.editorPanel = new
C2DMappingEditorPanel(vmm.getCurrentVisualStyle(), mapping, attr,
- appManager, vmm, editorManager);
+ final String colName = mapping.getMappingColumnName();
+ final CyTable table;
+ if (currentNetwork.getTable(type,
CyNetwork.LOCAL_ATTRS).getColumn(colName) != null)
+ table = currentNetwork.getTable(type,
CyNetwork.LOCAL_ATTRS);
+ else
+ table = currentNetwork.getTable(type,
CyNetwork.SHARED_ATTRS);
+ this.editorPanel = new
C2DMappingEditorPanel(vmm.getCurrentVisualStyle(), mapping, table, appManager,
vmm,
+ editorManager);
}
}
\ No newline at end of file
Modified:
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/GradientEditor.java
===================================================================
---
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/GradientEditor.java
2012-08-08 18:02:21 UTC (rev 30125)
+++
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/editor/mappingeditor/GradientEditor.java
2012-08-08 18:07:32 UTC (rev 30126)
@@ -34,8 +34,15 @@
@SuppressWarnings("unchecked")
Class<? extends CyIdentifiable> type = (Class<? extends
CyIdentifiable>) mapping.getVisualProperty()
.getTargetDataType();
- final CyTable attr =
manager.getTable(appManager.getCurrentNetwork(), type, CyNetwork.DEFAULT_ATTRS);
- this.editorPanel = new
GradientEditorPanel(vmm.getCurrentVisualStyle(), mapping, attr, appManager,
+
+ final String colName = mapping.getMappingColumnName();
+ final CyTable table;
+ if(currentNetwork.getTable(type,
CyNetwork.LOCAL_ATTRS).getColumn(colName)!= null)
+ table = currentNetwork.getTable(type,
CyNetwork.LOCAL_ATTRS);
+ else
+ table=currentNetwork.getTable(type,
CyNetwork.SHARED_ATTRS);
+
+ this.editorPanel = new
GradientEditorPanel(vmm.getCurrentVisualStyle(), mapping, table, appManager,
editorManager.getValueEditor(Paint.class), vmm);
}
}
Modified:
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
===================================================================
---
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
2012-08-08 18:02:21 UTC (rev 30125)
+++
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/event/CellEditorEventHandler.java
2012-08-08 18:07:32 UTC (rev 30126)
@@ -200,12 +200,18 @@
*/
@SuppressWarnings("unchecked")
Class<? extends CyIdentifiable> type = (Class<? extends
CyIdentifiable>) editor.getTargetObjectType();
- final CyTable attrForTest =
tableMgr.getTable(applicationManager.getCurrentNetwork(), type,
CyNetwork.DEFAULT_ATTRS);
+// final CyTable attrForTest =
tableMgr.getTable(applicationManager.getCurrentNetwork(), type,
CyNetwork.DEFAULT_ATTRS);
- final CyColumn column = attrForTest.getColumn(ctrAttrName);
+ CyNetwork currentNetwork =
applicationManager.getCurrentNetwork();
+ CyTable localTable = currentNetwork.getTable(type,
CyNetwork.LOCAL_ATTRS);
+ CyTable sharedTable = currentNetwork.getTable(type,
CyNetwork.SHARED_ATTRS);
+ CyColumn column = localTable.getColumn(ctrAttrName);
if (column == null)
+ column = sharedTable.getColumn(ctrAttrName);
+
+ if(column == null)
return;
-
+
final Class<K> dataType = (Class<K>) column.getType();
if (mapping == null) {
Modified:
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/legend/ContinuousMappingLegendPanel.java
===================================================================
---
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/legend/ContinuousMappingLegendPanel.java
2012-08-08 18:02:21 UTC (rev 30125)
+++
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/legend/ContinuousMappingLegendPanel.java
2012-08-08 18:07:32 UTC (rev 30126)
@@ -62,9 +62,6 @@
this.vmm = vmm;
this.vp = mapping.getVisualProperty();
- // this.points = points;
- // this.type = vpt;
-
// Resize it when window size changed.
this.addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent e) {
Modified:
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/task/ui/LegendDialog.java
===================================================================
---
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/task/ui/LegendDialog.java
2012-08-08 18:02:21 UTC (rev 30125)
+++
csplugins/trunk/toronto/jm/cy3-shared-tables/impl/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/task/ui/LegendDialog.java
2012-08-08 18:07:32 UTC (rev 30126)
@@ -21,6 +21,9 @@
import javax.swing.border.TitledBorder;
import org.cytoscape.application.CyApplicationManager;
+import org.cytoscape.model.CyNetwork;
+import org.cytoscape.model.CyNode;
+import org.cytoscape.model.CyTable;
import org.cytoscape.view.vizmap.VisualMappingFunction;
import org.cytoscape.view.vizmap.VisualMappingManager;
import org.cytoscape.view.vizmap.VisualStyle;
@@ -91,10 +94,18 @@
private void createMappingLegends(final
Collection<VisualMappingFunction<?, ?>> mappings, final JPanel legend) {
for (VisualMappingFunction<?, ?> map : mappings) {
final JPanel mappingLenegd;
+
+ // Find Table
+ final String colName = map.getMappingColumnName();
+ final CyNetwork currentNetwork =
appManager.getCurrentNetwork();
+ final CyTable table;
+ if(currentNetwork.getTable(CyNode.class,
CyNetwork.LOCAL_ATTRS).getColumn(colName)!= null)
+ table = currentNetwork.getTable(CyNode.class,
CyNetwork.LOCAL_ATTRS);
+ else
+ table=currentNetwork.getTable(CyNode.class,
CyNetwork.SHARED_ATTRS);
if (map instanceof ContinuousMapping) {
- mappingLenegd = new
ContinuousMappingLegendPanel(visualStyle, (ContinuousMapping) map, appManager
-
.getCurrentNetwork().getDefaultNodeTable(), appManager, vmm);
+ mappingLenegd = new
ContinuousMappingLegendPanel(visualStyle, (ContinuousMapping) map, table,
appManager, vmm);
} else if (map instanceof DiscreteMapping) {
mappingLenegd = new
DiscreteLegend((DiscreteMapping<?, ?>) map, appManager);
} else if (map instanceof DiscreteMapping) {
--
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.