|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--Spirograph.DotPanel
This class keeps track of the coordinates of the Dot. It has a seperate Thread to update the "state" of the two coordinates and to repaint itself. It also handles the dot bouncing off either the walls of the square or the circle. It also keeps track of all of the gravity points and all of the places where the dot has been before and draw them in.
Copyright (C) 1998 Massachusetts Institute of Technology.
Coord
,
Spirograph
,
AccelHandler
, Serialized FormFields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
DotPanel(Coord x,
Coord y)
|
Method Summary | |
void |
addGrav(int x,
int y)
|
int |
curHeight()
|
int |
curWidth()
|
void |
flushGrav()
|
void |
flushLines()
|
boolean |
getBounce()
|
boolean |
getCirc()
|
double |
getMaxX()
|
double |
getMaxY()
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
boolean |
getWrap()
|
boolean |
inEllipse()
This is called by the AdvArg to see whether or not the ball is in the circle. |
void |
paint(java.awt.Graphics out)
|
void |
paintBuf()
This method paints an off-screen image to be used for the double buffering. It adds the balls current position to the vector of Points, then reconstructs the balls path from the Points. |
void |
run()
|
void |
setBounce(boolean bounceOn)
|
void |
setCirc(boolean circMode)
|
void |
setMode(int mode)
|
void |
setSize(int width,
int height)
Called by the DotFrame whenever the DotFrame is resized |
void |
setWrap(boolean wrapOn)
|
Methods inherited from class java.awt.Canvas |
addNotify |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
contains,
createImage,
createImage,
deliverEvent,
disable,
disableEvents,
dispatchEvent,
doLayout,
enable,
enable,
enableEvents,
enableInputMethods,
firePropertyChange,
getAlignmentX,
getAlignmentY,
getBackground,
getBounds,
getBounds,
getColorModel,
getComponentAt,
getComponentAt,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getGraphics,
getHeight,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocation,
getLocationOnScreen,
getMaximumSize,
getName,
getParent,
getPeer,
getSize,
getSize,
getToolkit,
getTreeLock,
getWidth,
getX,
getY,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
invalidate,
isDisplayable,
isDoubleBuffered,
isEnabled,
isFocusTraversable,
isLightweight,
isOpaque,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
layout,
list,
list,
list,
list,
list,
locate,
location,
lostFocus,
minimumSize,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
paramString,
postEvent,
preferredSize,
prepareImage,
prepareImage,
print,
printAll,
processComponentEvent,
processEvent,
processFocusEvent,
processInputMethodEvent,
processKeyEvent,
processMouseEvent,
processMouseMotionEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
repaint,
requestFocus,
reshape,
resize,
resize,
setBackground,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setEnabled,
setFont,
setForeground,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setVisible,
show,
show,
size,
toString,
transferFocus,
update,
validate |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public DotPanel(Coord x, Coord y)
Method Detail |
public void setMode(int mode)
public java.awt.Dimension getPreferredSize()
public java.awt.Dimension getMinimumSize()
public double getMaxX()
public double getMaxY()
public void run()
public boolean inEllipse()
public void paintBuf()
It adds the balls current position to the vector of Points, then reconstructs the balls path from the Points.
public void paint(java.awt.Graphics out)
public void setSize(int width, int height)
public void flushLines()
public void flushGrav()
public void addGrav(int x, int y)
public void setCirc(boolean circMode)
public boolean getCirc()
public int curHeight()
public int curWidth()
public boolean getBounce()
public void setBounce(boolean bounceOn)
public boolean getWrap()
public void setWrap(boolean wrapOn)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |