|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
Eye
public class Eye
A panel which looks like an eye. The eye contains an eyeball that follows the mouse.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected EyeBall |
eyeBall
The eyeball inside this eye. |
protected Color |
eyeColor
The color of this eye. |
protected int |
eyeRadius
Put here a description of this field. |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
Eye()
Construct an eye with the default color and size and construct the eye's eyeball with its default color. |
|
Eye(Color eyeColor,
Color eyeBallColor)
Construct an eye with the given color and default size and construct the eye's eyeball with its given color. |
|
| Method Summary | |
|---|---|
protected void |
look(Point mousePoint)
Ask this eye to look wherever the mouse is. |
void |
mouseDragged(MouseEvent event)
Do nothing when the user drags the mouse. |
void |
mouseMoved(MouseEvent event)
Ask this eye to look wherever the mouse is. |
void |
paintComponent(Graphics graphics)
Draw this eye and its eyeball. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected EyeBall eyeBall
protected Color eyeColor
protected int eyeRadius
| Constructor Detail |
|---|
public Eye()
public Eye(Color eyeColor,
Color eyeBallColor)
eyeColor - Color of the eye.eyeBallColor - Color of the eyeball.| Method Detail |
|---|
public void mouseMoved(MouseEvent event)
mouseMoved in interface MouseMotionListenerevent - The MouseEvent that occurred when the mouse was moved.public void mouseDragged(MouseEvent event)
mouseDragged in interface MouseMotionListenerevent - The MouseEvent that occurred when the mouse was dragged.protected void look(Point mousePoint)
mousePoint - Position of the mouse, relative to the frame.public void paintComponent(Graphics graphics)
paintComponent in class JComponentgraphics - Graphics object onto which to draw.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||