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

cytoscape.visual.mappings
Class PassThroughMapping

java.lang.Object
  extended by cytoscape.visual.mappings.PassThroughMapping
All Implemented Interfaces:
ObjectMapping, Cloneable

public class PassThroughMapping
extends Object
implements ObjectMapping

Defines a mapping from a bundle of data attributes to a visual attribute. The returned value is simply the value of one of the data attributes, defined by the controlling attribute name. This value is type-checked against the expected range class; null is returned instead if the data value is of the wrong type.


Field Summary
 
Fields inherited from interface cytoscape.visual.mappings.ObjectMapping
EDGE_MAPPING, NODE_MAPPING
 
Constructor Summary
PassThroughMapping(Object defaultObj)
           
PassThroughMapping(Object defaultObj, byte mapType)
          Standard constructor for compatibility with new calculator creation in the UI.
PassThroughMapping(Object defaultObj, String attrName)
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Empty implementation because PassThroughMapping has no UI.
 void applyProperties(Properties props, String baseKey, ValueParser parser)
          Customize this object by applying mapping defintions described by the supplied Properties argument.
 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 visualAttr, byte b)
           
 Properties getProperties(String baseKey)
          Return a Properties object with entries suitable for customizing this object via the applyProperties method.
 Class getRangeClass()
           
 JPanel getUI(JDialog parent, CyNetwork network)
           
 void removeChangeListener(ChangeListener l)
          Empty implementation because PassThroughMapping has no UI.
 void setControllingAttributeName(String attrName, CyNetwork network, boolean preserveMapping)
          Set the controlling attribute name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassThroughMapping

public PassThroughMapping(Object defaultObj,
                          byte mapType)
Standard constructor for compatibility with new calculator creation in the UI.

Parameters:
defaultObj - Default object - provided only to establish mapping's range class.
mapType - unused.

PassThroughMapping

public PassThroughMapping(Object defaultObj)

PassThroughMapping

public PassThroughMapping(Object defaultObj,
                          String attrName)
Method Detail

clone

public Object clone()
Specified by:
clone in interface ObjectMapping
Overrides:
clone in class Object

getRangeClass

public Class getRangeClass()
Specified by:
getRangeClass in interface ObjectMapping

getAcceptedDataClasses

public Class[] getAcceptedDataClasses()
Description copied from interface: ObjectMapping
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.

Specified by:
getAcceptedDataClasses in interface ObjectMapping
Returns:
Array of accepted attribute data class types

getControllingAttributeName

public String getControllingAttributeName()
Description copied from interface: ObjectMapping
Get the controlling attribute name

Specified by:
getControllingAttributeName in interface ObjectMapping

setControllingAttributeName

public void setControllingAttributeName(String attrName,
                                        CyNetwork network,
                                        boolean preserveMapping)
Description copied from interface: ObjectMapping
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.

Specified by:
setControllingAttributeName in interface ObjectMapping

addChangeListener

public void addChangeListener(ChangeListener l)
Empty implementation because PassThroughMapping has no UI.

Specified by:
addChangeListener in interface ObjectMapping
Parameters:
l - ChangeListener to add

removeChangeListener

public void removeChangeListener(ChangeListener l)
Empty implementation because PassThroughMapping has no UI.

Specified by:
removeChangeListener in interface ObjectMapping
Parameters:
l - ChangeListener to add

getUI

public JPanel getUI(JDialog parent,
                    CyNetwork network)
Specified by:
getUI in interface ObjectMapping

calculateRangeValue

public Object calculateRangeValue(Map attrBundle)
Specified by:
calculateRangeValue in interface ObjectMapping

applyProperties

public void applyProperties(Properties props,
                            String baseKey,
                            ValueParser parser)
Customize this object by applying mapping defintions described by the supplied Properties argument.

Specified by:
applyProperties in interface ObjectMapping

getProperties

public Properties getProperties(String baseKey)
Return a Properties object with entries suitable for customizing this object via the applyProperties method.

Specified by:
getProperties in interface ObjectMapping

getLegend

public JPanel getLegend(String visualAttr,
                        byte b)
Specified by:
getLegend in interface ObjectMapping

www.cytoscape.org