Class Zoom

  • All Implemented Interfaces:
    Command

    public class Zoom
    extends PositionCommand
    A command for zooming in/out a zoomable object.
    Author:
    Arnaud BLOUIN
    • Field Detail

      • zoomable

        protected final Zoomable zoomable
        The object to zoom.
      • zoomLevel

        protected double zoomLevel
        The zooming level.
    • Constructor Detail

      • Zoom

        public Zoom​(Zoomable zoomable)
        Initialises a Zoom command.
        Parameters:
        zoomable - The object to zoom.
    • 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.
      • doCmdBody

        protected void doCmdBody()
        Description copied from class: CommandImpl
        This method contains the statements to execute the command. This method is automatically called by DoIt and must not be called explicitly.
        Specified by:
        doCmdBody in class CommandImpl
      • setZoomLevel

        public void setZoomLevel​(double newZoomLevel)
        Parameters:
        newZoomLevel - the zoomLevel to set.