Cytoscape 2.8.0 API

cytoscape.visual.mappings
Interface ObjectMapping

All Superinterfaces:
Cloneable
All Known Implementing Classes:
AbstractMapping, ContinuousMapping, DiscreteMapping, PassThroughMapping

public interface ObjectMapping
extends Cloneable

Mappings should implement this interface. Mappings are classes that map from a value stored in the edge attributes or node attributes HashMap in cytoscape.CyAttributes. The range of the mapping depends on the AbstractCalculator that owns the mapping.

All classes implementing this interface MUST have a constructor that takes the arguments Object, CyNetwork, byte, where Object is the default object the mapper should map to, CyNetwork is the CyNetwork object representing the network displayed in Cytoscape, and the byte is one of EDGE_MAPPING or NODE_MAPPING. K - Key attribute value. Can be any type (for this implementation, number, string, boolean, list, or map). V - Mapped visual value, such as color, node shape, etc.


Field Summary
static byte EDGE_MAPPING
          Deprecated. 
static byte NODE_MAPPING
          Deprecated. 
 
Method Summary
 void addChangeListener(ChangeListener l)
          Add a ChangeListener to the mapping.
 void applyProperties(Properties props, String baseKey, ValueParser parser)
           
 Object calculateRangeValue(Map<String,Object> attrBundle)
          Create a mapped visual representation from the given attribute value.
 Object clone()
           
 Class<?>[] getAcceptedDataClasses()
          Return the classes that the ObjectMapping can map from, eg.
 String getControllingAttributeName()
          Get the controlling attribute name
 JPanel getLegend(VisualPropertyType type)
           
 Properties getProperties(String baseKey)
           
 Class<?> getRangeClass()
          Class of mapped object.
 JPanel getUI(JDialog parent, CyNetwork network)
          Deprecated. 
 void removeChangeListener(ChangeListener l)
          Remove a ChangeListener from the mapping.
 void setControllingAttributeName(String controllingAttrName)
          Set controlling attribute of this mapping.
 void setControllingAttributeName(String attrName, CyNetwork network, boolean preserveMapping)
          Deprecated. Will be removed in 2.8. Use setControllingAttributeName(final String controllingAttrName) instead.
 

Field Detail

EDGE_MAPPING

@Deprecated
static final byte EDGE_MAPPING
Deprecated. 
See Also:
Constant Field Values

NODE_MAPPING

@Deprecated
static final byte NODE_MAPPING
Deprecated. 
See Also:
Constant Field Values
Method Detail

getRangeClass

Class<?> getRangeClass()
Class of mapped object. For example, if this is an Node Color mapping, this value is Color.class.

Returns:

getAcceptedDataClasses

Class<?>[] getAcceptedDataClasses()
Return the classes that the ObjectMapping can map from, eg. the contents of the data of the controlling attribute.

For example, DiscreteMapping DiscreteMapping can only accept String types in the mapped attribute data. Likewise, ContinuousMapping ContinuousMapping can only accept numeric types in the mapped attribute data since it must interpolate.

Return null if this mapping has no restrictions on the domain type.

Returns:
Array of accepted attribute data class types

setControllingAttributeName

@Deprecated
void setControllingAttributeName(String attrName,
                                            CyNetwork network,
                                            boolean preserveMapping)
Deprecated. Will be removed in 2.8. Use setControllingAttributeName(final String controllingAttrName) instead.

Set the controlling attribute name. The current mappings will be unchanged if preserveMapping is true and cleared otherwise. The network argument is provided so that the current values for the given attribute name can be loaded for UI purposes. Null values for the network argument are allowed. Do not use this method. None of the network, preserveMapping parameters are used in Cytoscape.


setControllingAttributeName

void setControllingAttributeName(String controllingAttrName)
Set controlling attribute of this mapping.

Parameters:
controllingAttrName - - name of the attribute associated with this mapping.

getControllingAttributeName

String getControllingAttributeName()
Get the controlling attribute name


addChangeListener

void addChangeListener(ChangeListener l)
Add a ChangeListener to the mapping. When the state underlying the mapping changes, all ChangeListeners will be notified. This is used in the UI classes to ensure that the UI panes stay consistent with the data held in the mappings.

Parameters:
l - ChangeListener to add

removeChangeListener

void removeChangeListener(ChangeListener l)
Remove a ChangeListener from the mapping. When the state underlying the mapping changes, all ChangeListeners will be notified. This is used in the UI classes to ensure that the UI panes stay consistent with the data held in the mappings.

Parameters:
l - ChangeListener to add

calculateRangeValue

Object calculateRangeValue(Map<String,Object> attrBundle)
Create a mapped visual representation from the given attribute value.

Parameters:
attrBundle -
Returns:

getLegend

JPanel getLegend(VisualPropertyType type)

clone

Object clone()

applyProperties

void applyProperties(Properties props,
                     String baseKey,
                     ValueParser parser)

getProperties

Properties getProperties(String baseKey)

getUI

@Deprecated
JPanel getUI(JDialog parent,
                        CyNetwork network)
Deprecated. 

Do not use this method. Will be removed in next release (2.8) It was for old VizMape GUI which was removed in 2.5.

Parameters:
parent -
network -
Returns:

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.