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 Zoomable zoomable
        The object to zoom.
      • zoomLevel

        protected double zoomLevel
        The zooming level.
    • Constructor Detail

      • Zoom

        public Zoom()
        Initialises a Zoom command.
    • Method Detail

      • flush

        public void flush()
        Description copied from interface: Command
        Flushes the command. Can be useful to close streams, free objects, etc. A command should flushed manually only when it is not managed by the cmd registry of the application. When a command is gathered and managed by a command registry, it is automatically flushed when the command registry removes the cmd.
        Specified by:
        flush in interface Command
        Overrides:
        flush in class CommandImpl
      • 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 PositionCommand
        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
      • setZoomable

        public void setZoomable​(Zoomable newZoomable)
        Parameters:
        newZoomable - the zoomable to set.
      • setZoomLevel

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