Author: mmichaud
Date: 2009-05-29 07:14:41 -0700 (Fri, 29 May 2009)
New Revision: 16846
Added:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedPropHandler.java
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FlexiblyBoundedPropHandler.java
Removed:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedDoublePropHandler.java
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedFloatPropHandler.java
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedIntegerPropHandler.java
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedLongPropHandler.java
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropInterceptor.java
Log:
[]
Deleted:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedDoublePropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedDoublePropHandler.java
2009-05-29 14:11:29 UTC (rev 16845)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedDoublePropHandler.java
2009-05-29 14:14:41 UTC (rev 16846)
@@ -1,49 +0,0 @@
-package org.cytoscape.work.internal.props;
-
-import java.lang.reflect.Field;
-import java.util.Properties;
-
-import org.cytoscape.work.Tunable;
-import org.cytoscape.work.util.BoundedDouble;
-
-
-public class BoundedDoublePropHandler extends AbstractPropHandler {
-
- BoundedDouble bounded;
-
- public BoundedDoublePropHandler(Field f, Object o, Tunable t) {
- super(f,o,t);
- try{
- this.bounded = (BoundedDouble)f.get(o);
- }catch(Exception e){e.printStackTrace();}
- }
-
-
- public Properties getProps() {
- Properties p = new Properties();
- p.put(propKey, bounded.getValue());
- return p;
- }
-
-
- public void add(Properties p) {
- bounded.setValue(bounded.getValue().doubleValue()); //Need to
initialize the value
- try{
- p.put(propKey,bounded.getValue().toString());
- }catch(Exception e){e.printStackTrace();}
- }
-
-
- public void setProps(Properties p) {
- try {
- if (p.containsKey(propKey)) {
- String val = p.get(propKey).toString();
- bounded.setValue(Double.parseDouble(val));
- if (val != null)
- f.set(o, bounded);
- }
- } catch (IllegalAccessException iae) {
- iae.printStackTrace();
- }
- }
-}
Deleted:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedFloatPropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedFloatPropHandler.java
2009-05-29 14:11:29 UTC (rev 16845)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedFloatPropHandler.java
2009-05-29 14:14:41 UTC (rev 16846)
@@ -1,49 +0,0 @@
-package org.cytoscape.work.internal.props;
-
-import java.lang.reflect.Field;
-import java.util.Properties;
-
-import org.cytoscape.work.Tunable;
-import org.cytoscape.work.util.BoundedFloat;
-
-public class BoundedFloatPropHandler extends AbstractPropHandler {
-
- BoundedFloat bounded;
-
- public BoundedFloatPropHandler(Field f, Object o, Tunable t) {
- super(f,o,t);
- try{
- this.bounded = (BoundedFloat)f.get(o);
- }catch(Exception e){e.printStackTrace();}
- }
-
-
-
- public Properties getProps() {
- Properties p = new Properties();
- p.put(propKey, bounded.getValue());
- return p;
- }
-
-
- public void add(Properties p) {
- bounded.setValue(bounded.getValue().floatValue()); //Need to
initialize the value
- try{
- p.put(propKey,bounded.getValue().toString());
- }catch(Exception e){e.printStackTrace();}
- }
-
-
- public void setProps(Properties p) {
- try {
- if (p.containsKey(propKey)) {
- String val = p.get(propKey).toString();
- bounded.setValue(Float.parseFloat(val));
- if (val != null)
- f.set(o, bounded);
- }
- } catch (IllegalAccessException iae) {
- iae.printStackTrace();
- }
- }
-}
Deleted:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedIntegerPropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedIntegerPropHandler.java
2009-05-29 14:11:29 UTC (rev 16845)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedIntegerPropHandler.java
2009-05-29 14:14:41 UTC (rev 16846)
@@ -1,50 +0,0 @@
-package org.cytoscape.work.internal.props;
-
-import java.lang.reflect.Field;
-import java.util.Properties;
-
-import org.cytoscape.work.util.BoundedInteger;
-import org.cytoscape.work.Tunable;
-
-
-public class BoundedIntegerPropHandler extends AbstractPropHandler {
-
- BoundedInteger bounded;
-
- public BoundedIntegerPropHandler(Field f, Object o, Tunable t) {
- super(f,o,t);
- try{
- this.bounded = (BoundedInteger)f.get(o);
- }catch(Exception e){e.printStackTrace();}
- }
-
-
-
- public Properties getProps() {
- Properties p = new Properties();
- p.put(propKey, bounded.getValue());
- return p;
- }
-
-
- public void add(Properties p) {
- bounded.setValue(bounded.getValue().intValue()); //Need to
initialize the value
- try{
- p.put(propKey,bounded.getValue().toString());
- }catch(Exception e){e.printStackTrace();}
- }
-
-
- public void setProps(Properties p) {
- try {
- if (p.containsKey(propKey)) {
- String val = p.get(propKey).toString();
- bounded.setValue(Integer.parseInt(val));
- if (val != null)
- f.set(o, bounded);
- }
- } catch (IllegalAccessException iae) {
- iae.printStackTrace();
- }
- }
-}
Deleted:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedLongPropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedLongPropHandler.java
2009-05-29 14:11:29 UTC (rev 16845)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedLongPropHandler.java
2009-05-29 14:14:41 UTC (rev 16846)
@@ -1,48 +0,0 @@
-package org.cytoscape.work.internal.props;
-
-import java.lang.reflect.Field;
-import java.util.Properties;
-
-import org.cytoscape.work.util.BoundedLong;
-import org.cytoscape.work.Tunable;
-
-
-public class BoundedLongPropHandler extends AbstractPropHandler {
-
- BoundedLong bounded;
-
- public BoundedLongPropHandler(Field f, Object o, Tunable t) {
- super(f,o,t);
- try{
- this.bounded = (BoundedLong)f.get(o);
- }catch(Exception e){e.printStackTrace();}
- }
-
- public Properties getProps() {
- Properties p = new Properties();
- p.put(propKey, bounded.getValue());
- return p;
- }
-
-
- public void add(Properties p) {
- bounded.setValue(bounded.getValue().longValue()); //Need to
initialize the value
- try{
- p.put(propKey,bounded.getValue().toString());
- }catch(Exception e){e.printStackTrace();}
- }
-
-
- public void setProps(Properties p) {
- try {
- if (p.containsKey(propKey)) {
- String val = p.get(propKey).toString();
- bounded.setValue(Long.parseLong(val));
- if (val != null)
- f.set(o, bounded);
- }
- } catch (IllegalAccessException iae) {
- iae.printStackTrace();
- }
- }
-}
Added:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedPropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedPropHandler.java
2009-05-29 14:11:29 UTC (rev 16845)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/BoundedPropHandler.java
2009-05-29 14:14:41 UTC (rev 16846)
@@ -0,0 +1,36 @@
+package org.cytoscape.work.internal.props;
+
+import java.lang.reflect.Field;
+import java.util.Properties;
+
+import org.cytoscape.work.Tunable;
+import org.cytoscape.work.util.AbstractBounded;
+
+
+public class BoundedPropHandler<T extends AbstractBounded<?>> extends
AbstractPropHandler {
+
+ public BoundedPropHandler(Field f, Object o, Tunable t){
+ super(f,o,t);
+ }
+
+ public Properties getProps() {
+ Properties p = new Properties();
+ try {
+ p.setProperty(propKey,
((T)f.get(o)).getValue().toString());
+ }catch(IllegalAccessException iae) {iae.printStackTrace();}
+ return p;
+ }
+
+ public void setProps(Properties p) {
+ try{
+ if(p.containsKey(propKey)){
+ T bo = (T) f.get(o);
+ String val = p.getProperty(propKey).toString();
+ if(val != null) {
+ bo.setValue(val);
+ f.set(o, bo);
+ }
+ }
+ }catch(Exception e){e.printStackTrace();}
+ }
+}
\ No newline at end of file
Added:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FlexiblyBoundedPropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FlexiblyBoundedPropHandler.java
2009-05-29 14:11:29 UTC (rev 16845)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FlexiblyBoundedPropHandler.java
2009-05-29 14:14:41 UTC (rev 16846)
@@ -0,0 +1,42 @@
+package org.cytoscape.work.internal.props;
+
+import java.lang.reflect.Field;
+import java.util.Properties;
+
+import org.cytoscape.work.Tunable;
+import org.cytoscape.work.util.AbstractFlexiblyBounded;
+
+
+
+public class FlexiblyBoundedPropHandler<T extends AbstractFlexiblyBounded<?>>
extends AbstractPropHandler {
+
+ public FlexiblyBoundedPropHandler(Field f, Object o, Tunable t){
+ super(f,o,t);
+ }
+
+ public Properties getProps() {
+ Properties p = new Properties();
+ try {
+ T bo = (T)f.get(o);
+ p.put(propKey, new
String(bo.getLowerBound()+","+bo.getValue()+","+bo.getUpperBound()+","+bo.isLowerBoundStrict()+","+bo.isUpperBoundStrict()));
+ }catch(IllegalAccessException iae) {iae.printStackTrace();}
+ return p;
+ }
+
+ public void setProps(Properties p) {
+ try{
+ if(p.containsKey(propKey)){
+ T bo = (T)f.get(o);
+ String[] vals =
p.getProperty(propKey).split(",");
+ if(vals != null){
+ bo.setLowerBound(vals[0]);
+ bo.setValue(vals[1]);
+ bo.setUpperBound(vals[2]);
+
bo.setLowerBoundStrict(Boolean.getBoolean(vals[3]));
+
bo.setUpperBoundStrict(Boolean.getBoolean(vals[4]));
+ }
+ if(bo != null) f.set(o, bo);
+ }
+ }catch(Exception e){e.printStackTrace();}
+ }
+}
\ No newline at end of file
Deleted:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropInterceptor.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropInterceptor.java
2009-05-29 14:11:29 UTC (rev 16845)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropInterceptor.java
2009-05-29 14:14:41 UTC (rev 16846)
@@ -1,6 +0,0 @@
-package org.cytoscape.work.internal.props;
-
-public interface PropInterceptor{
-
- public int process();
-}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---