Class TransformNodesCommand

    • Constructor Detail

      • TransformNodesCommand

        protected TransformNodesCommand​(java.util.Collection<? extends OsmPrimitive> objects)
        Creates a TransformNodesObject. Find out the impacted nodes and store their initial state.
        Parameters:
        objects - objects to fetch nodes from. Must neither be null nor empty. Items must belong to a data set
        Throws:
        java.lang.NullPointerException - if objects is null or contain null item
        java.util.NoSuchElementException - if objects is empty
    • Method Detail

      • storeOldState

        protected final void storeOldState()
        Stores the state of the nodes before the command.
      • handleEvent

        public abstract void handleEvent​(EastNorth currentEN)
        Handling of a mouse event (e.g. dragging event).
        Parameters:
        currentEN - the current world position of the mouse
      • transformNodes

        protected abstract void transformNodes()
        Implementation for the nodes transformation. No parameters are given here, you should handle the user input in handleEvent() and store it internally.
      • executeCommand

        public boolean executeCommand()
        Finally apply the transformation of the nodes. This is called when the user is happy with the current state of the command and its effects.
        Overrides:
        executeCommand in class Command
        Returns:
        true
      • fillModifiedData

        public void fillModifiedData​(java.util.Collection<OsmPrimitive> modified,
                                     java.util.Collection<OsmPrimitive> deleted,
                                     java.util.Collection<OsmPrimitive> added)
        Description copied from class: Command
        Fill in the changed data this command operates on. Add to the lists, don't clear them.
        Specified by:
        fillModifiedData in class Command
        Parameters:
        modified - The modified primitives
        deleted - The deleted primitives
        added - The added primitives
      • getDescriptionText

        public java.lang.String getDescriptionText()
        Description copied from interface: PseudoCommand
        Provides a description text representing this command.
        Returns:
        description text representing this command
      • getDescriptionIcon

        public javax.swing.Icon getDescriptionIcon()
        Description copied from interface: PseudoCommand
        Provides a descriptive icon of this command.
        Returns:
        descriptive icon of this command
      • getTransformedNodes

        public java.util.Collection<NodegetTransformedNodes()
        Get the nodes with the current transformation applied.
        Returns:
        nodes with the current transformation applied
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class Command