Author: clopes
Date: 2012-06-14 13:36:39 -0700 (Thu, 14 Jun 2012)
New Revision: 29567
Modified:
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewEditorImpl.java
Log:
Fixes bug #1066 again (VizMap defaults not populated in GUI). The original fix
was removed by later changes, rather than merged.
Modified:
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewEditorImpl.java
===================================================================
---
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewEditorImpl.java
2012-06-14 20:29:35 UTC (rev 29566)
+++
core3/impl/trunk/vizmap-gui-impl/src/main/java/org/cytoscape/view/vizmap/gui/internal/DefaultViewEditorImpl.java
2012-06-14 20:36:39 UTC (rev 29567)
@@ -114,18 +114,18 @@
private final EditorManager editorFactory;
private final VisualMappingManager vmm;
-
private final VizMapperUtil util;
-
private final DefaultViewPanelImpl mainView;
-
private final CyEventHelper cyEventHelper;
private DependencyTable depTable;
- public DefaultViewEditorImpl(final DefaultViewPanelImpl mainView, final
EditorManager editorFactory,
- final CyApplicationManager cyApplicationManager, final
VisualMappingManager vmm, final VizMapperUtil util,
- final CyEventHelper cyEventHelper) {
+ public DefaultViewEditorImpl(final DefaultViewPanelImpl mainView,
+ final
EditorManager editorFactory,
+ final
CyApplicationManager cyApplicationManager,
+ final
VisualMappingManager vmm,
+ final
VizMapperUtil util,
+ final
CyEventHelper cyEventHelper) {
super();
if (mainView == null)
@@ -215,7 +215,6 @@
}
private void updateDependencyTable() {
-
final VisualStyle selectedStyle = vmm.getCurrentVisualStyle();
final Set<VisualPropertyDependency<?>> dependencies =
selectedStyle.getAllVisualPropertyDependencies();
final DependencyTableModel depTableModel = new
DependencyTableModel();
@@ -445,14 +444,13 @@
* Populate the list model based on current lexicon tree structure.
*/
private void buildList() {
-
final VisualPropCellRenderer renderer = new
VisualPropCellRenderer();
- final RenderingEngine<CyNetwork> currentEngine =
this.cyApplicationManager.getCurrentRenderingEngine();
- if (currentEngine == null)
+ final RenderingEngine<CyNetwork> engine =
mainView.getRenderingEngine();
+
+ if (engine == null)
return;
-
- final VisualLexicon lex = currentEngine.getVisualLexicon();
-
+
+ final VisualLexicon lex = engine.getVisualLexicon();
final VisualStyle selectedStyle = vmm.getCurrentVisualStyle();
for (Class<? extends CyIdentifiable> key : vpSets.keySet()) {
@@ -483,7 +481,7 @@
final VisualLexiconNode treeNode =
lex.getVisualLexiconNode(vp);
if (treeNode != null)
model.addElement(vp);
-
+
// Override dependency
final Set<VisualPropertyDependency<?>>
dependencies = selectedStyle.getAllVisualPropertyDependencies();
for (VisualPropertyDependency<?> dep :
dependencies) {
@@ -492,12 +490,13 @@
final VisualProperty<?>
parentVP = dep.getParentVisualProperty();
if (model.contains(parentVP) ==
false)
model.addElement(parentVP);
-
+
for (VisualProperty<?> prop :
props)
model.removeElement(prop);
}
}
}
+
list.setCellRenderer(renderer);
}
}
@@ -529,7 +528,7 @@
if (value instanceof VisualProperty<?>) {
vp = (VisualProperty<Object>) value;
- final RenderingEngine<?> presentation =
cyApplicationManager.getCurrentRenderingEngine();
+ final RenderingEngine<?> presentation =
mainView.getRenderingEngine();
if (presentation != null) {
final Object defValue =
selectedStyle.getDefaultValue(vp);
@@ -570,11 +569,10 @@
return mainView;
}
+ @Override
public void handleEvent(SetCurrentVisualStyleEvent e) {
-
final VisualStyle selectedStyle = e.getVisualStyle();
setTitle("Default Appearance for " + selectedStyle.getTitle());
-
}
private static class VisualPropertyComparator implements
Comparator<VisualProperty<?>> {
@@ -586,7 +584,6 @@
return name1.compareTo(name2);
}
-
}
@Override
@@ -596,6 +593,5 @@
mainView.updateView();
mainView.repaint();
-
}
}
--
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.