|
||||||||||
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
ballwar.controller.BallControl
public class BallControl
The "Controller" in a Model-View-Controller architecture Sets up the appropriate wiring between the model and the view.
Nested Class Summary | |
---|---|
(package private) static interface |
BallControl.IPaintFac
An abstract factory used for manufacturing paint strategies. |
(package private) static interface |
BallControl.IStrategyFac
An abstract factory used for manufacturing strategies. |
Nested classes/interfaces inherited from class javax.swing.JApplet |
---|
JApplet.AccessibleJApplet |
Nested classes/interfaces inherited from class java.applet.Applet |
---|
Applet.AccessibleApplet |
Nested classes/interfaces inherited from class java.awt.Panel |
---|
Panel.AccessibleAWTPanel |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
private OptionPanel |
_keysPnl
An OptionPanel used to display the movement keys. |
private BallModel |
_model
The system's model. |
private BallGUI |
_view
The system's view (GUI). |
private WindowListener |
_windowListener
The window listener used by the view when the window is closed. |
private static long |
serialVersionUID
|
Fields inherited from class javax.swing.JApplet |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
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 | |
---|---|
BallControl()
Constructor for the BallControl class Used when run as an applet. |
|
BallControl(WindowListener wl)
Constructor for the BallControl class Used when run as an application. |
Method Summary | |
---|---|
private String |
fixName(String packageName,
Object classname,
String restOfName)
Convenience method to add the rest of a strategy's classname plus the word "Strategy" at the end of the classname. |
void |
init()
Initializes the system by instantiating the view and the model and all the necessary adapters. |
static void |
main(String[] args)
Entry point to the program. |
void |
start()
Starts the systems running by validating the view and setting to be visible and starting the model. |
Methods inherited from class javax.swing.JApplet |
---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.applet.Applet |
---|
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, stop |
Methods inherited from class java.awt.Panel |
---|
addNotify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private BallGUI _view
private WindowListener _windowListener
private BallModel _model
private OptionPanel _keysPnl
Constructor Detail |
---|
public BallControl()
public BallControl(WindowListener wl)
wl
- WindowListener that should call System.exit(0)Method Detail |
---|
public void init()
init
in class Applet
public void start()
start
in class Applet
private String fixName(String packageName, Object classname, String restOfName)
classname
- The classname, assuming that it is in the
ballwar.model.strategy package and ends with the word
"Strategy".
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |