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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTunableHandler(Field field, Object instance, Tunable tunable) Standard base class constructor forTunableHandlers that deal withTunables that annotate a field.AbstractTunableHandler(Method getter, Method setter, Object instance, Tunable tunable) Standard base class constructor forTunableHandlers that deal withTunables that use getter and setter methods. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanReturns true if the associatedTunableallows switching of mutually exclusive nested children, else false.final StringReturns the dependsOn property of the associatedTunable.final StringReturns 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.final StringThis returns the context of the Tunable.final StringReturns the associatedTunable's description.final StringReturns the exampleStringValue property of the associatedTunable.final StringProvides a format string suitable for passing to String.format.final doubleReturns the gravity value for the annotation.final String[]Returns the associatedTunable's groups or nesting hierarchy.final StringReturns the associatedTunable's longDescriptionfinal StringgetName()Returns a name representing a tunable property.final PropertiesReturns the parsed result fromTunable.getParams().final StringReturns 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.final booleanReturns true if this Tunable must be set (i.e.final StringReturns the tooltip annotation for this Tunable if there is one.final Class<?>getType()Returns the class type of the field or method annotated byTunable.final ObjectgetValue()Returns an object describing a field / get method annotated withTunableor null if no field / get method has been associated with this handler.final String[]Returns the listenForChange property of the associatedTunable.voidsetOffset(double offset) voidAttempts 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, waitMethods inherited from interface org.cytoscape.work.TunableHandler
handle
-
Field Details
-
TOOLTIP
- See Also:
-
GRAVITY
- See Also:
-
CONTEXT
- See Also:
-
FORMAT
- See Also:
-
-
Constructor Details
-
AbstractTunableHandler
Standard base class constructor forTunableHandlers that deal withTunables that annotate a field.- Parameters:
field- An instance ofFieldthat represents a field annotated with@Tunableinstance- An object instance that contains a field corresponding to the field parametertunable- TheTunablethat annotates field
-
AbstractTunableHandler
Standard base class constructor forTunableHandlers that deal withTunables 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- TheTunablethat annotates the getter.
-
-
Method Details
-
getType
Description copied from interface:TunableHandlerReturns the class type of the field or method annotated byTunable.- Specified by:
getTypein interfaceTunableHandler- Returns:
- the class type of the field or method annotated by
Tunable.
-
getValue
Description copied from interface:TunableHandlerReturns an object describing a field / get method annotated withTunableor null if no field / get method has been associated with this handler.- Specified by:
getValuein interfaceTunableHandler- Returns:
- an object describing a field / get method annotated with @Tunable or null if no field has been associated with this handler
- Throws:
IllegalAccessExceptionInvocationTargetException
-
setValue
Description copied from interface:TunableHandlerAttempts to set the value of the associated field or set method that has been annotated withTunable.- Specified by:
setValuein interfaceTunableHandler- Parameters:
newValue- the value to be written into field or set method annotated withTunable- Throws:
IllegalAccessExceptionInvocationTargetException
-
getDescription
Description copied from interface:TunableHandlerReturns the associatedTunable's description.- Specified by:
getDescriptionin interfaceTunableHandler- Returns:
- the associated
Tunable's description
-
getLongDescription
Description copied from interface:TunableHandlerReturns the associatedTunable's longDescription- Specified by:
getLongDescriptionin interfaceTunableHandler- Returns:
- the associated
Tunable's longDescription
-
getExampleStringValue
Description copied from interface:TunableHandlerReturns the exampleStringValue property of the associatedTunable.- Specified by:
getExampleStringValuein interfaceTunableHandler- Returns:
- the exampleStringValue property of the associated
Tunable.
-
getGroups
Description copied from interface:TunableHandlerReturns the associatedTunable's groups or nesting hierarchy.- Specified by:
getGroupsin interfaceTunableHandler- Returns:
- the associated
Tunable's groups or nesting hierarchy
-
controlsMutuallyExclusiveNestedChildren
public final boolean controlsMutuallyExclusiveNestedChildren()Description copied from interface:TunableHandlerReturns true if the associatedTunableallows switching of mutually exclusive nested children, else false.- Specified by:
controlsMutuallyExclusiveNestedChildrenin interfaceTunableHandler- Returns:
- true if the associated
Tunableallows switching of mutually exclusive nested children, else false
-
getChildKey
Description copied from interface:TunableHandlerReturns 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:
getChildKeyin 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:TunableHandlerReturns the dependsOn property of the associatedTunable.- Specified by:
dependsOnin interfaceTunableHandler- Returns:
- the dependsOn property of the tunable
-
listenForChange
Description copied from interface:TunableHandlerReturns the listenForChange property of the associatedTunable.- Specified by:
listenForChangein interfaceTunableHandler- Returns:
- the listenForChange property of the tunable
-
getName
Description copied from interface:TunableHandlerReturns a name representing a tunable property.- Specified by:
getNamein interfaceTunableHandler- Returns:
- a name representing a tunable property
-
getQualifiedName
Description copied from interface:TunableHandlerReturns 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:
getQualifiedNamein 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:TunableHandlerReturns the parsed result fromTunable.getParams().- Specified by:
getParamsin 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)
-