Class NFEAddFeatureElementTool

  • All Implemented Interfaces:
    Layer, Tool, PropertySupport

    public class NFEAddFeatureElementTool
    extends NFETool
    Tool used for creating new feature elements for a feature layer
    • Constructor Detail

      • NFEAddFeatureElementTool

        public NFEAddFeatureElementTool​(MapCanvas canvas,
                                        NFEModel model)
        Allocates a new add feature element tool
        Parameters:
        canvas - the current MapCanvas
        model - the current NFE model
    • Method Detail

      • getFeatureClass

        public NFEFeatureClass getFeatureClass()
        Gets the feature class used for creating new features in case a target feature has not been specified
        Returns:
        a feature class
      • setFeatureClass

        public void setFeatureClass​(NFEFeatureClass featClass)
        Sets the feature class used for creating new features in case a target feature has not been specified
        Parameters:
        featClass - a feature class
      • getTargetFeature

        public NFEFeature getTargetFeature()
        Gets the feature to which the new feature elements will be added
        Returns:
        a feature
      • setTargetFeature

        public void setTargetFeature​(NFEFeature targetFeature)
        Sets the feature to which the new feature elements will be added. If a target feature is set, there is not need to set the current feature class.
        Parameters:
        targetFeature - a feature
      • getHoverLayer

        public HoverableLayer getHoverLayer()
        Gets the layer that is hovered when adding feature elements. Typically it would be a network layer
        Returns:
        a hoverable layer
      • setHoverLayer

        public void setHoverLayer​(HoverableLayer targetLayer)
        Sets the layer that is hovered when adding feature elements. Typically it would be a network layer
        Parameters:
        targetLayer - a hoverable layer
      • handleEvent

        public boolean handleEvent​(java.util.EventObject evt)
        Description copied from interface: Layer
        The main method that performs event handling for this tool. Returns whether the event should be propagated to other layers down stream (further down the layer stack) after the event has been handled.
        Specified by:
        handleEvent in interface Layer
        Overrides:
        handleEvent in class NFETool
      • mouseMoved

        protected boolean mouseMoved​(java.awt.event.MouseEvent evt)
        Description copied from class: NFETool
        Called when a mouse moved event is registered
        Overrides:
        mouseMoved in class NFETool
        Parameters:
        evt - a mouse event event
        Returns:
        true if the event should be propagated
      • mouseClicked

        protected boolean mouseClicked​(java.awt.event.MouseEvent evt)
        Description copied from class: NFETool
        Called when a mouse clicked event is registered
        Overrides:
        mouseClicked in class NFETool
        Parameters:
        evt - a mouse event
        Returns:
        true if the event should be propagated
      • clear

        public void clear()
        Description copied from interface: Layer
        Clears all contents of this layer.
        Specified by:
        clear in interface Layer
        Overrides:
        clear in class BasicLayer
      • render

        public long render​(java.awt.Graphics2D g)
        Description copied from interface: Layer
        Renders the layer contents to the given Graphics.
        Specified by:
        render in interface Layer
        Overrides:
        render in class BasicLayer
        Parameters:
        g - the graphics object
        Returns:
        the rendering time in milliseconds.