Cytoscape 2.8.0 API

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.


Field Summary
 
Fields inherited from class cytoscape.visual.SubjectBase
observers
 
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!
 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!
 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!
 
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
 

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.


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!

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.


Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.