Class EMapDetailsPanel

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  EMapDetailsPanel.ContextUnitFilter
      A unit filter that accepts units that are in all regions occuring in a given Selection context.
      static class  EMapDetailsPanel.ShowItems
      Constants declaring which items are shown in the region overview (in the capacity node)
      • 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 javax.swing.AbstractButton addTag  
      protected boolean allowCustomIcons  
      protected magellan.client.EMapDetailsPanel.CombatStateContextFactory combatContext  
      protected magellan.client.EMapDetailsPanel.CommentContextFactory commentContext  
      protected ContextManager contextManager  
      protected java.util.Collection<java.lang.String> excludeTags  
      protected java.lang.Object lastCause  
      protected NodeWrapperFactory nodeWrapperFactory  
      protected BasicRegionPanel regionPanel  
      protected magellan.client.EMapDetailsPanel.RelationContextFactory relationContext  
      protected javax.swing.AbstractButton removeTag  
      protected boolean showTagButtons  
      protected magellan.client.EMapDetailsPanel.StealthContextFactory stealthContext  
      protected java.awt.Container tagContainer  
      protected java.awt.Container treeContainer  
      protected javax.swing.undo.UndoManager undoMgr  
      protected magellan.client.EMapDetailsPanel.UnitCommentContextFactory unitCommentContext  
      protected magellan.client.EMapDetailsPanel.DetailsUnitContextFactory unitContext  
      • 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
      EMapDetailsPanel​(EventDispatcher d, GameData data, java.util.Properties p, javax.swing.undo.UndoManager _undoMgr)
      Creates a new EMapDetailsPanel object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent actionEvent)
      Called when one of the tag buttons is pressed.
      protected void addFiltered​(java.util.Collection<Unit> result, java.util.Collection<Unit> input, UnitFilter filter)
      Adds all units from input to result that are excepted by filter.
      PreferencesAdapter createPreferencesAdapter()
      Creates the component for the preferences.
      void gameDataChanged​(GameDataEvent e)
      Invoked when the current game data object becomes invalid.
      protected SelectionEvent getActiveSelection()  
      protected java.lang.String getDescriptionPart​(java.lang.String s)  
      javax.swing.JPanel getDetailsPanel()
      Returns the Details Tree panel for selected regions
      MultiEditorOrderEditorList getEditor()
      Returns the Order Editor component.
      protected GameSpecificStuff getGameSpecificStuff()  
      java.lang.String getListenerDescription()
      Returns a (localized) description (or name) for this listener.
      javax.swing.JMenu getMenu()  
      protected MovementEvaluator getMovementEvaluator()  
      javax.swing.JPanel getNameAndDescriptionPanel()
      Returns a panel with a Textfield for the name and a Textarea for the description.
      NodeWrapperFactory getNodeWrapperFactory()
      Returns the factory used to create the nodes of the tree for this panel
      javax.swing.JComponent getOrderEditor()
      Returns the multi order editor.
      AutoCompletion getOrders()
      Returns the AutoCompletion Editor component.
      protected java.lang.String getPrivatePart​(java.lang.String s)  
      BasicRegionPanel getRegionPanel()
      Returns the Region Panel.
      protected GameSpecificRules getRules()  
      java.lang.String getShortcutDescription​(javax.swing.KeyStroke stroke)
      Returns a short description for the specified thing...
      java.util.Iterator<javax.swing.KeyStroke> getShortCuts()
      Should return all short cuts this class want to be informed.
      EMapDetailsPanel.ShowItems getShowCapacityItems()
      Returns which items are shown (in capacity nodes).
      java.lang.String getSuperMenu()  
      java.lang.String getSuperMenuTitle()  
      boolean isAllowingCustomIcons()
      Returns if custom (faction) icons are shown.
      boolean isCompactLayout()
      Returns if more compact layout is used.
      static boolean isPrivileged​(Faction f)
      Deprecated.
      static boolean isPrivilegedAndNoSpy​(Unit u)
      Deprecated.
      boolean isShowingTagButtons()
      Returns if the buttons for adding tags are shown.
      protected java.lang.String normalizeDescription​(java.lang.String s)  
      void quit()
      Stores the expansion state.
      protected void refresh()  
      void selectionChanged​(SelectionEvent se)
      Selection event handler, update all elements in this panel with the appropriate data.
      protected void setActiveSelection​(SelectionEvent se)  
      void setAllowCustomIcons​(boolean allow)
      Sets if custom (faction) items are displayd.
      void setCompactLayout​(boolean compact)
      Enables or disabled a more compact layout of the panel.
      void setGameData​(GameData data)
      Sets the value of data.
      void setShowCapacityItems​(EMapDetailsPanel.ShowItems newValue)
      Sets the types of items displayed (in capacity nodes).
      void setShowTagButtons​(boolean bool)
      Called to activate or deactivate the buttons for adding tags.
      void shortCut​(javax.swing.KeyStroke shortcut)
      This method is called when a shortcut from getShortCuts() is recognized.
      protected void show​(SelectionEvent se, boolean dontForceRefresh)
      Changes to a new object and displays its information depending on the active region.
      protected boolean showMultiple​(SelectionEvent se)
      Tries to show the given collection.
      void updateTree​(java.lang.Object src)
      Repaint the tree.
      • 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
    • Field Detail

      • excludeTags

        protected java.util.Collection<java.lang.String> excludeTags
      • addTag

        protected javax.swing.AbstractButton addTag
      • removeTag

        protected javax.swing.AbstractButton removeTag
      • tagContainer

        protected java.awt.Container tagContainer
      • treeContainer

        protected java.awt.Container treeContainer
      • showTagButtons

        protected boolean showTagButtons
      • allowCustomIcons

        protected boolean allowCustomIcons
      • stealthContext

        protected magellan.client.EMapDetailsPanel.StealthContextFactory stealthContext
      • combatContext

        protected magellan.client.EMapDetailsPanel.CombatStateContextFactory combatContext
      • commentContext

        protected magellan.client.EMapDetailsPanel.CommentContextFactory commentContext
      • unitCommentContext

        protected magellan.client.EMapDetailsPanel.UnitCommentContextFactory unitCommentContext
      • unitContext

        protected magellan.client.EMapDetailsPanel.DetailsUnitContextFactory unitContext
      • relationContext

        protected magellan.client.EMapDetailsPanel.RelationContextFactory relationContext
      • undoMgr

        protected javax.swing.undo.UndoManager undoMgr
      • lastCause

        protected java.lang.Object lastCause
    • Constructor Detail

      • EMapDetailsPanel

        public EMapDetailsPanel​(EventDispatcher d,
                                GameData data,
                                java.util.Properties p,
                                javax.swing.undo.UndoManager _undoMgr)
        Creates a new EMapDetailsPanel object.
    • Method Detail

      • getNameAndDescriptionPanel

        public javax.swing.JPanel getNameAndDescriptionPanel()
        Returns a panel with a Textfield for the name and a Textarea for the description.
      • getDetailsPanel

        public javax.swing.JPanel getDetailsPanel()
        Returns the Details Tree panel for selected regions
      • getOrderEditor

        public javax.swing.JComponent getOrderEditor()
        Returns the multi order editor.
      • getNodeWrapperFactory

        public NodeWrapperFactory getNodeWrapperFactory()
        Returns the factory used to create the nodes of the tree for this panel
      • normalizeDescription

        protected java.lang.String normalizeDescription​(java.lang.String s)
      • getDescriptionPart

        protected java.lang.String getDescriptionPart​(java.lang.String s)
      • getPrivatePart

        protected java.lang.String getPrivatePart​(java.lang.String s)
      • addFiltered

        protected void addFiltered​(java.util.Collection<Unit> result,
                                   java.util.Collection<Unit> input,
                                   UnitFilter filter)
        Adds all units from input to result that are excepted by filter.
        Parameters:
        result - Results are appended to this collection
        input - Input collections
        filter -
      • showMultiple

        protected boolean showMultiple​(SelectionEvent se)
        Tries to show the given collection. Currently, pure collections of Regions, Factions or Units are implemented. If no implementation applies, false is returned, otherwise true.
      • refresh

        protected void refresh()
      • setActiveSelection

        protected void setActiveSelection​(SelectionEvent se)
      • show

        protected void show​(SelectionEvent se,
                            boolean dontForceRefresh)
        Changes to a new object and displays its information depending on the active region.
        Parameters:
        dontForceRefresh - If true, nothing is done if the new object is the already displayed object.
      • getShortCuts

        public java.util.Iterator<javax.swing.KeyStroke> getShortCuts()
        Should return all short cuts this class want to be informed. The elements should be of type javax.swing.KeyStroke
        Specified by:
        getShortCuts in interface ShortcutListener
        Returns:
        Iterator over all short
      • shortCut

        public void shortCut​(javax.swing.KeyStroke shortcut)
        This method is called when a shortcut from getShortCuts() is recognized.
        Specified by:
        shortCut in interface ShortcutListener
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent actionEvent)
        Called when one of the tag buttons is pressed.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        See Also:
        ActionListener.actionPerformed(java.awt.event.ActionEvent)
      • isShowingTagButtons

        public boolean isShowingTagButtons()
        Returns if the buttons for adding tags are shown.
        Returns:
        true if the buttons for adding tags are shown
      • isAllowingCustomIcons

        public boolean isAllowingCustomIcons()
        Returns if custom (faction) icons are shown.
        Returns:
        true if custom (faction) icons are shown
      • isCompactLayout

        public boolean isCompactLayout()
        Returns if more compact layout is used.
        Returns:
        true if more compact layout is used
      • getShowCapacityItems

        public EMapDetailsPanel.ShowItems getShowCapacityItems()
        Returns which items are shown (in capacity nodes).
        Returns:
        which items are shown (in capacity nodes)
      • setShowCapacityItems

        public void setShowCapacityItems​(EMapDetailsPanel.ShowItems newValue)
        Sets the types of items displayed (in capacity nodes).
      • setShowTagButtons

        public void setShowTagButtons​(boolean bool)
        Called to activate or deactivate the buttons for adding tags.
      • setAllowCustomIcons

        public void setAllowCustomIcons​(boolean allow)
        Sets if custom (faction) items are displayd.
      • setCompactLayout

        public void setCompactLayout​(boolean compact)
        Enables or disabled a more compact layout of the panel.
      • updateTree

        public void updateTree​(java.lang.Object src)
        Repaint the tree.
        Specified by:
        updateTree in interface TreeUpdate
        Parameters:
        src - The object that was responsible for this event.
      • getOrders

        public AutoCompletion getOrders()
        Returns the AutoCompletion Editor component.
      • getRegionPanel

        public BasicRegionPanel getRegionPanel()
        Returns the Region Panel.