Author: paperwing
Date: 2012-03-26 12:01:28 -0700 (Mon, 26 Mar 2012)
New Revision: 28648
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/WindRenderingEngine.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/coordinator/ViewingCoordinator.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/edges/EdgeAnalyser.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/processing/TableSelectionCytoscapeDataSubprocessor.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/data/GraphicsData.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/layouts/SphericalLayoutAlgorithmTask.java
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/GeometryToolkit.java
Log:
Added GLAnimatorControl reference to GraphicsData and ViewingCoordinator to
allow pausing of rendering when Cytoscape is idle, fixed error with nodes
selected via right-click "Select First Neighbors" not being able to be dragged
properly
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-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/Graphics.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -221,6 +221,7 @@
graphicsData.setStartTime(System.nanoTime());
graphicsData.setGlContext(gl);
+ graphicsData.setAnimatorControl(drawable.getAnimator());
handler.initializeGraphicsProcedures(graphicsData);
handler.setupLighting(graphicsData);
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-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/WindRenderingEngine.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -6,6 +6,8 @@
import java.awt.Image;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
import java.awt.image.BufferedImage;
import java.awt.print.Printable;
import java.util.Properties;
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/coordinator/ViewingCoordinator.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/coordinator/ViewingCoordinator.java
2012-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/coordinator/ViewingCoordinator.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -4,6 +4,8 @@
import java.util.Map;
import java.util.jar.Manifest;
+import javax.media.opengl.GLAnimatorControl;
+
import org.cytoscape.paperwing.internal.cytoscape.edges.EdgeAnalyser;
import org.cytoscape.paperwing.internal.geometric.Quadrilateral;
import org.cytoscape.paperwing.internal.geometric.Vector3;
@@ -11,6 +13,8 @@
import org.cytoscape.paperwing.internal.tools.SimpleCamera;
import org.cytoscape.view.model.CyNetworkView;
+import com.jogamp.opengl.util.FPSAnimator;
+
/**
* This class is responsible for allowing communication between the main
* and bird's eye rendering objects without introducing circular reference
schemes,
@@ -45,6 +49,8 @@
private EdgeAnalyser mainEdgeAnalyser = null;
+ private GLAnimatorControl birdsEyeAnimatorControl = null;
+
// Claiming: Means whether a Graphics object has claimed ownership of
this coordinator by obtaining a reference to it.
// Linking: Whether or not that Graphics object wishes to retain the
reference to the coordinator, useful for garbage collection
@@ -293,4 +299,12 @@
public EdgeAnalyser getMainEdgeAnalyser() {
return mainEdgeAnalyser;
}
+
+ public void setBirdsEyeAnimatorControl(GLAnimatorControl
birdsEyeAnimatorControl) {
+ this.birdsEyeAnimatorControl = birdsEyeAnimatorControl;
+ }
+
+ public GLAnimatorControl getBirdsEyeAnimatorControl() {
+ return birdsEyeAnimatorControl;
+ }
}
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/edges/EdgeAnalyser.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/edges/EdgeAnalyser.java
2012-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/edges/EdgeAnalyser.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -82,8 +82,6 @@
for (AugmentedEdgeContainer edgeContainer :
edgeContainersToBeRemoved) {
edgeContainers.remove(edgeContainer.getEdgeView());
-
- System.out.println("Removed edge " +
edgeContainer.getEdgeView().getSUID());
}
return edgeContainers.values();
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/processing/TableSelectionCytoscapeDataSubprocessor.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/processing/TableSelectionCytoscapeDataSubprocessor.java
2012-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/cytoscape/processing/TableSelectionCytoscapeDataSubprocessor.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -1,5 +1,6 @@
package org.cytoscape.paperwing.internal.cytoscape.processing;
+import java.util.List;
import java.util.Set;
import org.cytoscape.model.CyEdge;
@@ -7,6 +8,7 @@
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyRow;
import org.cytoscape.model.CyTable;
+import org.cytoscape.model.CyTableUtil;
import org.cytoscape.paperwing.internal.data.GraphicsData;
import org.cytoscape.paperwing.internal.data.GraphicsSelectionData;
import org.cytoscape.paperwing.internal.tools.NetworkToolkit;
@@ -29,7 +31,7 @@
// Update CyTable with the currently selected set of nodes and
edges
processSelectionData(graphicsData);
- // processUpdateSelected(graphicsData);
+ processUpdateSelected(graphicsData);
}
// Performs selection in Cytoscape data objects, such as CyTable
@@ -68,18 +70,10 @@
Set<Integer> selectedNodeIndices =
graphicsData.getSelectionData().getSelectedNodeIndices();
Set<Integer> selectedEdgeIndices =
graphicsData.getSelectionData().getSelectedEdgeIndices();
- for (View<CyNode> nodeView : networkView.getNodeViews()) {
- if
(NetworkToolkit.checkNodeSelected(nodeView.getModel().getIndex(), networkView))
{
-// if
(nodeView.getVisualProperty(BasicVisualLexicon.NODE_SELECTED)) {
-
selectedNodeIndices.add(nodeView.getModel().getIndex());
- }
- }
+ List<CyNode> tableSelectedNodes =
CyTableUtil.getNodesInState(networkView.getModel(), "selected", true);
- for (View<CyEdge> edgeView : networkView.getEdgeViews()) {
- if
(NetworkToolkit.checkNodeSelected(edgeView.getModel().getIndex(), networkView))
{
-// if
(edgeView.getVisualProperty(BasicVisualLexicon.EDGE_SELECTED)) {
-
selectedEdgeIndices.add(edgeView.getModel().getIndex());
- }
+ for (CyNode node : tableSelectedNodes) {
+ selectedNodeIndices.add(node.getIndex());
}
}
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/data/GraphicsData.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/data/GraphicsData.java
2012-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/data/GraphicsData.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -6,6 +6,7 @@
import java.util.Set;
import javax.media.opengl.GL2;
+import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.glu.GLU;
import org.cytoscape.paperwing.internal.Graphics;
@@ -21,6 +22,8 @@
import org.cytoscape.work.swing.DialogTaskManager;
import org.cytoscape.work.swing.SubmenuTaskManager;
+import com.jogamp.opengl.util.FPSAnimator;
+
/**
* This class represents a data object in which data relevant to the renderer,
* such as the position of the camera, the number of frames elapsed, the
coordinates
@@ -98,6 +101,9 @@
private EdgeAnalyser edgeAnalyser;
+ /** The {@link GLAnimatorControl} object used to control the animator
which automatically makes calls to redraw the scene */
+ private GLAnimatorControl animatorControl;
+
/**
* A {@link GraphicsSelectionData} object which is responsible for
* storing all data related to selection of objects in the network, such
@@ -363,4 +369,12 @@
public EdgeAnalyser getEdgeAnalyser() {
return edgeAnalyser;
}
+
+ public void setAnimatorControl(GLAnimatorControl animatorControl) {
+ this.animatorControl = animatorControl;
+ }
+
+ public GLAnimatorControl getAnimatorControl() {
+ return animatorControl;
+ }
}
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/layouts/SphericalLayoutAlgorithmTask.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/layouts/SphericalLayoutAlgorithmTask.java
2012-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/layouts/SphericalLayoutAlgorithmTask.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -40,8 +40,6 @@
List<LayoutPartition> layoutPartitions =
PartitionUtil.partition(networkView, false, null);
int numPartitions = layoutPartitions.size();
- System.out.println("Number of partitions: " + numPartitions);
-
Collection<Collection<View<CyNode>>> partitions = new
HashSet<Collection<View<CyNode>>>(layoutPartitions.size());
Collection<View<CyNode>> partitionNodeViews;
@@ -133,7 +131,6 @@
}
private void arrangeAsBox(Collection<View<CyNode>> nodeViews) {
-
}
private void arrangeAsSphere(Collection<View<CyNode>> nodeViews) {
Modified:
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/GeometryToolkit.java
===================================================================
---
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/GeometryToolkit.java
2012-03-26 18:23:16 UTC (rev 28647)
+++
csplugins/trunk/toronto/yuedong/paperwing-impl/src/main/java/org/cytoscape/paperwing/internal/tools/GeometryToolkit.java
2012-03-26 19:01:28 UTC (rev 28648)
@@ -97,7 +97,7 @@
Vector3 yOffset = cameraUp.copy();
yOffset.multiplyLocal(planeDistance * Math.tan(verticalFov /
360.0 * Math.PI));
-
+ System.out.println("yOffset: " + yOffset);
Vector3 xOffset = cameraDirection.copy(); // xOffset will be
the camera's right vector
xOffset.crossLocal(cameraUp);
xOffset.multiplyLocal(yOffset.magnitude() * aspectRatio); //
aspect = width / length
--
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.