Class ZoomCommand
- All Implemented Interfaces:
Command
This includes zoom in and zoom out behaviour on a relative base. Defaults to 10% steps if no relative zoom factor is supplied by the caller.
Zooming behaviour can be configured to be document- or page specific by using the underlying
AbstractDocumentCommand.setScope(Scope) method.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.levigo.jadice.web.client.commands.AbstractDocumentCommand
AbstractDocumentCommand.Scope -
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.ZoomCommand(boolean zoomIn) Constructor.ZoomCommand(ZoomHelper zoomHelper, float zoomRelative) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanChecks if this command can be executed.protected voidexecute()Executes this command.getID()The ID of the command.setZoomRelative(float zoomRelative) Sets the relative zoom factor.Methods inherited from class com.levigo.jadice.web.client.commands.AbstractDocumentCommand
getDocument, getRenderControls, getScope, setScopeMethods inherited from class com.levigo.jadice.web.client.commands.AbstractMouseCommand
clearInjections, isDoubleClicked, setMouseEventMethods inherited from class com.levigo.jadice.web.client.commands.AbstractPageViewCommand
getPageView, setPageViewMethods inherited from class com.levigo.jadice.web.client.commands.AbstractContextCommand
getContext, propagateContextChange, setContextMethods inherited from class com.levigo.jadice.web.client.util.command.InjectedCommand
canExecute, execute, getKey, isSelected, isSelected, setKeyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.levigo.jadice.web.client.util.command.Command
isAvailable, isAvailable
-
Constructor Details
-
ZoomCommand
public ZoomCommand()Default Constructor. Initializes this command to provide zoom in behaviour. -
ZoomCommand
public ZoomCommand(boolean zoomIn) Constructor.- Parameters:
zoomIn- if true zoom in behaviour is configured, if false zoom out behaviour is configured.
-
ZoomCommand
Deprecated.
-
-
Method Details
-
setZoomRelative
Sets the relative zoom factor.The @Parameter annotation allows to wire command params. See examples in com.levigo.jadice.web.demo.common.server.DefaultDescriptorService.
- Parameters:
zoomRelative- the relative zoom factor that will be applied whenexecute()is called- Returns:
- this command instance
-
canExecute
protected boolean canExecute()Checks if this command can be executed.- Overrides:
canExecutein classAbstractDocumentCommand- Returns:
- true, if
execute()can be called, false else
-
execute
protected void execute()Executes this command.Applies the relative zoom factor to the existing one by mathematically adding it. The underlying
AbstractDocumentCommand.getRenderControls(boolean)decides on the givenAbstractDocumentCommand.Scopeif a document specific zoom or a page specific zoom is performed.If a document wide zoom is executed all page render settings zoom factors will be overridden.
- Specified by:
executein classInjectedCommand
-
getID
Description copied from interface:CommandThe ID of the command. This is typically the command class name. If the Command is parameterized the ID should comprise the class name + parameter information.- Specified by:
getIDin interfaceCommand- Overrides:
getIDin classAbstractDocumentCommand- Returns:
- the ID of the command
-