Class ExtendedCommandsDock

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, SelectionListener, EventListener, net.infonode.docking.DockingWindowListener

    public class ExtendedCommandsDock
    extends javax.swing.JPanel
    implements java.awt.event.ActionListener, net.infonode.docking.DockingWindowListener, SelectionListener
    This is a dialog to edit the script/commands for a given unit.
    TODO Save dialog positions (size, location, slider position)
    Version:
    1.0, 11.09.2007
    Author:
    Thoralf Rickert
    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 IDENTIFIER  
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)
      This method is called, if one of the buttons is clicked.
      void closeTab​(java.lang.String key, net.infonode.tabbedpanel.Tab tab)  
      protected java.lang.String createKey​(Unit unit, UnitContainer container)  
      protected java.lang.String createTitle​(Unit unit, UnitContainer container)  
      GameData getWorld()
      Returns the value of world.
      protected void init()
      Initializes the GUI of the dock.
      protected void openCurrent()
      Open tabs for current selection.
      protected void saveTab​(net.infonode.tabbedpanel.titledtab.TitledTab tab)
      Saves the content of a tab inside the Extended Commands List.
      void selectionChanged​(SelectionEvent e)
      Invoked when different objects are activated or selected.
      void setScript​(Unit unit, UnitContainer container, Script script)
      Setups the dock and opens the script for the given unit or container.
      void setWorld​(GameData world)
      Sets the value of world.
      void viewFocusChanged​(net.infonode.docking.View previouslyFocusedView, net.infonode.docking.View focusedView)  
      void windowAdded​(net.infonode.docking.DockingWindow addedToWindow, net.infonode.docking.DockingWindow addedWindow)  
      void windowClosed​(net.infonode.docking.DockingWindow window)  
      void windowClosing​(net.infonode.docking.DockingWindow window)  
      void windowDocked​(net.infonode.docking.DockingWindow window)  
      void windowDocking​(net.infonode.docking.DockingWindow window)  
      void windowHidden​(net.infonode.docking.DockingWindow window)  
      void windowMaximized​(net.infonode.docking.DockingWindow window)  
      void windowMaximizing​(net.infonode.docking.DockingWindow window)  
      void windowMinimized​(net.infonode.docking.DockingWindow window)  
      void windowMinimizing​(net.infonode.docking.DockingWindow window)  
      void windowRemoved​(net.infonode.docking.DockingWindow removedFromWindow, net.infonode.docking.DockingWindow removedWindow)  
      void windowRestored​(net.infonode.docking.DockingWindow window)  
      void windowRestoring​(net.infonode.docking.DockingWindow window)  
      void windowShown​(net.infonode.docking.DockingWindow window)  
      void windowUndocked​(net.infonode.docking.DockingWindow window)  
      void windowUndocking​(net.infonode.docking.DockingWindow window)  
      • 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, isShowing, 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
    • Constructor Detail

      • ExtendedCommandsDock

        public ExtendedCommandsDock​(ExtendedCommands commands)
    • Method Detail

      • init

        protected void init()
        Initializes the GUI of the dock.
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        This method is called, if one of the buttons is clicked.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        See Also:
        ActionListener.actionPerformed(java.awt.event.ActionEvent)
      • openCurrent

        protected void openCurrent()
        Open tabs for current selection.
      • saveTab

        protected void saveTab​(net.infonode.tabbedpanel.titledtab.TitledTab tab)
        Saves the content of a tab inside the Extended Commands List. Attention: This is NOT a save-to-disc Operation. It clones the content of the tab and set's it inside the Commands object.
      • setScript

        public void setScript​(Unit unit,
                              UnitContainer container,
                              Script script)
        Setups the dock and opens the script for the given unit or container.
      • createKey

        protected java.lang.String createKey​(Unit unit,
                                             UnitContainer container)
      • createTitle

        protected java.lang.String createTitle​(Unit unit,
                                               UnitContainer container)
      • getWorld

        public GameData getWorld()
        Returns the value of world.
        Returns:
        Returns world.
      • setWorld

        public void setWorld​(GameData world)
        Sets the value of world.
        Parameters:
        world - The value for world.
      • viewFocusChanged

        public void viewFocusChanged​(net.infonode.docking.View previouslyFocusedView,
                                     net.infonode.docking.View focusedView)
        Specified by:
        viewFocusChanged in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.viewFocusChanged(net.infonode.docking.View, net.infonode.docking.View)
      • windowAdded

        public void windowAdded​(net.infonode.docking.DockingWindow addedToWindow,
                                net.infonode.docking.DockingWindow addedWindow)
        Specified by:
        windowAdded in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowAdded(net.infonode.docking.DockingWindow, net.infonode.docking.DockingWindow)
      • windowClosed

        public void windowClosed​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowClosed in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowClosed(net.infonode.docking.DockingWindow)
      • windowClosing

        public void windowClosing​(net.infonode.docking.DockingWindow window)
                           throws net.infonode.docking.OperationAbortedException
        Specified by:
        windowClosing in interface net.infonode.docking.DockingWindowListener
        Throws:
        net.infonode.docking.OperationAbortedException
        See Also:
        DockingWindowListener.windowClosing(net.infonode.docking.DockingWindow)
      • windowDocked

        public void windowDocked​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowDocked in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowDocked(net.infonode.docking.DockingWindow)
      • windowDocking

        public void windowDocking​(net.infonode.docking.DockingWindow window)
                           throws net.infonode.docking.OperationAbortedException
        Specified by:
        windowDocking in interface net.infonode.docking.DockingWindowListener
        Throws:
        net.infonode.docking.OperationAbortedException
        See Also:
        DockingWindowListener.windowDocking(net.infonode.docking.DockingWindow)
      • windowHidden

        public void windowHidden​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowHidden in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowHidden(net.infonode.docking.DockingWindow)
      • windowMaximized

        public void windowMaximized​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowMaximized in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowMaximized(net.infonode.docking.DockingWindow)
      • windowMaximizing

        public void windowMaximizing​(net.infonode.docking.DockingWindow window)
                              throws net.infonode.docking.OperationAbortedException
        Specified by:
        windowMaximizing in interface net.infonode.docking.DockingWindowListener
        Throws:
        net.infonode.docking.OperationAbortedException
        See Also:
        DockingWindowListener.windowMaximizing(net.infonode.docking.DockingWindow)
      • windowMinimized

        public void windowMinimized​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowMinimized in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowMinimized(net.infonode.docking.DockingWindow)
      • windowMinimizing

        public void windowMinimizing​(net.infonode.docking.DockingWindow window)
                              throws net.infonode.docking.OperationAbortedException
        Specified by:
        windowMinimizing in interface net.infonode.docking.DockingWindowListener
        Throws:
        net.infonode.docking.OperationAbortedException
        See Also:
        DockingWindowListener.windowMinimizing(net.infonode.docking.DockingWindow)
      • windowRemoved

        public void windowRemoved​(net.infonode.docking.DockingWindow removedFromWindow,
                                  net.infonode.docking.DockingWindow removedWindow)
        Specified by:
        windowRemoved in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowRemoved(net.infonode.docking.DockingWindow, net.infonode.docking.DockingWindow)
      • windowRestored

        public void windowRestored​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowRestored in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowRestored(net.infonode.docking.DockingWindow)
      • windowRestoring

        public void windowRestoring​(net.infonode.docking.DockingWindow window)
                             throws net.infonode.docking.OperationAbortedException
        Specified by:
        windowRestoring in interface net.infonode.docking.DockingWindowListener
        Throws:
        net.infonode.docking.OperationAbortedException
        See Also:
        DockingWindowListener.windowRestoring(net.infonode.docking.DockingWindow)
      • windowShown

        public void windowShown​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowShown in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowShown(net.infonode.docking.DockingWindow)
      • windowUndocked

        public void windowUndocked​(net.infonode.docking.DockingWindow window)
        Specified by:
        windowUndocked in interface net.infonode.docking.DockingWindowListener
        See Also:
        DockingWindowListener.windowUndocked(net.infonode.docking.DockingWindow)
      • windowUndocking

        public void windowUndocking​(net.infonode.docking.DockingWindow window)
                             throws net.infonode.docking.OperationAbortedException
        Specified by:
        windowUndocking in interface net.infonode.docking.DockingWindowListener
        Throws:
        net.infonode.docking.OperationAbortedException
        See Also:
        DockingWindowListener.windowUndocking(net.infonode.docking.DockingWindow)
      • closeTab

        public void closeTab​(java.lang.String key,
                             net.infonode.tabbedpanel.Tab tab)