Cytoscape 2.8.0 API

cytoscape.visual.mappings
Class AbstractMapping

java.lang.Object
  extended by cytoscape.visual.SubjectBase
      extended by cytoscape.visual.mappings.AbstractMapping
All Implemented Interfaces:
ObjectMapping, Cloneable
Direct Known Subclasses:
ContinuousMapping, DiscreteMapping, PassThroughMapping

public abstract class AbstractMapping
extends SubjectBase
implements ObjectMapping


Field Summary
protected  Class<?>[] acceptedClasses
           
protected  String controllingAttrName
           
protected  Class<?> rangeClass
           
 
Fields inherited from class cytoscape.visual.SubjectBase
observers
 
Fields inherited from interface cytoscape.visual.mappings.ObjectMapping
EDGE_MAPPING, NODE_MAPPING
 
Constructor Summary
AbstractMapping(Class<?> rangeClass, String controllingAttrName)
           
 
Method Summary
abstract  void applyProperties(Properties props, String baseKey, ValueParser parser)
           
abstract  Object calculateRangeValue(Map<String,Object> attrBundle)
          Create a mapped visual representation from the given attribute value.
abstract  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)
           
abstract  Properties getProperties(String baseKey)
           
 Class<?> getRangeClass()
          Class of mapped object.
 JPanel getUI(JDialog parent, CyNetwork network)
          Deprecated. 
 void setControllingAttributeName(String controllingAttrName)
          Set controlling attribute of this mapping.
 void setControllingAttributeName(String attrName, CyNetwork network, boolean preserveMapping)
          Deprecated. 
 
Methods inherited from class cytoscape.visual.SubjectBase
addChangeListener, fireStateChanged, removeChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cytoscape.visual.mappings.ObjectMapping
addChangeListener, removeChangeListener
 

Field Detail

rangeClass

protected final Class<?> rangeClass

controllingAttrName

protected String controllingAttrName

acceptedClasses

protected Class<?>[] acceptedClasses
Constructor Detail

AbstractMapping

public AbstractMapping(Class<?> rangeClass,
                       String controllingAttrName)
Method Detail

applyProperties

public abstract void applyProperties(Properties props,
                                     String baseKey,
                                     ValueParser parser)
Specified by:
applyProperties in interface ObjectMapping

getProperties

public abstract Properties getProperties(String baseKey)
Specified by:
getProperties in interface ObjectMapping

calculateRangeValue

public abstract Object calculateRangeValue(Map<String,Object> attrBundle)
Description copied from interface: ObjectMapping
Create a mapped visual representation from the given attribute value.

Specified by:
calculateRangeValue in interface ObjectMapping
Returns:

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

getRangeClass

public Class<?> getRangeClass()
Description copied from interface: ObjectMapping
Class of mapped object. For example, if this is an Node Color mapping, this value is Color.class.

Specified by:
getRangeClass in interface ObjectMapping
Returns:

setControllingAttributeName

public void setControllingAttributeName(String controllingAttrName)
Description copied from interface: ObjectMapping
Set controlling attribute of this mapping.

Specified by:
setControllingAttributeName in interface ObjectMapping
Parameters:
controllingAttrName - - name of the attribute associated with this mapping.

clone

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

getLegend

public JPanel getLegend(VisualPropertyType type)
Specified by:
getLegend in interface ObjectMapping

getUI

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

Gets the UI Object Associated with the Mapper. Required by the ObjectMapping interface.

Specified by:
getUI in interface ObjectMapping
Parameters:
parent - Parent Dialog.
network - CyNetwork.
Returns:
JPanel Object.

setControllingAttributeName

@Deprecated
public void setControllingAttributeName(String attrName,
                                                   CyNetwork network,
                                                   boolean preserveMapping)
Deprecated. 

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. Do not use this method. None of the network, preserveMapping parameters are used in Cytoscape.

Specified by:
setControllingAttributeName in interface ObjectMapping

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.