- java.lang.Object
-
- io.github.interacto.command.CommandImpl
-
- io.github.interacto.command.library.PositionCommand
-
- io.github.interacto.command.library.Zoom
-
- All Implemented Interfaces:
Command
public class Zoom extends PositionCommand
A command for zooming in/out a zoomable object.- Author:
- Arnaud BLOUIN
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.github.interacto.command.Command
Command.CmdStatus, Command.RegistrationPolicy
-
-
Field Summary
Fields Modifier and Type Field Description protected ZoomablezoomableThe object to zoom.protected doublezoomLevelThe zooming level.-
Fields inherited from class io.github.interacto.command.library.PositionCommand
px, py
-
Fields inherited from class io.github.interacto.command.CommandImpl
status
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDo()Checks whether the command can be executed.protected voiddoCmdBody()This method contains the statements to execute the command.voidsetZoomLevel(double newZoomLevel)-
Methods inherited from class io.github.interacto.command.library.PositionCommand
setPx, setPy
-
Methods inherited from class io.github.interacto.command.CommandImpl
cancel, createMemento, doIt, done, flush, getRegistrationPolicy, getStatus, hadEffect, isDone, toString, unregisteredBy
-
-
-
-
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:CommandChecks whether the command can be executed.- Specified by:
canDoin interfaceCommand- Overrides:
canDoin classCommandImpl- Returns:
- True if the command can be executed.
-
doCmdBody
protected void doCmdBody()
Description copied from class:CommandImplThis method contains the statements to execute the command. This method is automatically called by DoIt and must not be called explicitly.- Specified by:
doCmdBodyin classCommandImpl
-
setZoomLevel
public void setZoomLevel(double newZoomLevel)
- Parameters:
newZoomLevel- the zoomLevel to set.
-
-