Package org.cytoscape.work
Class AbstractTunableHandler
java.lang.Object
org.cytoscape.work.AbstractTunableHandler
- All Implemented Interfaces:
TunableHandler
- Direct Known Subclasses:
AbstractGUITunableHandler
,AbstractStringTunableHandler
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.
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>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractTunableHandler(Field field, Object instance, Tunable tunable)
Standard base class constructor forTunableHandler
s that deal withTunable
s that annotate a field.AbstractTunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
Standard base class constructor forTunableHandler
s that deal withTunable
s that use getter and setter methods. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the associatedTunable
allows switching of mutually exclusive nested children, else false.Returns the dependsOn property of the associatedTunable
.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.This returns the context of the Tunable.Returns the associatedTunable
's description.Returns the exampleStringValue property of the associatedTunable
.Provides a format string suitable for passing to String.format.double
Returns the gravity value for the annotation.String[]
Returns the associatedTunable
's groups or nesting hierarchy.Returns the associatedTunable
's longDescriptiongetName()
Returns a name representing a tunable property.Returns the parsed result fromTunable.getParams()
.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.boolean
Returns true if this Tunable must be set (i.e.Returns the tooltip annotation for this Tunable if there is one.Class<?>
getType()
Returns the class type of the field or method annotated byTunable
.getValue()
Returns an object describing a field / get method annotated withTunable
or null if no field / get method has been associated with this handler.String[]
Returns the listenForChange property of the associatedTunable
.void
setOffset(double offset)
void
Attempts to set the value of the associated field or set method that has been annotated withTunable
.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
-
Field Details
-
TOOLTIP
- See Also:
- Constant Field Values
-
GRAVITY
- See Also:
- Constant Field Values
-
CONTEXT
- See Also:
- Constant Field Values
-
FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Details
-
AbstractTunableHandler
Standard base class constructor forTunableHandler
s that deal withTunable
s that annotate a field.- Parameters:
field
- An instance ofField
that represents a field annotated with@Tunable
instance
- An object instance that contains a field corresponding to the field parametertunable
- TheTunable
that annotates field
-
AbstractTunableHandler
Standard base class constructor forTunableHandler
s that deal withTunable
s 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
- TheTunable
that annotates the getter.
-
-
Method Details
-
getType
Description copied from interface:TunableHandler
Returns the class type of the field or method annotated byTunable
.- Specified by:
getType
in interfaceTunableHandler
- Returns:
- the class type of the field or method annotated by
Tunable
.
-
getValue
Description copied from interface:TunableHandler
Returns an object describing a field / get method annotated withTunable
or null if no field / get method has been associated with this handler.- Specified by:
getValue
in interfaceTunableHandler
- 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
Description copied from interface:TunableHandler
Attempts to set the value of the associated field or set method that has been annotated withTunable
.- Specified by:
setValue
in interfaceTunableHandler
- Parameters:
newValue
- the value to be written into field or set method annotated withTunable
- Throws:
IllegalAccessException
InvocationTargetException
-
getDescription
Description copied from interface:TunableHandler
Returns the associatedTunable
's description.- Specified by:
getDescription
in interfaceTunableHandler
- Returns:
- the associated
Tunable
's description
-
getLongDescription
Description copied from interface:TunableHandler
Returns the associatedTunable
's longDescription- Specified by:
getLongDescription
in interfaceTunableHandler
- Returns:
- the associated
Tunable
's longDescription
-
getExampleStringValue
Description copied from interface:TunableHandler
Returns the exampleStringValue property of the associatedTunable
.- Specified by:
getExampleStringValue
in interfaceTunableHandler
- Returns:
- the exampleStringValue property of the associated
Tunable
.
-
getGroups
Description copied from interface:TunableHandler
Returns the associatedTunable
's groups or nesting hierarchy.- Specified by:
getGroups
in interfaceTunableHandler
- Returns:
- the associated
Tunable
's groups or nesting hierarchy
-
controlsMutuallyExclusiveNestedChildren
public final boolean controlsMutuallyExclusiveNestedChildren()Description copied from interface:TunableHandler
Returns true if the associatedTunable
allows switching of mutually exclusive nested children, else false.- Specified by:
controlsMutuallyExclusiveNestedChildren
in interfaceTunableHandler
- Returns:
- true if the associated
Tunable
allows switching of mutually exclusive nested children, else false
-
getChildKey
Description copied from 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.- Specified by:
getChildKey
in interfaceTunableHandler
- 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
Description copied from interface:TunableHandler
Returns the dependsOn property of the associatedTunable
.- Specified by:
dependsOn
in interfaceTunableHandler
- Returns:
- the dependsOn property of the tunable
-
listenForChange
Description copied from interface:TunableHandler
Returns the listenForChange property of the associatedTunable
.- Specified by:
listenForChange
in interfaceTunableHandler
- Returns:
- the listenForChange property of the tunable
-
getName
Description copied from interface:TunableHandler
Returns a name representing a tunable property.- Specified by:
getName
in interfaceTunableHandler
- Returns:
- a name representing a tunable property
-
getQualifiedName
Description copied from 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. Please note that the returned String will always contain a single embedded dot.- Specified by:
getQualifiedName
in interfaceTunableHandler
- 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
Description copied from interface:TunableHandler
Returns the parsed result fromTunable.getParams()
.- Specified by:
getParams
in interfaceTunableHandler
- Returns:
- the parsed result from
Tunable.getParams()
- Throws:
IllegalArgumentException
-
getContext
This returns the context of the Tunable. The context must be one of:- gui: used only when a graphical user interface is available
- nogui: used only when a graphical user interface is not available
- both: always used
- Returns:
- the context
-
getTooltip
Returns the tooltip annotation for this Tunable if there is one.- Returns:
- tooltip string, if any
-
getGravity
public final double getGravity()Returns the gravity value for the annotation.- Returns:
- Tunable gravity as a double
-
getRequired
public final boolean getRequired()Returns true if this Tunable must be set (i.e. is required), otherwise returns false.- Returns:
- true if it is required.
-
getFormat
Provides a format string suitable for passing to String.format. This allows default values to be rationally presented to users. Note that this is only for presentation purposes and does not effect the underlying values. Also, not all Tunables will respect format -- for example formatting boolean, checkboxes, or List selections don't make sense.- Returns:
- the string to use for the format
-
setOffset
public void setOffset(double offset)
-