|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.display.AbstractInteractive
public abstract class AbstractInteractive
AbstractInteractive implements common Interactive methods.
| Field Summary | |
|---|---|
java.awt.Color |
color
|
protected double |
x
|
protected double |
y
|
| Constructor Summary | |
|---|---|
AbstractInteractive()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.awt.Color color
protected double x
protected double y
| Constructor Detail |
|---|
public AbstractInteractive()
| Method Detail |
|---|
public abstract void draw(DrawingPanel panel,
java.awt.Graphics g)
draw in interface Drawablepanel - the drawing panelg - the graphics context
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 Interactive
public 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 - int
public boolean isMeasured()
Measurable
isMeasured in interface Measurablepublic double getXMin()
Measurable
getXMin in interface Measurablepublic double getXMax()
Measurable
getXMax in interface Measurablepublic double getYMin()
Measurable
getYMin in interface Measurablepublic double getYMax()
Measurable
getYMax 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 -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||