info.monitorenter.gui.util
Class ColorIterator

java.lang.Object
  extended by info.monitorenter.gui.util.ColorIterator
All Implemented Interfaces:
Iterator

public class ColorIterator
extends Object
implements Iterator

Iterator of ther color space.

Version:
$Revision: 1.3 $
Author:
Achim Westermann

Nested Class Summary
static class ColorIterator.ADefaultStepping
          Just for protected internal float stepping.
static class ColorIterator.APiggyBackStepper
          Base class for stepping models that may step in each direction of the Hue Saturation Luminance color space.
static class ColorIterator.HSBStepper
          Performs hue steps until it has walked the whole hue line, then performs a saturation step to start with hue steps again.
static class ColorIterator.HSStepper
          Performs hue steps until it has walked the whole hue line, then performs a saturation step to start with hue steps again.
static class ColorIterator.HueStepper
          A stepper that walks along the hue line of the color space.
static interface ColorIterator.ISteppingModel
          Defines the strategy of walking through the HSB color space.
static class ColorIterator.LuminanceStepper
          A stepping model that steps on the luminance line of the HSB color space.
static class ColorIterator.SaturationStepper
          A stepping model that steps on the saturation line of the HSB color space.
 
Constructor Summary
ColorIterator()
          Creates an instance that starts with a red and walks the hue line with a ColorIterator.HueStepper.
 
Method Summary
 boolean hasNext()
          Returns true if more colors are available.
static void main(String[] args)
          Main entry for a test application.
 Object next()
          Returns instances of java.awt.Color or throws a NoSuchElementException, if iterator has finished.
 void remove()
          Nothing is done here.
 void reset()
          Resets the ColorIterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorIterator

public ColorIterator()
Creates an instance that starts with a red and walks the hue line with a ColorIterator.HueStepper.

Method Detail

hasNext

public boolean hasNext()
Returns true if more colors are available.

Specified by:
hasNext in interface Iterator
Returns:
true if more colors are available.
See Also:
Iterator.hasNext()

next

public Object next()
            throws NoSuchElementException
Returns instances of java.awt.Color or throws a NoSuchElementException, if iterator has finished.

Specified by:
next in interface Iterator
Returns:
the next available Color.
Throws:
NoSuchElementException - if hasNext() returns false.

reset

public void reset()
Resets the ColorIterator. It will be able to start a new iteration over the colorspace.


remove

public void remove()
Nothing is done here. Do you really want to remove a color from the colorcircle model?

Specified by:
remove in interface Iterator

main

public static void main(String[] args)
Main entry for a test application.

Parameters:
args - ignored.


Copyright © 2001 - 2007 LGPL, All Rights Footloose.