|
|||||||||
| 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.Window
java.awt.Frame
org.jscience.architecture.traffic.Controller
public abstract class Controller
The main controller of the application . It starts the user interface and takes care of interaction with the user.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
java.awt.Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected ConfigDialog |
configDialog
The configuration dialog |
protected java.lang.String |
currentFilename
The name of the currently opened file, as used by 'Save' |
protected Selection |
currentSelection
The current selection on the main view |
protected Tool |
currentTool
The currently selected tool |
protected static HelpViewer |
helpViewer
Provides the online help system. |
protected static Controller |
mainController
The controller that started the app |
protected Model |
model
The Model (needed to change its observers) |
protected Settings |
settings
The current settings |
protected java.awt.Label |
statusBar
The statusbar (positioned at the bottom of the frame) |
protected TrafficToolBar |
toolBar
The toolbar of this controller |
protected java.awt.Panel |
toolPanel
DOCUMENT ME! |
protected MainView |
view
The MainView showing the model, controlled by this Controller |
protected ViewScroller |
viewScroller
ViewScroller that holds the view |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| 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(Model m,
boolean splash)
Constructs a new Controller. |
|
| Method Summary | |
|---|---|
protected abstract java.lang.String |
appName()
DOCUMENT ME! |
void |
changeTool(Tool t)
Changes the current tool |
protected abstract java.awt.MenuBar |
createMenuBar()
DOCUMENT ME! |
protected abstract TrafficToolBar |
createToolBar()
DOCUMENT ME! |
protected abstract void |
doLoad(java.lang.String filename)
Load state from disk. |
protected abstract void |
doSave(java.lang.String filename)
Save the current state to disk. |
ConfigDialog |
getConfigDialog()
Returns the configuration dialog |
Selection |
getCurrentSelection()
Returns the current selection |
Tool |
getCurrentTool()
Returns the current tool |
static Controller |
getMainController()
Returns the main controller |
Model |
getModel()
Returns the current model |
abstract java.awt.PopupMenu |
getPopupMenuFor(Selectable obj)
DOCUMENT ME! |
java.lang.String |
getStatus()
Returns the text on the status bar |
java.awt.Panel |
getToolPanel()
Returns the current tool panel |
View |
getView()
Returns the current View |
ViewScroller |
getViewScroller()
Returns the container of the view |
java.lang.String |
getXMLName()
DOCUMENT ME! |
boolean |
isViewEnabled()
Returns true if the view is currently enabled |
void |
load(XMLElement myElement,
XMLLoader loader)
Load this XMLSerializable |
protected void |
loadAll(XMLLoader loader,
Model model)
Loads a model,the current view and the current controller from a XMLLoader |
void |
newFile()
|
void |
newInfrastructure(Infrastructure infra)
Set a new infrastructure |
void |
openFile()
User wants to load a file |
void |
quit()
User wants to quit |
static void |
reportError(java.lang.Throwable e)
Reports unsuspected errors |
protected void |
resizeComponents()
Resizes all Components in the frame to make them
all fit. |
protected void |
saveAll(XMLSaver saver,
Model model)
Saves a model,the current view and the current controller to a XMLSaver |
void |
saveChilds(XMLSaver saver)
DOCUMENT ME! |
void |
saveFile()
User wants to save |
void |
saveFileAs()
User wants to save file as... |
XMLElement |
saveSelf()
DOCUMENT ME! |
void |
setConfigDialog(ConfigDialog cd)
Sets the configuration dialog |
void |
setCurrentFilename(java.lang.String name)
Sets name to be the currently opened file. |
void |
setCurrentSelection(Selection s)
Sets thec current selection |
void |
setCurrentTool(Tool t)
Sets the current tool |
static void |
setMainController(Controller c)
Sets the main controller |
void |
setParentName(java.lang.String parentName)
DOCUMENT ME! |
void |
setStatus(java.lang.String s)
Sets the text on the status bar |
void |
setToolPanel(java.awt.Panel p)
Sets the current tool panel |
void |
setViewEnabled(boolean b)
Sets visibility of View |
void |
showConfigDialog()
Shows the configuration dialog |
void |
showError(java.lang.String msg)
Shows an error dialog. |
abstract void |
showFilePropertiesDialog()
DOCUMENT ME! |
void |
showHelp(int helpItem)
Opens a help HTML-page. |
protected java.lang.String |
showSaveAsDialog()
Shows the 'Save as...' dialog and returns the filename chosen |
void |
showSettings()
Shows the configuration dialog with the general panel. |
void |
switchConfigDialog()
Shows the configuration dialog if it is hidden, hides it, if it is currently showing |
protected void |
tryLoad(java.lang.String filename)
Try to load a file, process exceptions |
protected void |
trySave(java.lang.String filename)
Try to save file , process exceptions |
boolean |
validateInfra()
Runs the validator on the current infrastructure |
protected void |
zoomChanged()
DOCUMENT ME! |
void |
zoomIn(java.awt.Point p)
Zooms the main view one step in |
void |
zoomOut(java.awt.Point p)
Zooms the main view one step out |
void |
zoomTo(int index)
Zooms the main view to the specified zoom factor index |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
protected static HelpViewer helpViewer
protected static Controller mainController
protected Model model
protected MainView view
protected ViewScroller viewScroller
protected TrafficToolBar toolBar
protected java.awt.Panel toolPanel
protected java.awt.Label statusBar
protected Settings settings
protected Tool currentTool
protected java.lang.String currentFilename
protected Selection currentSelection
protected ConfigDialog configDialog
| Constructor Detail |
|---|
public Controller(Model m,
boolean splash)
m - The Model to control.splash - DOCUMENT ME!| Method Detail |
|---|
public ConfigDialog getConfigDialog()
public void setConfigDialog(ConfigDialog cd)
cd - DOCUMENT ME!public static Controller getMainController()
public static void setMainController(Controller c)
c - DOCUMENT ME!public java.awt.Panel getToolPanel()
public void setToolPanel(java.awt.Panel p)
p - DOCUMENT ME!public Selection getCurrentSelection()
public void setCurrentSelection(Selection s)
s - DOCUMENT ME!public Tool getCurrentTool()
public Model getModel()
public void setCurrentTool(Tool t)
t - DOCUMENT ME!public View getView()
View
public ViewScroller getViewScroller()
public java.lang.String getStatus()
public void setStatus(java.lang.String s)
s - DOCUMENT ME!public void setViewEnabled(boolean b)
b - DOCUMENT ME!public boolean isViewEnabled()
public void setCurrentFilename(java.lang.String name)
name - DOCUMENT ME!public void quit()
protected void resizeComponents()
Components in the frame to make them
all fit.
public void showError(java.lang.String msg)
msg - The message to be shown.public void showHelp(int helpItem)
helpItem - The specified item to be opened. (One of defined
'HelpViewer.HELP_xxx' constants.)public void switchConfigDialog()
public void showConfigDialog()
public void showSettings()
public static void reportError(java.lang.Throwable e)
e - DOCUMENT ME!public void zoomTo(int index)
index - DOCUMENT ME!public void zoomIn(java.awt.Point p)
p - DOCUMENT ME!public void zoomOut(java.awt.Point p)
p - The Point to be centered at after zoom outprotected void zoomChanged()
public boolean validateInfra()
public void newInfrastructure(Infrastructure infra)
infra - DOCUMENT ME!public void changeTool(Tool t)
t - DOCUMENT ME!public void newFile()
public void openFile()
public void saveFileAs()
public void saveFile()
protected void tryLoad(java.lang.String filename)
filename - The name of the file to load fromprotected void trySave(java.lang.String filename)
filename - The name of the file to save toprotected java.lang.String showSaveAsDialog()
protected abstract void doLoad(java.lang.String filename)
throws InvalidFilenameException,
java.lang.Exception
filename - DOCUMENT ME!
InvalidFilenameException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!
protected abstract void doSave(java.lang.String filename)
throws InvalidFilenameException,
java.lang.Exception
filename - DOCUMENT ME!
InvalidFilenameException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!
protected void loadAll(XMLLoader loader,
Model model)
throws java.io.IOException,
XMLTreeException,
XMLInvalidInputException
loader - The loader to load everything frommodel - The model to load
java.io.IOException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!
protected void saveAll(XMLSaver saver,
Model model)
throws java.io.IOException,
XMLTreeException,
XMLCannotSaveException
saver - The XMLSaver to save everything tomodel - The model to save
java.io.IOException - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!
public void load(XMLElement myElement,
XMLLoader loader)
throws XMLTreeException,
java.io.IOException,
XMLInvalidInputException
XMLSerializable
load in interface XMLSerializablemyElement - The XMLElement which represents this object in the XML
tree. It can contain attributes which hold information about the
object.loader - The XMLLoader which this XMLSerializable can use to load
child objects.
XMLTreeException - The parser can throw this exception if it is
called by the XMLSerializable. The XMLSerializable should NOT
throw this exception by itself and preferrably not catch it
too.
java.io.IOException - Thrown in case of an read error in the XML file.
XMLInvalidInputException - The XMLSerializable can throw this
exception if it cannot load itself or one of its child objects
for whatever reason.
public XMLElement saveSelf()
throws XMLCannotSaveException
saveSelf in interface XMLSerializableXMLCannotSaveException - DOCUMENT ME!
public void saveChilds(XMLSaver saver)
throws XMLTreeException,
java.io.IOException,
XMLCannotSaveException
saveChilds in interface XMLSerializablesaver - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!public java.lang.String getXMLName()
getXMLName in interface XMLSerializable
public void setParentName(java.lang.String parentName)
throws XMLTreeException
setParentName in interface XMLSerializableparentName - DOCUMENT ME!
XMLTreeException - DOCUMENT ME!protected abstract java.lang.String appName()
public abstract void showFilePropertiesDialog()
public abstract java.awt.PopupMenu getPopupMenuFor(Selectable obj)
throws PopupException
obj - DOCUMENT ME!
PopupException - DOCUMENT ME!protected abstract TrafficToolBar createToolBar()
protected abstract java.awt.MenuBar createMenuBar()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||