com.davisor.graphics
Class PaintPalette

java.lang.Object
  extended bycom.davisor.graphics.PaintPalette

public class PaintPalette
extends java.lang.Object

PaintPalette implements an paint iteratory utility to cycle through a BetterPaint paint chain, and return back to beginning. The utility supports also ordinary paints, for which the paint chain is an infinite loop of that one ordinary paint.

Since:
JDK1.4

Field Summary
protected  java.awt.Paint M_current
           
protected  java.awt.Paint M_first
           
 
Constructor Summary
PaintPalette(java.awt.Paint paint)
          Creates a new paint palette from given better paint.
 
Method Summary
static PaintPalette create(java.awt.Paint paint)
          Creates a new paint palette, but only if given paint is not null.
 java.awt.Paint getCurrent()
          Gets current paint in paint chain.
static java.awt.Paint getCurrent(PaintPalette paintPalette)
          Gets current paint in paint palette, but only if is not null.
 java.awt.Paint getFirst()
          Gets the first paint in paint chain.
 void next()
          Moves the current paint to the next paint in a paint chain.
static void next(PaintPalette paintPalette)
          Moves the current point to the next paint in a paint chain, but only if is not null.
 void reset()
          Moves the current paint to the first paint in paint chain.
static void reset(PaintPalette paintPalette)
          Resets given paint palette, but only if is not null.
 java.lang.String toString()
          Gets paint palette string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M_first

protected java.awt.Paint M_first

M_current

protected java.awt.Paint M_current
Constructor Detail

PaintPalette

public PaintPalette(java.awt.Paint paint)
Creates a new paint palette from given better paint.

Parameters:
paint - palette paint (may be null)
Method Detail

toString

public java.lang.String toString()
Gets paint palette string representation.


create

public static PaintPalette create(java.awt.Paint paint)
Creates a new paint palette, but only if given paint is not null.

Parameters:
paint - palette paint (may be null)
Returns:
new paint palette, or null if paint was null

getFirst

public java.awt.Paint getFirst()
Gets the first paint in paint chain.

See Also:
reset()

getCurrent

public java.awt.Paint getCurrent()
Gets current paint in paint chain.

See Also:
getCurrent(PaintPalette)

getCurrent

public static java.awt.Paint getCurrent(PaintPalette paintPalette)
Gets current paint in paint palette, but only if is not null.

Parameters:
paintPalette - paint palette (may be null)
Returns:
current paint in paint palette, or null if the palette was null
See Also:
getCurrent()

next

public void next()
Moves the current paint to the next paint in a paint chain. If the current paint is not however an instance of BetterPaint, nothing is done.

See Also:
next(PaintPalette), reset()

next

public static void next(PaintPalette paintPalette)
Moves the current point to the next paint in a paint chain, but only if is not null.

Parameters:
paintPalette - paint palette (may be null)
See Also:
next()

reset

public void reset()
Moves the current paint to the first paint in paint chain.

See Also:
next(), reset(PaintPalette)

reset

public static void reset(PaintPalette paintPalette)
Resets given paint palette, but only if is not null.

Parameters:
paintPalette - paint palette (may be null)
See Also:
reset()


Copyright © 2001-2004 Davisor Oy. All Rights Reserved.