|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--jwo.utils.JWColourRing
Creates a colour ring for displaying HSV colour space.
| Nested Class Summary |
| Nested classes inherited from class java.awt.Canvas |
Canvas.AccessibleAWTCanvas |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JWColourRing(int radius)
Creates a hue colour ring surrounding a saturation- brightness square. |
|
JWColourRing(int radius,
Color colour)
Creates a hue colour ring surrounding a saturation- brightness square. |
|
| Method Summary | |
Color |
getColour()
Reports the currently selected colour. |
Dimension |
getMinimumSize()
Determines the minimum size of the bean. |
Dimension |
getPreferredSize()
Determines the preferred size of the bean. |
void |
mouseClicked(MouseEvent mouseEvent)
Checks for mouse clicks, but does nothing. |
void |
mouseDragged(MouseEvent mouseEvent)
Checks for mouse drag and continuously changes selected colour. |
void |
mouseEntered(MouseEvent mouseEvent)
Checks for pointer entering event, but does nothing. |
void |
mouseExited(MouseEvent mouseEvent)
Checks for pointer exiting event, but does nothing. |
void |
mouseMoved(MouseEvent mouseEvent)
Checks for mouse movement, but does nothing. |
void |
mousePressed(MouseEvent mouseEvent)
Checks for mouse button press, changes colour selected. |
void |
mouseReleased(MouseEvent mouseEvent)
Checks for mouse button release and turns off mouse movement query. |
void |
paint(Graphics g)
Paints colour ring onto the canvas. |
void |
setColour(Color newColour)
Sets the currently selected colour to a given value. |
void |
update(Graphics g)
Overrides the update method to stop the screen from being recleared each time. |
| Methods inherited from class java.awt.Canvas |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public JWColourRing(int radius)
radius - Radius of colour ring in pixels.
public JWColourRing(int radius,
Color colour)
radius - Radius of colour ring in pixels.| Method Detail |
public Color getColour()
public void setColour(Color newColour)
newColour - New colour to store.public Dimension getPreferredSize()
getPreferredSize in class Componentpublic Dimension getMinimumSize()
getMinimumSize in class Componentpublic void update(Graphics g)
update in class Canvasg - Graphics context to paint to.public void paint(Graphics g)
paint in class Canvasg - The graphics context to paint to.public void mouseClicked(MouseEvent mouseEvent)
mouseClicked in interface MouseListenermouseEvent - Mouse click event.public void mousePressed(MouseEvent mouseEvent)
mousePressed in interface MouseListenermouseEvent - Mouse press event.public void mouseReleased(MouseEvent mouseEvent)
mouseReleased in interface MouseListenermouseEvent - Mouse release event.public void mouseMoved(MouseEvent mouseEvent)
mouseMoved in interface MouseMotionListenermouseEvent - Mouse movement event.public void mouseEntered(MouseEvent mouseEvent)
mouseEntered in interface MouseListenermouseEvent - Pointer entering event.public void mouseExited(MouseEvent mouseEvent)
mouseExited in interface MouseListenermouseEvent - Mouse exiting event.public void mouseDragged(MouseEvent mouseEvent)
mouseDragged in interface MouseMotionListenermouseEvent - Mouse press event.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||