Author: mes
Date: 2011-03-11 16:13:16 -0800 (Fri, 11 Mar 2011)
New Revision: 24419
Modified:
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITaskManager.java
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableHandler.java
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableInterceptor.java
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/package-info.java
Log:
cleaned up javadocs and interfaces
Modified:
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITaskManager.java
===================================================================
---
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITaskManager.java
2011-03-12 00:12:50 UTC (rev 24418)
+++
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITaskManager.java
2011-03-12 00:13:16 UTC (rev 24419)
@@ -24,7 +24,7 @@
/**
* Sets the container panel on the TunableInterceptor that it manages.
- * @param parent the new parent panel for the tunables panel
+ * @param panel the new parent panel for the tunables panel
*/
void setTunablePanel(final JPanel panel);
Modified:
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableHandler.java
===================================================================
---
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableHandler.java
2011-03-12 00:12:50 UTC (rev 24418)
+++
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableHandler.java
2011-03-12 00:13:16 UTC (rev 24419)
@@ -7,9 +7,11 @@
/**
- * An extension of <code>TunableHandler</code> with added functionality to
support the construction of a Swing-based UI.
+ * An extension of <code>TunableHandler</code> with added functionality to
support
+ * the construction of a Swing-based UI.
*/
public interface GUITunableHandler extends TunableHandler {
+
/**
* to get the panel that contains the GUI representation
* (<code>JTextField, JFileChooser, JLabel, JList ...</code>)
@@ -28,11 +30,6 @@
String getState();
/**
- * Updates an annotated object with the current value as retrieved from
the GUI.
- */
- void handle();
-
- /**
* Notify dependents that this object has changed, i.e. an event
occured.
*/
void notifyDependents();
@@ -51,17 +48,21 @@
* Check the dependencies :
*
* - if there isn't any dependency, this handler's JPanel container is
enabled
- * - if there is, enable or not the JPanel, depending on the name
(<code>depName</code>) and the state(<code>depState</code>)
- * of the dependencies of this <code>GUITunableHandler</code>
+ * - if there is, enable or not the JPanel, depending on the name
+ * (<code>depName</code>) and the state(<code>depState</code>)
+ * of the dependencies of this <code>GUITunableHandler</code>
* </pre></p>
*
- * @param depName if this handler has a dependency, it must match
this in order for the associated <code>JPanel</code> to be enabled
- * @param depState if this handler has a dependency, this must match
the condition in order for the associated <code>JPanel</code> to be enabled
+ * @param depName if this handler has a dependency, it must match this
in order
+ * for the associated <code>JPanel</code> to be enabled
+ * @param depState if this handler has a dependency, this must match
the condition
+ * in order for the associated <code>JPanel</code> to be enabled
*/
void checkDependency(String depName, String depState);
/**
- * Retrieves the settings for the <code>Tunables</code> object that
have been modified if their JPanel is enabled.
+ * Retrieves the settings for the <code>Tunables</code> object that
have been modified
+ * if their JPanel is enabled.
*/
void handleDependents();
Modified:
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableInterceptor.java
===================================================================
---
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableInterceptor.java
2011-03-12 00:12:50 UTC (rev 24418)
+++
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/GUITunableInterceptor.java
2011-03-12 00:13:16 UTC (rev 24419)
@@ -10,40 +10,17 @@
/**
* Provides methods to intercept the Objects annotated as
<code>@Tunable</code>,
- * use, and display them.
- * Intended to be used as an OSGi service.
+ * use, and display them. Intended to be used as an OSGi service.
* @param <TH> <code>TunableHandler</code>s that will be detected.
* It will contain the information provided
* by the <code>@Tunable</code> annotations and the Object itself.
* @author Pasteur
*/
public interface GUITunableInterceptor<TH extends TunableHandler> extends
TunableInterceptor<TH> {
- /**
- * Identify Tunables of an Object o and assign a
<code>TunableHandler</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
- * <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).
- *
- * @param o This has to be an instance of a class that contains at
least
- * one <code>@Tunable</code> annotation.
- */
- void loadTunables(Object o);
/**
- * Returns the Map that contains all the <code>TunableHandler</code>s
for an 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>.
- */
- Map<String, TH> getHandlers(Object o);
-
- /**
- * Returns the <code>JPanel</code> that will be constructed from
annotations on <code>objs</code>.
+ * Returns the <code>JPanel</code> that will be constructed from
annotations
+ * on <code>objs</code>.
* @param obs objects which are instances classes with
<code>Tunables</code> that need
* to be displayed to a user.
* @return a panel that contains a visual representation of the
tunables and is
@@ -52,45 +29,13 @@
JPanel getUI(Object... obs);
/**
- * Display the identified tunables to a user in order to allow her/him
to modify their values.
- * <p><pre>
- * Create the UI with JPanels for each <code>GUITunableHandler</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.
- *
- * 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.
- * </pre></p>
- * @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);
-
- /**
- * Use to add the Tunables' JPanels to an external JPanel that has been
defined in another class.
+ * Use to add the Tunables' JPanels to an external JPanel that has been
defined
+ * in another class.
* @param parent An Object that has to be an instance of a
<code>JPanel</code>.
- * @throws IllegalArgumentException If the Object o is not a JPanel, it
can not be set as the parent for the others : they will be displayed to the
user in a <code>JOptionPanel</code>.
+ * @throws IllegalArgumentException If the Object o is not a JPanel, it
can not be
+ * set as the parent for the others : they will be displayed to the
user in a
+ * <code>JOptionPanel</code>.
*/
void setParent(final JPanel parent);
- /**
- * 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>GUITunableHandler</code> taken from the <code>Map</code> that is
containing the
- * <code>Handlers</code>.<br>
- * Important : the value of the <code>GUITunableHandler</code> will be
set only if its JPanel is valid.
- *
- * @param objs objects which are instances 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
- */
- boolean validateAndWriteBackTunables(Object... objs);
-
- /** Tests an object for whether it has been annotated with
<code>@Tunable</code> or not.
- * @return true if <code>o</code> has been annoated with
<code>@Tunable</code>, otherwise false
- */
- boolean hasTunables(final Object o);
}
Modified:
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/package-info.java
===================================================================
---
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/package-info.java
2011-03-12 00:12:50 UTC (rev 24418)
+++
core3/work-swing-api/trunk/src/main/java/org/cytoscape/work/swing/package-info.java
2011-03-12 00:13:16 UTC (rev 24419)
@@ -1,5 +1,6 @@
/**
- * This packages provides Swing-specific specialisations of concepts from
work-api This includes
- * {@link TaskFactory}, {@link TaskManager}. and {@link TaskIterator}.
+ * This packages provides Swing-specific specialisations of concepts from
work-api
+ * This includes {@link org.cytoscape.work.TaskFactory}, {@link
org.cytoscape.work.TaskManager},
+ * and {@link org.cytoscape.work.TaskIterator}.
*/
package org.cytoscape.work.swing;
--
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.