Cytoscape 3.0.1 API

org.cytoscape.view.model
Class AbstractVisualProperty<T>

java.lang.Object
  extended by 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, DefaultVisualizableVisualProperty, DoubleVisualProperty, EdgeBendVisualProperty, FontVisualProperty, IntegerVisualProperty, LineTypeVisualProperty, NodeShapeVisualProperty, NullVisualProperty, PaintVisualProperty, StringVisualProperty

public abstract class AbstractVisualProperty<T>
extends Object
implements VisualProperty<T>

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.

Field Summary
protected  boolean shouldIgnoreDefault
          If this is true, default value will be ignored by VizMapper.
 
Constructor Summary
AbstractVisualProperty(T defaultValue, Range<T> range, String id, String displayName, Class<? extends CyIdentifiable> targetObjectDataType)
          Constructor to set all immutable fields.
 
Method Summary
 T getDefault()
          The default value of this property.
 String getDisplayName()
          Returns a short string suitable for presentation to humans.
 String getIdString()
          Returns a short string used to identify this visual property and suitable for serializing to XML and other text formats.
 Range<T> getRange()
          Returns the Range of this VisualProperty.
 Class<? extends CyIdentifiable> getTargetDataType()
          VisualProperty is always associated with a data type.
 boolean shouldIgnoreDefault()
          In some cases, default value from visual style is not suitable, such as x, y, z location of nodes.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.cytoscape.view.model.VisualProperty
parseSerializableString, toSerializableString
 

Field Detail

shouldIgnoreDefault

protected boolean shouldIgnoreDefault
If this is true, default value will be ignored by VizMapper.

Constructor Detail

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 - the Range for 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 Detail

getRange

public Range<T> getRange()
Description copied from interface: VisualProperty
Returns the Range of this VisualProperty.

Specified by:
getRange in interface VisualProperty<T>
Returns:
the Range of this VisualProperty.

getDefault

public T getDefault()
Description copied from interface: VisualProperty
The default value of this property. This value is immutable.

Specified by:
getDefault in interface VisualProperty<T>
Returns:
The default value of this property.

getIdString

public String getIdString()
Description copied from interface: VisualProperty
Returns a short string used to identify this visual property and suitable for serializing to XML and other text formats.

Specified by:
getIdString in interface VisualProperty<T>
Returns:
A short string used to identify this visual property and suitable for serialization.

getDisplayName

public String getDisplayName()
Description copied from interface: VisualProperty
Returns a short string suitable for presentation to humans. Should not be used for serialization.

Specified by:
getDisplayName in interface VisualProperty<T>
Returns:
A short string suitable for presentation to humans.

shouldIgnoreDefault

public boolean shouldIgnoreDefault()
Description copied from interface: VisualProperty
In 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:
shouldIgnoreDefault in interface VisualProperty<T>
Returns:
true if the default value should be ignored (as with x,y,z locations) and false otherwise.

getTargetDataType

public Class<? extends CyIdentifiable> getTargetDataType()
Description copied from interface: VisualProperty
VisualProperty is always associated with a data type. For example, EDGE_COLOR is associated with CyEdge data object. In that case, this returns Class<CyEdge>. For now, return data types are CyNode, CyEdge, and CyNetwork.

Specified by:
getTargetDataType in interface VisualProperty<T>
Returns:
target data type of this visual property. CyNode, CyEdge, or CyNetwork.

toString

public String toString()
Overrides:
toString in class Object

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.