Package org.cytoscape.filter.model


package org.cytoscape.filter.model
Provides interfaces and classes for defining Transformers and Filters. Transformations can be applied to a stream of elements typically provided by a TransformerSource. The output of a transformation is collected into a TransformerSink. There are three main types of Transformers, listed in order of increasing generality:
Filter
This transformer narrows an element stream by deciding whether or not the element makes it to the sink. The binary nature of this transformation allows users to compose multiple filters together into a CompositeFilter, which combines their result using Boolean logic. In the Cytoscape GUI, these transformers appear in the "Filter" section of the "Select" tab.
ElementTransformer
This transformer takes a single element from a specific context as input and decides what elements from that same context make it to the sink. These may or may not include the original element. In the Cytoscape GUI, these transformers appear in the "Chain" section of the "Select" tab.
HolisticTransformer
This transformer takes multiple elements from a specific context as input and decides what elements from that same context make it to the sink. These may or may not include the original element. In the Cytoscape GUI, these transformers appear in the "Chain" section of the "Select" tab.
To define a custom Transformer, extend AbstractTransformer and implement one of the three interfaces listed above. Finally, create another class that implements either FilterFactory, ElementTransformerFactory, or HolisticTransformerFactory, which creates instances of your custom transformer. Finally, register that factory as an OSGi service. If your transformer is parameterized, declare the parameters as get/set method pairs. Use the Tunable annotation on the get method to allow clients of your code to adjust the parameters using TunableSetter without having to expose any API. When the set method is called, your implementation should notify all registered TransformerListeners of the change in parameters (e.g. by calling AbstractTransformer.notifyListeners(). To define a user interface for your transformer, see the view package.