Package org.cytoscape.work.swing
Interface GUITunableHandler
-
- All Superinterfaces:
TunableHandler
- All Known Implementing Classes:
AbstractGUITunableHandler
public interface GUITunableHandler extends TunableHandler
An extension ofTunableHandlerwith added functionality to support the construction of a Swing-based UI.
Any implementation of this interface should extendAbstractGUITunableHandlerto avoid the difficult handling of dependencies!Module:
work-swing-apiTo 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 voidaddChangeListener(GUITunableHandler gh)Adds aGUITunableHandlerthat listens to THIS tunable handler.voidaddDependent(GUITunableHandler gh)Adds aGUITunableHandlerthat depends on THIS tunable handler.voidchangeOccurred(String name, String state)This is called when aGUITunableHandlerthat this tunable handler listens to makes a change.voidcheckDependency(String depName, String depState)To check the dependencies of thisGUITunableHandlerwith the others.String[]getChangeSources()Returns the name of differentGUITunableHandlers that this tunable handler listens to.StringgetDependency()Returns the name of a differentGUITunableHandlerthat this tunable handler depends on.JPanelgetJPanel()To get the panel that contains the GUI representation (JTextField, JFileChooser, JLabel, JList ...)StringgetState()To get the current value of aHandler(or path for aFileHandler, or selected item(s) forListMultipleSelection ListSingleSelection, ...)voidnotifyChangeListeners()Notify listeners that this object has changed, i.e.voidnotifyDependents()Notify dependents that this object has changed, i.e.voidupdate()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 aGUITunableHandlerthat depends on THIS tunable handler.- Parameters:
gh- theGUITunableHandlerthat depends on THIS tunable handler.
-
checkDependency
void checkDependency(String depName, String depState)
To check the dependencies of thisGUITunableHandlerwith 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 associatedJPanelto be enableddepState- if this handler has a dependency, this must match the condition in order for the associatedJPanelto be enabled
-
getDependency
String getDependency()
Returns the name of a differentGUITunableHandlerthat this tunable handler depends on.- Returns:
- the name of a different
GUITunableHandlerthat 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 aGUITunableHandlerthat listens to THIS tunable handler.- Parameters:
gh- theGUITunableHandlerthat listens to THIS tunable handler.
-
getChangeSources
String[] getChangeSources()
Returns the name of differentGUITunableHandlers that this tunable handler listens to.- Returns:
- the name of different
GUITunableHandlers that this tunable handler listens to.
-
changeOccurred
void changeOccurred(String name, String state)
This is called when aGUITunableHandlerthat 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 theGUITunableHandlerthat has changed.state- The state theGUITunableHandlerhas 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.
-
-