Cytoscape 2.8.0 API

cytoscape.visual
Class CalculatorCatalog

java.lang.Object
  extended by cytoscape.visual.CalculatorCatalog

public class CalculatorCatalog
extends Object

Stores various types of Calculators from data attributes to an attribute of a specified type. Also keeps track of available mappings. Notifies interested classes of changes to the underlying datasets.


Field Summary
protected  ChangeEvent changeEvent
          Only one ChangeEvent is needed per catalog instance since the event's only state is the source property.
 
Constructor Summary
CalculatorCatalog()
          Creates a new CalculatorCatalog object.
CalculatorCatalog(Properties props)
          Creates a new CalculatorCatalog object.
 
Method Summary
 void addCalculator(Calculator dupe)
          Add any calculator to the catalog.
protected  void addCalculator(Calculator c, Map m)
           
 void addChangeListener(ChangeListener l, VisualPropertyType type)
          DOCUMENT ME!
 void addMapping(String name, Class m)
          Add a mapping to the database of available mappings.
 void addVisualStyle(VisualStyle vs)
          DOCUMENT ME!
 String checkCalculatorName(String calcName, VisualPropertyType calcType)
          DOCUMENT ME!
 String checkCalculatorName(VisualPropertyType type, String name)
          DOCUMENT ME!
 String checkMappingName(String name)
          DOCUMENT ME!
protected  String checkName(String name, Map m)
           
 String checkVisualStyleName(String name)
          DOCUMENT ME!
 void clear()
          DOCUMENT ME!
 void createDefaultVisualStyle()
          DOCUMENT ME!
protected  void fireStateChanged(VisualPropertyType type)
           
 Calculator getCalculator(VisualPropertyType type, String name)
          DOCUMENT ME!
protected  Map<String,Calculator> getCalculatorMap(VisualPropertyType type)
          Given a known byte identifier, returns the matching Map structure holding calculators of that type.
 Collection<Calculator> getCalculators()
          DOCUMENT ME!
 Collection<Calculator> getCalculators(VisualPropertyType type)
          DOCUMENT ME!
 Collection<VisualPropertyType> getCalculatorTypes()
          DOCUMENT ME!
protected  List getListenerList(VisualPropertyType type)
           
 Class getMapping(String name)
          DOCUMENT ME!
 Set<String> getMappingNames()
          Returns the HashMap of mappers
 VisualStyle getVisualStyle(String name)
          DOCUMENT ME!
 Set<String> getVisualStyleNames()
          DOCUMENT ME!
 Collection<VisualStyle> getVisualStyles()
          DOCUMENT ME!
 void removeCalculator(Calculator c)
          Remove a calculator.
 Calculator removeCalculator(VisualPropertyType type, String name)
          DOCUMENT ME!
 Class removeMapping(String name)
          DOCUMENT ME!
 VisualStyle removeVisualStyle(String name)
          DOCUMENT ME!
 void renameCalculator(Calculator c, String name)
          Renames a calculator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changeEvent

protected transient ChangeEvent changeEvent
Only one ChangeEvent is needed per catalog instance since the event's only state is the source property. The source of events generated is always "this".

Constructor Detail

CalculatorCatalog

public CalculatorCatalog()
Creates a new CalculatorCatalog object.


CalculatorCatalog

public CalculatorCatalog(Properties props)
Creates a new CalculatorCatalog object.

Parameters:
props - DOCUMENT ME!
Method Detail

clear

public void clear()
DOCUMENT ME!


getListenerList

protected List getListenerList(VisualPropertyType type)
                        throws IllegalArgumentException
Throws:
IllegalArgumentException

addChangeListener

public void addChangeListener(ChangeListener l,
                              VisualPropertyType type)
                       throws IllegalArgumentException
DOCUMENT ME!

Parameters:
l - DOCUMENT ME!
type - DOCUMENT ME!
Throws:
IllegalArgumentException - DOCUMENT ME!

fireStateChanged

protected void fireStateChanged(VisualPropertyType type)
                         throws IllegalArgumentException
Throws:
IllegalArgumentException

getCalculatorMap

protected Map<String,Calculator> getCalculatorMap(VisualPropertyType type)
Given a known byte identifier, returns the matching Map structure holding calculators of that type.

Parameters:
VisualPropertyType - a known type identifier
Returns:
Map the matching Map structure

addCalculator

public void addCalculator(Calculator dupe)
                   throws DuplicateCalculatorNameException,
                          IllegalArgumentException
Add any calculator to the catalog. Automatically checks type. Calculator is added according to its name as reported by the toString() method.

Parameters:
dupe - Calculator to add
Throws:
DuplicateCalculatorNameException - if calculator's name is a duplicate with valid name as detail message
IllegalArgumentException - if calculator is of an unknown type

checkCalculatorName

public String checkCalculatorName(String calcName,
                                  VisualPropertyType calcType)
DOCUMENT ME!

Parameters:
calcName - DOCUMENT ME!
calcType - DOCUMENT ME!
Returns:
DOCUMENT ME!

renameCalculator

public void renameCalculator(Calculator c,
                             String name)
                      throws DuplicateCalculatorNameException,
                             IllegalArgumentException
Renames a calculator.

Parameters:
c - Calculator to rename
name - New name for calculator
Throws:
DuplicateCalculatorNameException - if name is a duplicate with valid name as detail message
IllegalArgumentException - if c is of an unknown type

removeCalculator

public void removeCalculator(Calculator c)
                      throws IllegalArgumentException
Remove a calculator.

Parameters:
c - Calculator to remove
Throws:
IllegalArgumentException - if c is of an unknown calculator type

getMappingNames

public Set<String> getMappingNames()
Returns the HashMap of mappers


addMapping

public void addMapping(String name,
                       Class m)
                throws DuplicateCalculatorNameException,
                       IllegalArgumentException
Add a mapping to the database of available mappings. Because mappings are instantiated for each calculator, only class types are stored.

Parameters:
name - Name of the mapping
m - Class of the mapping
Throws:
DuplicateCalculatorNameException - if the given name is already taken
IllegalArgumentException - if the given class is not in the mapping hierarchy

removeMapping

public Class removeMapping(String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

getMapping

public Class getMapping(String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

checkMappingName

public String checkMappingName(String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

getVisualStyleNames

public Set<String> getVisualStyleNames()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getVisualStyles

public Collection<VisualStyle> getVisualStyles()
DOCUMENT ME!

Returns:
DOCUMENT ME!

addVisualStyle

public void addVisualStyle(VisualStyle vs)
DOCUMENT ME!

Parameters:
vs - DOCUMENT ME!

removeVisualStyle

public VisualStyle removeVisualStyle(String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

getVisualStyle

public VisualStyle getVisualStyle(String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

checkVisualStyleName

public String checkVisualStyleName(String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

addCalculator

protected void addCalculator(Calculator c,
                             Map m)
                      throws DuplicateCalculatorNameException
Throws:
DuplicateCalculatorNameException

checkName

protected String checkName(String name,
                           Map m)

getCalculators

public Collection<Calculator> getCalculators()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getCalculators

public Collection<Calculator> getCalculators(VisualPropertyType type)
DOCUMENT ME!

Parameters:
type - DOCUMENT ME!
Returns:
DOCUMENT ME!

getCalculator

public Calculator getCalculator(VisualPropertyType type,
                                String name)
DOCUMENT ME!

Parameters:
type - DOCUMENT ME!
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

checkCalculatorName

public String checkCalculatorName(VisualPropertyType type,
                                  String name)
DOCUMENT ME!

Parameters:
type - DOCUMENT ME!
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

removeCalculator

public Calculator removeCalculator(VisualPropertyType type,
                                   String name)
DOCUMENT ME!

Parameters:
type - DOCUMENT ME!
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

getCalculatorTypes

public Collection<VisualPropertyType> getCalculatorTypes()
DOCUMENT ME!

Returns:
DOCUMENT ME!

createDefaultVisualStyle

public void createDefaultVisualStyle()
DOCUMENT ME!


Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.