- 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
-
-
Constructor Summary
Constructors Constructor Description Zoom()Initialises a Zoom command.
-
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.voidflush()Flushes the command.voidsetZoomable(Zoomable newZoomable)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, getRegistrationPolicy, getStatus, hadEffect, isDone, toString, unregisteredBy
-
-
-
-
Field Detail
-
zoomable
protected Zoomable zoomable
The object to zoom.
-
zoomLevel
protected double zoomLevel
The zooming level.
-
-
Method Detail
-
flush
public void flush()
Description copied from interface:CommandFlushes 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:
flushin interfaceCommand- Overrides:
flushin classCommandImpl
-
canDo
public boolean canDo()
Description copied from interface:CommandChecks whether the command can be executed.- Specified by:
canDoin interfaceCommand- Overrides:
canDoin classPositionCommand- 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
-
setZoomable
public void setZoomable(Zoomable newZoomable)
- Parameters:
newZoomable- the zoomable to set.
-
setZoomLevel
public void setZoomLevel(double newZoomLevel)
- Parameters:
newZoomLevel- the zoomLevel to set.
-
-