Package org.cytoscape.view.model
Class AbstractVisualProperty<T>
java.lang.Object
org.cytoscape.view.model.AbstractVisualProperty<T>
- Type Parameters:
T- the generic type for this AbstractVisualProperty.
- All Implemented Interfaces:
VisualProperty<T>
- Direct Known Subclasses:
ArrowShapeVisualProperty,BooleanVisualProperty,CellFormatVisualProperty,DefaultVisualizableVisualProperty,DoubleVisualProperty,EdgeBendVisualProperty,EdgeStackingVisualProperty,FontVisualProperty,IntegerVisualProperty,LabelBackgroundShapeVisualProperty,LineTypeVisualProperty,NodeShapeVisualProperty,NullVisualProperty,ObjectPositionVisualProperty,PaintVisualProperty,StringVisualProperty,TableModeVisualProperty
An abstract implementation of VisualProperty that omits the methods dealing
with serializing data.
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.
Module: viewmodel-api
To use this in your app, include the following dependency in your POM:
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>viewmodel-api</artifactId>
</dependency>-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIf this is true, default value will be ignored by VizMapper. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractVisualProperty(T defaultValue, Range<T> range, String id, String displayName, Class<? extends CyIdentifiable> targetObjectDataType) Constructor to set all immutable fields. -
Method Summary
Modifier and TypeMethodDescriptionThe default value of this property.Returns a short string suitable for presentation to humans.Returns a short string used to identify this visual property and suitable for serializing to XML and other text formats.getRange()Returns theRangeof this VisualProperty.Class<? extends CyIdentifiable>VisualProperty is always associated with a data type.booleanIn some cases, default value from visual style is not suitable, such as x, y, z location of nodes.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cytoscape.view.model.VisualProperty
parseSerializableString, toSerializableString
-
Field Details
-
shouldIgnoreDefault
protected boolean shouldIgnoreDefaultIf this is true, default value will be ignored by VizMapper.
-
-
Constructor Details
-
AbstractVisualProperty
public AbstractVisualProperty(T defaultValue, Range<T> range, String id, String displayName, Class<? extends CyIdentifiable> targetObjectDataType) Constructor to set all immutable fields.- Parameters:
defaultValue- default value for this visual property.range- theRangefor the visual property.id- unique string for serialization.displayName- human-readable name for this visual property.targetObjectDataType- the type of the target object for this visual property.
-
-
Method Details
-
getRange
Description copied from interface:VisualPropertyReturns theRangeof this VisualProperty.- Specified by:
getRangein interfaceVisualProperty<T>- Returns:
- the
Rangeof this VisualProperty.
-
getDefault
Description copied from interface:VisualPropertyThe default value of this property. This value is immutable.- Specified by:
getDefaultin interfaceVisualProperty<T>- Returns:
- The default value of this property.
-
getIdString
Description copied from interface:VisualPropertyReturns a short string used to identify this visual property and suitable for serializing to XML and other text formats.- Specified by:
getIdStringin interfaceVisualProperty<T>- Returns:
- A short string used to identify this visual property and suitable for serialization.
-
getDisplayName
Description copied from interface:VisualPropertyReturns a short string suitable for presentation to humans. Should not be used for serialization.- Specified by:
getDisplayNamein interfaceVisualProperty<T>- Returns:
- A short string suitable for presentation to humans.
-
shouldIgnoreDefault
public boolean shouldIgnoreDefault()Description copied from interface:VisualPropertyIn some cases, default value from visual style is not suitable, such as x, y, z location of nodes. If this flag is on, it will be ignored and it will be controlled by mapping only.- Specified by:
shouldIgnoreDefaultin interfaceVisualProperty<T>- Returns:
- true if the default value should be ignored (as with x,y,z locations) and false otherwise.
-
getTargetDataType
Description copied from interface:VisualPropertyVisualProperty is always associated with a data type. For example, EDGE_COLOR is associated withCyEdgedata object. In that case, this returns Class<CyEdge>. For now, return data types are CyNode, CyEdge, and CyNetwork.- Specified by:
getTargetDataTypein interfaceVisualProperty<T>- Returns:
- target data type of this visual property. CyNode, CyEdge, or CyNetwork.
-
toString
-