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
Modifier and TypeFieldDescriptionprotected static final Color
protected static final Color
protected final VisualProperty<NullDataType>
The Root of this tree. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
addIdentifierMapping
(Class<?> type, String id, VisualProperty<?> vp) protected abstract void
protected final void
addVisualProperty
(VisualProperty<?> vp, VisualProperty<?> parent) Insert aVisualProperty
to 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 aVisualProperty
that uses aDiscreteRange
.protected abstract Class<?>[]
getTypes()
final VisualLexiconNode
Get a tree node in for the given VisualProperty.boolean
isSupported
(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:VisualLexicon
Returns the Set of VisualPropertys supported by this Renderer.- Specified by:
getAllVisualProperties
in interfaceVisualLexicon
- Returns:
- Set of all visual properties
-
getAllDescendants
Description copied from interface:VisualLexicon
Get collection of visual properties for a given object type (node/edge/network).- Specified by:
getAllDescendants
in interfaceVisualLexicon
- Parameters:
prop
- any visual property- Returns:
- Collection of visual properties for the type.
-
getRootVisualProperty
Description copied from interface:VisualLexicon
Get root of this tree. To traverse this tree, use this node as the entry point.- Specified by:
getRootVisualProperty
in interfaceVisualLexicon
- Returns:
- root node.
-
addVisualProperty
Insert aVisualProperty
to the tree.- Parameters:
vp
- the VisualProperty to insert in the tree.parent
- the parent of the VisualProperty to insert.
-
getVisualLexiconNode
Description copied from interface:VisualLexicon
Get a tree node in for the given VisualProperty.- Specified by:
getVisualLexiconNode
in interfaceVisualLexicon
- Parameters:
vp
- target VisualProperty in this lexicon.- Returns:
- tree node for the VisualProperty in this lexicon.
-
lookup
Description copied from interface:VisualLexicon
Returns 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:
lookup
in 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:VisualLexicon
Test the given Visual Property is supported in this Lexicon.- Specified by:
isSupported
in interfaceVisualLexicon
- Parameters:
vp
- visual property to be tested.- Returns:
- true if this lexicon supports the given vp.
-
getSupportedValueRange
Description copied from interface:VisualLexicon
Returns a filtered value range for aVisualProperty
that uses aDiscreteRange
. VisualLexicons may override this method to remove or add values to aDiscreteRange
for a built-inVisualProperty
from BasicVisualLexicon.- Specified by:
getSupportedValueRange
in interfaceVisualLexicon
- Parameters:
vp
- VisualProperty where vp.getRange().isDiscrete() == true
-
addIdentifierMapping
- Parameters:
type
-id
-vp
-
-