Class MultiEditorOrderEditorList

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  MultiEditorOrderEditorList.ButtonPanel  
      • 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
      protected MultiEditorOrderEditorList.ButtonPanel buttons  
      protected magellan.client.swing.completion.MultiEditorOrderEditorList.MECaretAdapter caretAdapter  
      protected java.util.List<javax.swing.event.CaretListener> caretListeners  
      protected magellan.client.swing.completion.MultiEditorOrderEditorList.ScrollPanel content  
      protected magellan.client.swing.completion.MultiEditorOrderEditorList.MEFocusAdapter focusAdapter  
      protected java.util.List<java.awt.event.FocusListener> focusListeners  
      protected magellan.client.swing.completion.MultiEditorOrderEditorList.MEKeyAdapter keyAdapter  
      protected java.util.List<java.awt.event.KeyListener> keyListeners  
      static int LIST_FACTION
      List editors for currently selected element's faction (if applicable)
      static int LIST_ISLAND
      List editors for currently selected element's island (if applicable)
      static int LIST_REGION
      List editors for currently selected element's region (if applicable)
      static int LIST_UNIT
      List only editor for current unit
      protected int listMode  
      protected javax.swing.JScrollPane scpContent  
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiEditorOrderEditorList​(EventDispatcher dispatcher, GameData data, java.util.Properties settings, javax.swing.undo.UndoManager undoMgr)
      Creates a new MultiEditorOrderEditorList object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addExternalCaretListener​(javax.swing.event.CaretListener k)
      DOCUMENT-ME
      void addExternalFocusListener​(java.awt.event.FocusListener k)
      DOCUMENT-ME
      void addExternalKeyListener​(java.awt.event.KeyListener k)
      DOCUMENT-ME
      void clearCache​(Cache c)
      Called if a cache is cleared.
      void focusGained​(java.awt.event.FocusEvent e)  
      void focusLost​(java.awt.event.FocusEvent e)  
      void gameDataChanged​(GameDataEvent e)
      Invoked when the current game data object becomes invalid.
      java.awt.Color getActiveBackgroundColor()
      Returns the color for the active unconfirmed unit's editor.
      java.awt.Color getActiveBackgroundColorConfirmed()
      Returns the color for the active confirmed unit's editor.
      protected javax.swing.border.Border getBorder​(Unit u, boolean active)  
      protected MultiEditorOrderEditorList.ButtonPanel getButtonPanel()  
      AutoCompletion getCompleter()  
      javax.swing.text.JTextComponent getCurrentEditor()
      DOCUMENT-ME
      Unit getCurrentUnit()
      DOCUMENT-ME
      java.awt.Color getErrorBackground()  
      int getListMode()
      Returns the variable listMode.
      protected Unit getNextUnit()  
      protected Unit getNextUnit​(Unit u)  
      PreferencesAdapter getPreferencesAdapter()
      DOCUMENT-ME
      java.awt.Color getStandardBackgroundColor()
      Returns the background color for editors.
      java.awt.Color getStandardBackgroundColorConfirmed()
      Returns the background color for confirmed unit's editrs.
      java.awt.Color getTokenColor​(java.lang.String styleName)
      Return the color of the specified token style used for syntax highlighting in the editor.
      boolean getUseSyntaxHighlighting()
      Return whether syntax highlighting in the editor is enabled or disabled.
      static boolean getUseSyntaxHighlighting​(java.util.Properties settings)
      Return whether syntax highlighting is enabled or disabled.
      boolean isEditAllFactions()  
      boolean isHideButtons()
      Returns true if temp/confirmation buttons should be shown.
      boolean isMultiEditorLayout()  
      void keyPressed​(java.awt.event.KeyEvent e)
      Processes CTRL+UP/DOWN keys.
      void keyReleased​(java.awt.event.KeyEvent e)  
      void keyTyped​(java.awt.event.KeyEvent e)  
      protected void loadListProperty()  
      void mouseClicked​(java.awt.event.MouseEvent e)
      Show a context menu on right-click.
      void mouseEntered​(java.awt.event.MouseEvent e)  
      void mouseExited​(java.awt.event.MouseEvent e)  
      void mousePressed​(java.awt.event.MouseEvent e)
      Selects the editor in multi editor layout.
      void mouseReleased​(java.awt.event.MouseEvent e)  
      void paint​(java.awt.Graphics g)  
      void removeExternalCaretListener​(javax.swing.event.CaretListener k)
      DOCUMENT-ME
      void removeExternalFocusListener​(java.awt.event.FocusListener k)
      DOCUMENT-ME
      void removeExternalKeyListener​(java.awt.event.KeyListener k)
      DOCUMENT-ME
      void requestFocus()
      Ensures that the right order editor gets the focus.
      void saveListProperty()  
      void selectionChanged​(SelectionEvent se)
      Updates the editors after a new object has been selected.
      void setActiveBackgroundColor​(java.awt.Color c)
      Sets and applies the color for the active unconfirmed unit's editor.
      void setActiveBackgroundColorConfirmed​(java.awt.Color c)
      Sets and applies the color for the active confirmed unit's editor.
      void setCompleter​(AutoCompletion completion)
      Sets completion as the completion for order auto completion.
      void setEditAllFactions​(boolean edit)  
      void setErrorBackground​(java.awt.Color c)
      Set Background color of orders with errors.
      void setGameData​(GameData data)
      Sets the value of data.
      void setHideButtons​(boolean bool)
      Sets and applies if temp/confirmation buttons should be shown.
      void setListMode​(int listMode)
      Sets the variable listMode.
      void setMultiEditorLayout​(boolean multi)
      Does initialization (of content resp. editor) for the specified mode.
      void setStandardBackgroundColor​(java.awt.Color c)
      Changes the background color for all editors.
      void setStandardBackgroundColorConfirmed​(java.awt.Color c)
      Sets and applies the background color for confirmed unit's editors for all editors.
      void setTokenColor​(java.lang.String styleName, java.awt.Color color)
      Set the color of the specified token style used for syntax highlighting in the editor.
      void setUseSyntaxHighlighting​(boolean bool)
      Enable or disable syntax highlighting in the editor.
      void tempUnitCreated​(TempUnitEvent e)
      Ensures that the correct editors are loaded if a temp unit was created.
      void tempUnitDeleting​(TempUnitEvent e)
      Ensures that the right editors are loaded if a temp unit was created.
      • 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, 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, 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
    • Field Detail

      • keyListeners

        protected java.util.List<java.awt.event.KeyListener> keyListeners
      • keyAdapter

        protected magellan.client.swing.completion.MultiEditorOrderEditorList.MEKeyAdapter keyAdapter
      • caretListeners

        protected java.util.List<javax.swing.event.CaretListener> caretListeners
      • caretAdapter

        protected magellan.client.swing.completion.MultiEditorOrderEditorList.MECaretAdapter caretAdapter
      • focusListeners

        protected java.util.List<java.awt.event.FocusListener> focusListeners
      • focusAdapter

        protected magellan.client.swing.completion.MultiEditorOrderEditorList.MEFocusAdapter focusAdapter
      • content

        protected magellan.client.swing.completion.MultiEditorOrderEditorList.ScrollPanel content
      • scpContent

        protected javax.swing.JScrollPane scpContent
      • listMode

        protected int listMode
      • LIST_UNIT

        public static final int LIST_UNIT
        List only editor for current unit
        See Also:
        Constant Field Values
      • LIST_FACTION

        public static final int LIST_FACTION
        List editors for currently selected element's faction (if applicable)
        See Also:
        Constant Field Values
      • LIST_REGION

        public static final int LIST_REGION
        List editors for currently selected element's region (if applicable)
        See Also:
        Constant Field Values
      • LIST_ISLAND

        public static final int LIST_ISLAND
        List editors for currently selected element's island (if applicable)
        See Also:
        Constant Field Values
    • Constructor Detail

      • MultiEditorOrderEditorList

        public MultiEditorOrderEditorList​(EventDispatcher dispatcher,
                                          GameData data,
                                          java.util.Properties settings,
                                          javax.swing.undo.UndoManager undoMgr)
        Creates a new MultiEditorOrderEditorList object.
    • Method Detail

      • paint

        public void paint​(java.awt.Graphics g)
        Overrides:
        paint in class javax.swing.JComponent
        See Also:
        JComponent.paint(java.awt.Graphics)
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Processes CTRL+UP/DOWN keys.
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent e)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
        See Also:
        KeyListener.keyReleased(java.awt.event.KeyEvent)
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent e)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
        See Also:
        KeyListener.keyTyped(java.awt.event.KeyEvent)
      • focusGained

        public void focusGained​(java.awt.event.FocusEvent e)
        Specified by:
        focusGained in interface java.awt.event.FocusListener
      • focusLost

        public void focusLost​(java.awt.event.FocusEvent e)
        Specified by:
        focusLost in interface java.awt.event.FocusListener
        See Also:
        FocusListener.focusLost(java.awt.event.FocusEvent)
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent e)
        Show a context menu on right-click.
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
        See Also:
        MouseListener.mouseClicked(java.awt.event.MouseEvent)
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent e)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        See Also:
        MouseListener.mouseEntered(java.awt.event.MouseEvent)
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent e)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
        See Also:
        MouseListener.mouseExited(java.awt.event.MouseEvent)
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Selects the editor in multi editor layout.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        See Also:
        MouseListener.mousePressed(java.awt.event.MouseEvent)
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        See Also:
        MouseListener.mouseReleased(java.awt.event.MouseEvent)
      • getUseSyntaxHighlighting

        public boolean getUseSyntaxHighlighting()
        Return whether syntax highlighting in the editor is enabled or disabled.
      • setUseSyntaxHighlighting

        public void setUseSyntaxHighlighting​(boolean bool)
        Enable or disable syntax highlighting in the editor.
      • getTokenColor

        public java.awt.Color getTokenColor​(java.lang.String styleName)
        Return the color of the specified token style used for syntax highlighting in the editor.
      • setTokenColor

        public void setTokenColor​(java.lang.String styleName,
                                  java.awt.Color color)
        Set the color of the specified token style used for syntax highlighting in the editor.
      • getErrorBackground

        public java.awt.Color getErrorBackground()
        Returns:
        Background color of orders with errors
      • setErrorBackground

        public void setErrorBackground​(java.awt.Color c)
        Set Background color of orders with errors.
        Parameters:
        c -
      • getStandardBackgroundColor

        public java.awt.Color getStandardBackgroundColor()
        Returns the background color for editors.
      • setStandardBackgroundColor

        public void setStandardBackgroundColor​(java.awt.Color c)
        Changes the background color for all editors.
      • getStandardBackgroundColorConfirmed

        public java.awt.Color getStandardBackgroundColorConfirmed()
        Returns the background color for confirmed unit's editrs.
      • setStandardBackgroundColorConfirmed

        public void setStandardBackgroundColorConfirmed​(java.awt.Color c)
        Sets and applies the background color for confirmed unit's editors for all editors.
      • getActiveBackgroundColor

        public java.awt.Color getActiveBackgroundColor()
        Returns the color for the active unconfirmed unit's editor.
      • setActiveBackgroundColor

        public void setActiveBackgroundColor​(java.awt.Color c)
        Sets and applies the color for the active unconfirmed unit's editor.
      • getActiveBackgroundColorConfirmed

        public java.awt.Color getActiveBackgroundColorConfirmed()
        Returns the color for the active confirmed unit's editor.
      • setActiveBackgroundColorConfirmed

        public void setActiveBackgroundColorConfirmed​(java.awt.Color c)
        Sets and applies the color for the active confirmed unit's editor.
      • isMultiEditorLayout

        public boolean isMultiEditorLayout()
        Returns:
        true iff currently in multi editor layout
      • setMultiEditorLayout

        public void setMultiEditorLayout​(boolean multi)
        Does initialization (of content resp. editor) for the specified mode.
        Parameters:
        multi - If true multi editor layout is initialized, else single editor mode.
      • isHideButtons

        public boolean isHideButtons()
        Returns true if temp/confirmation buttons should be shown.
      • setHideButtons

        public void setHideButtons​(boolean bool)
        Sets and applies if temp/confirmation buttons should be shown.
      • getNextUnit

        protected Unit getNextUnit()
        Returns:
        The unit following on currentUnit in the unit sorting of EMapOverviewPanel
      • getNextUnit

        protected Unit getNextUnit​(Unit u)
        Returns:
        The unit following on u in the unit sorting of EMapOverviewPanel
      • getBorder

        protected javax.swing.border.Border getBorder​(Unit u,
                                                      boolean active)
      • requestFocus

        public void requestFocus()
        Ensures that the right order editor gets the focus.
        Overrides:
        requestFocus in class javax.swing.JComponent
      • loadListProperty

        protected void loadListProperty()
      • saveListProperty

        public void saveListProperty()
      • getListMode

        public int getListMode()
        Returns the variable listMode.
      • setListMode

        public void setListMode​(int listMode)
        Sets the variable listMode.
      • isEditAllFactions

        public boolean isEditAllFactions()
      • setEditAllFactions

        public void setEditAllFactions​(boolean edit)
      • setCompleter

        public void setCompleter​(AutoCompletion completion)
        Sets completion as the completion for order auto completion.
        Parameters:
        completion -
      • getCompleter

        public AutoCompletion getCompleter()
        Returns:
        The current order completer
      • getUseSyntaxHighlighting

        public static boolean getUseSyntaxHighlighting​(java.util.Properties settings)
        Return whether syntax highlighting is enabled or disabled.