PamView
Class ColourArray

java.lang.Object
  extended by PamView.ColourArray
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ColourArray
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A series of functions for creating arrays of colours

Can be used for spectrogram colouring, contour colouring, etc.

Author:
Doug Gillespie
See Also:
Serialized Form

Nested Class Summary
static class ColourArray.ColourArrayType
           
 
Field Summary
private  java.awt.Color[] colours
           
 
Constructor Summary
private ColourArray()
           
 
Method Summary
protected  ColourArray clone()
           
static ColourArray createBlackToWhiteArray(int nPoints)
           
static ColourArray createHotArray(int nPoints)
           
static ColourArray createMergedArray(int nPoints, java.awt.Color c1, java.awt.Color c2)
           
static ColourArray createMultiColouredArray(int nPoints, java.awt.Color... colourList)
          Create a multicoloured array of colours that merges in turn between each of the colours given in the list.
static ColourArray createStandardColourArray(int nPoints, ColourArray.ColourArrayType type)
           
static ColourArray createWhiteToBlackArray(int nPoints)
           
 java.awt.Color getColour(int iCol)
           
 java.awt.Color[] getColours()
           
 int[] getIntColourArray(int iCol)
           
static java.lang.String getName(ColourArray.ColourArrayType type)
           
 int getNumbColours()
           
 void reverseArray()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colours

private java.awt.Color[] colours
Constructor Detail

ColourArray

private ColourArray()
Method Detail

getName

public static java.lang.String getName(ColourArray.ColourArrayType type)

createStandardColourArray

public static ColourArray createStandardColourArray(int nPoints,
                                                    ColourArray.ColourArrayType type)

createWhiteToBlackArray

public static ColourArray createWhiteToBlackArray(int nPoints)

createBlackToWhiteArray

public static ColourArray createBlackToWhiteArray(int nPoints)

createHotArray

public static ColourArray createHotArray(int nPoints)

createMultiColouredArray

public static ColourArray createMultiColouredArray(int nPoints,
                                                   java.awt.Color... colourList)
Create a multicoloured array of colours that merges in turn between each of the colours given in the list.

Parameters:
nPoints - total number of colour points
colourList - variable number of colours.
Returns:
a new ColourArray object.

createMergedArray

public static ColourArray createMergedArray(int nPoints,
                                            java.awt.Color c1,
                                            java.awt.Color c2)

getColours

public java.awt.Color[] getColours()

getColour

public java.awt.Color getColour(int iCol)

getIntColourArray

public int[] getIntColourArray(int iCol)

getNumbColours

public int getNumbColours()

reverseArray

public void reverseArray()

clone

protected ColourArray clone()
Overrides:
clone in class java.lang.Object