|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.display.DrawableBuffer
public class DrawableBuffer
A DrawableBuffer contains an image of drawable objects. This image is displayed on a drawing panel whenever when the draw method is invoked. A drawble buffer should be used to render complex drawable objects that change infrequently. Use the updateImage method to generate a new image when the properties of the drawable objects change.
| Constructor Summary | |
|---|---|
DrawableBuffer()
Constructor DrawableBuffer |
|
DrawableBuffer(Drawable drawable)
Constructor DrawableBuffer |
|
| Method Summary | |
|---|---|
void |
addDrawable(Drawable drawable)
Adds a drawable object to the drawing buffer. |
void |
clear()
Remove all drawable objects from the drawing buffer. |
void |
draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
Method draw |
double |
getXMax()
Method getXMax |
double |
getXMin()
Method getXMin |
double |
getYMax()
Method getYMax |
double |
getYMin()
Method getYMin |
void |
invalidateImage()
Invalidates the image so that it is redrawn during the next repaint operation. |
boolean |
isMeasured()
Tests to see if the buffer has an object with a valid measure. |
boolean |
isVisible()
Reads the visible flag. |
void |
setBackground(java.awt.Color color)
Method setBackground |
void |
setVisible(boolean vis)
Sets the bufferrer's visible flag. |
void |
updateImage(DrawingPanel drawingPanel)
Updates the image using the given drawing panel to set the dimension. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DrawableBuffer()
public DrawableBuffer(Drawable drawable)
drawable - | Method Detail |
|---|
public void addDrawable(Drawable drawable)
drawable - public void setBackground(java.awt.Color color)
color - public void setVisible(boolean vis)
vis - booleanpublic boolean isVisible()
public void clear()
public void invalidateImage()
public void updateImage(DrawingPanel drawingPanel)
drawingPanel -
public void draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
draw in interface DrawabledrawingPanel - g - public double getXMin()
getXMin in interface Measurablepublic double getXMax()
getXMax in interface Measurablepublic double getYMin()
getYMin in interface Measurablepublic double getYMax()
getYMax in interface Measurablepublic boolean isMeasured()
isMeasured in interface Measurable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||