Class AbstractVisualMappingFunction<K,V>
- java.lang.Object
-
- org.cytoscape.view.vizmap.mappings.AbstractVisualMappingFunction<K,V>
-
- Type Parameters:
K
- Generic type of the attribute mapped.V
- Generic type of theVisualProperty
used in this mapping.
- All Implemented Interfaces:
VisualMappingFunction<K,V>
public abstract class AbstractVisualMappingFunction<K,V> extends Object implements VisualMappingFunction<K,V>
A base class for visual mapping functions where all fields are immutable.Module:
vizmap-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>vizmap-api</artifactId> </dependency>
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
Fields Modifier and Type Field Description protected String
columnName
Mapping attribute name.protected Class<K>
columnType
Type of attribute.protected CyEventHelper
eventHelper
protected VisualProperty<V>
vp
Visual Property used in this mapping.
-
Constructor Summary
Constructors Constructor Description AbstractVisualMappingFunction(String columnName, Class<K> columnType, VisualProperty<V> vp, CyEventHelper eventHelper)
Constructs this AbstractVisualMappingFunction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(CyRow row, View<? extends CyIdentifiable> view)
Apply mapping to the view model.String
getMappingColumnName()
Returns attribute name used in this mapping.Class<K>
getMappingColumnType()
Returns data type of mapping attribute.VisualProperty<V>
getVisualProperty()
Visual Property associated with this function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cytoscape.view.vizmap.VisualMappingFunction
getMappedValue
-
-
-
-
Field Detail
-
columnName
protected final String columnName
Mapping attribute name.
-
vp
protected final VisualProperty<V> vp
Visual Property used in this mapping.
-
eventHelper
protected final CyEventHelper eventHelper
-
-
Constructor Detail
-
AbstractVisualMappingFunction
public AbstractVisualMappingFunction(String columnName, Class<K> columnType, VisualProperty<V> vp, CyEventHelper eventHelper)
Constructs this AbstractVisualMappingFunction.- Parameters:
columnName
- Mapping attribute column name.columnType
- Type of attribute column.vp
- Visual Property used in this mapping.
-
-
Method Detail
-
getMappingColumnName
public String getMappingColumnName()
Description copied from interface:VisualMappingFunction
Returns attribute name used in this mapping. This field is immutable.- Specified by:
getMappingColumnName
in interfaceVisualMappingFunction<K,V>
- Returns:
- name of attribute (a column name in data table) associated with this mapping.
-
getMappingColumnType
public Class<K> getMappingColumnType()
Description copied from interface:VisualMappingFunction
Returns data type of mapping attribute.- Specified by:
getMappingColumnType
in interfaceVisualMappingFunction<K,V>
- Returns:
- data type of controlling attribute.
-
getVisualProperty
public VisualProperty<V> getVisualProperty()
Description copied from interface:VisualMappingFunction
Visual Property associated with this function. This field is immutable.- Specified by:
getVisualProperty
in interfaceVisualMappingFunction<K,V>
- Returns:
- VisualProperty used in this mapping.
-
apply
public void apply(CyRow row, View<? extends CyIdentifiable> view)
Description copied from interface:VisualMappingFunction
Apply mapping to the view model. Once this method is called, Cytoscape updates the view model and fires proper events.- Specified by:
apply
in interfaceVisualMappingFunction<K,V>
- Parameters:
row
- The data row used to create the visual property value for the specified view.view
- target View model to be updated. View should be one of the following: Node, Edge, or Network.
-
-