Class HSVHex
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----HSVHex
- public class HSVHex
- extends Canvas
This class produces the HSV hexagon component.
-
Bx
- coordinates for Blue vertex.
-
By
- coordinates for Blue vertex.
-
Cx
- coordinates for Cyan vertex.
-
Cy
- coordinates for Cyan vertex.
-
D
-
-
fradius
- radius (float)
-
Gx
- coordinates for Green vertex.
-
Gy
- coordinates for Green vertex.
-
H
-
-
h
- hue and saturation for each (x,y) of the image.
-
hue
- Current HSV space coordinates.
-
image
- Image of the hexagon.
-
iradius
- radius (int)
-
Mx
- coordinates for Magenta vertex.
-
My
- coordinates for Magenta vertex.
-
pix
- pixel array.
-
Rx
- coordinates for Red vertex.
-
Ry
- coordinates for Red vertex.
-
s
- hue and saturation for each (x,y) of the image.
-
saturation
- Current HSV space coordinates.
-
value
- Current HSV space coordinates.
-
yout
-
-
Yx
- coordinates for Yellow vertex.
-
Yy
- coordinates for Yellow vertex.
-
HSVHex(float, float, float)
- Constructs the hexagon.
-
compute_hs(int, int)
- compute H and S for given (x,y) position on the hexagon.
-
computeImage()
- Computes and creates the hexagon image.
-
drawHS(Graphics)
- Draws the marker indicating current (H,S) coordinates.
-
minimumSize()
- Overrides the default minimumSize() method.
-
paint(Graphics)
- Draws the image of the hexagon and the (H,S) marker.
-
preferredSize()
- Overrides the default preferredSize() method.
-
setHSV(float)
- Sets the V value and repaints the hexagon.
-
setHSV(float, float)
- Sets the S and H values and repaints the hexagon.
-
setHSV(float, float, float)
- Sets the H, S and V values and repaints the hexagon.
-
update(Graphics)
- Overrides the default update(Graphics) method
in order not to clear screen to avoid flicker.
image
Image image
- Image of the hexagon.
hue
float hue
- Current HSV space coordinates.
saturation
float saturation
- Current HSV space coordinates.
value
float value
- Current HSV space coordinates.
h
float h
- hue and saturation for each (x,y) of the image.
s
float s
- hue and saturation for each (x,y) of the image.
pix
int pix[]
- pixel array.
Rx
int Rx
- coordinates for Red vertex.
Ry
int Ry
- coordinates for Red vertex.
Yx
int Yx
- coordinates for Yellow vertex.
Yy
int Yy
- coordinates for Yellow vertex.
Gx
int Gx
- coordinates for Green vertex.
Gy
int Gy
- coordinates for Green vertex.
Cx
int Cx
- coordinates for Cyan vertex.
Cy
int Cy
- coordinates for Cyan vertex.
Bx
int Bx
- coordinates for Blue vertex.
By
int By
- coordinates for Blue vertex.
Mx
int Mx
- coordinates for Magenta vertex.
My
int My
- coordinates for Magenta vertex.
fradius
float fradius
- radius (float)
iradius
int iradius
- radius (int)
yout
int yout
D
int D
H
int H
HSVHex
public HSVHex(float hue,
float saturation,
float value)
- Constructs the hexagon.
- Parameters:
- hue - the H coordinate
- saturation - the S coordinate
- value - the V coordinate
compute_hs
void compute_hs(int x,
int y)
- compute H and S for given (x,y) position on the hexagon.
(x,y) must be inside the hexagon.
setHSV
public void setHSV(float value)
- Sets the V value and repaints the hexagon.
- Parameters:
- value - the V coordinate
setHSV
public void setHSV(float hue,
float saturation)
- Sets the S and H values and repaints the hexagon.
- Parameters:
- hue - the H coordinate
- saturation - the S coordinate
setHSV
public void setHSV(float hue,
float saturation,
float value)
- Sets the H, S and V values and repaints the hexagon.
- Parameters:
- hue - the H coordinate
- saturation - the S coordinate
- value - the V coordinate
minimumSize
public Dimension minimumSize()
- Overrides the default minimumSize() method.
- Returns:
- new Dimension
- Overrides:
- minimumSize in class Component
preferredSize
public Dimension preferredSize()
- Overrides the default preferredSize() method.
- Returns:
- new Dimension
- Overrides:
- preferredSize in class Component
computeImage
void computeImage()
- Computes and creates the hexagon image.
drawHS
void drawHS(Graphics g)
- Draws the marker indicating current (H,S) coordinates.
paint
public void paint(Graphics g)
- Draws the image of the hexagon and the (H,S) marker.
- Overrides:
- paint in class Canvas
update
public void update(Graphics g)
- Overrides the default update(Graphics) method
in order not to clear screen to avoid flicker.
- Overrides:
- update in class Component