|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Drawable
panel
- the drawing panelg
- the graphics contextpublic 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 Interactive
panel
- DrawingPanelxpix
- intypix
- int
public boolean isMeasured()
Measurable
isMeasured
in interface Measurable
public double getXMin()
Measurable
getXMin
in interface Measurable
public double getXMax()
Measurable
getXMax
in interface Measurable
public double getYMin()
Measurable
getYMin
in interface Measurable
public double getYMax()
Measurable
getYMax
in interface Measurable
public double getX()
getX
in interface Interactive
public void setX(double _x)
setX
in interface Interactive
_x
- public double getY()
getY
in interface Interactive
public 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 |