dguitar.gui
Class ColorScheme

java.lang.Object
  extended bydguitar.gui.ColorScheme
All Implemented Interfaces:
java.lang.Cloneable

public class ColorScheme
extends java.lang.Object
implements java.lang.Cloneable

This class lets you associate durations of beats or notes to a color a ColorScheme has at this moment 8 colors inside or 1 unique color.

Author:
Mauricio Gracia Gutiérrez

Field Summary
private  java.awt.Color[] colors
           
private  java.awt.Color uniqueColor
           
 
Constructor Summary
ColorScheme()
          Creates a new instance of ColorScheme, withe de default colors
ColorScheme(java.awt.Color c)
          Creates a new instance of ColorScheme, where all colors are set to C
 
Method Summary
protected  java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.awt.Color getColor()
          returns the unique color
 java.awt.Color getColor(GPDuration duration)
          returns the color for a Given GP duration
 java.awt.Color getColor(int pos)
          returns the color for the position pos
 void gradientDarkerUntil(java.awt.Color base, int delta)
          the maximum value for delta is 31, asuming base is Color.BLACK ;
 void gradientLighterFrom(java.awt.Color base, int delta)
          the maximum value for delta is 31, asuming base is Color.BLACK ;
 boolean isUniqueColor()
           
 void setColor(java.awt.Color color)
          Sets the uniqueColor
 boolean setColor(java.awt.Color color, int pos)
          Sets the color for the position pos
 void setColors(java.awt.Color[] array)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uniqueColor

private java.awt.Color uniqueColor

colors

private java.awt.Color[] colors
Constructor Detail

ColorScheme

public ColorScheme()
Creates a new instance of ColorScheme, withe de default colors


ColorScheme

public ColorScheme(java.awt.Color c)
Creates a new instance of ColorScheme, where all colors are set to C

Method Detail

gradientLighterFrom

public void gradientLighterFrom(java.awt.Color base,
                                int delta)
the maximum value for delta is 31, asuming base is Color.BLACK ;


gradientDarkerUntil

public void gradientDarkerUntil(java.awt.Color base,
                                int delta)
the maximum value for delta is 31, asuming base is Color.BLACK ;


setColors

public void setColors(java.awt.Color[] array)

isUniqueColor

public boolean isUniqueColor()

setColor

public boolean setColor(java.awt.Color color,
                        int pos)
Sets the color for the position pos


setColor

public void setColor(java.awt.Color color)
Sets the uniqueColor


getColor

public java.awt.Color getColor()
returns the unique color


getColor

public java.awt.Color getColor(int pos)
returns the color for the position pos


getColor

public java.awt.Color getColor(GPDuration duration)
returns the color for a Given GP duration


equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode(), Hashtable

clone

protected java.lang.Object clone()