Package 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:- Attribute value: node name(Strings), expression values(Numbers), ...
- Visual Property: node size(Numbers), edge color(Color), node shape(NodeShape), ...
as the key and as the value. The direction of mapping is ALWAYS: K(Attribute) ---> V(Visual Property)
K will be used in implementations.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 (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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
apply(CyRow row, View<? extends CyIdentifiable> view)
Apply mapping to the view model.V
getMappedValue(CyRow row)
Returns the mapped value for a CyRow.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.
-
-
-
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.
-
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.
-
-