Package org.cytoscape.work
Interface TunableHandler
-
- All Known Subinterfaces:
GUITunableHandler
,StringTunableHandler
,TunablePropertyHandler
- All Known Implementing Classes:
AbstractGUITunableHandler
,AbstractStringTunableHandler
,AbstractTunableHandler
public interface TunableHandler
Interface for classes that deal with reading out and writing backTunable
s and their properties. TunableHandler classes are provided to the system viaTunableHandlerFactory
services. Different presentation mediums (e.g. Swing GUI, command line, etc.) will demand different TunableHandler andTunableHandlerFactory
implementations to display, parse, get, and set the necessaryTunable
values. Each different type of object (String, Double,ListSingleSelection
will need its own TunableHandler/TunableHandlerFactory
pair to process fields/methods of that type.Module:
work-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>work-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 Default Methods Modifier and Type Method Description boolean
controlsMutuallyExclusiveNestedChildren()
Returns true if the associatedTunable
allows switching of mutually exclusive nested children, else false.String
dependsOn()
Returns the dependsOn property of the associatedTunable
.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 associatedTunable
's description.String
getExampleStringValue()
Returns the exampleStringValue property of the associatedTunable
.String[]
getGroups()
Returns the associatedTunable
's groups or nesting hierarchy.default String
getLongDescription()
Returns the associatedTunable
's longDescriptionString
getName()
Returns a name representing a tunable property.Properties
getParams()
Returns the parsed result fromTunable.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 byTunable
.Object
getValue()
Returns an object describing a field / get method annotated withTunable
or null if no field / get method has been associated with this handler.void
handle()
Updates an annotated object with the current value as retrieved from the the user interface generated by this handler.String[]
listenForChange()
Returns the listenForChange property of the associatedTunable
.void
setValue(Object newValue)
Attempts to set the value of the associated field or set method that has been annotated withTunable
.
-
-
-
Method Detail
-
getValue
Object getValue() throws IllegalAccessException, InvocationTargetException
Returns an object describing a field / get method annotated withTunable
or null if no field / get method has been associated with this handler.- 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
void setValue(Object newValue) throws IllegalAccessException, InvocationTargetException
Attempts to set the value of the associated field or set method that has been annotated withTunable
.- Parameters:
newValue
- the value to be written into field or set method annotated withTunable
- Throws:
IllegalAccessException
InvocationTargetException
-
getDescription
String getDescription()
Returns the associatedTunable
's description.- Returns:
- the associated
Tunable
's description
-
getLongDescription
default String getLongDescription()
Returns the associatedTunable
's longDescription- Returns:
- the associated
Tunable
's longDescription
-
getGroups
String[] getGroups()
Returns the associatedTunable
's groups or nesting hierarchy.- Returns:
- the associated
Tunable
's groups or nesting hierarchy
-
controlsMutuallyExclusiveNestedChildren
boolean controlsMutuallyExclusiveNestedChildren()
Returns true if the associatedTunable
allows switching of mutually exclusive nested children, else false.- Returns:
- true if the associated
Tunable
allows switching of mutually exclusive nested children, else false
-
getChildKey
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.- 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
String dependsOn()
Returns the dependsOn property of the associatedTunable
.- Returns:
- the dependsOn property of the tunable
-
getName
String getName()
Returns a name representing a tunable property.- Returns:
- a name representing a tunable property
-
getQualifiedName
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.- 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
Properties getParams()
Returns the parsed result fromTunable.getParams()
.- Returns:
- the parsed result from
Tunable.getParams()
-
handle
void handle()
Updates an annotated object with the current value as retrieved from the the user interface generated by this handler.
-
listenForChange
String[] listenForChange()
Returns the listenForChange property of the associatedTunable
.- Returns:
- the listenForChange property of the tunable
-
getType
Class<?> getType()
Returns the class type of the field or method annotated byTunable
.- Returns:
- the class type of the field or method annotated by
Tunable
.
-
getExampleStringValue
String getExampleStringValue()
Returns the exampleStringValue property of the associatedTunable
.- Returns:
- the exampleStringValue property of the associated
Tunable
.
-
-