Author: mes
Date: 2010-01-13 15:03:17 -0800 (Wed, 13 Jan 2010)
New Revision: 18892

Modified:
   cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependency.java
   cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependencyImpl.java
   cytoscape/trunk/tests/cytoscape/visual/VisualPropertyDependencyTest.java
Log:
refactored the copy method to make the API a bit cleaner

Modified: cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependency.java
===================================================================
--- cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependency.java  
2010-01-13 22:58:11 UTC (rev 18891)
+++ cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependency.java  
2010-01-13 23:03:17 UTC (rev 18892)
@@ -89,13 +89,6 @@
         */
        void copy(VisualPropertyDependency v);
 
-       /**
-        * DO NOT USE THIS METHOD. Will return the object bound to the 
specified Definition, or null
-        * if nothing has been set. This method is used by the copy method and 
should otherwise
-        * not be used.
-        */
-       Boolean get(final Definition s);
-
        /** 
         * Will search the specified Properties using the specified basedKey for
         * each dependency definition and will update this object according

Modified: cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependencyImpl.java
===================================================================
--- cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependencyImpl.java      
2010-01-13 22:58:11 UTC (rev 18891)
+++ cytoscape/trunk/src/cytoscape/visual/VisualPropertyDependencyImpl.java      
2010-01-13 23:03:17 UTC (rev 18892)
@@ -59,10 +59,6 @@
                        state.put(s,b);
        }
 
-       public Boolean get(final Definition s) {
-               return state.get(s);
-       }
-
        public void applyDefaultProperties(final Properties props, final String 
baseKey) {
                for ( Definition d : Definition.values() ) {
                        final String lockKey = baseKey + "." + 
d.getDefaultPropertyKey();
@@ -96,8 +92,8 @@
                        return;
                state.clear();
                for ( Definition def : Definition.values() ) {
-                       Boolean b = d.get(def);
-                       if ( b != null ) 
+                       final boolean b = d.check(def);
+                       if ( b != def.getDefault() )
                                state.put( def, b );
                }
        }

Modified: 
cytoscape/trunk/tests/cytoscape/visual/VisualPropertyDependencyTest.java
===================================================================
--- cytoscape/trunk/tests/cytoscape/visual/VisualPropertyDependencyTest.java    
2010-01-13 22:58:11 UTC (rev 18891)
+++ cytoscape/trunk/tests/cytoscape/visual/VisualPropertyDependencyTest.java    
2010-01-13 23:03:17 UTC (rev 18892)
@@ -71,7 +71,7 @@
 
                deps.applyDefaultProperties(props,baseKey);
 
-               assertTrue( !deps.get(NODE_SIZE_LOCKED) );
+               assertTrue( !deps.check(NODE_SIZE_LOCKED) );
        }
 
        public void testGetOnlySetProps() {

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