Author: kono
Date: 2009-04-24 16:35:54 -0700 (Fri, 24 Apr 2009)
New Revision: 16691
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.java
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Presentation.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/TwoDVisualProperties.java
Log:
DGraphView implements Presentation API. Presentation API has a new method
"getImage()". TwoDVP has been changed into an abstract class.
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.java
2009-04-24 18:57:15 UTC (rev 16690)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/EdgeView.java
2009-04-24 23:35:54 UTC (rev 16691)
@@ -1,10 +1,11 @@
package org.cytoscape.ding;
+import java.awt.Paint;
+import java.awt.Stroke;
+
import org.cytoscape.model.CyEdge;
-import java.awt.*;
-
public interface EdgeView extends GraphViewObject {
/**
Modified:
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
===================================================================
---
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2009-04-24 18:57:15 UTC (rev 16690)
+++
core3/ding-presentation-impl/trunk/src/main/java/org/cytoscape/ding/impl/DGraphView.java
2009-04-24 23:35:54 UTC (rev 16691)
@@ -34,60 +34,73 @@
*/
package org.cytoscape.ding.impl;
-import org.cytoscape.spacial.SpacialIndex2D;
-import org.cytoscape.spacial.SpacialIndex2DFactory;
-import org.cytoscape.spacial.SpacialEntry2DEnumerator;
+import static org.cytoscape.model.GraphObject.EDGE;
+import static org.cytoscape.model.GraphObject.NETWORK;
+import static org.cytoscape.model.GraphObject.NODE;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Paint;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+import java.awt.print.PageFormat;
+import java.awt.print.Printable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import javax.swing.JComponent;
+import javax.swing.JLayeredPane;
+
+import org.cytoscape.ding.EdgeContextMenuListener;
+import org.cytoscape.ding.EdgeView;
+import org.cytoscape.ding.GraphView;
+import org.cytoscape.ding.GraphViewChangeListener;
+import org.cytoscape.ding.GraphViewObject;
+import org.cytoscape.ding.NodeContextMenuListener;
+import org.cytoscape.ding.NodeView;
+import org.cytoscape.ding.PrintLOD;
import org.cytoscape.graph.render.immed.GraphGraphics;
import org.cytoscape.graph.render.stateful.GraphLOD;
import org.cytoscape.graph.render.stateful.GraphRenderer;
-import org.cytoscape.util.intr.IntBTree;
-import org.cytoscape.util.intr.IntEnumerator;
-import org.cytoscape.util.intr.IntHash;
-import org.cytoscape.util.intr.IntStack;
-import org.cytoscape.model.CyRow;
import org.cytoscape.model.CyDataTable;
import org.cytoscape.model.CyDataTableFactory;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
+import org.cytoscape.model.subnetwork.CyRootNetworkFactory;
import org.cytoscape.model.subnetwork.CySubNetwork;
-import org.cytoscape.model.subnetwork.CyRootNetworkFactory;
+import org.cytoscape.spacial.SpacialEntry2DEnumerator;
+import org.cytoscape.spacial.SpacialIndex2D;
+import org.cytoscape.spacial.SpacialIndex2DFactory;
+import org.cytoscape.util.intr.IntBTree;
+import org.cytoscape.util.intr.IntEnumerator;
+import org.cytoscape.util.intr.IntHash;
+import org.cytoscape.util.intr.IntStack;
import org.cytoscape.view.model.CyNetworkView;
+import org.cytoscape.view.model.View;
+import org.cytoscape.view.model.ViewChangeListener;
import org.cytoscape.view.model.VisualProperty;
-import org.cytoscape.view.model.ViewChangeListener;
-import org.cytoscape.view.model.View;
import org.cytoscape.view.model.VisualPropertyCatalog;
+import org.cytoscape.view.presentation.Presentation;
import org.cytoscape.view.presentation.twod.TwoDVisualProperties;
-import org.cytoscape.ding.EdgeContextMenuListener;
-import org.cytoscape.ding.EdgeView;
-import org.cytoscape.ding.GraphView;
-import org.cytoscape.ding.GraphViewChangeListener;
-import org.cytoscape.ding.GraphViewObject;
-import org.cytoscape.ding.NodeContextMenuListener;
-import org.cytoscape.ding.NodeView;
-import org.cytoscape.ding.PrintLOD;
import org.cytoscape.work.UndoSupport;
+
import phoebe.PhoebeCanvasDropListener;
import phoebe.PhoebeCanvasDroppable;
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Point2D;
-import java.awt.image.BufferedImage;
-import java.awt.print.PageFormat;
-import java.awt.print.Printable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Collection;
-
-import static org.cytoscape.model.GraphObject.*;
-
/**
* DING implementation of the GINY view.
*
@@ -101,7 +114,7 @@
*
* @author Nerius Landys
*/
-public class DGraphView implements GraphView, Printable,
PhoebeCanvasDroppable, ViewChangeListener {
+public class DGraphView implements Presentation, GraphView, Printable,
PhoebeCanvasDroppable, ViewChangeListener {
private static enum ZOrder {
BACKGROUND_PANE,
@@ -2521,10 +2534,6 @@
m_networkCanvas.setSize(d);
}
- public Printable getPrintable() {
- return this;
- }
-
public Container getContainer(JLayeredPane jlp) {
return new InternalFrameComponent(jlp,this);
}
@@ -2605,4 +2614,24 @@
setZoom(((Double)o).doubleValue());
}
}
+
+ //////// The following implements Presentation API ////////////
+
+ public Printable getPrintable() {
+ return this;
+ }
+
+ public Image getImage() {
+ return null;
+ }
+
+ public Properties getProperties() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setProperties(Properties props) {
+ // TODO Auto-generated method stub
+
+ }
}
Modified:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Presentation.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Presentation.java
2009-04-24 18:57:15 UTC (rev 16690)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/Presentation.java
2009-04-24 23:35:54 UTC (rev 16691)
@@ -1,13 +1,84 @@
+/*
+ Copyright (c) 2006, 2007, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
package org.cytoscape.view.presentation;
+import java.awt.Image;
import java.awt.print.Printable;
+
import java.util.Properties;
+
+/**
+ * Represents an presentation, i.e., actual 2D/3D visualization.
+ *
+ * Rendering engines should implement this interface.
+ *
+ * @author mes
+ * @author kono
+ *
+ * @since Cytoscape 3.0
+ *
+ */
public interface Presentation {
+ /**
+ *
+ *
+ * @param props DOCUMENT ME!
+ */
+ public void setProperties(Properties props);
- Printable getPrintable();
- void setProperties(Properties props);
- Properties getProperties();
+ /**
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ public Properties getProperties();
+
+ /**
+ * For export image function.
+ *
+ * @return DOCUMENT ME!
+ */
+ public Printable getPrintable();
+
+ /**
+ * Generate image from the current presentation.
+ *
+ * @return Image object created from current window.
+ */
+ public Image getImage();
}
-
Modified:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/TwoDVisualProperties.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/TwoDVisualProperties.java
2009-04-24 18:57:15 UTC (rev 16690)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/TwoDVisualProperties.java
2009-04-24 23:35:54 UTC (rev 16691)
@@ -52,7 +52,7 @@
* 'Renderer' is simply anything that provides VisualProperties.
* With a 'VisualProperties as annotations' this won't be needed.
*/
-public class TwoDVisualProperties implements Renderer {
+public abstract class TwoDVisualProperties implements Renderer {
protected Set<VisualProperty<?>> visualPropertySet;
@@ -124,4 +124,5 @@
public Set<VisualProperty<?>> getVisualProperties() {
return Collections.unmodifiableSet( visualPropertySet );
}
+
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---