Author: scooter
Date: 2012-09-06 13:06:13 -0700 (Thu, 06 Sep 2012)
New Revision: 30327

Added:
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
Removed:
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/AbstractPaintedShape.java
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphics.java
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsFactory.java
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaint.java
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaintedShapes.java
Log:
Backout old custom graphics attemp and restart...


Deleted: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/AbstractPaintedShape.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/AbstractPaintedShape.java
  2012-09-06 18:10:20 UTC (rev 30326)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/AbstractPaintedShape.java
  2012-09-06 20:06:13 UTC (rev 30327)
@@ -1,37 +0,0 @@
-package org.cytoscape.view.presentation.customgraphics;
-
-import java.awt.Paint;
-import java.awt.Shape;
-import java.awt.Stroke;
-import java.awt.geom.Rectangle2D;
-
-public class AbstractPaintedShape implements PaintedShape {
-       protected Shape shape;
-       protected Paint fill;
-       protected Stroke stroke;
-       protected Paint strokePaint;
-
-       public AbstractPaintedShape(Shape shape, Paint fill,
-                                   Stroke stroke, Paint strokePaint) {
-               this.shape = shape;
-               this.fill = fill;
-               this.stroke = stroke;
-               this.strokePaint = strokePaint;
-       }
-
-       public Shape getShape(Rectangle2D bounds) {
-               return shape;
-       }
-
-       public Paint getFill(Rectangle2D bounds) {
-               return fill;
-       }
-
-       public Stroke getStroke() {
-               return stroke;
-       }
-
-       public Paint getStrokePaint() {
-               return strokePaint;
-       }
-}

Deleted: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphics.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphics.java
        2012-09-06 18:10:20 UTC (rev 30326)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphics.java
        2012-09-06 20:06:13 UTC (rev 30327)
@@ -1,38 +0,0 @@
-package org.cytoscape.view.presentation.customgraphics;
-
-import java.awt.Image;
-import java.awt.geom.Rectangle2D;
-
-/**
- * This interface defines a custom graphics object that
- * provides a simple {@link java.awt.Image} to be painted
- * on a {@link org.cytoscape.model.CyNode} and is the only mandatory interface 
that
- * must be implemented by all
- * {@link org.cytoscape.view.presentation.RenderingEngine}s.
- * It is assumed that
- * any {@link org.cytoscape.view.presentation.RenderingEngine} will
- * be able to display an {@link java.awt.Image}, and that all more complicated
- * CustomGraphics implementations will be able to generate an image from
- * their graphical data.
- */
-public interface CustomGraphics {
-       /**
-        * This key is the threshold the provider wants to set for 
re-rendering.  If the
-        * zoom changes less than this value, none of the CustomGraphics 
methods will be
-        * called and the existing graphics will be reused.  If it exceeds this 
threshold
-        * the appropriate methods will be called to generate new custom 
graphics data.
-        */
-       public static String ZOOM_THRESHOLD = "zoomThreshold";
-
-       /**
-        * This method is called by the 
-        * {@link org.cytoscape.view.presentation.RenderingEngine} to get an 
image
-        * to paint onto a {@link org.cytoscape.model.CyNode}.  The size (in 
display
-        * coordinates) are given by the bounding rectangle.
-        *
-        * @param bounds the bounding rectangle of the displayed {@link 
org.cytoscape.model.CyNode}.
-        * @return an {@link java.awt.Image} that should be painted on the 
appropriate 
-        * {@link org.cytoscape.model.CyNode}.
-        */
-       public Image getRenderedImage(Rectangle2D bounds);
-}

Deleted: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsFactory.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsFactory.java
 2012-09-06 18:10:20 UTC (rev 30326)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsFactory.java
 2012-09-06 20:06:13 UTC (rev 30327)
@@ -1,45 +0,0 @@
-package org.cytoscape.view.presentation.customgraphics;
-
-import java.util.List;
-
-import org.cytoscape.model.CyNode;
-import org.cytoscape.view.model.CyNetworkView;
-import org.cytoscape.view.model.View;
-
-/**
- * This interface provides a factory for creating custom graphics
- * providers for a particular node view in a particular network.
- * All custom graphics providers are expected to implement the
- * {@link org.cytoscape.view.presentation.customgraphics.CustomGraphics}
- * interface.  Other interfaces may be implemented also.  The usual
- * way to register a {@link CustomGraphicsFactory} is to provide an 
implementation
- * of this interface and register it as part of the CyActivator for your App.
- * {@link org.cytoscape.view.presentation.RenderingEngine}s will read the
- * {@link java.util.Properties} object provided as part of the registration
- * to determine default position, zoom action, etc.  See 
- * {@link org.cytoscape.view.presentation.customgraphics.CustomGraphics} for
- * the default keys.
- */
-public interface CustomGraphicsFactory {
-       /**
-        * Create a new custom graphics.  A
-        * {@link org.cytoscape.view.presentation.RenderingEngine} will provide
-        * an ordered list of types that it supports in the "requestedTypes" 
list,
-        * with the first in the list being the highest quality rendering that 
this
-        * {@link org.cytoscape.view.presentation.RenderingEngine} can provide.
-        * The {@link org.cytoscape.view.presentation.RenderingEngine} will 
determine
-        * what this particular custom graphics class supports.
-        *
-        * @param netView the {@link org.cytoscape.view.model.CyNetworkView} 
this applies to.  
-        *                It can not be null.
-        * @param nodeView the {@link org.cytoscape.model.CyNode} {@link 
org.cytoscape.view.model.View}
-        *                 this applies to.
-        * @param requestedTypes the types of CustomGraphics this 
-        *                       {@link 
org.cytoscape.view.presentation.RenderingEngine} supports.
-        * @return a {@link org.cytoscape.view.presentation.CustomGraphics} 
object 
-        *         for this network and node view.
-        */
-       public CustomGraphics createCustomGraphics(CyNetworkView netView,
-                                                  View<CyNode> nodeView,
-                                                  List<Class<?>> 
requestedTypes);
-}

Deleted: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaint.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaint.java
   2012-09-06 18:10:20 UTC (rev 30326)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaint.java
   2012-09-06 20:06:13 UTC (rev 30327)
@@ -1,28 +0,0 @@
-package org.cytoscape.view.presentation.customgraphics;
-
-import java.awt.Paint;
-import java.awt.geom.Rectangle2D;
-
-/**
- * This interface defines a custom graphics object that provides
- * only a simple {@link java.awt.Paint} to a
- * {@link org.cytoscape.view.presentation.RenderingEngine} that can
- * be used to fill an arbitrary shape.  This might be used for something
- * like creating a data-driven gradient to use on a {@link 
org.cytoscape.model.CyNode}
- * visualization.  {@link org.cytoscape.view.presentation.RenderingEngine}s
- * are not required to implement this, so any implementation of this interface
- * must also implement {@link CustomGraphics}.
- */
-public interface CustomGraphicsPaint {
-       /**
-        * Return the {@link java.awt.Paint} to use for the
-        * {@link org.cytoscape.model.CyNode} specified by the
-        * {@link 
org.cytoscape.view.presentation.customgraphics.CustomGraphicsFactory}.
-        *
-        * @param bounds the bounding box of the {@link 
org.cytoscape.model.CyNode}.  Not
-        *               usually required for {@link java.awt.Paint} but 
provided here for
-        *               completeness.
-        * @return the {@link java.awt.Paint} to for this {@link 
org.cytoscape.model.CyNode}.
-        */
-       public Paint getPaint(Rectangle2D bounds);
-}

Deleted: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaintedShapes.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaintedShapes.java
   2012-09-06 18:10:20 UTC (rev 30326)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicsPaintedShapes.java
   2012-09-06 20:06:13 UTC (rev 30327)
@@ -1,30 +0,0 @@
-package org.cytoscape.view.presentation.customgraphics;
-
-import java.awt.geom.Rectangle2D;
-import java.util.List;
-
-/**
- * This interface defines a custom graphics object that provides
- * a series of {@link java.awt.Shape}s with arbitrary fill
- * {@link java.awt.Paint} and {@link java.awt.Stroke} to a
- * {@link org.cytoscape.view.presentation.RenderingEngine}.
- * This might be used for something
- * like creating a data-driven pie chart to use on a {@link 
org.cytoscape.model.CyNode}
- * visualization.  {@link org.cytoscape.view.presentation.RenderingEngine}s
- * are not required to implement this, so any implementation of this interface
- * must also implement {@link CustomGraphics}.
- */
-public interface CustomGraphicsPaintedShapes {
-       /**
-        * Return a list of {@link PaintedShape}s to the
-        * {@link org.cytoscape.view.presentation.RenderingEngine} for
-        * painting onto the {@link org.cytoscape.model.CyNode} visualization.
-        *
-        * @param bounds the bounding box of the 
-        *               {@link org.cytoscape.model.CyNode} visualization.
-        * @return a {@link java.util.List} of {@link PaintedShape}s that will 
-        *         be drawn in list order.  This means that the first 
-        *         {@link PaintedShape}s may be under subsequent {@link 
PaintedShape}s.
-        */
-       public List<PaintedShape> getPaintedShapes(Rectangle2D bounds);
-}

Added: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
                              (rev 0)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
      2012-09-06 20:06:13 UTC (rev 30327)
@@ -0,0 +1,92 @@
+package org.cytoscape.view.presentation.customgraphics;
+
+import java.awt.Image;
+import java.util.List;
+
+
+/**
+ * Base interface for all Custom Graphics.
+ *
+ */
+public interface CyCustomGraphics<T> {
+               
+       /**
+        * Immutable session-unique identifier of image generated in 
constructor.
+        * 
+        * NOT globally unique.  Uniqueness is guaranteed in a session.
+        * 
+        * @return Immutable ID as Long.
+        */
+       public Long getIdentifier();
+       
+       /**
+        * Display name is a simple description of this image object.
+        * May not be unique and mutable.
+        * 
+        * @return display name as String.
+        */
+       public String getDisplayName();
+       
+       
+       /**
+        * Set human readable display name.
+        * 
+        * @param displayName
+        */
+       public void setDisplayName(final String displayName);
+       
+       
+       /**
+        * Get layers belongs to this object.
+        * In current Implementation, ti's always Ding's CustomGraphic object.
+        * Ordered by Z-Order value.
+        * 
+        * @return Collection of layer objects (in this version, it's 
CustomGraphics in Ding)
+        * 
+        */
+       public List<T> getLayers();
+       
+       
+       /**
+        * Returns width of current object.
+        * 
+        * @return
+        */
+       public int getWidth();
+       
+       
+       /**
+        * Returns height of current object.
+        * 
+        * @return
+        */
+       public int getHeight();
+       
+       
+       /**
+        * Set width of Custom Graphics.
+        * 
+        * @param width
+        */
+       public void setWidth(final int width);
+       
+       /**
+        * Set height of Custom Graphics.
+        * 
+        * @param height
+        */
+       public void setHeight(final int height);
+       
+       public float getFitRatio();
+       public void setFitRatio(float ratio);
+       
+       /**
+        * From layers of graphics objects, render scaled Image object.
+        * Usually done by Java2D low level code. 
+        * 
+        * Usually, the image returned by this method is used in GUI components 
(as icons).
+        * 
+        * @return rendered image object.
+        */
+       public Image getRenderedImage();
+}

-- 
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.

Reply via email to