JHotDraw 7.6

org.jhotdraw.color
Class ComplexColorWheelImageProducer

java.lang.Object
  extended by java.awt.image.MemoryImageSource
      extended by org.jhotdraw.color.AbstractColorWheelImageProducer
          extended by org.jhotdraw.color.ComplexColorWheelImageProducer
All Implemented Interfaces:
java.awt.image.ImageProducer

public class ComplexColorWheelImageProducer
extends AbstractColorWheelImageProducer

Produces the image of a JColorWheel by interpreting two components of a ColorSpace as complex numbers (real and imaginary).

Version:
$Id: ColorWheelImageProducer.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer
See Also:
JColorWheel

Field Summary
protected  int[] alphas
          Lookup table for alphas.
protected  float[] angulars
          Lookup table for angular component values.
protected  float[] radials
          Lookup table for radial component values.
 
Fields inherited from class org.jhotdraw.color.AbstractColorWheelImageProducer
angularIndex, colorSpace, h, isLookupValid, isPixelsValid, pixels, radialIndex, verticalIndex, verticalValue, w
 
Constructor Summary
ComplexColorWheelImageProducer(java.awt.color.ColorSpace sys, int w, int h)
          Creates a new instance.
ComplexColorWheelImageProducer(java.awt.color.ColorSpace sys, int w, int h, boolean flipX, boolean flipY)
          Creates a new instance.
 
Method Summary
 void generateColorWheel()
           
protected  void generateLookupTables()
           
protected  void generateLookupTables1()
           
 float[] getColorAt(int x, int y)
           
 java.awt.Point getColorLocation(float[] components)
           
 boolean needsGeneration()
           
 void regenerateColorWheel()
           
 
Methods inherited from class org.jhotdraw.color.AbstractColorWheelImageProducer
getColorLocation, getRadius, setAngularComponentIndex, setRadialComponentIndex, setVerticalComponentIndex, setVerticalValue
 
Methods inherited from class java.awt.image.MemoryImageSource
addConsumer, isConsumer, newPixels, newPixels, newPixels, newPixels, newPixels, removeConsumer, requestTopDownLeftRightResend, setAnimated, setFullBufferUpdates, startProduction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

angulars

protected float[] angulars
Lookup table for angular component values.


radials

protected float[] radials
Lookup table for radial component values.


alphas

protected int[] alphas
Lookup table for alphas. The alpha value is used for antialiasing the color wheel.

Constructor Detail

ComplexColorWheelImageProducer

public ComplexColorWheelImageProducer(java.awt.color.ColorSpace sys,
                                      int w,
                                      int h)
Creates a new instance.


ComplexColorWheelImageProducer

public ComplexColorWheelImageProducer(java.awt.color.ColorSpace sys,
                                      int w,
                                      int h,
                                      boolean flipX,
                                      boolean flipY)
Creates a new instance.

Method Detail

generateLookupTables1

protected void generateLookupTables1()

generateLookupTables

protected void generateLookupTables()

needsGeneration

public boolean needsGeneration()
Overrides:
needsGeneration in class AbstractColorWheelImageProducer

regenerateColorWheel

public void regenerateColorWheel()
Overrides:
regenerateColorWheel in class AbstractColorWheelImageProducer

generateColorWheel

public void generateColorWheel()
Specified by:
generateColorWheel in class AbstractColorWheelImageProducer

getColorLocation

public java.awt.Point getColorLocation(float[] components)
Specified by:
getColorLocation in class AbstractColorWheelImageProducer

getColorAt

public float[] getColorAt(int x,
                          int y)
Specified by:
getColorAt in class AbstractColorWheelImageProducer

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.