Cytoscape 3.0.1 API

org.cytoscape.view.vizmap.mappings
Class AbstractVisualMappingFunction<K,V>

java.lang.Object
  extended by org.cytoscape.view.vizmap.mappings.AbstractVisualMappingFunction<K,V>
Type Parameters:
K - Generic type of the attribute mapped.
V - Generic type of the VisualProperty 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.


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  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
AbstractVisualMappingFunction(String columnName, Class<K> columnType, VisualProperty<V> vp, CyEventHelper eventHelper)
          Constructs this AbstractVisualMappingFunction.
 
Method Summary
 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.


columnType

protected final Class<K> columnType
Type of attribute.


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 interface VisualMappingFunction<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 interface VisualMappingFunction<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 interface VisualMappingFunction<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 interface VisualMappingFunction<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.

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.