Interface GUITunableHandler

All Superinterfaces:
TunableHandler
All Known Implementing Classes:
AbstractGUITunableHandler

public interface GUITunableHandler extends TunableHandler
An extension of 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 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 a Handler (or path for a FileHandler, or selected item(s) for ListMultipleSelection 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 a GUITunableHandler that depends on THIS tunable handler.
      Parameters:
      gh - the GUITunableHandler that depends on THIS tunable handler.
    • checkDependency

      void checkDependency(String depName, String depState)
      To check the dependencies of this 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
        

      Parameters:
      depName - if this handler has a dependency, it must match this in order for the associated JPanel to be enabled
      depState - if this handler has a dependency, this must match the condition in order for the associated JPanel to be enabled
    • getDependency

      String getDependency()
      Returns the name of a different GUITunableHandler 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 a GUITunableHandler that listens to THIS tunable handler.
      Parameters:
      gh - the GUITunableHandler that listens to THIS tunable handler.
    • getChangeSources

      String[] getChangeSources()
      Returns the name of different GUITunableHandlers 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 a 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.
      Parameters:
      name - The name of the GUITunableHandler that has changed.
      state - The state the GUITunableHandler 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.