Package org.cytoscape.work.swing
Interface GUITunableHandler
-
- All Superinterfaces:
TunableHandler
- All Known Implementing Classes:
AbstractGUITunableHandler
public interface GUITunableHandler extends TunableHandler
An extension ofTunableHandler
with added functionality to support the construction of a Swing-based UI.
Any implementation of this interface should extendAbstractGUITunableHandler
to avoid the difficult handling of dependencies!Module:
work-swing-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>work-swing-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addChangeListener(GUITunableHandler gh)
Adds aGUITunableHandler
that listens to THIS tunable handler.void
addDependent(GUITunableHandler gh)
Adds aGUITunableHandler
that depends on THIS tunable handler.void
changeOccurred(String name, String state)
This is called when aGUITunableHandler
that this tunable handler listens to makes a change.void
checkDependency(String depName, String depState)
To check the dependencies of thisGUITunableHandler
with the others.String[]
getChangeSources()
Returns the name of differentGUITunableHandler
s that this tunable handler listens to.String
getDependency()
Returns the name of a differentGUITunableHandler
that this tunable handler depends on.JPanel
getJPanel()
To get the panel that contains the GUI representation (JTextField, JFileChooser, JLabel, JList ...
)String
getState()
To get the current value of aHandler
(or path for aFileHandler
, or selected item(s) forListMultipleSelection ListSingleSelection
, ...)void
notifyChangeListeners()
Notify listeners that this object has changed, i.e.void
notifyDependents()
Notify dependents that this object has changed, i.e.void
update()
This method should be implemented to update the user interface in such a way that other tunable handlers we listen to have changed, this tunable handler can display the appropriate inforamtion.-
Methods inherited from interface org.cytoscape.work.TunableHandler
controlsMutuallyExclusiveNestedChildren, dependsOn, getChildKey, getDescription, getExampleStringValue, getGroups, getLongDescription, getName, getParams, getQualifiedName, getType, getValue, handle, listenForChange, setValue
-
-
-
-
Method Detail
-
getJPanel
JPanel getJPanel()
To get the panel that contains the GUI representation (JTextField, JFileChooser, JLabel, JList ...
)- Returns:
- the panel containing GUI
-
getState
String getState()
To get the current value of aHandler
(or path for aFileHandler
, or selected item(s) forListMultipleSelection ListSingleSelection
, ...)- Returns:
- string representing the state
-
notifyDependents
void notifyDependents()
Notify dependents that this object has changed, i.e. an event occured.
-
addDependent
void addDependent(GUITunableHandler gh)
Adds aGUITunableHandler
that depends on THIS tunable handler.- Parameters:
gh
- theGUITunableHandler
that depends on THIS tunable handler.
-
checkDependency
void checkDependency(String depName, String depState)
To check the dependencies of thisGUITunableHandler
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
- Parameters:
depName
- if this handler has a dependency, it must match this in order for the associatedJPanel
to be enableddepState
- if this handler has a dependency, this must match the condition in order for the associatedJPanel
to be enabled
-
getDependency
String getDependency()
Returns the name of a differentGUITunableHandler
that this tunable handler depends on.- Returns:
- the name of a different
GUITunableHandler
that this tunable handler depends on.
-
notifyChangeListeners
void notifyChangeListeners()
Notify listeners that this object has changed, i.e. an event occured.
-
addChangeListener
void addChangeListener(GUITunableHandler gh)
Adds aGUITunableHandler
that listens to THIS tunable handler.- Parameters:
gh
- theGUITunableHandler
that listens to THIS tunable handler.
-
getChangeSources
String[] getChangeSources()
Returns the name of differentGUITunableHandler
s that this tunable handler listens to.- Returns:
- the name of different
GUITunableHandler
s that this tunable handler listens to.
-
changeOccurred
void changeOccurred(String name, String state)
This is called when aGUITunableHandler
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.- Parameters:
name
- The name of theGUITunableHandler
that has changed.state
- The state theGUITunableHandler
has changed to.
-
update
void update()
This method should be implemented to update the user interface in such a way that other tunable handlers we listen to have changed, this tunable handler can display the appropriate inforamtion.
-
-