Author: paperwing
Date: 2012-02-10 14:59:21 -0800 (Fri, 10 Feb 2012)
New Revision: 28237
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/pom.xml
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/WindBirdsEyeRenderingEngine.java
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/rendering/RenderNodeLabelsProcedure.java
Log:
Attempted update to accomodate new version of JOGL and the TextRenderer class;
paused update to release current implementation on Wiki.
Modified: csplugins/trunk/toronto/yuedong/paperwing-impl/pom.xml
===================================================================
--- csplugins/trunk/toronto/yuedong/paperwing-impl/pom.xml 2012-02-10
20:37:43 UTC (rev 28236)
+++ csplugins/trunk/toronto/yuedong/paperwing-impl/pom.xml 2012-02-10
22:59:21 UTC (rev 28237)
@@ -22,6 +22,9 @@
<dependency>
<groupId>cytoscape-temp</groupId>
<artifactId>jogl</artifactId>
+ <!--
+ <version>2.0-b45-20111219</version>
+ -->
<version>2.0-b23-20110303</version>
</dependency>
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-10 20:37:43 UTC (rev 28236)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
2012-02-10 22:59:21 UTC (rev 28237)
@@ -71,7 +71,7 @@
* aspects
*/
public static void initSingleton() {
- GLProfile.initSingleton(false);
+// GLProfile.initSingleton(false);
//System.out.println("initSingleton called");
}
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindBirdsEyeRenderingEngine.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindBirdsEyeRenderingEngine.java
2012-02-10 20:37:43 UTC (rev 28236)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindBirdsEyeRenderingEngine.java
2012-02-10 22:59:21 UTC (rev 28237)
@@ -59,4 +59,10 @@
animator.start();
}
+
+ @Override
+ public void setProperties(String key, String value) {
+ // TODO Auto-generated method stub
+
+ }
}
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-02-10 20:37:43 UTC (rev 28236)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindMainRenderingEngine.java
2012-02-10 22:59:21 UTC (rev 28237)
@@ -83,5 +83,11 @@
};
}
+ @Override
+ public void setProperties(String key, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
}
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-02-10 20:37:43 UTC (rev 28236)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindRenderingEngine.java
2012-02-10 22:59:21 UTC (rev 28237)
@@ -6,8 +6,6 @@
import java.awt.Image;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
import java.awt.image.BufferedImage;
import java.awt.print.Printable;
import java.util.Properties;
@@ -18,12 +16,9 @@
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JInternalFrame;
-import javax.swing.JPanel;
-
import org.cytoscape.model.CyNetwork;
import org.cytoscape.service.util.CyServiceRegistrar;
import org.cytoscape.view.model.CyNetworkView;
-import org.cytoscape.view.model.CyNetworkViewManager;
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.VisualLexicon;
import org.cytoscape.view.model.VisualProperty;
@@ -31,7 +26,6 @@
import org.cytoscape.view.model.events.NetworkViewAboutToBeDestroyedListener;
import org.cytoscape.view.presentation.RenderingEngine;
-import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.FPSAnimator;
/** This class represents a WindRenderingEngine, responsible for
@@ -105,6 +99,7 @@
GLProfile profile = GLProfile.getDefault();
GLCapabilities capabilities = new
GLCapabilities(profile);
+
// TODO: check if this line should be moved to
graphics object
capabilities.setDoubleBuffered(true);
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-10 20:37:43 UTC (rev 28236)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/rendering/RenderNodeLabelsProcedure.java
2012-02-10 22:59:21 UTC (rev 28237)
@@ -15,15 +15,22 @@
import org.cytoscape.view.presentation.property.RichVisualLexicon;
import com.jogamp.opengl.util.awt.TextRenderer;
-// import com.jogamp.graph.curve.opengl.TextRenderer;
+// Below will be used for JOGL 2.0-b45-20111219
+/*
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.TextRenderer;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.font.FontFactory;
+*/
+
public class RenderNodeLabelsProcedure implements ReadOnlyGraphicsProcedure {
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 static final Font TEXT_DEFAULT_FONT = new
Font(DEFAULT_FONT_NAME, Font.PLAIN, TEXT_FONT_SIZE);
private TextRenderer textRenderer;
@@ -36,14 +43,17 @@
// Increase rendering efficiency; can set to true if desired
// textRenderer.setSmoothing(false);
+
+ // Temporarily removed -- pausing JOGL update to
2.0-b45-20111219
+// textRenderer =
TextRenderer.create(RenderState.getRenderState(gl),
GLRegion.TWO_PASS_DEFAULT_TEXTURE_UNIT);
}
@Override
public void execute(GraphicsData graphicsData) {
GL2 gl = graphicsData.getGlContext();
- textRenderer = new TextRenderer(defaultFont);
-
+ textRenderer = new TextRenderer(TEXT_DEFAULT_FONT);
+
CyNetworkView networkView = graphicsData.getNetworkView();
float distanceScale = graphicsData.getDistanceScale();
float x, y, z;
@@ -62,7 +72,10 @@
gl.glPushMatrix();
textRenderer.beginRendering(graphicsData.getScreenWidth(),
graphicsData.getScreenHeight(), true);
+ // textRenderer.drawString3D(arg0, arg1, arg2, arg3, arg4, arg5)
+ // textRenderer.beginRendering(graphicsData.getScreenWidth(),
graphicsData.getScreenHeight(), true);
+ // textRenderer.createString(gl, null, 0, "test").
for (View<CyNode> nodeView : networkView.getNodeViews()) {
x =
nodeView.getVisualProperty(RichVisualLexicon.NODE_X_LOCATION)
.floatValue() / distanceScale;
@@ -74,8 +87,6 @@
// Draw it only if the visual property says it is
visible
if
(nodeView.getVisualProperty(MinimalVisualLexicon.NODE_VISIBLE)) {
- gl.glColor3f(0.2f, 0.2f, 0.2f);
-
text =
nodeView.getVisualProperty(MinimalVisualLexicon.NODE_LABEL);
if (text != null) {
@@ -96,7 +107,16 @@
// Use black as default
if no node label color was found
textColor =
TEXT_DEFAULT_COLOR;
}
+
+ // Below to be used for JOGL
2.0-b45-20111219's new TextRenderer
+// gl.glColor3f((float)
textColor.getRed() / 255,
+// (float)
textColor.getGreen() / 255,
+// (float)
textColor.getBlue() / 255);
+
+// textRenderer.drawString3D(gl,
FontFactory.getDefault().getDefault(),
+// text, new
float[]{1.0f, 1.0f, 2.0f}, TEXT_FONT_SIZE, 1024);
+
textRenderer.setColor(textColor);
textRenderer.draw(text, (int)
screenCoordinates.x() - findTextScreenWidth(text) / 2, (int)
screenCoordinates.y());
}
--
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.