Class PositionCommand

  • All Implemented Interfaces:
    Command
    Direct Known Subclasses:
    Zoom

    public abstract class PositionCommand
    extends CommandImpl
    Defines an abstract command that move an object to the given position.
    Author:
    Arnaud BLOUIN
    • Field Detail

      • px

        protected double px
        The X-coordinate of the location to zoom.
      • py

        protected double py
        The Y-coordinate of the location to zoom.
    • Constructor Detail

      • PositionCommand

        public PositionCommand()
        Creates the command.
    • Method Detail

      • canDo

        public boolean canDo()
        Description copied from interface: Command
        Checks whether the command can be executed.
        Specified by:
        canDo in interface Command
        Overrides:
        canDo in class CommandImpl
        Returns:
        True if the command can be executed.
      • setPx

        public void setPx​(double px)
        Parameters:
        px - The x-coordinate to set.
      • setPy

        public void setPy​(double py)
        Parameters:
        py - The y-coordinate to set.