Class RGBCube
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----CanvasDB
|
+----RGBCube
- public class RGBCube
- extends CanvasDB
This class produces RGB cube in RGB or YIQ color spaces.
-
RGBCube(float, float, float)
- Constructs an RGB cube in YIQ color space.
-
RGBCube(int, int, int)
- Constructs an RGB cube in RGB color space.
-
minimumSize()
- Overrides the default minimumSize() method.
-
mouseDown(Event, int, int)
- Processes mouse down event.
-
mouseDrag(Event, int, int)
- Processes mouse drag event to rotate the RGB cube.
-
paint(Graphics)
- Computes and paints all vertices and edges of the RGB cube.
-
preferredSize()
- Overrides the default preferredSize() method.
-
setCoord(float, float, float)
- Updates the position of the vertex indicating current color position
within the cube.
-
setCoord(int, int, int)
- Updates the position of the vertex indicating current color position
within the cube.
RGBCube
public RGBCube(int red,
int green,
int blue)
- Constructs an RGB cube in RGB color space.
- Parameters:
- red - initial value of red component
- green - initial value of green component
- blue - initial value of blue component
RGBCube
public RGBCube(float y,
float i,
float q)
- Constructs an RGB cube in YIQ color space.
- Parameters:
- y - initial value of Y component
- i - initial value of I component
- q - initial value of Q component
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- Processes mouse down event.
- Overrides:
- mouseDown in class Component
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- Processes mouse drag event to rotate the RGB cube.
- Overrides:
- mouseDrag in class Component
setCoord
public void setCoord(int red,
int green,
int blue)
- Updates the position of the vertex indicating current color position
within the cube.
- Parameters:
- red - new red component
- green - new green component
- blue - new blue component
setCoord
public void setCoord(float y,
float i,
float q)
- Updates the position of the vertex indicating current color position
within the cube.
- Parameters:
- y - new Y component
- i - new I component
- q - new Q component
paint
public void paint(Graphics g)
- Computes and paints all vertices and edges of the RGB cube.
- Overrides:
- paint in class Canvas
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