Package org.opentcs.guing.application
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.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMODELNAME_PROPERTYProperty key for the currently loaded driving course model.static java.lang.StringNAMEThe name/title of this application.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_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT -
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 voidaddBackgroundBitmap(java.io.File file)Adds a background image to the currently active drawing view.bibliothek.gui.dock.common.DefaultSingleCDockableaddDrawingView()Adds a new drawing view to the tabbed wrappingPanel.voidaddSelectedModelComponent(org.opentcs.guing.model.ModelComponent modelComponent)booleancanSaveTo(java.net.URI file)voidclear()voidcreateEmptyModel()org.opentcs.guing.model.ModelComponentcreateModelComponent(java.lang.Class<? extends org.opentcs.guing.model.ModelComponent> clazz)voiddownloadModelFromKernel()voidexportModel(org.opentcs.components.plantoverview.PlantModelExporter exporter)voidfigureSelected(org.opentcs.guing.model.ModelComponent modelComponent)java.net.URIgetURI()voidimportModel(org.opentcs.components.plantoverview.PlantModelImporter importer)voidinit()voidloadModel()voidonEvent(java.lang.Object event)voidread(java.net.URI f, org.jhotdraw.gui.URIChooser chooser)voidresetWindowArrangement()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)booleansaveModel()booleansaveModelAs()voidselectModelComponent(org.opentcs.guing.model.ModelComponent modelComponent)voidshowPluginPanel(org.opentcs.components.plantoverview.PluggablePanelFactory factory, boolean visible)voidstop()booleantreeComponentRemoved(org.opentcs.guing.model.ModelComponent model)voidupdateModelName()booleanuploadModelToKernel()Uploads the current (local) model to the kernel.voidwrite(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, startMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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
-
Field Details
-
NAME
public static final java.lang.String NAMEThe name/title of this application. -
MODELNAME_PROPERTY
public static final java.lang.String MODELNAME_PROPERTYProperty 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- TheJFramethis 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 UserMessageHelperdrawingViewFactory- 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:
initin interfaceorg.jhotdraw.app.View- Overrides:
initin classorg.jhotdraw.app.AbstractView
-
stop
public void stop()- Specified by:
stopin interfaceorg.jhotdraw.app.View- Overrides:
stopin classorg.jhotdraw.app.AbstractView
-
clear
public void clear()- Specified by:
clearin interfaceorg.jhotdraw.app.View
-
onEvent
public void onEvent(java.lang.Object event)- Specified by:
onEventin interfaceorg.opentcs.util.event.EventHandler
-
showPluginPanel
public void showPluginPanel(org.opentcs.components.plantoverview.PluggablePanelFactory factory, boolean visible)- Specified by:
showPluginPanelin interfaceorg.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:
createEmptyModelin interfaceorg.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:
restoreModelComponentsin interfaceorg.opentcs.guing.application.ComponentsManager
-
write
public void write(java.net.URI f, org.jhotdraw.gui.URIChooser chooser) throws java.io.IOException- Specified by:
writein interfaceorg.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:
readin interfaceorg.jhotdraw.app.View- Throws:
java.io.IOException
-
canSaveTo
public boolean canSaveTo(java.net.URI file)- Specified by:
canSaveToin interfaceorg.jhotdraw.app.View- Overrides:
canSaveToin classorg.jhotdraw.app.AbstractView
-
getURI
public java.net.URI getURI()- Specified by:
getURIin interfaceorg.jhotdraw.app.View- Overrides:
getURIin classorg.jhotdraw.app.AbstractView
-
selectModelComponent
public void selectModelComponent(org.opentcs.guing.model.ModelComponent modelComponent)- Specified by:
selectModelComponentin interfaceorg.opentcs.guing.application.GuiManager
-
addSelectedModelComponent
public void addSelectedModelComponent(org.opentcs.guing.model.ModelComponent modelComponent)- Specified by:
addSelectedModelComponentin interfaceorg.opentcs.guing.application.GuiManager
-
treeComponentRemoved
public boolean treeComponentRemoved(org.opentcs.guing.model.ModelComponent model)- Specified by:
treeComponentRemovedin interfaceorg.opentcs.guing.application.GuiManager
-
figureSelected
public void figureSelected(org.opentcs.guing.model.ModelComponent modelComponent)- Specified by:
figureSelectedin interfaceorg.opentcs.guing.application.GuiManager
-
loadModel
public void loadModel()- Specified by:
loadModelin interfaceorg.opentcs.guing.application.GuiManager
-
importModel
public void importModel(org.opentcs.components.plantoverview.PlantModelImporter importer)- Specified by:
importModelin interfaceorg.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:
saveModelin interfaceorg.opentcs.guing.application.GuiManager
-
saveModelAs
public boolean saveModelAs()- Specified by:
saveModelAsin interfaceorg.opentcs.guing.application.GuiManager
-
exportModel
public void exportModel(org.opentcs.components.plantoverview.PlantModelExporter exporter)- Specified by:
exportModelin interfaceorg.opentcs.guing.application.GuiManager
-
createModelComponent
public org.opentcs.guing.model.ModelComponent createModelComponent(java.lang.Class<? extends org.opentcs.guing.model.ModelComponent> clazz)- Specified by:
createModelComponentin interfaceorg.opentcs.guing.application.GuiManager
-