Author: kono
Date: 2009-08-11 17:55:58 -0700 (Tue, 11 Aug 2009)
New Revision: 17779

Modified:
   
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/CyDrawable.java
   
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/ProcessingNetworkRenderer.java
   
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Cube.java
   
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/CyQuad.java
   
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Line.java
   
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Rectangle.java
   
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/visualproperty/ProcessingVisualLexicon.java
Log:
Text drawing methods had been added.

Modified: 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/CyDrawable.java
===================================================================
--- 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/CyDrawable.java
   2009-08-12 00:46:58 UTC (rev 17778)
+++ 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/CyDrawable.java
   2009-08-12 00:55:58 UTC (rev 17779)
@@ -36,6 +36,8 @@
         * @return
         */
        public List<CyDrawable> getChildren();
+       
+       public void addChild(CyDrawable child);
 
        /**
         * Get compatible data type. For example, if this object accepts CyNode,

Modified: 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/ProcessingNetworkRenderer.java
===================================================================
--- 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/ProcessingNetworkRenderer.java
   2009-08-12 00:46:58 UTC (rev 17778)
+++ 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/ProcessingNetworkRenderer.java
   2009-08-12 00:55:58 UTC (rev 17779)
@@ -61,6 +61,8 @@
        private GLCanvas canvas;
 
        private Overlay overlay;
+       
+       private final PFont DEF_FONT = createFont("SansSerif", 20);
 
        private ParticleManager particleManager;
        private VerletPhysics physics;
@@ -187,14 +189,14 @@
                particleManager = new ParticleManager(numP, this, physics);
 
                overlay = new Overlay(this, 
view.getSource().attrs().get("name", String.class));
-
+               
                System.out.println("%%%%%%%%%%%%% Setup DONE for P5");
        }
 
        private int numP;
 
        public void draw() {
-               background(0);
+               background(200);
                physics.update();
                lights();
 
@@ -212,6 +214,7 @@
                translate(-width / 2 + translateX, -height / 2 + translateY,
                                -height / 2);
 
+               textFont(DEF_FONT);
                for (CyDrawable node : nodes)
                        node.draw();
 

Modified: 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Cube.java
===================================================================
--- 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Cube.java
  2009-08-12 00:46:58 UTC (rev 17778)
+++ 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Cube.java
  2009-08-12 00:55:58 UTC (rev 17779)
@@ -8,6 +8,7 @@
 
 import java.awt.Color;
 import java.awt.Paint;
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -52,7 +53,9 @@
        private float size;
        private int r, g, b, alpha;
        
+       private final List<CyDrawable> children;
        
+       
        private Map<VisualProperty<?>, Object> fieldMap;
        
        public Cube(PApplet parent, VisualLexicon lexicon) {
@@ -61,6 +64,10 @@
                this.lexicon = lexicon;
                this.picked = false;
                
+               this.children = new ArrayList<CyDrawable>();
+               // Create children for label
+               this.children.add(new Text(p, lexicon));
+               
                compatibleDataType = new HashSet<Class<?>>();
                compatibleDataType.add(CyNode.class);
        }
@@ -85,22 +92,21 @@
                p.fill(r, g, b, alpha);
                p.box(size);
                p.popMatrix();
+               
+               for(CyDrawable child: children)
+                       child.draw();
        }
 
        public List<CyDrawable> getChildren() {
                // TODO Auto-generated method stub
-               return null;
+               return children;
        }
 
        public void setContext(View<?> viewModel) {
+               
                // Pick compatible lexicon only.
                this.x = 
viewModel.getVisualProperty(NODE_X_LOCATION).floatValue();
-               this.y = 
viewModel.getVisualProperty(NODE_Y_LOCATION).floatValue();
-               
-               if(p.random(1)> 0.5) {
-                       viewModel.setVisualProperty(NODE_Z_LOCATION, 2000d);
-               }
-               
+               this.y = 
viewModel.getVisualProperty(NODE_Y_LOCATION).floatValue();             
                this.z = 
viewModel.getVisualProperty(NODE_Z_LOCATION).floatValue();
                
                this.size = 
viewModel.getVisualProperty(NODE_X_SIZE).floatValue();
@@ -120,7 +126,18 @@
                        this.b = ((Color)color).getBlue();
                        //this.alpha = opacity.intValue();              
                        this.alpha = 100;
-               }       
+               }
+               
+//             String text = viewModel.getVisualProperty(NODE_LABEL);
+//             if(text != null || text.length() != 0) {
+//                     children.add(new Text(p, lexicon));
+//             }
+               
+               
+               
+               // Set values for children
+               for(CyDrawable child: children)
+                       child.setContext(viewModel);
        }
        
        public void setContext(View<?> viewModel, VisualProperty<?> vp) {
@@ -153,6 +170,11 @@
                
        }
 
+       public void addChild(CyDrawable child) {
+               // TODO Auto-generated method stub
+               this.children.add(child);
+       }
+
        
 
 }

Modified: 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/CyQuad.java
===================================================================
--- 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/CyQuad.java
        2009-08-12 00:46:58 UTC (rev 17778)
+++ 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/CyQuad.java
        2009-08-12 00:55:58 UTC (rev 17779)
@@ -53,4 +53,9 @@
                
        }
 
+       public void addChild(CyDrawable child) {
+               // TODO Auto-generated method stub
+               
+       }
+
 }

Modified: 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Line.java
===================================================================
--- 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Line.java
  2009-08-12 00:46:58 UTC (rev 17778)
+++ 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Line.java
  2009-08-12 00:55:58 UTC (rev 17779)
@@ -80,4 +80,9 @@
                
        }
 
+       public void addChild(CyDrawable child) {
+               // TODO Auto-generated method stub
+               
+       }
+
 }

Modified: 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Rectangle.java
===================================================================
--- 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Rectangle.java
     2009-08-12 00:46:58 UTC (rev 17778)
+++ 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/internal/shape/Rectangle.java
     2009-08-12 00:55:58 UTC (rev 17779)
@@ -140,4 +140,9 @@
                
        }
 
+       public void addChild(CyDrawable child) {
+               // TODO Auto-generated method stub
+               
+       }
+
 }

Modified: 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/visualproperty/ProcessingVisualLexicon.java
===================================================================
--- 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/visualproperty/ProcessingVisualLexicon.java
       2009-08-12 00:46:58 UTC (rev 17778)
+++ 
csplugins/trunk/soc/kozo/processing-renderer/processing-rendering-engine/src/main/java/org/cytoscape/view/presentation/processing/visualproperty/ProcessingVisualLexicon.java
       2009-08-12 00:55:58 UTC (rev 17779)
@@ -10,6 +10,7 @@
 import org.cytoscape.view.model.VisualLexicon;
 import org.cytoscape.view.model.VisualProperty;
 import org.cytoscape.view.presentation.processing.CyDrawable;
+import org.cytoscape.view.presentation.property.StringVisualProperty;
 import org.cytoscape.view.presentation.property.ThreeDVisualLexicon;
 
 public class ProcessingVisualLexicon extends ThreeDVisualLexicon {
@@ -23,6 +24,7 @@
        
        public static final VisualProperty<? extends Image> 
NETWORK_BACKGROUND_IMAGE = new ImageVisualProperty(
                        NETWORK, null, "NETWORK_BACKGROUND_IMAGE", "Network 
Background Image"); 
+
        
        public ProcessingVisualLexicon() {
                super();


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