Author: scooter
Date: 2012-09-11 08:49:41 -0700 (Tue, 11 Sep 2012)
New Revision: 30341

Added:
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicLayer.java
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphicLayer.java
Removed:
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphic.java
   
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphic.java
Modified:
   
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/PaintedShape.java
Log:
Change to CustomGraphicsLayer as suggested by Jason


Deleted: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphic.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphic.java
 2012-09-10 18:46:55 UTC (rev 30340)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphic.java
 2012-09-11 15:49:41 UTC (rev 30341)
@@ -1,48 +0,0 @@
-package org.cytoscape.view.presentation.customgraphics;
-
-import java.awt.Paint;
-import java.awt.Rectangle;
-import java.awt.Shape;
-import java.awt.Stroke;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.Rectangle2D;
-
-/**
- * This interface defines a the mimimum interface to
- * add a custom graphics to a {@link org.cytoscape.model.CyNode}.
- */
-public interface CustomGraphic {
-       /**
-        * Return the bounds of the area covered by this
-        * CustomGraphic as a {@link java.awt.Rectangle}
-        *
-        * @return the {@link java.awt.Rectangle}
-        */
-       public Rectangle getBounds();
-
-       /**
-        * Return the bounds of the area covered by this
-        * CustomGraphic as a {@link java.awt.Rectangle2D}
-        *
-        * @return the {@link java.awt.Rectangle2D}
-        */
-       public Rectangle2D getBounds2D();
-
-       /**
-        * Return the {@link java.awt.Paint} to be used to
-        * fill the {@link java.awt.Shape}.
-        *
-        * @param bounds the bounding box of the {@link 
org.cytoscape.model.CyNode}.
-        * @return the fill {@link java.awt.Paint}
-        */
-       public Paint getPaint(Rectangle2D bounds);
-
-       /**
-        * Return a new NodeCustomGraphics that has been transformed by the
-        * provided {@link java.awt.geom.AffineTransform}.
-        *
-        * @param xform transform to perform on the shape
-        * @return the transformed NodeCustomGraphic
-        */
-  public CustomGraphic transform(AffineTransform xform);
-}

Copied: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicLayer.java
 (from rev 30340, 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphic.java)
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicLayer.java
                            (rev 0)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CustomGraphicLayer.java
    2012-09-11 15:49:41 UTC (rev 30341)
@@ -0,0 +1,48 @@
+package org.cytoscape.view.presentation.customgraphics;
+
+import java.awt.Paint;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.Stroke;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+
+/**
+ * This interface defines a the mimimum interface to
+ * add a custom graphics to a {@link org.cytoscape.model.CyNode}.
+ */
+public interface CustomGraphicLayer {
+       /**
+        * Return the bounds of the area covered by this
+        * CustomGraphicLayer as a {@link java.awt.Rectangle}
+        *
+        * @return the {@link java.awt.Rectangle}
+        */
+       public Rectangle getBounds();
+
+       /**
+        * Return the bounds of the area covered by this
+        * CustomGraphicLayer as a {@link java.awt.Rectangle2D}
+        *
+        * @return the {@link java.awt.Rectangle2D}
+        */
+       public Rectangle2D getBounds2D();
+
+       /**
+        * Return the {@link java.awt.Paint} to be used to
+        * fill the {@link java.awt.Shape}.
+        *
+        * @param bounds the bounding box of the {@link 
org.cytoscape.model.CyNode}.
+        * @return the fill {@link java.awt.Paint}
+        */
+       public Paint getPaint(Rectangle2D bounds);
+
+       /**
+        * Return a new CustomGraphicLayer that has been transformed by the
+        * provided {@link java.awt.geom.AffineTransform}.
+        *
+        * @param xform transform to perform on the shape
+        * @return the transformed CustomGraphicLayer
+        */
+  public CustomGraphicLayer transform(AffineTransform xform);
+}

Modified: 
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
      2012-09-10 18:46:55 UTC (rev 30340)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
      2012-09-11 15:49:41 UTC (rev 30341)
@@ -8,7 +8,7 @@
  * Base interface for all Custom Graphics.
  *
  */
-public interface CyCustomGraphics<T> {
+public interface CyCustomGraphics<T extends CustomGraphicLayer> {
                
        /**
         * Immutable session-unique identifier of image generated in 
constructor.
@@ -35,13 +35,18 @@
         */
        public void setDisplayName(final String displayName);
        
+       /**
+        * Generate a string suitable for serializing the state of this
+        * custom graphic.
+        * 
+        * @return serialized custom graphic state
+        */
+       public String toSerializableString();
        
        /**
-        * Get layers belongs to this object.
-        * In current Implementation, ti's always Ding's CustomGraphic object.
-        * Ordered by Z-Order value.
+        * Get layers that belong to this object.
         * 
-        * @return Collection of layer objects (in this version, it's 
CustomGraphics in Ding)
+        * @return Collection of layer objects (in this version, it's 
CustomGraphicLayers from Ding)
         * 
         */
        public List<T> getLayers();

Added: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
                               (rev 0)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
       2012-09-11 15:49:41 UTC (rev 30341)
@@ -0,0 +1,25 @@
+package org.cytoscape.view.presentation.customgraphics;
+
+import java.awt.Image;
+import java.util.List;
+
+
+/**
+ * This interface provides the factory to create CyCustomGraphics objects.
+ * Implementations of CyCustomGraphicsFactory are the objects that should
+ * be registered as OSGi services and will be utilized by the renderers to
+ * create CyCustomGraphics objects.
+ *
+ */
+public interface CyCustomGraphicsFactory<T extends CustomGraphicLayer> {
+       /**
+        * Get a new instance of the CyCustomGraphics
+        */
+       public CyCustomGraphics<T> getInstance(); 
+
+       /**
+        * Create a new CyCustomGraphics object by parsing the string
+        * resulting from the toSerializableString() method.
+        */
+       public CyCustomGraphics<T> parseSerializableString(String string);
+}

Deleted: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphic.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphic.java
    2012-09-10 18:46:55 UTC (rev 30340)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphic.java
    2012-09-11 15:49:41 UTC (rev 30341)
@@ -1,20 +0,0 @@
-package org.cytoscape.view.presentation.customgraphics;
-
-import java.awt.TexturePaint;
-import java.awt.geom.Rectangle2D;
-
-/**
- * This interface defines a the mimimum interface to
- * add a custom graphics to a {@link org.cytoscape.model.CyNode}.
- */
-public interface ImageCustomGraphic extends CustomGraphic {
-       /**
-        * Return the {@link java.awt.TexturePaint} to be used as
-        * an image to fill a node
-        *
-        * @param bounds the bounding box of the {@link 
org.cytoscape.model.CyNode}.
-        * @return the fill {@link java.awt.TexturePaint}
-        */
-       @Override
-       public TexturePaint getPaint(Rectangle2D bounds);
-}

Copied: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphicLayer.java
 (from rev 30340, 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphic.java)
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphicLayer.java
                               (rev 0)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/ImageCustomGraphicLayer.java
       2012-09-11 15:49:41 UTC (rev 30341)
@@ -0,0 +1,20 @@
+package org.cytoscape.view.presentation.customgraphics;
+
+import java.awt.TexturePaint;
+import java.awt.geom.Rectangle2D;
+
+/**
+ * This interface defines a the mimimum interface to
+ * add a custom graphics to a {@link org.cytoscape.model.CyNode}.
+ */
+public interface ImageCustomGraphicLayer extends CustomGraphicLayer {
+       /**
+        * Return the {@link java.awt.TexturePaint} to be used as
+        * an image to fill a node
+        *
+        * @param bounds the bounding box of the {@link 
org.cytoscape.model.CyNode}.
+        * @return the fill {@link java.awt.TexturePaint}
+        */
+       @Override
+       public TexturePaint getPaint(Rectangle2D bounds);
+}

Modified: 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/PaintedShape.java
===================================================================
--- 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/PaintedShape.java
  2012-09-10 18:46:55 UTC (rev 30340)
+++ 
core3/api/trunk/custom-graphics-api/src/main/java/org/cytoscape/view/presentation/customgraphics/PaintedShape.java
  2012-09-11 15:49:41 UTC (rev 30341)
@@ -10,7 +10,7 @@
  * construct a {@link java.awt.Shape} that has an arbitrary
  * fill {@link java.awt.Paint} and {@link java.awt.Stroke}.
  */
-public interface PaintedShape extends CustomGraphic {
+public interface PaintedShape extends CustomGraphicLayer {
        /**
         * Return the {@link java.awt.Shape}
         *

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