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

cytoscape.visual
Class GlobalAppearanceCalculator

java.lang.Object
  extended by cytoscape.visual.SubjectBase
      extended by cytoscape.visual.GlobalAppearanceCalculator
All Implemented Interfaces:
Cloneable

public class GlobalAppearanceCalculator
extends SubjectBase
implements Cloneable

This class calculates global visual attributes such as the background color of the graph window. Currently dynamic calculators for these values are not supported, only default values.


Constructor Summary
GlobalAppearanceCalculator()
          Creates a new GlobalAppearanceCalculator object.
GlobalAppearanceCalculator(GlobalAppearanceCalculator toCopy)
          Copy constructor.
GlobalAppearanceCalculator(String name, Properties gProps, String baseKey, CalculatorCatalog catalog)
          Creates a new GlobalAppearanceCalculator and immediately customizes it by calling applyProperties with the supplied arguments.
 
Method Summary
 void applyProperties(String name, Properties nacProps, String baseKey, CalculatorCatalog catalog)
          This method customizes this object by searching the supplied properties object for keys identifying default values and calculators.
 Color calculateBackgroundColor(CyNetwork network)
          Currently no calculators are supported for global visual attributes, so this method simply returns the default background color.
 Color calculateEdgeReverseSelectionColor(CyNetwork network)
          DOCUMENT ME!
 Color calculateEdgeSelectionColor(CyNetwork network)
          DOCUMENT ME!
 GlobalAppearance calculateGlobalAppearance(CyNetwork network)
          Constructs a new GlobalAppearance object containing the values for the known global visual attributes.
 void calculateGlobalAppearance(GlobalAppearance appr, CyNetwork network)
          The supplied GlobalAppearance object will be changed to hold new values for the known global visual attributes.
 Color calculateNodeReverseSelectionColor(CyNetwork network)
          DOCUMENT ME!
 Color calculateNodeSelectionColor(CyNetwork network)
          DOCUMENT ME!
 Color calculateSloppySelectionColor(CyNetwork network)
          Deprecated. Will be removed 5/2008
 Object clone()
          Make deep copy of this object
 Color getDefaultBackgroundColor()
          DOCUMENT ME!
 Color getDefaultColor(String name)
          Get default color for the given parameter name.
 Color getDefaultEdgeReverseSelectionColor()
          DOCUMENT ME!
 Color getDefaultEdgeSelectionColor()
          DOCUMENT ME!
 Color getDefaultNodeReverseSelectionColor()
          DOCUMENT ME!
 Color getDefaultNodeSelectionColor()
          DOCUMENT ME!
 Color getDefaultSloppySelectionColor()
          Deprecated. Will be removed 5/2008
 String getDescription()
          Returns a text description of this object's current state.
static String[] getGlobalAppearanceNames()
          Get name of global appearances.
 Properties getProperties(String baseKey)
          Returns a Properties description of this object, suitable for customization by the applyProperties method.
 void setDefaultBackgroundColor(Color c)
          DOCUMENT ME!
 void setDefaultColor(String name, Color newColor)
          DOCUMENT ME!
 void setDefaultEdgeReverseSelectionColor(Color c)
          DOCUMENT ME!
 void setDefaultEdgeSelectionColor(Color c)
          DOCUMENT ME!
 void setDefaultNodeReverseSelectionColor(Color c)
          DOCUMENT ME!
 void setDefaultNodeSelectionColor(Color c)
          DOCUMENT ME!
 void setDefaultSloppySelectionColor(Color c)
          Deprecated. Will be removed 5/2008
 
Methods inherited from class cytoscape.visual.SubjectBase
addChangeListener, fireStateChanged, removeChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalAppearanceCalculator

public GlobalAppearanceCalculator()
Creates a new GlobalAppearanceCalculator object.


GlobalAppearanceCalculator

public GlobalAppearanceCalculator(GlobalAppearanceCalculator toCopy)
Copy constructor. Returns a default object if the argument is null.


GlobalAppearanceCalculator

public GlobalAppearanceCalculator(String name,
                                  Properties gProps,
                                  String baseKey,
                                  CalculatorCatalog catalog)
Creates a new GlobalAppearanceCalculator and immediately customizes it by calling applyProperties with the supplied arguments.

Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Make deep copy of this object

Overrides:
clone in class Object
Throws:
CloneNotSupportedException

getDefaultColor

public Color getDefaultColor(String name)
                      throws Exception
Get default color for the given parameter name. Should be used names in GlobalAppearenceNames enum.

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

setDefaultColor

public void setDefaultColor(String name,
                            Color newColor)
                     throws Exception
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
newColor - DOCUMENT ME!
Throws:
Exception - DOCUMENT ME!

getGlobalAppearanceNames

public static String[] getGlobalAppearanceNames()
Get name of global appearances.

Returns:
DOCUMENT ME!

calculateGlobalAppearance

public GlobalAppearance calculateGlobalAppearance(CyNetwork network)
Constructs a new GlobalAppearance object containing the values for the known global visual attributes.


calculateGlobalAppearance

public void calculateGlobalAppearance(GlobalAppearance appr,
                                      CyNetwork network)
The supplied GlobalAppearance object will be changed to hold new values for the known global visual attributes.


getDefaultBackgroundColor

public Color getDefaultBackgroundColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDefaultBackgroundColor

public void setDefaultBackgroundColor(Color c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

calculateBackgroundColor

public Color calculateBackgroundColor(CyNetwork network)
Currently no calculators are supported for global visual attributes, so this method simply returns the default background color.


getDefaultSloppySelectionColor

@Deprecated
public Color getDefaultSloppySelectionColor()
Deprecated. Will be removed 5/2008

DOCUMENT ME!

Returns:
DOCUMENT ME!

setDefaultSloppySelectionColor

@Deprecated
public void setDefaultSloppySelectionColor(Color c)
Deprecated. Will be removed 5/2008

DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

getDefaultNodeSelectionColor

public Color getDefaultNodeSelectionColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDefaultNodeSelectionColor

public void setDefaultNodeSelectionColor(Color c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

getDefaultNodeReverseSelectionColor

public Color getDefaultNodeReverseSelectionColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDefaultNodeReverseSelectionColor

public void setDefaultNodeReverseSelectionColor(Color c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

getDefaultEdgeSelectionColor

public Color getDefaultEdgeSelectionColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDefaultEdgeSelectionColor

public void setDefaultEdgeSelectionColor(Color c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

getDefaultEdgeReverseSelectionColor

public Color getDefaultEdgeReverseSelectionColor()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDefaultEdgeReverseSelectionColor

public void setDefaultEdgeReverseSelectionColor(Color c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!

calculateSloppySelectionColor

@Deprecated
public Color calculateSloppySelectionColor(CyNetwork network)
Deprecated. Will be removed 5/2008

Currently no calculators are supported for global visual attributes, so this method simply returns the default sloppy selection color.


calculateNodeSelectionColor

public Color calculateNodeSelectionColor(CyNetwork network)
DOCUMENT ME!

Parameters:
network - DOCUMENT ME!
Returns:
DOCUMENT ME!

calculateNodeReverseSelectionColor

public Color calculateNodeReverseSelectionColor(CyNetwork network)
DOCUMENT ME!

Parameters:
network - DOCUMENT ME!
Returns:
DOCUMENT ME!

calculateEdgeSelectionColor

public Color calculateEdgeSelectionColor(CyNetwork network)
DOCUMENT ME!

Parameters:
network - DOCUMENT ME!
Returns:
DOCUMENT ME!

calculateEdgeReverseSelectionColor

public Color calculateEdgeReverseSelectionColor(CyNetwork network)
DOCUMENT ME!

Parameters:
network - DOCUMENT ME!
Returns:
DOCUMENT ME!

getDescription

public String getDescription()
Returns a text description of this object's current state.


applyProperties

public void applyProperties(String name,
                            Properties nacProps,
                            String baseKey,
                            CalculatorCatalog catalog)
This method customizes this object by searching the supplied properties object for keys identifying default values and calculators. Recognized keys are of the form "globalAppearanceCalculator." + name + ident, where name is a supplied argument and ident is a String indicating a default value for a specific visual attribute. Since calculators are not supported for global visual attributes, the catalog argument is currently ignored.


getProperties

public Properties getProperties(String baseKey)
Returns a Properties description of this object, suitable for customization by the applyProperties method.


www.cytoscape.org