Class EMapOverviewPanel

    • 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 int COLLAPSE_FLAG
      DOCUMENT-ME
      static int COLLAPSE_ONLY_EXPANDED
      DOCUMENT-ME
      static int EXPAND_FLAG
      DOCUMENT-ME
      static int EXPAND_IFINSIDE_FLAG
      DOCUMENT-ME
      static java.lang.String IDENTIFIER
      Deprecated.
      protected java.lang.Object lastCause  
      protected Region lastRegion  
      • 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 Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void addExpandInfo​(javax.swing.tree.DefaultMutableTreeNode node)  
      protected void checkPathToExpand​(javax.swing.tree.TreePath path)
      Looks a path down from root to the leaf if to expand any segment
      protected void collapseSelected()  
      protected void collectCollapseInfo()
      Collections all information about nodes to be collapsed.
      protected void collectExpandInfo​(Region region, javax.swing.tree.DefaultMutableTreeNode node, javax.swing.tree.TreePath path)  
      PreferencesAdapter createPreferencesAdapter()
      Creates the component for the preferences.
      protected TreeBuilder createTreeBuilder()  
      protected void doExpandAndCollapse​(java.util.Collection<javax.swing.tree.TreePath> newSelection)  
      protected void expandSelected​(Region region, javax.swing.tree.DefaultMutableTreeNode node, javax.swing.tree.TreePath path)  
      void gameDataChanged​(GameDataEvent e)
      GameDataChanged event handler routine updating the tree.
      int getCollapseMode()
      Returns the value of collapseMode.
      java.lang.String getComponentConfiguration()
      Returns the current configuration of this component.
      EventDispatcher getEventDispatcher()
      Returns the event dispatcher of this panel.
      int getExpandMode()
      Returns the value of expandMode.
      int getExpandTrustLevel()
      Returns the value of expandTrustLevel.
      java.awt.Component getHistoryComponent()
      Returns the component displaying the history.
      java.lang.String getListenerDescription()
      Returns a (localized) description (or name) for this listener.
      javax.swing.JMenu getMenu()
      Deprecated.
      I think this is needless.
      NodeWrapperFactory getNodeWrapperFactory()
      Returns the factory that creates node wrappers.
      java.awt.Component getOverviewComponent()
      Returns the component displaying the overview tree.
      SelectionEvent getSelectedObjects()  
      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.
      java.lang.String getSuperMenu()  
      java.lang.String getSuperMenuTitle()  
      static java.util.Comparator<? super Unit> getUnitSorting​(java.util.Properties settings)
      Retrieve a Comparator to sort the units according to the settings.
      void initComponent​(java.lang.String params)
      Initialize interface
      protected void loadCollapseProperty()  
      protected void loadExpandProperties()  
      void orderConfirmationChanged​(OrderConfirmEvent e)
      Change event handler, change the display status of the tree if an unit orderConfimation Status changed
      void quit()
      Do clean-up on quitting.
      void rebuildTree()
      Rebuild the region tree from scratch.
      void repaint()
      Repaints this component.
      protected void resetExpandInfo()  
      void selectionChanged​(SelectionEvent se)
      Selection event handler, update the selection status of the tree.
      void setCollapseMode​(int collapseMode)
      Sets the value of collapseMode.
      void setExpandMode​(int expandMode)
      Sets the value of expandMode.
      void setExpandTrustLevel​(int expandTrustlevel)
      Sets the value of expandTrustlevel.
      void setGameData​(GameData data)
      Sets the value of data.
      void shortCut​(javax.swing.KeyStroke shortcut)
      This method is called when a shortcut from getShortCuts() is recognized.
      void shortCut_B()
      Confirms/unconfirms a unit.
      void shortCut_N()
      Selects the next unit.
      protected void shortCut_N​(boolean traverseDown)
      Selects the next or previous unit.
      void shortCut_Reverse_N()
      Selects the previous unit.
      void stateChanged​(javax.swing.event.ChangeEvent p1)  
      void tempUnitCreated​(TempUnitEvent e)
      Inserts the temp unit into the tree.
      void tempUnitDeleting​(TempUnitEvent e)
      Removes the temp unit from the tree.
      void treeCollapsed​(javax.swing.event.TreeExpansionEvent e)
      Event handler for TreeCollapsedEvents
      void treeExpanded​(javax.swing.event.TreeExpansionEvent e)
      Event handler for TreeExpansionEvents (recenters the tree if necessary)
      protected void update​(Unit u)
      Updates the nodes of this unit and all nodes that are related to this unit indirectly by no more than updateRelationPartersDistance.
      void updateTree​(java.lang.Object src)
      Called when the tree should be updated.
      void valueChanged​(javax.swing.event.TreeSelectionEvent tse)
      TreeSelection event handler, notifies event listeners.
      • 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, 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

      • EMapOverviewPanel

        public EMapOverviewPanel​(EventDispatcher d,
                                 GameData data,
                                 java.util.Properties p)
        Creates a new EMapOverviewPanel object.
        Parameters:
        d -
        p -
    • Method Detail

      • getNodeWrapperFactory

        public NodeWrapperFactory getNodeWrapperFactory()
        Returns the factory that creates node wrappers.
      • getOverviewComponent

        public java.awt.Component getOverviewComponent()
        Returns the component displaying the overview tree.
      • getHistoryComponent

        public java.awt.Component getHistoryComponent()
        Returns the component displaying the history.
      • rebuildTree

        public void rebuildTree()
        Rebuild the region tree from scratch.
      • getUnitSorting

        public static java.util.Comparator<? super Unit> getUnitSorting​(java.util.Properties settings)
        Retrieve a Comparator to sort the units according to the settings.
        Parameters:
        settings -
      • valueChanged

        public void valueChanged​(javax.swing.event.TreeSelectionEvent tse)
        TreeSelection event handler, notifies event listeners.
        Specified by:
        valueChanged in interface javax.swing.event.TreeSelectionListener
        See Also:
        TreeSelectionListener.valueChanged(javax.swing.event.TreeSelectionEvent)
      • initComponent

        public void initComponent​(java.lang.String params)
        Initialize interface
        Specified by:
        initComponent in interface Initializable
      • getComponentConfiguration

        public java.lang.String getComponentConfiguration()
        Description copied from interface: Initializable
        Returns the current configuration of this component. This may use any characters except "," and ";".
        Specified by:
        getComponentConfiguration in interface Initializable
      • treeExpanded

        public void treeExpanded​(javax.swing.event.TreeExpansionEvent e)
        Event handler for TreeExpansionEvents (recenters the tree if necessary)
        Specified by:
        treeExpanded in interface javax.swing.event.TreeExpansionListener
        See Also:
        TreeExpansionListener.treeExpanded(javax.swing.event.TreeExpansionEvent)
      • treeCollapsed

        public void treeCollapsed​(javax.swing.event.TreeExpansionEvent e)
        Event handler for TreeCollapsedEvents
        Specified by:
        treeCollapsed in interface javax.swing.event.TreeExpansionListener
        See Also:
        TreeExpansionListener.treeCollapsed(javax.swing.event.TreeExpansionEvent)
      • collectCollapseInfo

        protected void collectCollapseInfo()
        Collections all information about nodes to be collapsed.
      • resetExpandInfo

        protected void resetExpandInfo()
      • addExpandInfo

        protected void addExpandInfo​(javax.swing.tree.DefaultMutableTreeNode node)
      • collectExpandInfo

        protected void collectExpandInfo​(Region region,
                                         javax.swing.tree.DefaultMutableTreeNode node,
                                         javax.swing.tree.TreePath path)
      • doExpandAndCollapse

        protected void doExpandAndCollapse​(java.util.Collection<javax.swing.tree.TreePath> newSelection)
      • checkPathToExpand

        protected void checkPathToExpand​(javax.swing.tree.TreePath path)
        Looks a path down from root to the leaf if to expand any segment
      • selectionChanged

        public void selectionChanged​(SelectionEvent se)
        Selection event handler, update the selection status of the tree. First the active object is considered and selected in the tree if contained. After that selected objects are considered, but only selection type is different from SelectionEvent.ST_REGIONS. In this case the tree selection is set to the selected objects (as long as they are contained in the tree anyway). Keep in mind, that this will produce the active object _NOT_ to be selected, if selectedObjects != null && !selectedObjects.contains(activeObject) !!!
        Specified by:
        selectionChanged in interface SelectionListener
        Parameters:
        se -
        See Also:
        SelectionListener.selectionChanged(magellan.client.event.SelectionEvent)
      • expandSelected

        protected void expandSelected​(Region region,
                                      javax.swing.tree.DefaultMutableTreeNode node,
                                      javax.swing.tree.TreePath path)
      • collapseSelected

        protected void collapseSelected()
      • 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
        See Also:
        ShortcutListener.getShortCuts()
      • shortCut_B

        public void shortCut_B()
        Confirms/unconfirms a unit.
      • shortCut_N

        public void shortCut_N()
        Selects the next unit.
      • shortCut_Reverse_N

        public void shortCut_Reverse_N()
        Selects the previous unit.
      • shortCut_N

        protected void shortCut_N​(boolean traverseDown)
        Selects the next or previous unit.
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent p1)
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        See Also:
        ChangeListener.stateChanged(javax.swing.event.ChangeEvent)
      • repaint

        public void repaint()
        Repaints this component. This method also explicitly repaints it's managed components because the may be separated by the Magellan Desktop.
        Overrides:
        repaint in class java.awt.Component
      • loadExpandProperties

        protected void loadExpandProperties()
      • loadCollapseProperty

        protected void loadCollapseProperty()
      • update

        protected void update​(Unit u)
        Updates the nodes of this unit and all nodes that are related to this unit indirectly by no more than updateRelationPartersDistance.
        Parameters:
        u - The updated unit
      • createTreeBuilder

        protected TreeBuilder createTreeBuilder()
      • getMenu

        @Deprecated
        public javax.swing.JMenu getMenu()
        Deprecated.
        I think this is needless.
        Returns the menu for the overview panel that is used by the client.
        Specified by:
        getMenu in interface MenuProvider
      • getEventDispatcher

        public EventDispatcher getEventDispatcher()
        Returns the event dispatcher of this panel.
      • getExpandMode

        public int getExpandMode()
        Returns the value of expandMode.
      • getExpandTrustLevel

        public int getExpandTrustLevel()
        Returns the value of expandTrustLevel.
      • getCollapseMode

        public int getCollapseMode()
        Returns the value of collapseMode.
      • setExpandMode

        public void setExpandMode​(int expandMode)
        Sets the value of expandMode.
      • setExpandTrustLevel

        public void setExpandTrustLevel​(int expandTrustlevel)
        Sets the value of expandTrustlevel.
      • setCollapseMode

        public void setCollapseMode​(int collapseMode)
        Sets the value of collapseMode.