performancemonster.graph.coloring
Class Colorer

java.lang.Object
  extended by performancemonster.graph.coloring.Colorer

public class Colorer
extends java.lang.Object


Constructor Summary
Colorer()
           
 
Method Summary
 void addChangeListener(ColorChangeListener listener)
           
 void appendColorRule(ColorRule colorRule)
           
 java.awt.Color chooseBarColor(GraphElement element)
          Finds a bar color for the given GraphElement from the current rules.
 java.awt.Color chooseBorderColor(GraphElement element)
          Finds a border color for the given GraphElement from the current rules.
 boolean contains(ColorRule colorRule)
           
 Colorer copy()
          Creates a copy of this Colorer, in order to make an "undo" operation possible by using the replaceWith(Colorer) method later.
 java.awt.Color getBackgroundColor()
           
 ColorRule getColorRule(int index)
           
 java.util.List<ColorRule> getColorRules()
           
 java.awt.Color getDefaultBarColor()
           
 java.awt.Color getDefaultBorderColor()
           
 int getNumberOfRules()
           
 void moveDown(ColorRule colorRule)
           
 void moveUp(ColorRule colorRule)
           
 void removeChangeListener(ColorChangeListener listener)
           
 void removeColorRule(ColorRule colorRule)
           
 void replaceWith(Colorer other)
          Replaces the contents of this Colorer with the given one, except that listeners are not altered.
 void setBackgroundColor(java.awt.Color backgroundColor)
           
 void setDefaultBarColor(java.awt.Color defaultBarColor)
           
 void setDefaultBorderColor(java.awt.Color defaultBorderColor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Colorer

public Colorer()
Method Detail

copy

public Colorer copy()
Creates a copy of this Colorer, in order to make an "undo" operation possible by using the replaceWith(Colorer) method later.

Returns:
an exact copy of this Colorer, except that listeners are not copied.

replaceWith

public void replaceWith(Colorer other)
Replaces the contents of this Colorer with the given one, except that listeners are not altered. Listeners of this Colorer are notified.

Parameters:
other - Colorer to replace contents with.

chooseBarColor

public java.awt.Color chooseBarColor(GraphElement element)
Finds a bar color for the given GraphElement from the current rules.

Parameters:
element - The GraphElement to find a bar color for.
Returns:
the correct bar color for the element.

chooseBorderColor

public java.awt.Color chooseBorderColor(GraphElement element)
Finds a border color for the given GraphElement from the current rules.

Parameters:
element - The GraphElement to find a border color for.
Returns:
the correct border color for the element.

addChangeListener

public void addChangeListener(ColorChangeListener listener)

removeChangeListener

public void removeChangeListener(ColorChangeListener listener)

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)

getBackgroundColor

public java.awt.Color getBackgroundColor()

setDefaultBarColor

public void setDefaultBarColor(java.awt.Color defaultBarColor)

getDefaultBarColor

public java.awt.Color getDefaultBarColor()

setDefaultBorderColor

public void setDefaultBorderColor(java.awt.Color defaultBorderColor)

getDefaultBorderColor

public java.awt.Color getDefaultBorderColor()

getColorRules

public java.util.List<ColorRule> getColorRules()

appendColorRule

public void appendColorRule(ColorRule colorRule)

removeColorRule

public void removeColorRule(ColorRule colorRule)

contains

public boolean contains(ColorRule colorRule)

moveUp

public void moveUp(ColorRule colorRule)

moveDown

public void moveDown(ColorRule colorRule)

getNumberOfRules

public int getNumberOfRules()

getColorRule

public ColorRule getColorRule(int index)


Copyright © 2005 Ole Friis. All Rights Reserved.