|
Cytoscape 3.0.0-beta1 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 TunableHandler s that deal with
Tunable s that annotate a field. |
protected |
AbstractGUITunableHandler(Method getter,
Method setter,
Object instance,
Tunable tunable)
Standard base class constructor for TunableHandler s that deal with
Tunable s 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 GUITunableHandler s 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 "newValue" on the associated 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)
TunableHandler
s that deal with
Tunable
s that annotate a field.
field
- An instance of Field
that represents a field annotated with @Tunable
instance
- An object instance that contains a field corresponding to the field parametertunable
- The Tunable
that annotates fieldprotected AbstractGUITunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
TunableHandler
s that deal with
Tunable
s 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
AbstractTunableHandler
setValue
in interface TunableHandler
setValue
in class AbstractTunableHandler
newValue
- the value to be written into the tunable property
IllegalAccessException
InvocationTargetException
public void notifyDependents()
notifyDependents
in interface GUITunableHandler
public void notifyChangeListeners()
notifyChangeListeners
in interface GUITunableHandler
public void addChangeListener(GUITunableHandler gh)
GUITunableHandler
.
addChangeListener
in interface GUITunableHandler
gh
- Handler
on which this one will depend onpublic void addDependent(GUITunableHandler gh)
GUITunableHandler
.
addDependent
in interface GUITunableHandler
gh
- Handler
on which this one will depend onpublic String getDependency()
GUITunableHandler
that this tunable handler depends on.
getDependency
in interface GUITunableHandler
GUITunableHandler
that this tunable handler depends on.public String[] getChangeSources()
GUITunableHandler
s that this tunable handler listens to.
getChangeSources
in interface GUITunableHandler
GUITunableHandler
s 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 GUITunableHandler
name
- 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 thisGUITunableHandler
checkDependency
in interface GUITunableHandler
depName
- 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 GUITunableHandler
JPanel
container of this GUITunableHandler
public abstract void handle()
handle
in interface TunableHandler
public void update()
update
in interface GUITunableHandler
public String getState()
Tunable
associated with
this GUITunableHandler
.
getState
in interface GUITunableHandler
Tunable
represented as a string
|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |