|
||||||||||
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
javax.swing.JApplet
objectdraw.Controller
Controller is a Swing compatible class designed to be extended to produce programs that employ a GUI but do not include graphics displayed in a DrawingCanvas. To write such a program, a programmer should extend this class defining a begin method that performs initialization, including constructing the programs GUI, appropriate instance variable, and any private methods needed to simplify the definition of the begin method or to handle GUI events.
AWTController
,
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 | |
Controller()
|
Method Summary | |
void |
begin()
Programs written by extending Controller can perform any required initialization by defining a begin method containing the code to perform the initialization steps. |
void |
destroy()
This predefined method is invoked by the appletviewer or web browser running a program that extends Controller when the program's execution is complete. |
java.applet.AudioClip |
getAudio(java.lang.String path)
Retrieves an audio file |
java.awt.Image |
getImage(java.lang.String path)
Retrieves an image. |
static double |
getTime()
Deprecated. Use System.currentTimeMillis() instead |
static java.lang.String |
getVersion()
Determine the version of the objectdraw library being used. |
void |
init()
This predefined method is invoked by the applet viewer or web browser used to run a program that extends Controller to initiate the execution of the program. |
void |
placeInFrame(int width,
int height)
Associate of this controller with an independent window. |
void |
resize(int width,
int height)
Resize the window in which this controller is running (if possible) |
void |
start()
This predefined method is invoked by the appletviewer or web browser running a program that extends Controller when the program should commence or resume active execution. |
void |
startController()
Run this controller in an independent window of default size. |
void |
startController(int width,
int height)
Run this controller in an independent window of the specified size. |
void |
stop()
This predefined method is invoked by the appletviewer or web browser running a program that extends Controller when the program should cease active execution. |
Methods inherited from class javax.swing.JApplet |
getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update |
Methods inherited from class java.applet.Applet |
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, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, 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 Controller()
Method Detail |
public static java.lang.String getVersion()
public final void init()
public void begin()
public java.awt.Image getImage(java.lang.String path)
path
- the file path name or URL of the desired image.
public java.applet.AudioClip getAudio(java.lang.String path)
path
- the file path name or URL of the desired audio file
public static double getTime()
public final void start()
public final void stop()
start
method. The stop method ensures that all ActiveObjects that have been created
by the program are notified that the program has been suspended.
Programmers extending this class should not include their
own definition of stop.
public final void destroy()
public void placeInFrame(int width, int height)
width
- the width of the desired windowheight
- the height of the desired windowpublic void startController(int width, int height)
width
- the width of the desired windowheight
- the height of the desired windowpublic void startController()
public void resize(int width, int height)
width
- the new width for the windowheight
- the new height for the window
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |