|
|||||||||
| 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
support.convexhull.HullPoint
support.convexhull.HelperHullPoint
public class HelperHullPoint
A HelperHullPoint extends the basic HullPoint
by adding functionality needed to work correctly in the
HullHelper. Mainly it deals with graphical representation
and storing additional state information.
A HelperHullPoint has two different attributes, on/off hull,
and there is a color change associated with each state.
There is a third state, but this state is not encountered unless an error
occurs. That indicates that the insertion of this point caused an
exception.
These should only be created by the HullHelper.
HullHelper,
Serialized Form| Nested Class Summary |
|---|
| 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.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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 support.convexhull.ConvexHullConstants |
|---|
BLUE_POINT_IMAGE, BOTTOM_COLOR, c, CANVAS_HEIGHT, CANVAS_WIDTH, ERROR_COLOR, FIGHTER_MODEL, FRAME_HEIGHT, FRAME_WIDTH, FRAME_X, FRAME_Y, HULL_CONNECT_COLOR, HULL_POINT_RADIUS, IMAGE_PATH, MODEL_PATH, OFF_HULL, ON_HULL, PURPLE_POINT_IMAGE, RED_POINT_IMAGE, ROBOT_MODEL, TOP_COLOR |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
HelperHullPoint(HullCanvas c)
Constructs a new hull point. |
|
| Method Summary | |
|---|---|
Rectangle |
getBounds()
Gets the bounds of this component. |
boolean |
isError()
Identifies if this point was the last point inserted before an exception was thrown. |
boolean |
isOnHull()
Gets the state of the on/off hull attributed |
protected static void |
loadImages()
|
void |
paint(Graphics graphics)
Paints this point to the specified graphics object. |
void |
setError(boolean state)
Flags that this point caused an error. |
void |
setOnHull(boolean state)
Sets the state of the on/off hull attribute. |
protected void |
updateColor()
This updates the color of the current point. |
| Methods inherited from class support.convexhull.HullPoint |
|---|
getX, getY, setX, setY |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HelperHullPoint(HullCanvas c)
HullHelper should call
setLocation(int, int) after adding the point to the screen.
c - HullCanvas that contains this point| Method Detail |
|---|
protected static void loadImages()
protected void updateColor()
public Rectangle getBounds()
getBounds in class ComponentRectangle that contains the bounds of this point.public void paint(Graphics graphics)
HullCanvas.
paint in class JComponentgraphics - The Graphics object to use when painting
this HullPointpublic void setOnHull(boolean state)
state - the new state of the on/off hull attributepublic void setError(boolean state)
state - the new state of the error attributepublic boolean isOnHull()
true if the point is on the hull, false
otherwise.public boolean isError()
true if point caused an error, false
otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||