Class AbstractVisualLexicon
java.lang.Object
org.cytoscape.view.presentation.property.AbstractVisualLexicon
- All Implemented Interfaces:
VisualLexicon
- Direct Known Subclasses:
BasicTableVisualLexicon,BasicVisualLexicon
Reusable template implementation of VisualLexicon.
Module: presentation-api
To use this in your app, include the following dependency in your POM:
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>presentation-api</artifactId>
</dependency>-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Colorprotected static final Colorprotected final VisualProperty<NullDataType>The Root of this tree. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidaddIdentifierMapping(Class<?> type, String id, VisualProperty<?> vp) protected abstract voidprotected final voidaddVisualProperty(VisualProperty<?> vp, VisualProperty<?> parent) Insert aVisualPropertyto the tree.final Collection<VisualProperty<?>>getAllDescendants(VisualProperty<?> prop) Get collection of visual properties for a given object type (node/edge/network).final Set<VisualProperty<?>>Returns the Set of VisualPropertys supported by this Renderer.final VisualProperty<NullDataType>Get root of this tree.<T> Set<T>Returns a filtered value range for aVisualPropertythat uses aDiscreteRange.protected abstract Class<?>[]getTypes()final VisualLexiconNodeGet a tree node in for the given VisualProperty.booleanisSupported(VisualProperty<?> vp) Test the given Visual Property is supported in this Lexicon.final VisualProperty<?>Returns the appropriate visual property for the descriptive string.
-
Field Details
-
rootVisualProperty
The Root of this tree. -
MIN_COLOR
-
MAX_COLOR
-
PAINT_RANGE
-
STRING_SET
-
ARBITRARY_STRING_RANGE
-
ARBITRARY_DOUBLE_RANGE
-
NONE_ZERO_POSITIVE_DOUBLE_RANGE
-
ANGLE_DOUBLE_RANGE
-
-
Constructor Details
-
AbstractVisualLexicon
-
-
Method Details
-
getTypes
-
addVisualProperties
-
getAllVisualProperties
Description copied from interface:VisualLexiconReturns the Set of VisualPropertys supported by this Renderer.- Specified by:
getAllVisualPropertiesin interfaceVisualLexicon- Returns:
- Set of all visual properties
-
getAllDescendants
Description copied from interface:VisualLexiconGet collection of visual properties for a given object type (node/edge/network).- Specified by:
getAllDescendantsin interfaceVisualLexicon- Parameters:
prop- any visual property- Returns:
- Collection of visual properties for the type.
-
getRootVisualProperty
Description copied from interface:VisualLexiconGet root of this tree. To traverse this tree, use this node as the entry point.- Specified by:
getRootVisualPropertyin interfaceVisualLexicon- Returns:
- root node.
-
addVisualProperty
Insert aVisualPropertyto the tree.- Parameters:
vp- the VisualProperty to insert in the tree.parent- the parent of the VisualProperty to insert.
-
getVisualLexiconNode
Description copied from interface:VisualLexiconGet a tree node in for the given VisualProperty.- Specified by:
getVisualLexiconNodein interfaceVisualLexicon- Parameters:
vp- target VisualProperty in this lexicon.- Returns:
- tree node for the VisualProperty in this lexicon.
-
lookup
Description copied from interface:VisualLexiconReturns the appropriate visual property for the descriptive string. The string is generally expected to be descriptive identifier from a file format (e.g. XGMML, GML) that can be mapped to a VisualProperty by the implementer of the VisualLexicon. This method will return null if no match is found.- Specified by:
lookupin interfaceVisualLexicon- Parameters:
type- The type of the visual property sought, which should (in general) be CyNode.class, CyEdge.class, or CyNetwork.class.id- A string identifying a particular visual property.- Returns:
- A VisualProperty identified by the input string or null if no match is found.
-
isSupported
Description copied from interface:VisualLexiconTest the given Visual Property is supported in this Lexicon.- Specified by:
isSupportedin interfaceVisualLexicon- Parameters:
vp- visual property to be tested.- Returns:
- true if this lexicon supports the given vp.
-
getSupportedValueRange
Description copied from interface:VisualLexiconReturns a filtered value range for aVisualPropertythat uses aDiscreteRange. VisualLexicons may override this method to remove or add values to aDiscreteRangefor a built-inVisualPropertyfrom BasicVisualLexicon.- Specified by:
getSupportedValueRangein interfaceVisualLexicon- Parameters:
vp- VisualProperty where vp.getRange().isDiscrete() == true
-
addIdentifierMapping
- Parameters:
type-id-vp-
-