javax.swing.colorchooser
Class DefaultHSBChooserPanel.HSBImage

java.lang.Object
  extended byjavax.swing.colorchooser.SyntheticImage
      extended byjavax.swing.colorchooser.DefaultHSBChooserPanel.HSBImage
All Implemented Interfaces:
ImageProducer
Enclosing class:
DefaultHSBChooserPanel

class DefaultHSBChooserPanel.HSBImage
extends SyntheticImage

Class for the slider and palette images.


Field Summary
protected  boolean aborted
           
protected  float b
           
private static int BSLIDER
           
private static int BSQUARE
           
protected  int cachedColor
           
protected  int cachedY
           
(package private) static ColorModel cm
           
protected  float h
           
protected  int height
           
protected  float[] hsb
           
private static int HSLIDER
           
private static int HSQUARE
           
protected  boolean isDirty
           
static int pixMask
           
protected  float s
           
private static int SSLIDER
           
private static int SSQUARE
           
protected  int type
           
protected  int width
           
 
Constructor Summary
protected DefaultHSBChooserPanel.HSBImage(int type, int width, int height, float h, float s, float b)
           
 
Method Summary
 void addConsumer(ImageConsumer ic)
          Registers an ImageConsumer with the ImageProducer for access to the image data during a later reconstruction of the Image.
protected  void computeRow(int y, int[] row)
          Overriden method from SyntheticImage
 float getBrightness()
           
 void getHSBForLocation(int x, int y, float[] hsbArray)
           
 float getHue()
           
private  int getRGBForLocation(int x, int y)
           
 float getSaturation()
           
 boolean isConsumer(ImageConsumer ic)
          Determines if a specified ImageConsumer object is currently registered with this ImageProducer as one of its consumers.
protected  boolean isStatic()
           
 void nextFrame()
           
 void nextFrame(int param)
           
 void removeConsumer(ImageConsumer ic)
          Removes the specified ImageConsumer object from the list of consumers currently registered to receive image data.
 void requestTopDownLeftRightResend(ImageConsumer ic)
          Requests, on behalf of the ImageConsumer, that the ImageProducer attempt to resend the image data one more time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in order can be used to produce a better output version of the image.
 void setBrightness(float brightness)
           
 void setHue(float hue)
           
 void setSaturation(float saturation)
           
 void setValues(int type, float h, float s, float b)
           
 void startProduction(ImageConsumer ic)
          Registers the specified ImageConsumer object as a consumer and starts an immediate reconstruction of the image data which will then be delivered to this consumer and any other consumer which might have already been registered with the producer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

h

protected float h

s

protected float s

b

protected float b

hsb

protected float[] hsb

isDirty

protected boolean isDirty

cachedY

protected int cachedY

cachedColor

protected int cachedColor

type

protected int type

HSQUARE

private static final int HSQUARE
See Also:
Constant Field Values

SSQUARE

private static final int SSQUARE
See Also:
Constant Field Values

BSQUARE

private static final int BSQUARE
See Also:
Constant Field Values

HSLIDER

private static final int HSLIDER
See Also:
Constant Field Values

SSLIDER

private static final int SSLIDER
See Also:
Constant Field Values

BSLIDER

private static final int BSLIDER
See Also:
Constant Field Values

width

protected int width

height

protected int height

cm

static final ColorModel cm

pixMask

public static final int pixMask
See Also:
Constant Field Values

aborted

protected volatile boolean aborted
Constructor Detail

DefaultHSBChooserPanel.HSBImage

protected DefaultHSBChooserPanel.HSBImage(int type,
                                          int width,
                                          int height,
                                          float h,
                                          float s,
                                          float b)
Method Detail

setValues

public void setValues(int type,
                      float h,
                      float s,
                      float b)

setHue

public final void setHue(float hue)

setSaturation

public final void setSaturation(float saturation)

setBrightness

public final void setBrightness(float brightness)

getHue

public final float getHue()

getSaturation

public final float getSaturation()

getBrightness

public final float getBrightness()

isStatic

protected boolean isStatic()
Overrides:
isStatic in class SyntheticImage

nextFrame

public void nextFrame()

addConsumer

public void addConsumer(ImageConsumer ic)
Description copied from interface: ImageProducer
Registers an ImageConsumer with the ImageProducer for access to the image data during a later reconstruction of the Image. The ImageProducer may, at its discretion, start delivering the image data to the consumer using the ImageConsumer interface immediately, or when the next available image reconstruction is triggered by a call to the startProduction method.

Specified by:
addConsumer in interface ImageProducer
Overrides:
addConsumer in class SyntheticImage

getRGBForLocation

private int getRGBForLocation(int x,
                              int y)

getHSBForLocation

public void getHSBForLocation(int x,
                              int y,
                              float[] hsbArray)

computeRow

protected void computeRow(int y,
                          int[] row)
Overriden method from SyntheticImage

Overrides:
computeRow in class SyntheticImage

isConsumer

public boolean isConsumer(ImageConsumer ic)
Description copied from interface: ImageProducer
Determines if a specified ImageConsumer object is currently registered with this ImageProducer as one of its consumers.

Specified by:
isConsumer in interface ImageProducer
Parameters:
ic - the specified ImageConsumer
Returns:
true if the specified ImageConsumer is registered with this ImageProducer; false otherwise.

removeConsumer

public void removeConsumer(ImageConsumer ic)
Description copied from interface: ImageProducer
Removes the specified ImageConsumer object from the list of consumers currently registered to receive image data. It is not considered an error to remove a consumer that is not currently registered. The ImageProducer should stop sending data to this consumer as soon as is feasible.

Specified by:
removeConsumer in interface ImageProducer
Parameters:
ic - the specified ImageConsumer

startProduction

public void startProduction(ImageConsumer ic)
Description copied from interface: ImageProducer
Registers the specified ImageConsumer object as a consumer and starts an immediate reconstruction of the image data which will then be delivered to this consumer and any other consumer which might have already been registered with the producer. This method differs from the addConsumer method in that a reproduction of the image data should be triggered as soon as possible.

Specified by:
startProduction in interface ImageProducer
Parameters:
ic - the specified ImageConsumer
See Also:
ImageProducer.addConsumer(java.awt.image.ImageConsumer)

nextFrame

public void nextFrame(int param)

requestTopDownLeftRightResend

public void requestTopDownLeftRightResend(ImageConsumer ic)
Description copied from interface: ImageProducer
Requests, on behalf of the ImageConsumer, that the ImageProducer attempt to resend the image data one more time in TOPDOWNLEFTRIGHT order so that higher quality conversion algorithms which depend on receiving pixels in order can be used to produce a better output version of the image. The ImageProducer is free to ignore this call if it cannot resend the data in that order. If the data can be resent, the ImageProducer should respond by executing the following minimum set of ImageConsumer method calls:
	ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
	ic.setPixels(...);	// As many times as needed
	ic.imageComplete();
 

Specified by:
requestTopDownLeftRightResend in interface ImageProducer
Parameters:
ic - the specified ImageConsumer
See Also:
ImageConsumer.setHints(int)