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

cytoscape.visual.calculators
Class AbstractCalculator

java.lang.Object
  extended by cytoscape.visual.calculators.AbstractCalculator
All Implemented Interfaces:
Calculator, Cloneable
Direct Known Subclasses:
BasicCalculator

public abstract class AbstractCalculator
extends Object
implements Calculator

AbstractCalculator is the top of the tree for the Calculator classes. DO NOT extend this class directly! All calculators should extend one of NodeCalculator or EdgeCalculator TODO this shouldn't be public


Field Summary
 
Fields inherited from interface cytoscape.visual.calculators.Calculator
ID
 
Constructor Summary
AbstractCalculator(String name, ObjectMapping m, Class c)
          Deprecated. Will be removed 5/2008
AbstractCalculator(String name, ObjectMapping m, VisualPropertyType type)
          Creates a new AbstractCalculator object.
 
Method Summary
 void addChangeListener(ChangeListener l)
          Add a ChangeListener to the calcaultor.
 void addMapping(ObjectMapping m)
          Add a mapping to the mappings contained by the calculator.
 void apply(Appearance appr, Edge e, CyNetwork net)
          DOCUMENT ME!
 void apply(Appearance appr, Node n, CyNetwork net)
          DOCUMENT ME!
 Object clone()
          Clone the calculator.
 int getDupeCount()
          Get how many times this calculator has been duplicated.
 ObjectMapping getMapping(int i)
          Get the mapping at a specific index in this calculator.
 Vector<ObjectMapping> getMappings()
          Get all mappings contained by this calculator.
 Properties getProperties()
          Returns a properties description of this calculator.
 Properties getProperties(String baseKey)
          Deprecated. Just use getProperties() - baseKey is already known by the calculator. This will be removed 10/2007.
 String getPropertyLabel()
          Deprecated. Will be removed 5/2008
 byte getType()
          Deprecated. Will be removed 5/2008
 String getTypeName()
          Deprecated. Will be removed 5/2008
 JPanel getUI(JDialog parent, CyNetwork network)
          Get the UI for the calculator.
 VisualPropertyType getVisualPropertyType()
          Replaces the following 3 methods: public byte getType(); public String getTypeName(); public String getPropertyLabel(); The returned enum VisualPropertyType has replacement for these methods.
 void removeChangeListener(ChangeListener l)
          Remove a ChangeListener from the calcaultor.
 void setName(String newName)
          Set the name of this calculator.
 String toString()
          Get the name of this calculator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractCalculator

@Deprecated
public AbstractCalculator(String name,
                                     ObjectMapping m,
                                     Class c)
Deprecated. Will be removed 5/2008

Create a calculator with the specified object mapping and name. The object mapping is used to determine what classes of attribute data this calculator can map from. If the object mapping is null, no filtration on the attribute data is performed.

Parameters:
m - Object mapping for this calculator, or null
name - Name of this calculator

AbstractCalculator

public AbstractCalculator(String name,
                          ObjectMapping m,
                          VisualPropertyType type)
Creates a new AbstractCalculator object.

Parameters:
name - DOCUMENT ME!
m - DOCUMENT ME!
c - DOCUMENT ME!
type - DOCUMENT ME!
Method Detail

addMapping

public void addMapping(ObjectMapping m)
Add a mapping to the mappings contained by the calculator.

Parameters:
m - Mapping to add.

getMappings

public Vector<ObjectMapping> getMappings()
Get all mappings contained by this calculator.

Specified by:
getMappings in interface Calculator
Returns:
Vector of all mappings contained in this calculator

getMapping

public ObjectMapping getMapping(int i)
Get the mapping at a specific index in this calculator.

Specified by:
getMapping in interface Calculator
Parameters:
i - index of mapping to retrieve
Returns:
ObjectMapping at index i

getDupeCount

public int getDupeCount()
Get how many times this calculator has been duplicated.

Returns:
Calculator duplication count

clone

public Object clone()
             throws CloneNotSupportedException
Clone the calculator. AbstractCalculator makes an independent clone of itself but DOES NOT ensure that a unique name is created. Whoever is cloning the calculator should enter the new calculator in the catalog and create an appropriate name for it if needed.

Specified by:
clone in interface Calculator
Overrides:
clone in class Object
Returns:
Clone of this calculator
Throws:
CloneNotSupportedException - if something is seriously borked.

toString

public final String toString()
Get the name of this calculator.

Specified by:
toString in interface Calculator
Overrides:
toString in class Object
Returns:
the calculator's name

setName

public void setName(String newName)
Set the name of this calculator. Should only be done by the CalculatorCatalog after checking that name will not be duplicated.

Specified by:
setName in interface Calculator
Parameters:
newName - the new name for this calculator. Must be unique.

getProperties

public Properties getProperties()
Returns a properties description of this calculator. Adds the keyword ".mapping" to the supplied base key and calls the getProperties method of MappingFactory with the ObjectMapping and the augmented base key.

Specified by:
getProperties in interface Calculator

getProperties

public Properties getProperties(String baseKey)
Deprecated. Just use getProperties() - baseKey is already known by the calculator. This will be removed 10/2007.


getUI

public JPanel getUI(JDialog parent,
                    CyNetwork network)
Get the UI for the calculator.

Specified by:
getUI in interface Calculator
Parameters:
parent - Parent JDialog for the UI
network - CyNetwork object containing underlying graph data

addChangeListener

public void addChangeListener(ChangeListener l)
Add a ChangeListener to the calcaultor. When the state underlying the calculator 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.

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

removeChangeListener

public void removeChangeListener(ChangeListener l)
Remove a ChangeListener from the calcaultor. When the state underlying the calculator 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.

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

apply

public void apply(Appearance appr,
                  Edge e,
                  CyNetwork net)
DOCUMENT ME!

Specified by:
apply in interface Calculator
Parameters:
appr - DOCUMENT ME!
e - DOCUMENT ME!
net - DOCUMENT ME!

apply

public void apply(Appearance appr,
                  Node n,
                  CyNetwork net)
DOCUMENT ME!

Specified by:
apply in interface Calculator
Parameters:
appr - DOCUMENT ME!
n - DOCUMENT ME!
net - DOCUMENT ME!

getVisualPropertyType

public VisualPropertyType getVisualPropertyType()
Replaces the following 3 methods: The returned enum VisualPropertyType has replacement for these methods.

Specified by:
getVisualPropertyType in interface Calculator
Returns:

getType

@Deprecated
public byte getType()
Deprecated. Will be removed 5/2008

DOCUMENT ME!

Specified by:
getType in interface Calculator
Returns:
DOCUMENT ME!

getPropertyLabel

@Deprecated
public String getPropertyLabel()
Deprecated. Will be removed 5/2008

DOCUMENT ME!

Specified by:
getPropertyLabel in interface Calculator
Returns:
DOCUMENT ME!

getTypeName

@Deprecated
public String getTypeName()
Deprecated. Will be removed 5/2008

DOCUMENT ME!

Specified by:
getTypeName in interface Calculator
Returns:
DOCUMENT ME!

www.cytoscape.org