Cytoscape 3.0.0-beta1 API

org.cytoscape.view.vizmap
Interface VisualMappingFunction<K,V>

Type Parameters:
K - Attribute object type. This is the key of mapping (Can be any objects)
V - Visual property value type. (can be any type)
All Known Subinterfaces:
ContinuousMapping<K,V>, DiscreteMapping<K,V>, PassthroughMapping<K,V>
All Known Implementing Classes:
AbstractVisualMappingFunction

public interface VisualMappingFunction<K,V>

This class defines how an attribute gets mapped to a visual property.
It takes two values:

This provides the mapping function from converting the attribute to the visual property. Essentially, this is a map using as the key and as the value. The direction of mapping is ALWAYS:

K(Attribute) ---> V(Visual Property)

K will be used in implementations.


Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.

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.
 CyTable getMappingTable()
          Returns table used for this mapping.
 VisualProperty<V> getVisualProperty()
          Visual Property associated with this function.
 

Method Detail

getMappingColumnName

String getMappingColumnName()
Returns attribute name used in this mapping. This field is immutable.

Returns:
name of attribute (a column name in data table) associated with this mapping.

getMappingColumnType

Class<K> getMappingColumnType()
Returns data type of mapping attribute.

Returns:
data type of controlling attribute.

getMappingTable

CyTable getMappingTable()
Returns table used for this mapping.

Returns:
CyTable associated with this mapping.

getVisualProperty

VisualProperty<V> getVisualProperty()
Visual Property associated with this function. This field is immutable.

Returns:
VisualProperty used in this mapping.

apply

void apply(CyRow row,
           View<? extends CyIdentifiable> view)
Apply mapping to the view model. Once this method is called, Cytoscape updates the view model and fires proper events.

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.0-beta1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.