Cytoscape 3.0.0-beta1 API

org.cytoscape.work
Class BasicTunableHandlerFactory<T extends TunableHandler>

java.lang.Object
  extended by org.cytoscape.work.BasicTunableHandlerFactory<T>
Type Parameters:
T - The specific type of the TunableHandler.
All Implemented Interfaces:
TunableHandlerFactory<T>
Direct Known Subclasses:
SimpleGUITunableHandlerFactory

public class BasicTunableHandlerFactory<T extends TunableHandler>
extends Object
implements TunableHandlerFactory<T>

A convenience implementation of TunableHandlerFactory that will construct a TunableHandler of the specified type given the TunableHandler in question has at least two constructors, one with Field, Object, Tunable parameters and the other with Method, Method, Object, Tunable parameters. If you need additional parameters to construct your TunableHandler, then it is probably best to implement the TunableHandlerFactory interface directly!


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 Summary
BasicTunableHandlerFactory(Class<T> tunableHandlerClass, Class<?>... allowedTypes)
          Constructor.
 
Method Summary
 T createTunableHandler(Field field, Object instance, Tunable tunable)
          This method returns a TunableHandler for a Field annotated as a Tunable if this factory can produce an appropriate handler for this type of field.
 T createTunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
          This method returns a TunableHandler for a Method annotated as a Tunable if this factory can produce an appropriate handler for this type of field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTunableHandlerFactory

public BasicTunableHandlerFactory(Class<T> tunableHandlerClass,
                                  Class<?>... allowedTypes)
Constructor.

Parameters:
tunableHandlerClass - The type of the TunableHandler to be created.
allowedTypes - The object types that the TunableHandler is associated with. For instance, an IntegerTunableHandler might allow Integer.class and int.class.
Method Detail

createTunableHandler

public final T createTunableHandler(Field field,
                                    Object instance,
                                    Tunable tunable)
Description copied from interface: TunableHandlerFactory
This method returns a TunableHandler for a Field annotated as a Tunable if this factory can produce an appropriate handler for this type of field. If the factory cannot produce an appropriate handler, it will return null.

Specified by:
createTunableHandler in interface TunableHandlerFactory<T extends TunableHandler>
Parameters:
field - Field that need to have a Handler
instance - the object on which we want to read/write the Field field
tunable - Tunable that contains all the information concerning the user interface
Returns:
T the newly constructed TunableHandler or null if this factory can't handle a field of the specified type.

createTunableHandler

public final T createTunableHandler(Method getter,
                                    Method setter,
                                    Object instance,
                                    Tunable tunable)
Description copied from interface: TunableHandlerFactory
This method returns a TunableHandler for a Method annotated as a Tunable if this factory can produce an appropriate handler for this type of field. If the factory cannot produce an appropriate handler, it will return null.

Specified by:
createTunableHandler in interface TunableHandlerFactory<T extends TunableHandler>
Parameters:
getter - a Method that need to be annotated with @Tunable
setter - a Method that need to be annotated with @Tunable
instance - the object on which we want to invoke the setter and getter methods
tunable - Tunable that contains all the information concerning the user interface
Returns:
T the newly constructed TunableHandler or null if this factory can't handle a field of the specified type.

Cytoscape 3.0.0-beta1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.