Class MapMode

    • Field Detail

      • cursor

        protected final java.awt.Cursor cursor
      • ctrl

        protected boolean ctrl
      • alt

        protected boolean alt
      • shift

        protected boolean shift
      • meta

        protected boolean meta
        true if the meta key was pressed (the "Windows" key or the Mac "Command" key)
        Since:
        18456
    • Constructor Detail

      • MapMode

        protected MapMode​(java.lang.String name,
                          java.lang.String iconName,
                          java.lang.String tooltip,
                          Shortcut shortcut,
                          java.awt.Cursor cursor)
        Constructor for mapmodes without a menu
        Parameters:
        name - the action's text
        iconName - icon filename in mapmode directory
        tooltip - a longer description of the action that will be displayed in the tooltip.
        shortcut - a ready-created shortcut object or null if you don't want a shortcut.
        cursor - cursor displayed when map mode is active
        Since:
        11713
      • MapMode

        protected MapMode​(java.lang.String name,
                          java.lang.String iconName,
                          java.lang.String tooltip,
                          java.awt.Cursor cursor)
        Constructor for mapmodes with a menu (no shortcut will be registered)
        Parameters:
        name - the action's text
        iconName - icon filename in mapmode directory
        tooltip - a longer description of the action that will be displayed in the tooltip.
        cursor - cursor displayed when map mode is active
        Since:
        11713
    • Method Detail

      • enterMode

        public void enterMode()
        Makes this map mode active.
      • exitMode

        public void exitMode()
        Makes this map mode inactive.
      • getModeHelpText

        public java.lang.String getModeHelpText()
        Returns a short translated help message describing how this map mode can be used, to be displayed in status line.
        Returns:
        a short translated help message describing how this map mode can be used
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Call selectMapMode(this) on the parent mapFrame.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • layerIsSupported

        public boolean layerIsSupported​(Layer l)
        Determines if layer l is supported by this map mode. By default, all tools will work with all layers. Can be overwritten to require a special type of layer
        Parameters:
        l - layer
        Returns:
        true if the layer is supported by this map mode
      • updateKeyModifiers

        protected void updateKeyModifiers​(java.awt.event.InputEvent e)
        Update internal ctrl, alt, shift mask from given input event.
        Parameters:
        e - input event
      • updateKeyModifiers

        protected void updateKeyModifiers​(java.awt.event.MouseEvent e)
        Update internal ctrl, alt, shift mask from given mouse event.
        Parameters:
        e - mouse event
      • updateKeyModifiers

        protected void updateKeyModifiers​(java.awt.event.ActionEvent e)
        Update internal ctrl, alt, shift mask from given action event.
        Parameters:
        e - action event
        Since:
        12526
      • updateKeyModifiersEx

        protected void updateKeyModifiersEx​(int modifiers)
        Update internal ctrl, alt, shift, meta mask from given extended modifiers mask.
        Parameters:
        modifiers - event extended modifiers mask
        Since:
        12517
      • mapOldModifiers

        private static int mapOldModifiers​(int modifiers)
        Map old (pre jdk 1.4) modifiers to extended modifiers (only for Ctrl, Alt, Shift).
        Parameters:
        modifiers - old modifiers
        Returns:
        extended modifiers
      • mouseReleased

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

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

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

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

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

        public void mouseMoved​(java.awt.event.MouseEvent e)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
      • isEditableDataLayer

        protected boolean isEditableDataLayer​(Layer l)
        Determines if the given layer is a data layer that can be modified. Useful for layerIsSupported(Layer) implementations.
        Parameters:
        l - layer
        Returns:
        true if the given layer is a data layer that can be modified
        Since:
        13434