Package org.cytoscape.work.swing
Interface GUITunableHandler
- All Superinterfaces:
TunableHandler
- All Known Implementing Classes:
AbstractGUITunableHandler
An extension of
Any implementation of this interface should extend
TunableHandler
with added functionality to support
the construction of a Swing-based UI.
Any implementation of this interface should extend
AbstractGUITunableHandler
to avoid the difficult handling of dependencies!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.
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>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aGUITunableHandler
that listens to THIS tunable handler.void
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[]
Returns the name of differentGUITunableHandler
s that this tunable handler listens to.Returns the name of a differentGUITunableHandler
that this tunable handler depends on.To get the panel that contains the GUI representation (JTextField, JFileChooser, JLabel, JList ...
)getState()
To get the current value of aHandler
(or path for aFileHandler
, or selected item(s) forListMultipleSelection ListSingleSelection
, ...)void
Notify listeners that this object has changed, i.e.void
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 Details
-
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
Adds aGUITunableHandler
that depends on THIS tunable handler.- Parameters:
gh
- theGUITunableHandler
that depends on THIS tunable handler.
-
checkDependency
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
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
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.
-