Class AbstractTunableHandler

  • All Implemented Interfaces:
    TunableHandler
    Direct Known Subclasses:
    AbstractGUITunableHandler, AbstractStringTunableHandler

    public abstract class AbstractTunableHandler
    extends Object
    implements TunableHandler
    Provides the standard implementation for most of the methods declared by the TunableHandler interface.

    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 (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 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()
        Description copied from interface: TunableHandler
        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.
      • getDescription

        public final String getDescription()
        Description copied from interface: TunableHandler
        Returns the associated Tunable's description.
        Specified by:
        getDescription in interface TunableHandler
        Returns:
        the associated Tunable's description
      • getLongDescription

        public final String getLongDescription()
        Description copied from interface: TunableHandler
        Returns the associated Tunable's longDescription
        Specified by:
        getLongDescription in interface TunableHandler
        Returns:
        the associated Tunable's longDescription
      • getExampleStringValue

        public final String getExampleStringValue()
        Description copied from interface: TunableHandler
        Returns the exampleStringValue property of the associated Tunable.
        Specified by:
        getExampleStringValue in interface TunableHandler
        Returns:
        the exampleStringValue property of the associated Tunable.
      • getGroups

        public final String[] getGroups()
        Description copied from interface: TunableHandler
        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()
        Description copied from interface: TunableHandler
        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()
        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 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()
        Description copied from interface: TunableHandler
        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()
        Description copied from interface: TunableHandler
        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()
        Description copied from interface: TunableHandler
        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()
        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 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.
      • getContext

        public final String 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

        public final String 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

        public final String 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)