Cytoscape 3.0.1 API

org.cytoscape.work
Class AbstractTunableHandler

java.lang.Object
  extended by org.cytoscape.work.AbstractTunableHandler
All Implemented Interfaces:
TunableHandler
Direct Known Subclasses:
AbstractGUITunableHandler

public abstract class AbstractTunableHandler
extends Object
implements TunableHandler

Provides the standard implementation for most of the methods declared by the TunableHandler interface.


Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.

Constructor Summary
AbstractTunableHandler(Field field, Object instance, Tunable tunable)
          Standard base class constructor for TunableHandlers that deal with Tunables that annotate a field.
AbstractTunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
          Standard base class constructor for TunableHandlers that deal with Tunables that use getter and setter methods.
 
Method Summary
 boolean controlsMutuallyExclusiveNestedChildren()
          Returns true if the associated Tunable allows switching of mutually exclusive nested children, else false.
 String dependsOn()
          Returns the dependsOn property of the associated Tunable.
 String getChildKey()
          Returns the name of the key that determines the selection of which controlled nested child is currently presented, or the empty string if controlsMutuallyExclusiveNestedChildren() returns false.
 String getDescription()
          Returns the associated Tunable's description.
 String[] getGroups()
          Returns the associated Tunable's groups or nesting hierarchy.
 String getName()
          Returns a name representing a tunable property.
 Properties getParams()
          Returns the parsed result from Tunable.getParams().
 String getQualifiedName()
          Returns the name of the underlying class of the tunable followed by a dot and the name of the tunable field or getter/setter root name.
 Class<?> getType()
          Returns the class type of the field or method annotated by Tunable.
 Object getValue()
          Returns an object describing a field / get method annotated with Tunable or null if no field / get method has been associated with this handler.
 String[] listenForChange()
          Returns the listenForChange property of the associated Tunable.
 void setValue(Object newValue)
          Attempts to set the value of the associated field or set method that has been annotated with Tunable.
 
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
handle
 

Constructor Detail

AbstractTunableHandler

public AbstractTunableHandler(Field field,
                              Object instance,
                              Tunable tunable)
Standard base class constructor for TunableHandlers that deal with Tunables that annotate a field.

Parameters:
field - An instance of Field that represents a field annotated with @Tunable
instance - An object instance that contains a field corresponding to the field parameter
tunable - The Tunable that annotates field

AbstractTunableHandler

public AbstractTunableHandler(Method getter,
                              Method setter,
                              Object instance,
                              Tunable tunable)
Standard base class constructor for TunableHandlers that deal with Tunables that use getter and setter methods.

Parameters:
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

getType

public final Class<?> getType()
Returns the class type of the field or method annotated by Tunable.

Specified by:
getType in interface TunableHandler
Returns:
the class type of the field or method annotated by Tunable.

getValue

public final Object getValue()
                      throws IllegalAccessException,
                             InvocationTargetException
Returns an object describing a field / get method annotated with Tunable or null if no field / get method has been associated with this handler.

Specified by:
getValue in interface TunableHandler
Returns:
an object describing a field / get method annotated with @Tunable or null if no field has been associated with this handler
Throws:
IllegalAccessException
InvocationTargetException

setValue

public void setValue(Object newValue)
              throws IllegalAccessException,
                     InvocationTargetException
Attempts to set the value of the associated field or set method that has been annotated with Tunable.

Specified by:
setValue in interface TunableHandler
Parameters:
newValue - the value to be written into field or set method annotated with Tunable
Throws:
IllegalAccessException
InvocationTargetException

getDescription

public final String getDescription()
Returns the associated Tunable's description.

Specified by:
getDescription in interface TunableHandler
Returns:
the associated Tunable's description

getGroups

public final String[] getGroups()
Returns the associated Tunable's groups or nesting hierarchy.

Specified by:
getGroups in interface TunableHandler
Returns:
the associated Tunable's groups or nesting hierarchy

controlsMutuallyExclusiveNestedChildren

public final boolean controlsMutuallyExclusiveNestedChildren()
Returns true if the associated Tunable allows switching of mutually exclusive nested children, else false.

Specified by:
controlsMutuallyExclusiveNestedChildren in interface TunableHandler
Returns:
true if the associated Tunable allows switching of mutually exclusive nested children, else false

getChildKey

public final String getChildKey()
Returns the name of the key that determines the selection of which controlled nested child is currently presented, or the empty string if controlsMutuallyExclusiveNestedChildren() returns false.

Specified by:
getChildKey in interface TunableHandler
Returns:
the name of the key that determines the selection of which controlled nested child is currently presented, or the empty string if controlsMutuallyExclusiveNestedChildren() returns false.

dependsOn

public final String dependsOn()
Returns the dependsOn property of the associated Tunable.

Specified by:
dependsOn in interface TunableHandler
Returns:
the dependsOn property of the tunable

listenForChange

public final String[] listenForChange()
Returns the listenForChange property of the associated Tunable.

Specified by:
listenForChange in interface TunableHandler
Returns:
the listenForChange property of the tunable

getName

public final String getName()
Returns a name representing a tunable property.

Specified by:
getName in interface TunableHandler
Returns:
a name representing a tunable property

getQualifiedName

public final String getQualifiedName()
Returns the name of the underlying class of the tunable followed by a dot and the name of the tunable field or getter/setter root name. Please note that the returned String will always contain a single embedded dot.

Specified by:
getQualifiedName in interface TunableHandler
Returns:
the name of the underlying class of the tunable followed by a dot and the name of the tunable field or getter/setter root name.

getParams

public final Properties getParams()
                           throws IllegalArgumentException
Returns the parsed result from Tunable.getParams().

Specified by:
getParams in interface TunableHandler
Returns:
the parsed result from Tunable.getParams()
Throws:
IllegalArgumentException

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.