Author: paperwing
Date: 2012-02-03 14:02:18 -0800 (Fri, 03 Feb 2012)
New Revision: 28193

Modified:
   
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
   
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/ResetSceneProcedure.java
Log:
Added support for changing the network background color via the Network 
Background Paint visual property

Modified: 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
 2012-02-03 21:31:18 UTC (rev 28192)
+++ 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
 2012-02-03 22:02:18 UTC (rev 28193)
@@ -184,8 +184,6 @@
                handler.setupLighting(graphicsData);
                
                shapePickingProcessor.initialize(graphicsData);
-               
-               gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
        }
 
 
@@ -227,7 +225,7 @@
                float[] specularReflection = { 0.46f, 0.46f, 0.46f, 1.0f };
                gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_SPECULAR,
                                FloatBuffer.wrap(specularReflection));
-               gl.glMateriali(GL2.GL_FRONT, GL2.GL_SHININESS, 31);
+               gl.glMateriali(GL2.GL_FRONT, GL2.GL_SHININESS, 21); // Default 
shininess 31
                
                gl.glLightModeli(GL2.GL_LIGHT_MODEL_TWO_SIDE, 0);
        }

Modified: 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/ResetSceneProcedure.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/ResetSceneProcedure.java
    2012-02-03 21:31:18 UTC (rev 28192)
+++ 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/ResetSceneProcedure.java
    2012-02-03 22:02:18 UTC (rev 28193)
@@ -1,5 +1,8 @@
 package org.cytoscape.paperwing.internal.rendering;
 
+import java.awt.Color;
+import java.awt.Paint;
+
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.glu.GLU;
@@ -7,6 +10,7 @@
 import org.cytoscape.paperwing.internal.data.GraphicsData;
 import org.cytoscape.paperwing.internal.geometric.Vector3;
 import org.cytoscape.paperwing.internal.tools.SimpleCamera;
+import org.cytoscape.view.presentation.property.RichVisualLexicon;
 
 public class ResetSceneProcedure implements ReadOnlyGraphicsProcedure {
 
@@ -19,6 +23,17 @@
                GL2 gl = graphicsData.getGlContext();
                SimpleCamera camera = graphicsData.getCamera();
                
+               // Obtain the desired network background color
+               Color backgroundColor = (Color) 
+                       graphicsData.getNetworkView().getVisualProperty(
+                                       
RichVisualLexicon.NETWORK_BACKGROUND_PAINT);
+               
+               if (backgroundColor != null) {
+                       gl.glClearColor(backgroundColor.getRed() / 255f, 
+                                       backgroundColor.getGreen() / 255f, 
+                                       backgroundColor.getBlue() / 255f, 1.0f);
+               }
+               
                // Reset scene
                gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
                gl.glLoadIdentity();

-- 
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.

Reply via email to