|
Cytoscape 3.0.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cytoscape.work.BasicTunableHandlerFactory<T>
T
- The specific type of the TunableHandler.public class BasicTunableHandlerFactory<T extends TunableHandler>
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!
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 method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicTunableHandlerFactory(Class<T> tunableHandlerClass, Class<?>... allowedTypes)
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 |
---|
public final T createTunableHandler(Field field, Object instance, Tunable tunable)
TunableHandlerFactory
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.
createTunableHandler
in interface TunableHandlerFactory<T extends TunableHandler>
field
- Field that needs to be handled.instance
- The object on which we want to read/write the Field.tunable
- Tunable that contains all the information concerning the user interface.
TunableHandler
or null if this factory
can't handle a field of the specified type.public final T createTunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
TunableHandlerFactory
TunableHandler
for a method annotated as a Tunable
if this factory can produce an appropriate handler for this type of method. If the factory
cannot produce an appropriate handler, it will return null.
Tunable
annotation, however the method must take a single argument of the same type as
the getter method, it must return void, it must be named with the prefix "set", and the
rest of the name must match that of the getter method. See Tunable
for an example.
createTunableHandler
in interface TunableHandlerFactory<T extends TunableHandler>
getter
- A getter method that has been annotated with Tunable
.setter
- A setter method that matches the getter method.instance
- The object on which we want to invoke the getter
and setter
methods.tunable
- The Tunable that contains all the information concerning the user interface from the getter method.
TunableHandler
or null if this factory
can't handle the specified type.
|
Cytoscape 3.0.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |