Drawable, Interactive, MeasurableInteractiveShapepublic abstract class AbstractInteractive extends java.lang.Object implements Interactive
| Modifier and Type | Field | Description |
|---|---|---|
java.awt.Color |
color |
|
protected double |
x |
|
protected double |
y |
| Constructor | Description |
|---|---|
AbstractInteractive() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract void |
draw(DrawingPanel panel,
java.awt.Graphics g) |
Draws the object.
|
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix) |
Finds the interactive object that will respond to mouse actions.
|
double |
getX() |
Gets the x coordinate.
|
double |
getXMax() |
Gets the maximum x needed to draw this object.
|
double |
getXMin() |
Gets the minimum x needed to draw this object.
|
double |
getY() |
Gets the y coordinate.
|
double |
getYMax() |
Gets the maximum y needed to draw this object.
|
double |
getYMin() |
Gets the minimum y needed to draw this object.
|
boolean |
isEnabled() |
|
abstract boolean |
isInside(DrawingPanel panel,
int xpix,
int ypix) |
Checks to see if this object is enabled and if the pixel coordinates are inside the drawable.
|
boolean |
isMeasured() |
Determines if information is available to set min/max values.
|
void |
setEnabled(boolean _enabled) |
Sets the enabled flag.
|
void |
setX(double _x) |
Sets the x coordinate.
|
void |
setXY(double _x,
double _y) |
Sets the x and y coordinates.
|
void |
setY(double _y) |
Sets the y coordinate.
|
public abstract void draw(DrawingPanel panel, java.awt.Graphics g)
public abstract boolean isInside(DrawingPanel panel, int xpix, int ypix)
panel - xpix - ypix - public void setEnabled(boolean _enabled)
setEnabled in interface Interactive_enabled - public boolean isEnabled()
isEnabled in interface Interactivepublic void setXY(double _x,
double _y)
setXY in interface Interactive_x - _y - public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
findInteractive in interface Interactivepanel - DrawingPanelxpix - intypix - intpublic boolean isMeasured()
MeasurableisMeasured in interface Measurablepublic double getXMin()
MeasurablegetXMin in interface Measurablepublic double getXMax()
MeasurablegetXMax in interface Measurablepublic double getYMin()
MeasurablegetYMin in interface Measurablepublic double getYMax()
MeasurablegetYMax in interface Measurablepublic double getX()
getX in interface Interactivepublic void setX(double _x)
setX in interface Interactive_x - public double getY()
getY in interface Interactivepublic void setY(double _y)
setY in interface Interactive_y -