org.jscience.architecture.traffic.edit
Class EditController

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by org.jscience.architecture.traffic.Controller
                      extended by org.jscience.architecture.traffic.edit.EditController
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, XMLSerializable

public class EditController
extends Controller

The main controller for the editor part of the application.

See Also:
Serialized Form

Nested Class Summary
protected  class EditController.MousePosListener
          Shows the mouse position in the status bar.
 
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
 
Fields inherited from class org.jscience.architecture.traffic.Controller
configDialog, currentFilename, currentSelection, currentTool, helpViewer, mainController, model, settings, statusBar, toolBar, toolPanel, view, viewScroller
 
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
EditController(EditModel m, boolean splash)
          Creates the main frame
 
Method Summary
protected  java.lang.String appName()
          DOCUMENT ME!
protected  java.awt.MenuBar createMenuBar()
          Creates the menubar for the editor
protected  TrafficToolBar createToolBar()
          Creates the toolbar for the editor
 void deleteSelection()
          Removes all objects from the infrastructure that are currently selected
 void deselectAll()
          Empties the current selection (deselects)
protected  void disableGrid()
          DOCUMENT ME!
protected  void doLoad(java.lang.String filename)
          DOCUMENT ME!
protected  void doSave(java.lang.String filename)
          DOCUMENT ME!
protected  void enableGrid()
          DOCUMENT ME!
 java.lang.String getCurrentFilename()
          Returns the current infrastructure's filename
 EditModel getEditModel()
          Returns the current EditModel
 java.awt.PopupMenu getPopupMenuFor(Selectable obj)
          Creates a right-click popup-menu for the givens object
 XMLElement saveSelf()
          DOCUMENT ME!
 void selectAll()
          Selects all objects in the infrastructure
 void setEditModel(EditModel m)
          Sets the current EditModel
 void showChangeSizeDialog()
          Shows the change size dialog
 void showFilePropertiesDialog()
          Shows the file properties dialog
 
Methods inherited from class org.jscience.architecture.traffic.Controller
changeTool, getConfigDialog, getCurrentSelection, getCurrentTool, getMainController, getModel, getStatus, getToolPanel, getView, getViewScroller, getXMLName, isViewEnabled, load, loadAll, newFile, newInfrastructure, openFile, quit, reportError, resizeComponents, saveAll, saveChilds, saveFile, saveFileAs, setConfigDialog, setCurrentFilename, setCurrentSelection, setCurrentTool, setMainController, setParentName, setStatus, setToolPanel, setViewEnabled, showConfigDialog, showError, showHelp, showSaveAsDialog, showSettings, switchConfigDialog, tryLoad, trySave, validateInfra, zoomChanged, zoomIn, zoomOut, zoomTo
 
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
 

Constructor Detail

EditController

public EditController(EditModel m,
                      boolean splash)
Creates the main frame

Parameters:
m - The program can't run without this =]
splash - DOCUMENT ME!
Method Detail

getEditModel

public EditModel getEditModel()
Returns the current EditModel

Returns:
DOCUMENT ME!

setEditModel

public void setEditModel(EditModel m)
Sets the current EditModel

Parameters:
m - DOCUMENT ME!

getCurrentFilename

public java.lang.String getCurrentFilename()
Returns the current infrastructure's filename

Returns:
DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
Description copied from class: Controller
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Overrides:
saveSelf in class Controller
Returns:
DOCUMENT ME!
Throws:
XMLCannotSaveException - DOCUMENT ME!

doSave

protected void doSave(java.lang.String filename)
               throws InvalidFilenameException,
                      java.lang.Exception
DOCUMENT ME!

Specified by:
doSave in class Controller
Parameters:
filename - DOCUMENT ME!
Throws:
InvalidFilenameException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!

doLoad

protected void doLoad(java.lang.String filename)
               throws InvalidFilenameException,
                      java.lang.Exception
DOCUMENT ME!

Specified by:
doLoad in class Controller
Parameters:
filename - DOCUMENT ME!
Throws:
InvalidFilenameException - DOCUMENT ME!
java.lang.Exception - DOCUMENT ME!

appName

protected java.lang.String appName()
Description copied from class: Controller
DOCUMENT ME!

Specified by:
appName in class Controller
Returns:
DOCUMENT ME!

enableGrid

protected void enableGrid()
DOCUMENT ME!


disableGrid

protected void disableGrid()
DOCUMENT ME!


createMenuBar

protected java.awt.MenuBar createMenuBar()
Creates the menubar for the editor

Specified by:
createMenuBar in class Controller
Returns:
DOCUMENT ME!

createToolBar

protected TrafficToolBar createToolBar()
Creates the toolbar for the editor

Specified by:
createToolBar in class Controller
Returns:
DOCUMENT ME!

getPopupMenuFor

public java.awt.PopupMenu getPopupMenuFor(Selectable obj)
                                   throws PopupException
Creates a right-click popup-menu for the givens object

Specified by:
getPopupMenuFor in class Controller
Parameters:
obj - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
PopupException - DOCUMENT ME!

showFilePropertiesDialog

public void showFilePropertiesDialog()
Shows the file properties dialog

Specified by:
showFilePropertiesDialog in class Controller

showChangeSizeDialog

public void showChangeSizeDialog()
Shows the change size dialog


deleteSelection

public void deleteSelection()
Removes all objects from the infrastructure that are currently selected


selectAll

public void selectAll()
Selects all objects in the infrastructure


deselectAll

public void deselectAll()
Empties the current selection (deselects)