|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
objectdraw.AWTController
objectdraw.AWTWindowController
AWTWindowController is an AWT compatible class designed to be extended to produce programs that handle simple mouse events and draw graphics in a single window on the screen. In a program written by extending this class, the instructions to be executed in response to various mouse events are placed in the bodies of the methods onMousePress, onMouseRelease, onMouseClick, onMouseMove, onMouseDrag, onMouseEnter, and onMouseExit. Each of these methods is passed a Location describing the location of the mouse at the time of the event. As in the AWTController class, initialization code can be placed in the body of the definition of a begin method. Throughout the definition of a class that extends AWTWindowController, the name "canvas" can be used to refer to the program's DrawingCanvas.
AWTController
,
AWTFrameWindowController
,
WindowController
,
Serialized FormField Summary |
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 | |
AWTWindowController()
|
Method Summary | |
void |
begin()
Programs written by extending AWTController can perform any required initialization by defining a begin method containing the code to perform the initialization steps. |
void |
init()
Initializes the program by creating a window containing a canvas and invoking the user supplied begin method. |
void |
onMouseClick(Location point)
Invoked when the mouse has been clicked on the WindowController's canvas. |
void |
onMouseDrag(Location point)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
onMouseEnter(Location point)
Invoked when the mouse enters the WindowController's canvas. |
void |
onMouseExit(Location point)
Invoked when the mouse exits the WindowController's canvas. |
void |
onMouseMove(Location point)
Invoked when the mouse button has been moved on the WindowController's canvas (with no buttons depressed). |
void |
onMousePress(Location point)
Invoked when a mouse button has been pressed on the WindowController's canvas. |
void |
onMouseRelease(Location point)
Invoked when a mouse button has been released on the WindowController's canvas. |
Methods inherited from class objectdraw.AWTController |
destroy, getImage, getTime, placeInFrame, resize, start, startController, startController, stop |
Methods inherited from class java.applet.Applet |
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, setStub, showStatus |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AWTWindowController()
Method Detail |
public void init()
init
in class AWTController
public void begin()
AWTController
begin
in class AWTController
public void onMouseClick(Location point)
point
- the point the mouse clicked onpublic void onMousePress(Location point)
point
- the point the mouse pressed onpublic void onMouseRelease(Location point)
point
- the point the mouse released onpublic void onMouseEnter(Location point)
point
- the point the mouse enterspublic void onMouseExit(Location point)
point
- the point the mouse exitspublic void onMouseDrag(Location point)
point
- the point the mouse dragspublic void onMouseMove(Location point)
point
- the point the mouse moves
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |