public abstract class AbstractTunableHandler extends Object implements TunableHandler
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>
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT |
static String |
FORMAT |
static String |
GRAVITY |
static String |
TOOLTIP |
Constructor and Description |
---|
AbstractTunableHandler(Field field,
Object instance,
Tunable tunable)
Standard base class constructor for
TunableHandler s that deal with
Tunable s that annotate a field. |
AbstractTunableHandler(Method getter,
Method setter,
Object instance,
Tunable tunable)
Standard base class constructor for
TunableHandler s that deal with
Tunable s that use getter and setter methods. |
Modifier and Type | Method and Description |
---|---|
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 |
getContext()
This returns the context of the Tunable.
|
String |
getDescription()
Returns the associated
Tunable 's description. |
String |
getFormat()
Provides a format string suitable for passing to String.format.
|
double |
getGravity()
Returns the gravity value for the annotation.
|
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.
|
boolean |
getRequired()
Returns true if this Tunable must be set (i.e.
|
String |
getTooltip()
Returns the tooltip annotation for this Tunable if there is one.
|
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 . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handle
public static final String TOOLTIP
public static final String GRAVITY
public static final String CONTEXT
public static final String FORMAT
public AbstractTunableHandler(Field field, Object instance, Tunable tunable)
TunableHandler
s that deal with
Tunable
s that annotate a field.field
- An instance of Field
that represents a field
annotated with @Tunable
instance
- An object instance that contains a field corresponding to
the field parametertunable
- The Tunable
that annotates fieldpublic AbstractTunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
TunableHandler
s that deal with
Tunable
s that use getter and setter methods.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.public final Class<?> getType()
Tunable
.getType
in interface TunableHandler
Tunable
.public final Object getValue() throws IllegalAccessException, InvocationTargetException
Tunable
or null if no field / get method has been associated with this handler.getValue
in interface TunableHandler
IllegalAccessException
InvocationTargetException
public void setValue(Object newValue) throws IllegalAccessException, InvocationTargetException
Tunable
.setValue
in interface TunableHandler
newValue
- the value to be written into field or set method annotated with Tunable
IllegalAccessException
InvocationTargetException
public final String getDescription()
Tunable
's description.getDescription
in interface TunableHandler
Tunable
's descriptionpublic final String[] getGroups()
Tunable
's groups or nesting hierarchy.getGroups
in interface TunableHandler
Tunable
's groups or nesting hierarchypublic final boolean controlsMutuallyExclusiveNestedChildren()
Tunable
allows switching
of mutually exclusive nested children, else false.controlsMutuallyExclusiveNestedChildren
in interface TunableHandler
Tunable
allows switching
of mutually exclusive nested children, else falsepublic final String getChildKey()
getChildKey
in interface TunableHandler
public final String dependsOn()
Tunable
.dependsOn
in interface TunableHandler
public final String[] listenForChange()
Tunable
.listenForChange
in interface TunableHandler
public final String getName()
getName
in interface TunableHandler
public final String getQualifiedName()
getQualifiedName
in interface TunableHandler
public final Properties getParams() throws IllegalArgumentException
Tunable.getParams()
.getParams
in interface TunableHandler
Tunable.getParams()
IllegalArgumentException
public final String getContext()
public final String getTooltip()
public final double getGravity()
public final boolean getRequired()
public final String getFormat()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.