Class OpenTCSView

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jhotdraw.app.AbstractView
org.opentcs.guing.application.OpenTCSView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, org.jhotdraw.app.Disposable, org.jhotdraw.app.View, org.opentcs.guing.application.ComponentsManager, org.opentcs.guing.application.GuiManager, org.opentcs.guing.application.PluginPanelManager, org.opentcs.util.event.EventHandler

public class OpenTCSView
extends org.jhotdraw.app.AbstractView
implements org.opentcs.guing.application.GuiManager, org.opentcs.guing.application.ComponentsManager, org.opentcs.guing.application.PluginPanelManager, org.opentcs.util.event.EventHandler
Visualizes the driving course and other kernel objects as well as messages received by the kernel. (Contains everything underneath the tool bars.)
See Also:
Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from class javax.swing.JPanel

    javax.swing.JPanel.AccessibleJPanel

    Nested classes/interfaces inherited from class javax.swing.JComponent

    javax.swing.JComponent.AccessibleJComponent

    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 
    Modifier and Type Field Description
    static java.lang.String MODELNAME_PROPERTY
    Property key for the currently loaded driving course model.
    static java.lang.String NAME
    The name/title of this application.

    Fields inherited from class org.jhotdraw.app.AbstractView

    executor, preferences, uri

    Fields inherited from class javax.swing.JComponent

    listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW

    Fields inherited from class java.awt.Component

    accessibleContext, 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

    Fields inherited from interface org.jhotdraw.app.View

    APPLICATION_PROPERTY, ENABLED_PROPERTY, HAS_UNSAVED_CHANGES_PROPERTY, MULTIPLE_OPEN_ID_PROPERTY, SHOWING_PROPERTY, TITLE_PROPERTY, URI_PROPERTY
  • Constructor Summary

    Constructors 
    Constructor Description
    OpenTCSView​(org.opentcs.guing.application.ApplicationState appState, javax.swing.JFrame appFrame, org.opentcs.guing.application.ProgressIndicator progressIndicator, org.opentcs.access.SharedKernelServicePortalProvider portalProvider, ViewManagerModeling viewManager, org.opentcs.guing.components.drawing.OpenTCSDrawingEditor tcsDrawingEditor, ModelManagerModeling modelManager, org.opentcs.guing.application.StatusPanel statusPanel, org.opentcs.guing.util.PanelRegistry panelRegistry, org.opentcs.guing.util.ModelComponentFactory modelComponentFactory, org.opentcs.guing.util.UserMessageHelper userMessageHelper, DrawingViewFactory drawingViewFactory, UniqueNameGenerator modelCompNameGen, org.opentcs.thirdparty.jhotdraw.application.action.edit.UndoRedoManager undoRedoManager, org.opentcs.guing.components.tree.ComponentsTreeViewManager componentsTreeManager, org.opentcs.guing.components.tree.BlocksTreeViewManager blocksTreeManager, org.opentcs.guing.components.properties.SelectionPropertiesComponent propertiesComponent, org.opentcs.guing.components.tree.elements.UserObjectUtil userObjectUtil, javax.inject.Provider<ViewActionMap> actionMapProvider, javax.inject.Provider<ToolBarManager> toolBarManagerProvider, org.opentcs.guing.components.properties.panel.PropertiesPanelFactory propertiesPanelFactory, org.opentcs.util.event.EventBus eventBus, DockingManagerModeling dockingManager, org.opentcs.guing.components.dockable.DrawingViewFocusHandler drawingViewFocusHandler, org.opentcs.guing.components.layer.LayerManager layerManager, LayerEditorEventHandler layerEditorEventHandler)
    Creates a new instance.
  • Method Summary

    Modifier and Type Method Description
    void addBackgroundBitmap​(java.io.File file)
    Adds a background image to the currently active drawing view.
    bibliothek.gui.dock.common.DefaultSingleCDockable addDrawingView()
    Adds a new drawing view to the tabbed wrappingPanel.
    void addSelectedModelComponent​(org.opentcs.guing.model.ModelComponent modelComponent)  
    boolean canSaveTo​(java.net.URI file)  
    void clear()  
    void createEmptyModel()  
    org.opentcs.guing.model.ModelComponent createModelComponent​(java.lang.Class<? extends org.opentcs.guing.model.ModelComponent> clazz)  
    void downloadModelFromKernel()  
    void exportModel​(org.opentcs.components.plantoverview.PlantModelExporter exporter)  
    void figureSelected​(org.opentcs.guing.model.ModelComponent modelComponent)  
    java.net.URI getURI()  
    void importModel​(org.opentcs.components.plantoverview.PlantModelImporter importer)  
    void init()  
    void loadModel()  
    void onEvent​(java.lang.Object event)  
    void read​(java.net.URI f, org.jhotdraw.gui.URIChooser chooser)  
    void resetWindowArrangement()
    Restores the layout to default.
    java.util.List<org.opentcs.guing.components.tree.elements.UserObject> restoreModelComponents​(java.util.List<org.opentcs.guing.components.tree.elements.UserObject> userObjects)  
    boolean saveModel()  
    boolean saveModelAs()  
    void selectModelComponent​(org.opentcs.guing.model.ModelComponent modelComponent)  
    void showPluginPanel​(org.opentcs.components.plantoverview.PluggablePanelFactory factory, boolean visible)  
    void stop()  
    boolean treeComponentRemoved​(org.opentcs.guing.model.ModelComponent model)  
    void updateModelName()  
    boolean uploadModelToKernel()
    Uploads the current (local) model to the kernel.
    void write​(java.net.URI f, org.jhotdraw.gui.URIChooser chooser)  

    Methods inherited from class org.jhotdraw.app.AbstractView

    activate, addDisposable, deactivate, dispose, execute, getApplication, getComponent, getMultipleOpenId, getTitle, hasUnsavedChanges, isEmpty, isShowing, markChangesAsSaved, removeDisposable, setApplication, setHasUnsavedChanges, setMultipleOpenId, setShowing, setTitle, setURI, start

    Methods inherited from class javax.swing.JPanel

    getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI

    Methods inherited from class javax.swing.JComponent

    addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update

    Methods inherited from class java.awt.Container

    add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jhotdraw.app.View

    addPropertyChangeListener, getActionMap, isEnabled, removePropertyChangeListener, setActionMap, setEnabled
  • Field Details

    • NAME

      public static final java.lang.String NAME
      The name/title of this application.
    • MODELNAME_PROPERTY

      public static final java.lang.String MODELNAME_PROPERTY
      Property key for the currently loaded driving course model. The corresponding value contains a "*" if the model has been modified.
      See Also:
      Constant Field Values
  • Constructor Details

    • OpenTCSView

      @Inject public OpenTCSView​(org.opentcs.guing.application.ApplicationState appState, javax.swing.JFrame appFrame, org.opentcs.guing.application.ProgressIndicator progressIndicator, org.opentcs.access.SharedKernelServicePortalProvider portalProvider, ViewManagerModeling viewManager, org.opentcs.guing.components.drawing.OpenTCSDrawingEditor tcsDrawingEditor, ModelManagerModeling modelManager, org.opentcs.guing.application.StatusPanel statusPanel, org.opentcs.guing.util.PanelRegistry panelRegistry, org.opentcs.guing.util.ModelComponentFactory modelComponentFactory, org.opentcs.guing.util.UserMessageHelper userMessageHelper, DrawingViewFactory drawingViewFactory, UniqueNameGenerator modelCompNameGen, org.opentcs.thirdparty.jhotdraw.application.action.edit.UndoRedoManager undoRedoManager, org.opentcs.guing.components.tree.ComponentsTreeViewManager componentsTreeManager, org.opentcs.guing.components.tree.BlocksTreeViewManager blocksTreeManager, org.opentcs.guing.components.properties.SelectionPropertiesComponent propertiesComponent, org.opentcs.guing.components.tree.elements.UserObjectUtil userObjectUtil, javax.inject.Provider<ViewActionMap> actionMapProvider, javax.inject.Provider<ToolBarManager> toolBarManagerProvider, org.opentcs.guing.components.properties.panel.PropertiesPanelFactory propertiesPanelFactory, org.opentcs.util.event.EventBus eventBus, DockingManagerModeling dockingManager, org.opentcs.guing.components.dockable.DrawingViewFocusHandler drawingViewFocusHandler, org.opentcs.guing.components.layer.LayerManager layerManager, LayerEditorEventHandler layerEditorEventHandler)
      Creates a new instance.
      Parameters:
      appState - Provides/manages the application's current state.
      appFrame - The JFrame this view is wrapped in.
      progressIndicator - The progress indicator to be used.
      portalProvider - Provides a access to a portal.
      viewManager - The view manager to be used.
      tcsDrawingEditor - The drawing editor to be used.
      modelManager - The model manager to be used.
      statusPanel - The status panel to be used.
      panelRegistry - The plugin panel registry to be used.
      modelComponentFactory - The model component factory to be used.
      userMessageHelper - An UserMessageHelper
      drawingViewFactory - A factory for drawing views.
      modelCompNameGen - A generator for model components' names.
      undoRedoManager - Allows for undoing and redoing actions.
      componentsTreeManager - Manages the components tree view.
      blocksTreeManager - Manages the blocks tree view.
      propertiesComponent - Displays properties of the currently selected model component(s).
      userObjectUtil - A factory for UserObject instances.
      actionMapProvider - A provider for ActionMaps.
      toolBarManagerProvider - A provider for the tool bar manager.
      propertiesPanelFactory - A factory for properties-related panels.
      eventBus - The application's event bus.
      dockingManager - Manages docking frames.
      drawingViewFocusHandler - Handles focussing of dockables.
      layerManager - The layer manager.
      layerEditorEventHandler - Handles drawing editor events that the layer editor needs to know about.
  • Method Details

    • init

      public void init()
      Specified by:
      init in interface org.jhotdraw.app.View
      Overrides:
      init in class org.jhotdraw.app.AbstractView
    • stop

      public void stop()
      Specified by:
      stop in interface org.jhotdraw.app.View
      Overrides:
      stop in class org.jhotdraw.app.AbstractView
    • clear

      public void clear()
      Specified by:
      clear in interface org.jhotdraw.app.View
    • onEvent

      public void onEvent​(java.lang.Object event)
      Specified by:
      onEvent in interface org.opentcs.util.event.EventHandler
    • showPluginPanel

      public void showPluginPanel​(org.opentcs.components.plantoverview.PluggablePanelFactory factory, boolean visible)
      Specified by:
      showPluginPanel in interface org.opentcs.guing.application.PluginPanelManager
    • addDrawingView

      public bibliothek.gui.dock.common.DefaultSingleCDockable addDrawingView()
      Adds a new drawing view to the tabbed wrappingPanel.
      Returns:
      The newly created Dockable.
    • resetWindowArrangement

      public void resetWindowArrangement()
      Restores the layout to default.
    • createEmptyModel

      public void createEmptyModel()
      Specified by:
      createEmptyModel in interface org.opentcs.guing.application.GuiManager
    • downloadModelFromKernel

      public void downloadModelFromKernel()
    • updateModelName

      public void updateModelName()
    • addBackgroundBitmap

      public void addBackgroundBitmap​(java.io.File file)
      Adds a background image to the currently active drawing view.
      Parameters:
      file - The file with the image.
    • restoreModelComponents

      public java.util.List<org.opentcs.guing.components.tree.elements.UserObject> restoreModelComponents​(java.util.List<org.opentcs.guing.components.tree.elements.UserObject> userObjects)
      Specified by:
      restoreModelComponents in interface org.opentcs.guing.application.ComponentsManager
    • write

      public void write​(java.net.URI f, org.jhotdraw.gui.URIChooser chooser) throws java.io.IOException
      Specified by:
      write in interface org.jhotdraw.app.View
      Throws:
      java.io.IOException
    • read

      public void read​(java.net.URI f, org.jhotdraw.gui.URIChooser chooser) throws java.io.IOException
      Specified by:
      read in interface org.jhotdraw.app.View
      Throws:
      java.io.IOException
    • canSaveTo

      public boolean canSaveTo​(java.net.URI file)
      Specified by:
      canSaveTo in interface org.jhotdraw.app.View
      Overrides:
      canSaveTo in class org.jhotdraw.app.AbstractView
    • getURI

      public java.net.URI getURI()
      Specified by:
      getURI in interface org.jhotdraw.app.View
      Overrides:
      getURI in class org.jhotdraw.app.AbstractView
    • selectModelComponent

      public void selectModelComponent​(org.opentcs.guing.model.ModelComponent modelComponent)
      Specified by:
      selectModelComponent in interface org.opentcs.guing.application.GuiManager
    • addSelectedModelComponent

      public void addSelectedModelComponent​(org.opentcs.guing.model.ModelComponent modelComponent)
      Specified by:
      addSelectedModelComponent in interface org.opentcs.guing.application.GuiManager
    • treeComponentRemoved

      public boolean treeComponentRemoved​(org.opentcs.guing.model.ModelComponent model)
      Specified by:
      treeComponentRemoved in interface org.opentcs.guing.application.GuiManager
    • figureSelected

      public void figureSelected​(org.opentcs.guing.model.ModelComponent modelComponent)
      Specified by:
      figureSelected in interface org.opentcs.guing.application.GuiManager
    • loadModel

      public void loadModel()
      Specified by:
      loadModel in interface org.opentcs.guing.application.GuiManager
    • importModel

      public void importModel​(org.opentcs.components.plantoverview.PlantModelImporter importer)
      Specified by:
      importModel in interface org.opentcs.guing.application.GuiManager
    • uploadModelToKernel

      public boolean uploadModelToKernel()
      Uploads the current (local) model to the kernel.
      Returns:
      Whether the model was actually uploaded.
    • saveModel

      public boolean saveModel()
      Specified by:
      saveModel in interface org.opentcs.guing.application.GuiManager
    • saveModelAs

      public boolean saveModelAs()
      Specified by:
      saveModelAs in interface org.opentcs.guing.application.GuiManager
    • exportModel

      public void exportModel​(org.opentcs.components.plantoverview.PlantModelExporter exporter)
      Specified by:
      exportModel in interface org.opentcs.guing.application.GuiManager
    • createModelComponent

      public org.opentcs.guing.model.ModelComponent createModelComponent​(java.lang.Class<? extends org.opentcs.guing.model.ModelComponent> clazz)
      Specified by:
      createModelComponent in interface org.opentcs.guing.application.GuiManager