Author: paperwing
Date: 2012-01-11 16:20:23 -0800 (Wed, 11 Jan 2012)
New Revision: 27990
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindMainRenderingEngine.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindRenderingEngine.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/view/DefaultValueVault.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
Log:
NODE_FILL_COLOR visual property integrated with vizmapper partly as experiment
to see how responsive the renderer is to vizmapper changes
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindMainRenderingEngine.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindMainRenderingEngine.java
2012-01-12 00:04:41 UTC (rev 27989)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindMainRenderingEngine.java
2012-01-12 00:20:23 UTC (rev 27990)
@@ -55,7 +55,10 @@
@Override
protected void setUpAnimatorStarting(Container container, FPSAnimator
animator) {
- container.addFocusListener(getContainerFocusListener(animator));
+ animator.start();
+
+ // TODO: Disabled focus listener to let visual property changes
appear
+ //
container.addFocusListener(getContainerFocusListener(animator));
}
private FocusListener getContainerFocusListener(final FPSAnimator
animator) {
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindRenderingEngine.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindRenderingEngine.java
2012-01-12 00:04:41 UTC (rev 27989)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindRenderingEngine.java
2012-01-12 00:20:23 UTC (rev 27990)
@@ -95,6 +95,9 @@
// TODO: check whether to use GLCanvas or
GLJPanel
GLJPanel panel = new GLJPanel(capabilities);
+ // TODO: check if negative effects produced by
this
+ panel.setIgnoreRepaint(true);
+
graphics = getGraphicsInstance(networkView,
visualLexicon);
panel.addGLEventListener(graphics);
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/view/DefaultValueVault.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/view/DefaultValueVault.java
2012-01-12 00:04:41 UTC (rev 27989)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/view/DefaultValueVault.java
2012-01-12 00:20:23 UTC (rev 27990)
@@ -38,10 +38,13 @@
if (targetDataType == CyNode.class) {
nodeDefaultValues.put(visualProperty.getIdString(), valueHolder);
+// System.out.println("Node default: " +
visualProperty.getIdString() + " -> " + valueHolder.getValue());
} else if (targetDataType == CyEdge.class) {
edgeDefaultValues.put(visualProperty.getIdString(), valueHolder);
+// System.out.println("Edge default: " +
visualProperty.getIdString() + " -> " + valueHolder.getValue());
} else if (targetDataType == CyNetwork.class) {
networkDefaultValues.put(visualProperty.getIdString(), valueHolder);
+// System.out.println("Network default: " +
visualProperty.getIdString() + " -> " + valueHolder.getValue());
}
}
}
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
2012-01-12 00:04:41 UTC (rev 27989)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodesProcedure.java
2012-01-12 00:20:23 UTC (rev 27990)
@@ -92,7 +92,7 @@
float x, y, z;
int index;
- networkView.updateView();
+ // networkView.updateView();
for (View<CyNode> nodeView : networkView.getNodeViews()) {
x =
nodeView.getVisualProperty(RichVisualLexicon.NODE_X_LOCATION)
.floatValue() / distanceScale;
@@ -117,7 +117,7 @@
* RichVisualLexicon.NODE_DEPTH).floatValue() /
DISTANCE_SCALE);
*/
- Color color;
+ Color color = null;
// if (selectedNodeIndices.contains(index)) {
// if (NetworkToolkit.checkNodeSelected(index,
networkView)) {
@@ -139,13 +139,28 @@
nodeView.setVisualProperty(RichVisualLexicon.NODE_SELECTED,
false);
} else {
- color = (Color) nodeView
-
.getVisualProperty(MinimalVisualLexicon.NODE_PAINT);
+// color = (Color) nodeView
+//
.getVisualProperty(MinimalVisualLexicon.NODE_PAINT);
- gl.glColor3f(color.getRed() / 255.0f,
+ // TODO: Cleanup code below
+ Object colorObject =
nodeView.getVisualProperty(MinimalVisualLexicon.NODE_FILL_COLOR);
+
+ if (colorObject != null
+ && colorObject.getClass() ==
Color.class) {
+ color = (Color) colorObject;
+ } else if (colorObject.getClass() !=
Color.class) {
+// System.out.println("Found unexpected
NODE_FILL_COLOR type for: " + nodeView
+// + ", which was: " +
colorObject.getClass() + " with value: " + colorObject);
+ }
+
+ if (color != null) {
+ gl.glColor3f(color.getRed() / 255.0f,
color.getGreen() / 255.0f,
color.getBlue() / 255.0f);
-
- RenderColor.setNonAlphaColors(gl,
DEFAULT_COLOR);
+ } else {
+ RenderColor.setNonAlphaColors(gl,
DEFAULT_COLOR);
+ }
+
+ // RenderColor.setNonAlphaColors(gl,
DEFAULT_COLOR);
}
// Draw it only if the visual property says it is
visible
--
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.