Author: chinmoy
Date: 2009-06-26 12:41:36 -0700 (Fri, 26 Jun 2009)
New Revision: 17120
Removed:
csplugins/trunk/soc/chinmoy/sample plugins/LayoutPlugin/LayoutPlugin.java
Log:
Deleted: csplugins/trunk/soc/chinmoy/sample
plugins/LayoutPlugin/LayoutPlugin.java
===================================================================
--- csplugins/trunk/soc/chinmoy/sample plugins/LayoutPlugin/LayoutPlugin.java
2009-06-26 19:36:30 UTC (rev 17119)
+++ csplugins/trunk/soc/chinmoy/sample plugins/LayoutPlugin/LayoutPlugin.java
2009-06-26 19:41:36 UTC (rev 17120)
@@ -1,168 +0,0 @@
-package layout;
-
-
-import java.awt.event.ActionEvent;
-
-import cytoscape.Cytoscape;
-
-import cytoscape.plugin.CytoscapePlugin;
-import cytoscape.util.CytoscapeAction;
-
-import cytoscape.layout.CyLayouts;
-import cytoscape.layout.CyLayoutAlgorithm;
-import cytoscape.layout.AbstractLayout;
-
-import cytoscape.layout.LayoutProperties;
-import cytoscape.layout.Tunable;
-
-import giny.model.GraphPerspective;
-import giny.model.Node;
-import javax.swing.JPanel;
-
-import java.awt.GridLayout;
-import java.awt.Rectangle;
-
-import java.util.Iterator;
-/**
- *
- */
-public class LayoutPlugin extends CytoscapePlugin {
-
- private int groupcount = 2;
- private LayoutProperties layoutProperties;
-
-
- /**
- *
- */
- public LayoutPlugin() {
- CyLayouts.addLayout(new MyLayout(), "My zLayouts");
- }
-
- class MyLayout extends AbstractLayout{
- /**
- * Creates a new layout object.
- */
- public MyLayout() {
- super();
- layoutProperties = new LayoutProperties(getName());
- initialize_properties();
- }
-
- protected void initialize_properties() {
- layoutProperties.add(new Tunable("groupcount",
- "Number of random
groups ",
- Tunable.INTEGER, new
Integer(2)));
-
- layoutProperties.initializeProperties();
-
- updateSettings(true);
- }
-
- /**
- * DOCUMENT ME!
- */
- public void updateSettings() {
- updateSettings(false);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param force DOCUMENT ME!
- */
- public void updateSettings(boolean force) {
- layoutProperties.updateValues();
-
- Tunable t = layoutProperties.get("groupcount");
-
- if ((t != null) && (t.valueChanged() || force))
- groupcount = ((Integer)
t.getValue()).intValue();
- }
-
- /**
- * Get the settings panel for this layout
- */
- public JPanel getSettingsPanel() {
- JPanel panel = new JPanel(new GridLayout(0, 1));
- panel.add(layoutProperties.getTunablePanel());
-
- return panel;
- }
-
-
- /**
- * DOCUMENT ME!
- */
- public void revertSettings() {
- layoutProperties.revertProperties();
- }
-
- public LayoutProperties getSettings() {
- return layoutProperties;
- }
-
- /**
- * DOCUMENT ME!
- */
- public void construct() {
-
- taskMonitor.setStatus("Initializing");
- initialize(); // Calls initialize_local
-
-
- System.out.println("do layout here: groupcount = "+
groupcount);
-
- if (groupcount <2) {
- return;
- }
-
- // Get the group center X
- double[] group_center_x = new double[groupcount];
-
- for (int i=0; i<groupcount; i++) {
- group_center_x[i] = i* maxwidth/(groupcount*2);
- }
-
- double group_width = (maxwidth/groupcount)*0.6/2;
-
- Iterator<Node> it = network.nodesIterator();
-
- int group_id = 0;
-
- while (it.hasNext()) {
- if (canceled)
- return;
-
- group_id = (int)
Math.round((groupcount-1)*Math.random());
-
- double x = group_center_x[group_id] +
(Math.random()-0.5)*group_width;
-
- Node node = (Node) it.next();
-
- //System.out.println(group_id);
-
- networkView.getNodeView(node).setYPosition(x);
- }
- }
-
-
- private double maxwidth = 5000.0;
-
- /**
- * getName is used to construct property strings
- * for this layout.
- */
- public String getName() {
- return "My zLayout";
- }
-
- /**
- * toString is used to get the user-visible name
- * of the layout
- */
- public String toString(){
- return "My first zLayout";
- }
- }
-}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---