Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.visual.mappings
Interface ObjectMapping

All Superinterfaces:
Cloneable
All Known Implementing Classes:
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.


Field Summary
static byte EDGE_MAPPING
           
static byte NODE_MAPPING
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Add a ChangeListener to the mapping.
 void applyProperties(Properties props, String baseKey, ValueParser parser)
           
 Object calculateRangeValue(Map attrBundle)
           
 Object clone()
           
 Class[] getAcceptedDataClasses()
          Return the classes that the ObjectMapping can map from, eg. the contents of the data of the controlling attribute.
 String getControllingAttributeName()
          Get the controlling attribute name
 JPanel getLegend(String s, byte type)
          Deprecated. Use getLegend(VisualPropertyType) instead. Gone 5/2008.
 JPanel getLegend(VisualPropertyType type)
           
 Properties getProperties(String baseKey)
           
 Class getRangeClass()
           
 JPanel getUI(JDialog parent, CyNetwork network)
           
 void removeChangeListener(ChangeListener l)
          Remove a ChangeListener from the mapping.
 void setControllingAttributeName(String attrName, CyNetwork network, boolean preserveMapping)
          Set the controlling attribute name.
 

Field Detail

EDGE_MAPPING

static final byte EDGE_MAPPING
See Also:
Constant Field Values

NODE_MAPPING

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

getRangeClass

Class getRangeClass()

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

void setControllingAttributeName(String attrName,
                                 CyNetwork network,
                                 boolean preserveMapping)
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.


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 attrBundle)

getUI

JPanel getUI(JDialog parent,
             CyNetwork network)

getLegend

@Deprecated
JPanel getLegend(String s,
                            byte type)
Deprecated. Use getLegend(VisualPropertyType) instead. Gone 5/2008.


getLegend

JPanel getLegend(VisualPropertyType type)

clone

Object clone()

applyProperties

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

getProperties

Properties getProperties(String baseKey)

www.cytoscape.org