Author: scooter
Date: 2013-01-18 14:49:33 -0800 (Fri, 18 Jan 2013)
New Revision: 31061

Modified:
   
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
   
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
   
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/AbstractDCustomGraphics.java
   
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/NullCustomGraphics.java
   
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/PersistImageTask.java
   
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/RestoreImageTask.java
   
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/icon/CustomGraphicsIcon.java
   
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
   
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/visualproperty/CustomGraphicsVisualProperty.java
Log:
Updated CustomGraphics stuff to simplify signature of generics


Modified: 
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
===================================================================
--- 
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
        2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphics.java
        2013-01-18 22:49:33 UTC (rev 31061)
@@ -17,7 +17,7 @@
  * supported).  
  *
  */
-public interface CyCustomGraphics<T extends CustomGraphicLayer, S extends 
CyIdentifiable> {
+public interface CyCustomGraphics<T extends CustomGraphicLayer> {
                
        /**
         * Immutable session-unique identifier of this custom graphic generated 
by the 
@@ -79,7 +79,7 @@
         * @return List of layer objects
         * 
         */
-       public List<T> getLayers(CyNetworkView networkView, View<S> grView);
+       public List<T> getLayers(CyNetworkView networkView, View<? extends 
CyIdentifiable> grView);
        
        
        /**

Modified: 
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
===================================================================
--- 
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
 2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/api/branches/3.0.0-release/presentation-api/src/main/java/org/cytoscape/view/presentation/customgraphics/CyCustomGraphicsFactory.java
 2013-01-18 22:49:33 UTC (rev 31061)
@@ -23,7 +23,7 @@
  *
  *
  */
-public interface CyCustomGraphicsFactory<T extends CustomGraphicLayer, S 
extends CyIdentifiable> {
+public interface CyCustomGraphicsFactory<T extends CustomGraphicLayer> {
        /**
         * Return the prefix to identify this custom graphics factory.  This
         * is used by the passthrough mapping logic to figure out if a
@@ -51,7 +51,7 @@
         * @param url the url that points to the CyCustomGraphics data
         * @return the new instance, or null if URL references are not supported
         */
-       public CyCustomGraphics<T, S> getInstance(URL url); 
+       public CyCustomGraphics<T> getInstance(URL url); 
 
        /**
         * Get a new instance of the CyCustomGraphics.  The string argument may
@@ -66,14 +66,14 @@
         *              instance.  Not all implementations will use this.
         * @return the new instance
         */
-       public CyCustomGraphics<T,S> getInstance(String input); 
+       public CyCustomGraphics<T> getInstance(String input); 
 
        /**
         * Create a new CyCustomGraphics object by parsing the string
         * resulting from the toSerializableString() method.  This method
         * will be used to suport serialization of discrete mappings.
         */
-       public CyCustomGraphics<T,S> parseSerializableString(String string);
+       public CyCustomGraphics<T> parseSerializableString(String string);
 
        /**
         * Return the class that this factory creates.  This is used by the 
deserialization

Modified: 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/AbstractDCustomGraphics.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/AbstractDCustomGraphics.java
     2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/AbstractDCustomGraphics.java
     2013-01-18 22:49:33 UTC (rev 31061)
@@ -18,8 +18,8 @@
 import org.cytoscape.view.presentation.customgraphics.CyCustomGraphicsFactory;
 import org.cytoscape.view.presentation.customgraphics.CustomGraphicLayer;
 
-public abstract class AbstractDCustomGraphics<T extends CustomGraphicLayer, S 
extends CyIdentifiable> 
-                           implements CyCustomGraphics<T, S>, Taggable {
+public abstract class AbstractDCustomGraphics<T extends CustomGraphicLayer> 
+                           implements CyCustomGraphics<T>, Taggable {
 
        protected static final String DELIMITER = ",";
        public static final String LIST_DELIMITER = "|";
@@ -88,7 +88,7 @@
        }
 
        @Override       
-       public List<T> getLayers(CyNetworkView networkView, View<S> 
graphObject) {
+       public List<T> getLayers(CyNetworkView networkView, View<? extends 
CyIdentifiable> graphObject) {
                return layers;
        }
 

Modified: 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/NullCustomGraphics.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/NullCustomGraphics.java
  2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphics/NullCustomGraphics.java
  2013-01-18 22:49:33 UTC (rev 31061)
@@ -17,7 +17,7 @@
  * node views.
  * 
  */
-public class NullCustomGraphics extends 
AbstractDCustomGraphics<CustomGraphicLayer, CyNode> {
+public class NullCustomGraphics extends 
AbstractDCustomGraphics<CustomGraphicLayer> {
        
        private static final String DEF_IMAGE_FILE = "images/no_image.png";
        public static BufferedImage DEF_IMAGE;
@@ -31,9 +31,9 @@
                }
        }
 
-       static final CyCustomGraphics<CustomGraphicLayer, CyNode> NULL = new 
NullCustomGraphics();
+       static final CyCustomGraphics<CustomGraphicLayer> NULL = new 
NullCustomGraphics();
 
-       public static CyCustomGraphics<CustomGraphicLayer, CyNode> 
getNullObject() {
+       public static CyCustomGraphics<CustomGraphicLayer> getNullObject() {
                return NULL;
        }
 

Modified: 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/PersistImageTask.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/PersistImageTask.java
        2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/PersistImageTask.java
        2013-01-18 22:49:33 UTC (rev 31061)
@@ -65,7 +65,7 @@
                final ExecutorService exService = Executors
                                .newFixedThreadPool(NUM_THREADS);
 
-               for (final CyCustomGraphics<?, CyNode> cg : 
manager.getAllPersistantCustomGraphics()) {
+               for (final CyCustomGraphics<?> cg : 
manager.getAllPersistantCustomGraphics()) {
                        final Image img = cg.getRenderedImage();
                        if (img != null) {
                                try {

Modified: 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/RestoreImageTask.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/RestoreImageTask.java
        2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/customgraphicsmgr/internal/RestoreImageTask.java
        2013-01-18 22:49:33 UTC (rev 31061)
@@ -111,9 +111,9 @@
                                final Object[] args = { 
manager.getNextAvailableID() };
                                Object obj = constructor.newInstance(args);
                                if (obj instanceof CyCustomGraphics) {
-                                       final CyCustomGraphics<?,CyNode> cg = 
(CyCustomGraphics) obj;
+                                       final CyCustomGraphics<?> cg = 
(CyCustomGraphics) obj;
                                        boolean isExist = false;
-                                       for(final CyCustomGraphics<?,CyNode> 
testCG: allCG) {
+                                       for(final CyCustomGraphics<?> testCG: 
allCG) {
                                                if(testCG.getClass() == 
cg.getClass())
                                                        isExist = true;
                                        }
@@ -172,7 +172,7 @@
                        final String[] parts = imageURL.getFile().split("/");
                        final String dispNameString = parts[parts.length-1];
                        if (this.manager.getCustomGraphicsBySourceURL(imageURL) 
== null && !names.contains(dispNameString)) {
-                               final CyCustomGraphics<?,CyNode> cg = new 
URLImageCustomGraphics(manager.getNextAvailableID(), imageURL.toString());
+                               final CyCustomGraphics<?> cg = new 
URLImageCustomGraphics(manager.getNextAvailableID(), imageURL.toString());
                                if (cg != null) {
                                        manager.addCustomGraphics(cg, imageURL);
                                        cg.setDisplayName(dispNameString);
@@ -252,7 +252,7 @@
                                        if (image == null)
                                                continue;
 
-                                       final CyCustomGraphics<?,CyNode> cg = 
new URLImageCustomGraphics(fIdMap.get(f), fMap.get(f), image);
+                                       final CyCustomGraphics<?> cg = new 
URLImageCustomGraphics(fIdMap.get(f), fMap.get(f), image);
                                        if (cg instanceof Taggable && 
metatagMap.get(f) != null)
                                                ((Taggable) 
cg).getTags().addAll(metatagMap.get(f));
 

Modified: 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/icon/CustomGraphicsIcon.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/icon/CustomGraphicsIcon.java
    2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/icon/CustomGraphicsIcon.java
    2013-01-18 22:49:33 UTC (rev 31061)
@@ -9,12 +9,12 @@
 import org.cytoscape.model.CyNode;
 import org.cytoscape.view.presentation.customgraphics.CyCustomGraphics;
 
-public class CustomGraphicsIcon extends 
VisualPropertyIcon<CyCustomGraphics<?,CyNode>> {
+public class CustomGraphicsIcon extends 
VisualPropertyIcon<CyCustomGraphics<?>> {
 
        private static final long serialVersionUID = -216647303312376087L;
        
        
-       public CustomGraphicsIcon(CyCustomGraphics<?, CyNode> value, int width, 
int height,
+       public CustomGraphicsIcon(CyCustomGraphics<?> value, int width, int 
height,
                        String name) {
                super(value, width, height, name);
                this.setImage(value.getRenderedImage());

Modified: 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
     2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/DNodeView.java
     2013-01-18 22:49:33 UTC (rev 31061)
@@ -1118,14 +1118,14 @@
                } else if (vp == DVisualLexicon.NODE_LABEL_POSITION) {
                        this.setLabelPosition((ObjectPosition) value);
                } else if (vp instanceof CustomGraphicsVisualProperty) {
-                       applyCustomGraphics(vp, 
(CyCustomGraphics<CustomGraphicLayer,CyNode>) value);
+                       applyCustomGraphics(vp, 
(CyCustomGraphics<CustomGraphicLayer>) value);
                } else if (vp instanceof ObjectPositionVisualProperty) {
                        applyCustomGraphicsPosition(vp, (ObjectPosition) value);
                }
        }
 
        private void applyCustomGraphics(final VisualProperty<?> vp, 
-                                        final 
CyCustomGraphics<CustomGraphicLayer,CyNode> customGraphics) {
+                                        final 
CyCustomGraphics<CustomGraphicLayer> customGraphics) {
                Set<CustomGraphicLayer> dCustomGraphicsSet = cgMap.get(vp);
                
                if (dCustomGraphicsSet == null)
@@ -1217,7 +1217,7 @@
                this.cgMap.put(parent, currentCG);
        }
 
-       private CustomGraphicLayer 
syncSize(CyCustomGraphics<CustomGraphicLayer,CyNode> graphics, 
+       private CustomGraphicLayer 
syncSize(CyCustomGraphics<CustomGraphicLayer> graphics, 
                                       final CustomGraphicLayer cg, double 
width, double height) {
                // final double nodeW = this.getWidth();
                // final double nodeH = this.getHeight();

Modified: 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/visualproperty/CustomGraphicsVisualProperty.java
===================================================================
--- 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/visualproperty/CustomGraphicsVisualProperty.java
   2013-01-18 20:49:44 UTC (rev 31060)
+++ 
core3/impl/branches/3.0.0-release/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/visualproperty/CustomGraphicsVisualProperty.java
   2013-01-18 22:49:33 UTC (rev 31061)
@@ -12,7 +12,7 @@
 import org.cytoscape.view.model.AbstractVisualProperty;
 
 public class CustomGraphicsVisualProperty extends 
AbstractVisualProperty<CyCustomGraphics> {
-       public CustomGraphicsVisualProperty(final 
CyCustomGraphics<CustomGraphicLayer, CyNode> defaultValue,
+       public CustomGraphicsVisualProperty(final 
CyCustomGraphics<CustomGraphicLayer> defaultValue,
                                                        final 
CustomGraphicsRange customGraphicsRange, 
                                            String id, String displayName, 
                                            Class<? extends CyIdentifiable> 
targetObjectDataType) {
@@ -27,7 +27,7 @@
        // Parse the string associated with our visual property.  Note that we 
depend on the first
        // part of the string being the class name that was registered with the 
CustomGraphicsManager
        @Override
-       public CyCustomGraphics<CustomGraphicLayer, CyNode> 
parseSerializableString(String value) {
+       public CyCustomGraphics<CustomGraphicLayer> 
parseSerializableString(String value) {
                // This is hokey, but we've got no other way to get our hands 
on the
                // CustomGraphicsManager since the DVisualLexicon is created 
statically
                CustomGraphicsManagerImpl cgMgr = 
CustomGraphicsManagerImpl.getInstance();

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