Author: paperwing
Date: 2012-02-09 14:39:37 -0800 (Thu, 09 Feb 2012)
New Revision: 28222

Modified:
   
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodeLabelsProcedure.java
Log:
In process of switching from older com.jogamp.opengl.util.awt.TextRenderer to 
new com.jogamp.graph.curve.opengl.TextRenderer, about to update JOGL version to 
2.0-rc5 from 2.0-b23-20110303 which contains the newer implementation of the 
TextRenderer

Modified: 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodeLabelsProcedure.java
===================================================================
--- 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodeLabelsProcedure.java
      2012-02-09 22:05:45 UTC (rev 28221)
+++ 
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodeLabelsProcedure.java
      2012-02-09 22:39:37 UTC (rev 28222)
@@ -2,17 +2,12 @@
 
 import java.awt.Color;
 import java.awt.Font;
-import java.awt.font.FontRenderContext;
-import java.util.Set;
 
 import javax.media.opengl.GL2;
 
 import org.cytoscape.model.CyNode;
 import org.cytoscape.paperwing.internal.data.GraphicsData;
 import org.cytoscape.paperwing.internal.geometric.Vector3;
-import 
org.cytoscape.paperwing.internal.rendering.shapes.ScalableShapeDrawer.ShapeType;
-import org.cytoscape.paperwing.internal.rendering.text.StringRenderer;
-import org.cytoscape.paperwing.internal.tools.RenderColor;
 import org.cytoscape.paperwing.internal.tools.RenderToolkit;
 import org.cytoscape.view.model.CyNetworkView;
 import org.cytoscape.view.model.View;
@@ -20,19 +15,17 @@
 import org.cytoscape.view.presentation.property.RichVisualLexicon;
 
 import com.jogamp.opengl.util.awt.TextRenderer;
+// import com.jogamp.graph.curve.opengl.TextRenderer;
 
 public class RenderNodeLabelsProcedure implements ReadOnlyGraphicsProcedure {
 
-       private static final float TEXT_SCALE = 0.0005f;
-       private static final Vector3 TEXT_OFFSET = new Vector3 (0, 0.04, 0);
-       
-       private static final float TEXT_CHARACTER_WIDTH = 0.612f;
        private static final int TEXT_FONT_SIZE = 9;
-       
+       private static final String DEFAULT_FONT_NAME = "SansSerif";
        private static final Color TEXT_DEFAULT_COLOR = Color.BLACK;
        
+       private static final Font defaultFont = new Font(DEFAULT_FONT_NAME, 
Font.PLAIN, TEXT_FONT_SIZE);
+       
        private TextRenderer textRenderer;
-       private Font defaultFont = new Font("SansSerif", Font.PLAIN, 
TEXT_FONT_SIZE);
        
        public RenderNodeLabelsProcedure() {
        }
@@ -42,7 +35,7 @@
                GL2 gl = graphicsData.getGlContext();
                
                // Increase rendering efficiency; can set to true if desired
-               textRenderer.setSmoothing(false);
+               // textRenderer.setSmoothing(false);
        }
 
        @Override
@@ -89,8 +82,7 @@
                                        
                                        Vector3 text3dPosition = new Vector3(x, 
y, z);
                                        Vector3 screenCoordinates = 
RenderToolkit.convert3dToScreen(gl, text3dPosition, modelView, projection, 
viewPort);
-//                                     System.out.println("Node label " + (new 
Vector3(x, y, z)) + " mapped to: " + screenCoordinates);
-                                       
+
                                        Vector3 offsetFromCamera = 
text3dPosition.subtract(graphicsData.getCamera().getPosition());
                                        
                                        // Only draw the text if the front side 
of the camera faces it

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