|
Cytoscape 3.0.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cytoscape.work.AbstractTunableHandler
org.cytoscape.work.swing.AbstractGUITunableHandler
public abstract class AbstractGUITunableHandler
Base class for the various Swing implementations of TunableHandler.
| Field Summary | |
|---|---|
protected boolean |
horizontal
If true, the associated GUI element should be laid out next to others in the same group, if false, it should be vertically stacked relative to the others. |
protected JPanel |
panel
JPanel that will contain the GUI representation of the TunableHandler. |
| Constructor Summary | |
|---|---|
protected |
AbstractGUITunableHandler(Field field,
Object instance,
Tunable tunable)
Standard base class constructor for TunableHandlers that deal with
Tunables that annotate a field. |
protected |
AbstractGUITunableHandler(Method getter,
Method setter,
Object instance,
Tunable tunable)
Standard base class constructor for TunableHandlers that deal with
Tunables that use getter and setter methods. |
| Method Summary | |
|---|---|
void |
addChangeListener(GUITunableHandler gh)
Adds the argument as a new dependency to this GUITunableHandler. |
void |
addDependent(GUITunableHandler gh)
Adds the argument as a new dependency to this GUITunableHandler. |
void |
changeOccurred(String name,
String state)
This is called when a GUITunableHandler that this tunable handler listens to makes
a change. |
void |
checkDependency(String depName,
String depState)
To check the dependencies of this GUITunableHandler with the others. |
String[] |
getChangeSources()
Returns the name of different GUITunableHandlers that this tunable handler listens to. |
String |
getDependency()
Returns the name of a different GUITunableHandler that this tunable handler depends on. |
JPanel |
getJPanel()
Returns the panel associated with this GUITunableHandler. |
String |
getState()
Returns a string representation of the value of the Tunable associated with
this GUITunableHandler. |
abstract void |
handle()
Updates an annotated object with the current value as retrieved from the the user interface generated by this handler. |
void |
notifyChangeListeners()
Notifies all dependents that this object has changed. |
void |
notifyDependents()
Notifies all dependents that this object has changed. |
void |
setValue(Object newValue)
Attempts to set the value of the associated field or set method that has been annotated with Tunable. |
void |
update()
The default implementation is a no-op. |
| Methods inherited from class org.cytoscape.work.AbstractTunableHandler |
|---|
controlsMutuallyExclusiveNestedChildren, dependsOn, getChildKey, getDescription, getGroups, getName, getParams, getQualifiedName, getType, getValue, listenForChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.cytoscape.work.TunableHandler |
|---|
controlsMutuallyExclusiveNestedChildren, dependsOn, getChildKey, getDescription, getGroups, getName, getParams, getQualifiedName, getType, getValue, listenForChange |
| Field Detail |
|---|
protected boolean horizontal
protected JPanel panel
JPanel that will contain the GUI representation of the TunableHandler.
| Constructor Detail |
|---|
protected AbstractGUITunableHandler(Field field,
Object instance,
Tunable tunable)
TunableHandlers that deal with
Tunables that annotate a field.
field - An instance of Field that represents a field annotated with @Tunableinstance - An object instance that contains a field corresponding to the field parametertunable - The Tunable that annotates field
protected AbstractGUITunableHandler(Method getter,
Method setter,
Object instance,
Tunable tunable)
TunableHandlers that deal with
Tunables that use getter and setter methods.
getter - The getter method of the tunable object represented by the instance parameter.setter - The setter method complimentary to the getter.instance - An instance of an object with a getter method that has been determined to be annotated with @Tunable.tunable - The Tunable that annotates the getter.| Method Detail |
|---|
public void setValue(Object newValue)
throws IllegalAccessException,
InvocationTargetException
AbstractTunableHandlerTunable.
setValue in interface TunableHandlersetValue in class AbstractTunableHandlernewValue - the value to be written into field or set method annotated with Tunable
IllegalAccessException
InvocationTargetExceptionpublic void notifyDependents()
notifyDependents in interface GUITunableHandlerpublic void notifyChangeListeners()
notifyChangeListeners in interface GUITunableHandlerpublic void addChangeListener(GUITunableHandler gh)
GUITunableHandler.
addChangeListener in interface GUITunableHandlergh - Handler on which this one will depend onpublic void addDependent(GUITunableHandler gh)
GUITunableHandler.
addDependent in interface GUITunableHandlergh - Handler on which this one will depend onpublic String getDependency()
GUITunableHandler that this tunable handler depends on.
getDependency in interface GUITunableHandlerGUITunableHandler that this tunable handler depends on.public String[] getChangeSources()
GUITunableHandlers that this tunable handler listens to.
getChangeSources in interface GUITunableHandlerGUITunableHandlers that this tunable handler listens to.
public final void changeOccurred(String name,
String state)
GUITunableHandler that this tunable handler listens to makes
a change. This method will call the abstract update() method if the change described by the name and state
parameters has not already been recorded by this tunable handler.
changeOccurred in interface GUITunableHandlername - The name of the GUITunableHandler that has changed.state - The state the GUITunableHandler has changed to.
public final void checkDependency(String depName,
String depState)
GUITunableHandler with the others.
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
(depName) and the state(depState)
of the dependencies of this GUITunableHandler
checkDependency in interface GUITunableHandlerdepName - if this handler has a dependency, it must match this in order
for the associated JPanel to be enableddepState - if this handler has a dependency, this must match the condition
in order for the associated JPanel to be enabledpublic JPanel getJPanel()
GUITunableHandler.
getJPanel in interface GUITunableHandlerJPanel container of this GUITunableHandlerpublic abstract void handle()
handle in interface TunableHandlerpublic void update()
update in interface GUITunableHandlerpublic String getState()
Tunable associated with
this GUITunableHandler.
getState in interface GUITunableHandlerTunable represented as a string
|
Cytoscape 3.0.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||