Author: mes
Date: 2011-03-11 16:12:50 -0800 (Fri, 11 Mar 2011)
New Revision: 24418

Modified:
   
core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
   core3/work-api/trunk/src/main/java/org/cytoscape/work/ProvidesGUI.java
   core3/work-api/trunk/src/main/java/org/cytoscape/work/Tunable.java
   core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableHandler.java
   core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableInterceptor.java
   
core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTunableInterceptorTest.java
   core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java
   
core3/work-api/trunk/src/test/java/org/cytoscape/work/ValuedTaskExecutorTest.java
Log:
cleaned up javadocs and added a missing method ot TunableHandler

Modified: 
core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
===================================================================
--- 
core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
   2011-03-11 23:51:05 UTC (rev 24417)
+++ 
core3/work-api/trunk/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
   2011-03-12 00:12:50 UTC (rev 24418)
@@ -10,9 +10,11 @@
 import java.util.Properties;
 
 
-/** Provides the standard implementation for most of the methods declared by 
the TunableHandler interface.
+/** 
+ * Provides the standard implementation for most of the methods declared by 
the 
+ * TunableHandler interface.
  */
-public class AbstractTunableHandler implements TunableHandler {
+public abstract class AbstractTunableHandler implements TunableHandler {
        private enum ParamsParseState {
                KEY_START, LOOKING_FOR_EQUAL_SIGN, VALUE_START, 
LOOKING_FOR_SEMICOLON;
        }
@@ -23,12 +25,15 @@
        final private Object instance;
        final private Tunable tunable;
 
-       /** Standard base class constructor for <code>TunableHandler</code>s 
that deal with
-        *  <code>Tunable</code>s that annotate a field.
+       /** 
+        * Standard base class constructor for <code>TunableHandler</code>s 
that deal with
+        * <code>Tunable</code>s that annotate a field.
         *
-        *  @param field    An instance of <code>Field</code> that represents a 
field annotated with <code>@Tunable</code>
-        *  @param instance An object instance that contains a field 
corresponding to the <i>field</i> parameter
-        *  @param tunable  The <code>Tunable</code> that annotates <i>field</i>
+        * @param field    An instance of <code>Field</code> that represents a 
field 
+        * annotated with <code>@Tunable</code>
+        * @param instance An object instance that contains a field 
corresponding to 
+        * the <i>field</i> parameter
+        * @param tunable  The <code>Tunable</code> that annotates <i>field</i>
         */
        public AbstractTunableHandler(final Field field, final Object instance, 
final Tunable tunable) {
                this.field = field;
@@ -38,13 +43,16 @@
                this.tunable = tunable;
        }
 
-       /** Standard base class constructor for <code>TunableHandler</code>s 
that deal with
-        *  <code>Tunable</code>s that use getter and setter methods.
+       /** 
+        * Standard base class constructor for <code>TunableHandler</code>s 
that deal with
+        * <code>Tunable</code>s that use getter and setter methods.
         *
-        *  @param getter   The getter method of the tunable object represented 
by the <i>instance</i> parameter.
-        *  @param setter   The setter method complimentary to the getter.
-        *  @param instance An instance of an object with a getter method that 
has been determined to be annotated with <code>@Tunable</code>.
-        *  @param tunable  The <code>Tunable</code> that annotates the 
<i>getter</i>.
+        * @param getter The getter method of the tunable object represented by 
the 
+        * <i>instance</i> parameter.
+        * @param setter The setter method complimentary to the getter.
+        * @param instance An instance of an object with a getter method that 
has been 
+        * determined to be annotated with <code>@Tunable</code>.
+        * @param tunable  The <code>Tunable</code> that annotates the 
<i>getter</i>.
         */
        public AbstractTunableHandler(final Method getter, final Method setter, 
final Object instance, final Tunable tunable) {
                this.field = null;
@@ -54,13 +62,15 @@
                this.tunable = tunable;
        }
 
-       /** {@inheritDoc}
+       /** 
+        * {@inheritDoc}
         */
        final public Object getValue() throws IllegalAccessException, 
InvocationTargetException {
                return field != null ? field.get(instance) : 
getter.invoke(instance);
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public void setValue(final Object newValue) throws 
IllegalAccessException, InvocationTargetException {
                if (field != null)
@@ -69,37 +79,43 @@
                        setter.invoke(instance, newValue);
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public String getDescription() {
                return tunable.description();
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public String[] getGroups() {
                return tunable.groups();
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public boolean controlsMutuallyExclusiveNestedChildren() {
                return tunable.xorChildren();
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public String getChildKey() {
                return tunable.xorKey();
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public String dependsOn() {
                return tunable.dependsOn();
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public String getName() {
                if (field != null)
@@ -108,7 +124,8 @@
                        return setter.getName().substring(3);
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public String getQualifiedName() {
                final String unqualifiedClassName =
@@ -117,7 +134,8 @@
                 return 
unqualifiedClassName.substring(unqualifiedClassName.lastIndexOf(".") + 1) + "." 
+ getName();
        }
 
-       /** {@inheritDoc}
+       /**
+        * {@inheritDoc}
         */
        final public Properties getParams() throws IllegalArgumentException {
                final String rawString = tunable.params();

Modified: core3/work-api/trunk/src/main/java/org/cytoscape/work/ProvidesGUI.java
===================================================================
--- core3/work-api/trunk/src/main/java/org/cytoscape/work/ProvidesGUI.java      
2011-03-11 23:51:05 UTC (rev 24417)
+++ core3/work-api/trunk/src/main/java/org/cytoscape/work/ProvidesGUI.java      
2011-03-12 00:12:50 UTC (rev 24418)
@@ -8,8 +8,10 @@
 
 
 /**
- *  An annotation type that can be applied to a <i>method</i> in order to 
allow a <code>TunableInterceptor</code>
- *  to catch it, and so to use its members to create a corresponding interface 
for a user.
+ * An annotation type that can be applied to a <i>method</i> in order to 
+ * allow a <code>TunableInterceptor</code>
+ * to catch it, and so to use its members to create a corresponding interface 
+ * for a user.
  * 
  * Here is an example of how to use a <code>ProvidesGUI</code> annotation:
  *
@@ -18,7 +20,7 @@
  *     public JPanel getGUI() { return mySetupPanel; }
  * </pre>
  * 
- *  Please note that the method annotated with this needs to return a JPanel 
and take no arguments.
+ * Please note that the method annotated with this needs to return a JPanel 
and take no arguments.
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.METHOD})

Modified: core3/work-api/trunk/src/main/java/org/cytoscape/work/Tunable.java
===================================================================
--- core3/work-api/trunk/src/main/java/org/cytoscape/work/Tunable.java  
2011-03-11 23:51:05 UTC (rev 24417)
+++ core3/work-api/trunk/src/main/java/org/cytoscape/work/Tunable.java  
2011-03-12 00:12:50 UTC (rev 24418)
@@ -8,11 +8,15 @@
 
 
 /**
- * An annotation type that can be applied to a <i>field</i> or a <i>method</i> 
in order to allow <code>TunableInterceptor</code> to catch it,
+ * An annotation type that can be applied to a <i>field</i> or a <i>method</i> 
+ * in order to allow <code>TunableInterceptor</code> to catch it,
  * and so to use its members to create a corresponding interface for a user.
  * 
- * This interface describes the different members that can be used in the 
<code>@Tunable(...)</code> to control the instantiation of user interface to
+ * <br/>
+ * This interface describes the different members that can be used in the 
+ * <code>@Tunable(...)</code> to control the instantiation of user interface to
  * present to a user.
+ * <br/>
  * 
  * Here is an example of how to use a <code>Tunable</code> annotation:
  * <p><pre>
@@ -22,9 +26,12 @@
  * </code>
  * </pre></p>
  * 
- * This tunable will be part of a group("<code>pupil</code>"), which is also a 
part of a metagroup("<code>Human</code>").<br>
- * If a the user interface autogenerated from this is a GUI, 
<code>collapsed</code> could indicate that the initial state of the panel that 
may
- * display the JTextField with the <code>lastName</code> will be collapsed and 
needs to be expanded in order to see its components.<br>
+ * This tunable will be part of a group("<code>pupil</code>"), which is also a 
part of 
+ * a metagroup("<code>Human</code>").<br/>
+ * If a the user interface autogenerated from this is a GUI, 
<code>collapsed</code> could 
+ * indicate that the initial state of the panel that may display the 
JTextField with the 
+ * <code>lastName</code> will be collapsed and needs to 
+ * be expanded in order to see its components.<br>
  * 
  */
 @Retention(RetentionPolicy.RUNTIME)
@@ -36,7 +43,8 @@
        String description() default "";
 
        /**
-        * Used to define all the groups in which the Tunable takes part (by 
default, its doesn't belong to any group).
+        * Used to define all the groups in which the Tunable takes part (by 
default, 
+        * its doesn't belong to any group).
         * 
         * <p><pre><code>
         * <b>Example</b>:
@@ -57,21 +65,25 @@
         *      public String officeName = "CytoscapeDevelopment's Office";
         *      </code>
         * 
-        * Here we have a second item for the identity of a person(the 
<i>firstName</i>).So, the 2 <code>Tunable</code> <i>lastName</i> and 
<i>firstName</i> are in the subgroup <i>identity</i>
-        * But, the <code>Tunable</code> String officeName will only take part 
of the upperGroup <i>office</i>, and so won't be set with these other 2 fields.
+        * Here we have a second item for the identity of a person(the 
<i>firstName</i>).So, 
+        * the 2 <code>Tunable</code> <i>lastName</i> and <i>firstName</i> are 
in the subgroup 
+        * <i>identity</i> But, the <code>Tunable</code> String officeName will 
only take part 
+        * of the upperGroup <i>office</i>, and so won't be set with these 
other 2 fields.
         * </pre></p>
         */
        String[] groups() default {};
 
        
        /**
-        * Boolean value to choose if the <code>Tunable</code> will control the 
display of other, nested child tunables.
+        * Boolean value to choose if the <code>Tunable</code> will control the 
display of other, 
+        * nested child tunables.
         */
        boolean xorChildren() default false;
 
        
        /**
-        * Key that will refer to the "value" of the <code>Tunable</code> which 
has <code>xorChildren=true</code>
+        * Key that will refer to the "value" of the <code>Tunable</code> which 
has 
+        * <code>xorChildren=true</code>
         * 
         * <p><pre><code>
         * <b>Example</b> : 
@@ -86,9 +98,10 @@
         * </code>
         * </pre></p>
         *
-        *      Here, the 2 <code>ListMultipleSelection</code> won't be 
displayed in the GUI at the same time : each of them
-        *      depends on the xorKey(<i>FirstNames</i> or <i>Names</i>)
-        *      that will match the "value" (i.e item that has been selected) 
in the <code>ListSingleSelection</code>
+        * Here, the 2 <code>ListMultipleSelection</code> won't be displayed in 
the GUI at the 
+        * same time : each of them depends on the xorKey(<i>FirstNames</i> or 
<i>Names</i>)
+        * that will match the "value" (i.e item that has been selected) in the 
+        * <code>ListSingleSelection</code>
         */
        String xorKey() default "";
        
@@ -97,7 +110,8 @@
         * To add a dependency between 2 or more <code>Tunables</code> 
         * 
         * <p><pre>
-        * The <code>JPanel</code> of the <code>Tunable</code> that depends on 
the other one will be activated only if the value which is required is set.
+        * The <code>JPanel</code> of the <code>Tunable</code> that depends on 
the 
+        * other one will be activated only if the value which is required is 
set.
         * 
         * Here is an example of how to add dependencies between 
<code>Tunables<code> :
         * 
@@ -109,15 +123,15 @@
         *   public String hostname="";
         * </code>
         *  </pre></p>
-        *  So <code>hostname</code> will be activated if <code>type</code> is 
set to "true"
+        * So <code>hostname</code> will be activated if <code>type</code> is 
set to "true"
         */
        String dependsOn() default "";
 
        /**
-        *  Returns a key1=value1;key2=value2;...;keyN=valueN type string.  To 
include commas,
-        *  semicolons or backslashes in a value you must escape it with a 
leading backslash.
+        * Returns a key1=value1;key2=value2;...;keyN=valueN type string.  To 
include commas,
+        * semicolons or backslashes in a value you must escape it with a 
leading backslash.
         *
-        *  Possible keys (which must consist of letters only) are<br/>
+        * Possible keys (which must consist of letters only) are<br/>
         *  <ul>
         *   <li>
         *     fileCategory: this is used solely for File tunables and must be 
one of "network",
@@ -127,8 +141,10 @@
         *     input: this is used solely for File tunables and must be either 
"true" or "false"
         *   </li>
         *   <li>
-        *     slider: used when the object's values range should be 
represented by a slider, the value should always be "true".
-        *     This is being used by <code>AbstractBounded</code> and 
<code>AbstractFlexiblyBounded</code>.
+        *     slider: used when the object's values range should be 
represented by a slider, 
+        *     the value should always be "true".
+        *     This is being used by <code>AbstractBounded</code> and 
+        *     <code>AbstractFlexiblyBounded</code>.
         *   </li>
         *   <li>
         *     alignments: the value should be a comma-seperated list of 
"horizontal" or "vertical".
@@ -137,13 +153,15 @@
         *     correspondance with the strings in the "group" array.  Excess 
values will be ignored.
         *   </li>
         *   <li>
-        *    groupTitles: the value should be a comma-separated list of 
"hidden" and/or "displayed" indicating whether 
-        *    the name of a <code>Tunable</code>'s group has to be displayed or 
not in the <code>titleBorder</code> of
-        *    the <code>JPanel</code> representing this group.
+        *    groupTitles: the value should be a comma-separated list of 
"hidden" and/or 
+        *    "displayed" indicating whether the name of a 
<code>Tunable</code>'s group has to be 
+        *    displayed or not in the <code>titleBorder</code> of the 
<code>JPanel</code> 
+        *    representing this group.
         *   </li>
         *   <li>
-        *    displayState: if present, the corresponding 
<code>Tunable</code>'s JPanel will be collapsible.
-        *    The value must be either "collapsed" or "uncollapsed" indicating 
the initial display state.
+        *    displayState: if present, the corresponding 
<code>Tunable</code>'s JPanel will be 
+        *    collapsible. The value must be either "collapsed" or 
"uncollapsed" indicating the 
+        *    initial display state.
         *   </li>
         *  </ul>
         *

Modified: 
core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableHandler.java
===================================================================
--- core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableHandler.java   
2011-03-11 23:51:05 UTC (rev 24417)
+++ core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableHandler.java   
2011-03-12 00:12:50 UTC (rev 24418)
@@ -1,50 +1,56 @@
 package org.cytoscape.work;
 
-
 import java.lang.reflect.InvocationTargetException;
 import java.util.List;
 import java.util.Properties;
 
-
-/** Interface for classes that deal with reading out and writing back 
<code>Tunable</code>s and their properties.
+/** 
+ * Interface for classes that deal with reading out and writing back 
+ * <code>Tunable</code>s and their properties.
  */
 public interface TunableHandler {
+
        /**
-        * Returns an object describing a field annotated with @Tunable or null 
if no field has been associated with this handler.
-        * @return an object describing a field annotated with @Tunable or null 
if no field has been associated with this handler
+        * Returns an object describing a field annotated with 
+        * @Tunable or null if no field has been associated with this handler.
+        * @return an object describing a field annotated with @Tunable 
+        * or null if no field has been associated with this handler
         */
        Object getValue() throws IllegalAccessException, 
InvocationTargetException;
 
-       /** Attempts to set the value "newValue" on the associated Tunable.
-        *  @param newValue the value to be written into the tunable property
+       /** 
+        * Attempts to set the value "newValue" on the associated Tunable.
+        * @param newValue the value to be written into the tunable property
         */
        void setValue(final Object newValue) throws IllegalAccessException, 
InvocationTargetException;
 
        /**
-        *  Returns the associated <code>Tunable</code>'s description.
-        *  @return the associated <code>Tunable</code>'s description
+        * Returns the associated <code>Tunable</code>'s description.
+        * @return the associated <code>Tunable</code>'s description
         */
        String getDescription();
 
        /**
-        *  Returns the associated <code>Tunable</code>'s groups or nesting 
hierarchy.
-        *  @return the associated <code>Tunable</code>'s groups or nesting 
hierarchy
+        * Returns the associated <code>Tunable</code>'s groups or nesting 
hierarchy.
+        * @return the associated <code>Tunable</code>'s groups or nesting 
hierarchy
         */
        String[] getGroups();
 
        /**
-        *  Returns true if the associated <code>Tunable</code> allows 
switching of mutually exclusive nested children, else false.
-        *  @return true if the associated <code>Tunable</code> allows 
switching of mutually exclusive nested children, else false
+        * Returns true if the associated <code>Tunable</code> allows switching 
+        * of mutually exclusive nested children, else false.
+        * @return true if the associated <code>Tunable</code> allows switching 
+        * of mutually exclusive nested children, else false
         */
        boolean controlsMutuallyExclusiveNestedChildren();
 
        /**
-        *  Returns the name of the key that determines the selection of which 
controlled
-        *          nested child is currently presented, or the empty string if
-        *          controlsMutuallyExclusiveNestedChildren() returns false.
-        *  @return the name of the key that determines the selection of which 
controlled
-        *          nested child is currently presented, or the empty string if
-        *          controlsMutuallyExclusiveNestedChildren() returns false.
+        * Returns the name of the key that determines the selection of which 
controlled
+        * nested child is currently presented, or the empty string if
+        * controlsMutuallyExclusiveNestedChildren() returns false.
+        * @return the name of the key that determines the selection of which 
controlled
+        * nested child is currently presented, or the empty string if
+        * controlsMutuallyExclusiveNestedChildren() returns false.
         */
        String getChildKey();
 
@@ -61,10 +67,11 @@
        String getName();
 
        /**
-        *  Returns the name of the underlying class of the tunable followed by 
a dot and the name of the tunable field or getter/setter root name.
-        *  @return the name of the underlying class of the tunable followed by 
a dot and the name of the tunable field or getter/setter root name.
-        *
-        *  Please note that the returned String will always contain a single 
embedded dot.
+        * Returns the name of the underlying class of the tunable followed by 
+        * a dot and the name of the tunable field or getter/setter root name.
+        * Please note that the returned String will always contain a single 
embedded dot.
+        * @return the name of the underlying class of the tunable followed by 
+        * a dot and the name of the tunable field or getter/setter root name.
         */
        String getQualifiedName();
 
@@ -73,4 +80,10 @@
         *  @return the parsed result from <code>Tunable.getParams()</code>
         */
        Properties getParams();
+
+       /**
+        * Updates an annotated object with the current value as retrieved from 
the 
+        * the user interface generated by this handler.
+        */
+       void handle();
 }

Modified: 
core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableInterceptor.java
===================================================================
--- 
core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableInterceptor.java   
    2011-03-11 23:51:05 UTC (rev 24417)
+++ 
core3/work-api/trunk/src/main/java/org/cytoscape/work/TunableInterceptor.java   
    2011-03-12 00:12:50 UTC (rev 24418)
@@ -6,20 +6,24 @@
 
 
 /**
- * Provides methods to intercept the Objects annotated as 
<code>@Tunable</code>, use, and display them.
- * Intended to be used as an OSGi server.
- * @param <TH> <code>TunableHandler</code>s that will be detected. They will 
contain the informations provided by the <code>@Tunable</code> annotations and 
the Object itself.
- * @author Pasteur
+ * Provides methods to intercept the Objects annotated as 
<code>@Tunable</code>, use, 
+ * and display them. Intended to be used as an OSGi service.
+ * @param <TH> <code>TunableHandler</code>s that will be detected. They will 
contain 
+ * the informations provided by the <code>@Tunable</code> annotations and the 
Object itself.
  */
 public interface TunableInterceptor<TH extends TunableHandler> {
        /**
-        * Identify Tunables of an Object o and assign a <code>Handler</code> 
to each <code>Tunable</code>.
+        * Identify Tunables of an Object o and assign a <code>Handler</code> 
to each 
+        * <code>Tunable</code>.
         * 
-        * This method detects the fields and the methods of the object o, then 
searches for <code>@Tunable</code> annotations, and finally creates a
+        * This method detects the fields and the methods of the object o, then 
searches 
+        * for <code>@Tunable</code> annotations, and finally creates a
         * <code>Handler</code> for each type of Object by using the 
<code>HandlerFactory</code>. 
-        * The handlers are stored in a HashMap and can then be retrieved by 
their key (i.e name of the field or method).
+        * The handlers are stored in a HashMap and can then be retrieved by 
their key (i.e. 
+        * name of the field or method).
         * 
-        * @param o This has to be an instance of a class that contains at 
least one <code>@Tunable</code> annotation.
+        * @param o This has to be an instance of a class that contains at 
least one 
+        * <code>@Tunable</code> annotation.
         */
        void loadTunables(Object o);
        
@@ -27,7 +31,8 @@
         * Returns the Map that contains all the <code>Handler</code>s for the 
Object <code>o</code>.
         * 
         * @param o An Object on which the loadTunable() method has previously 
been executed.
-        * @return The Map with all the <code>Handlers</code> that have been 
previously assigned to <code>o</code>.
+        * @return The Map with all the <code>Handlers</code> that have been 
previously assigned 
+        * to <code>o</code>.
         */
        Map<String, TH> getHandlers(Object o);
 
@@ -36,34 +41,43 @@
         * <p><pre>
         * Create the UI with JPanels for each <code>GUIHandler</code>, and 
display it to the user :
         *      1) In a <i>parent</i> JPanel if <code>setParent()</code> method 
has been called before
-        *              The new values will be applied to the original Objects 
depending on the action that has been associated to the Buttons provided by 
this panel.
+        *              The new values will be applied to the original Objects 
depending on the action that 
+        *      has been associated to the Buttons provided by this panel.
         * 
         *      2) By default in a JOptionPanel<
-        *              This method will detect if the Object that contains the 
<code>@Tunable</code> annotations is implementing the 
<code>TunableValidator</code> interface, and if yes, execute the validation 
test.
-        *      The new values will be applied to the original Objects if "OK" 
is clicked, and if the validation test has succeeded. Either, no modification 
will happen.
+        *              This method will detect if the Object that contains the 
<code>@Tunable</code> 
+        *      annotations is implementing the <code>TunableValidator</code> 
interface, and if 
+        *      yes, execute the validation test.
+        *      The new values will be applied to the original Objects if "OK" 
is clicked, and 
+        *      if the validation test has succeeded. Either, no modification 
will happen.
         * </pre></p>
-        * @param obs Object[] which contains classes with 
<code>Tunables</code> that need to be displayed to a user.
+        * @param obs Object[] which contains classes with 
<code>Tunables</code> that need to 
+        * be displayed to a user.
         * @return newValuesSet True if at least one value has been modified, 
false if not.
         */
        boolean execUI(Object... obs);
        
        /**
         * Used to update tunable's values w/ the values as provided by a user.
-        * This method will set the value for the Object of each 
<code>GUIHandler</code> taken from the <code>Map</code> that is containing the
-        * <code>Handlers</code>.<br>
-        * Important : the value of the <code>GUIHandler</code> will be set 
only if its JPanel is valid.
+        * This method will set the value for the Object of each 
<code>GUIHandler</code> taken 
+        * from the <code>Map</code> that is containing the 
<code>Handlers</code>.<br>
+        * Important : the value of the <code>GUIHandler</code> will be set 
only if its JPanel 
+        * is valid.
         *
-        * @param objs Object[] which contains classes with 
<code>Tunables</code> that need to be displayed to a user.
+        * @param objs Object[] which contains classes with 
<code>Tunables</code> that need 
+        * to be displayed to a user.
         *
-        * @return boolean The success or failure of the validation of 
<code>Tunables</code>' values depending on <code>validate</code> method from 
<code>TunableValidator</code> interface.
-        * <p><pre>
-        * True if the validation of <code>Tunables</code> values is a success 
: the following tasks can then be executed
-        * 
-        * False if an exception is thrown (from <code>TunableValidator</code>) 
and so the tasks won't be performed
+        * @return boolean The success or failure of the validation of 
<code>Tunables</code>' 
+        * values depending on <code>validate</code> method from 
<code>TunableValidator</code> 
+        * interface.
+        * True if the validation of <code>Tunables</code> values is a success 
: the following 
+        * tasks can then be executed False if an exception is thrown (from 
+        * <code>TunableValidator</code>) and so the tasks won't be performed
         */
        boolean validateAndWriteBackTunables(Object... objs);
 
-       /** Tests an object for having tunable annotations.
+       /** 
+        * Tests an object for having tunable annotations.
         *
         *  @return true if "o" has tunable annotations and else false.
         */

Modified: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTunableInterceptorTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTunableInterceptorTest.java
   2011-03-11 23:51:05 UTC (rev 24417)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/AbstractTunableInterceptorTest.java
   2011-03-12 00:12:50 UTC (rev 24418)
@@ -121,14 +121,23 @@
        }
 }
 
+class FakeTunableHandler extends AbstractTunableHandler {
+       public FakeTunableHandler(Field f, Object o, Tunable t) {
+               super(f,o,t);
+       }
+       public FakeTunableHandler(Method get, Method set, Object o, Tunable t) {
+               super(get,set,o,t);
+       }
+       public void handle() {}
+}
 
 class SimpleHandlerFactory implements 
TunableHandlerFactory<AbstractTunableHandler> {
        public AbstractTunableHandler getHandler(final Field field, final 
Object instance, final Tunable tunable) {
-               return new AbstractTunableHandler(field, instance, tunable);
+               return new FakeTunableHandler(field, instance, tunable);
        }
 
        public AbstractTunableHandler getHandler(final Method setter, final 
Method getter, final Object instance, final Tunable tunable) {
-               return new AbstractTunableHandler(setter, getter, instance, 
tunable);
+               return new FakeTunableHandler(setter, getter, instance, 
tunable);
        }
 }
 

Modified: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java   
    2011-03-11 23:51:05 UTC (rev 24417)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/TunableHandlerTest.java   
    2011-03-12 00:12:50 UTC (rev 24418)
@@ -154,4 +154,6 @@
        public SimpleTunableHandler(final Method getter, final Method setter, 
final Object instance, final Tunable tunable) {
                super(getter, setter, instance, tunable);
        }
+
+       public void handle() {}
 }

Modified: 
core3/work-api/trunk/src/test/java/org/cytoscape/work/ValuedTaskExecutorTest.java
===================================================================
--- 
core3/work-api/trunk/src/test/java/org/cytoscape/work/ValuedTaskExecutorTest.java
   2011-03-11 23:51:05 UTC (rev 24417)
+++ 
core3/work-api/trunk/src/test/java/org/cytoscape/work/ValuedTaskExecutorTest.java
   2011-03-12 00:12:50 UTC (rev 24418)
@@ -116,7 +116,7 @@
        private class TaskRunner implements Runnable {
                private Task task;
                TaskRunner(Task task) { this.task = task; }
-               public void run() { try { task.run(tm); } catch (Exception e) { 
e.printStackTrace(); } }
+               public void run() { try { task.run(tm); } catch (Exception e) { 
} }
        }
 
        private class StringValuedTask implements ValuedTask<String> {

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