|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--edu.davidson.tools.SApplet
|
+--galton.BallDrop
BallDrop is an 'applet' that manages a set of Ball objects that are falling through a set of pins. This serves as an example of double buffered animation and the use of Java as an educational tool. What can you learn from this Applet? Probably that there are several correct ways to do the same thing, and that this isn't one of them.
| Fields inherited from class edu.davidson.tools.SApplet |
clock, dataConnections, dataListeners, dataSources, lock |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
BallDrop()
|
|
| Method Summary | |
void |
destroy()
|
void |
forward()
Start clock. |
double |
getMean()
|
SApplet |
getOwner()
|
double |
getStDev()
|
double[][] |
getVariables()
|
java.lang.String[] |
getVarStrings()
|
void |
init()
The code that initializes the applet. |
boolean |
mouseDown(java.awt.Event e,
int x,
int y)
Stop the animation when the user clicks on the applet. |
void |
paint(java.awt.Graphics g)
Paint the next frame in the animation |
void |
pause()
Pause the clock. |
void |
reset()
Reset the clock to time=0. |
void |
run()
The thread has begun to run |
void |
setDefault()
Reset the clock to time=0. |
void |
setOwner(SApplet owner)
|
void |
setShowFunc(boolean value)
|
void |
start()
Begin the animation thread |
void |
stop()
Stop the tread |
void |
update(java.awt.Graphics g)
Just call paint() so that the background color isn't painted also |
| Methods inherited from class java.applet.Applet |
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
addNotify |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.davidson.tools.SDataSource |
getID |
| Constructor Detail |
public BallDrop()
| Method Detail |
public void destroy()
destroy in class SAppletpublic void forward()
SAppletforward in class SAppletpublic double getMean()
public SApplet getOwner()
getOwner in interface edu.davidson.tools.SDataSourcepublic double getStDev()
public double[][] getVariables()
getVariables in interface edu.davidson.tools.SDataSourcepublic java.lang.String[] getVarStrings()
getVarStrings in interface edu.davidson.tools.SDataSourcepublic void init()
init in class java.applet.Applet
public boolean mouseDown(java.awt.Event e,
int x,
int y)
mouseDown in class java.awt.Componentpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic void pause()
SAppletpause in class SAppletpublic void reset()
SAppletreset in class SAppletpublic void run()
run in interface java.lang.Runnablepublic void setDefault()
SAppletsetDefault in class SAppletpublic void setOwner(SApplet owner)
setOwner in interface edu.davidson.tools.SDataSourcepublic void setShowFunc(boolean value)
public void start()
start in class java.applet.Appletpublic void stop()
stop in class java.applet.Appletpublic void update(java.awt.Graphics g)
update in class java.awt.Container
|
Copyright Wolfgang Christian | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||