Author: mes
Date: 2011-12-08 11:04:11 -0800 (Thu, 08 Dec 2011)
New Revision: 27740
Modified:
core3/impl/trunk/ding-impl/performance-debug/src/main/java/org/cytoscape/ding/internal/PerfTest.java
Log:
added actual display
Modified:
core3/impl/trunk/ding-impl/performance-debug/src/main/java/org/cytoscape/ding/internal/PerfTest.java
===================================================================
---
core3/impl/trunk/ding-impl/performance-debug/src/main/java/org/cytoscape/ding/internal/PerfTest.java
2011-12-08 00:01:57 UTC (rev 27739)
+++
core3/impl/trunk/ding-impl/performance-debug/src/main/java/org/cytoscape/ding/internal/PerfTest.java
2011-12-08 19:04:11 UTC (rev 27740)
@@ -10,6 +10,16 @@
import java.util.List;
import java.util.Properties;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JComponent;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+
+import org.cytoscape.ding.impl.DGraphView;
+import org.cytoscape.ding.impl.InnerCanvas;
+
import org.cytoscape.io.internal.util.ReadUtils;
import org.cytoscape.event.CyEventHelper;
import org.cytoscape.io.internal.util.StreamUtilImpl;
@@ -39,7 +49,9 @@
public static void main(String[] args) {
- new PerfTest().runTestLoop();
+ PerfTest pt = new PerfTest();
+ //pt.runTestLoop();
+ pt.visualizeNetworks();
}
protected TaskMonitor taskMonitor;
@@ -112,10 +124,31 @@
private void networkAndViewPerf(String name) throws Exception {
long start = System.currentTimeMillis();
CyNetworkView[] views = getViews(name);
+ for ( CyNetworkView view : views )
+ view.updateView();
long end = System.currentTimeMillis();
System.out.println("LOADING SIF file (" + name + ") with view
duration: " + (end - start));
}
+ private void visualizeNetworks() {
+ try {
+ CyNetworkView[] views = getViews("A50-50.sif");
+ JFrame frame = new JFrame();
+ frame.setPreferredSize(new Dimension(800,800));
+ JPanel panel = new JPanel();
+ panel.setPreferredSize(new Dimension(800,800));
+ panel.setBackground(Color.blue);
+ InnerCanvas jc = ((DGraphView)(views[0])).getCanvas();
+ jc.setVisible(true);
+ jc.setPreferredSize(new Dimension(800,800));
+ panel.add( jc );
+ frame.getContentPane().add(panel);
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.pack();
+ frame.setVisible(true);
+ } catch (Exception e) { e.printStackTrace(); }
+ }
+
private CyLayoutAlgorithmManager getLayouts() {
Properties p = new Properties();
CyProperty<Properties> props = new
SimpleCyProperty(p,CyProperty.SavePolicy.DO_NOT_SAVE);
--
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.