Class FitPageCommand
java.lang.Object
com.levigo.jadice.web.client.util.command.InjectedCommand
com.levigo.jadice.web.client.commands.AbstractContextCommand
com.levigo.jadice.web.client.commands.AbstractPageViewCommand
com.levigo.jadice.web.client.commands.FitPageCommand
- All Implemented Interfaces:
Command
Command that adjusts the zoom factor.
Zoom factor can be adjusted to
- make the width of the page cover the whole viewer area
- make the height of the page cover the whole viewer area
- use the minimum zoom factor of the options above
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Subclasses may override this method to perform argument validation beyond the validation that happens automatically during the injection phase.protected void
execute()
This method is called in order to execute the command.getID()
The ID of the command.protected boolean
Returns the selected state of this command.void
setDynamicZoomMode
(int dynamicZoomMode) Sets the dynamic zoom mode.Methods inherited from class com.levigo.jadice.web.client.commands.AbstractPageViewCommand
getPageView, setPageView
Methods inherited from class com.levigo.jadice.web.client.commands.AbstractContextCommand
getContext, propagateContextChange, setContext
Methods inherited from class com.levigo.jadice.web.client.util.command.InjectedCommand
canExecute, clearInjections, execute, getKey, isSelected, setKey
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.levigo.jadice.web.client.util.command.Command
isAvailable, isAvailable
-
Constructor Details
-
FitPageCommand
public FitPageCommand() -
FitPageCommand
public FitPageCommand(int dynamicZoomMode)
-
-
Method Details
-
setDynamicZoomMode
public void setDynamicZoomMode(int dynamicZoomMode) Sets the dynamic zoom mode.- Parameters:
dynamicZoomMode
- Supply 1 to choose the zoom factor that will make the width of the page cover the whole viewer area. Supply 2 to choose the zoom factor that will make the height of the page cover the whole viewer area. Supply 3 to choose the minimum zoom factor of the options above.
-
execute
protected void execute()Description copied from class:InjectedCommand
This method is called in order to execute the command. It is only called, after the arguments have been validated and injected and only ifInjectedCommand.canExecute()
has returnedtrue
.- Specified by:
execute
in classInjectedCommand
-
canExecute
protected boolean canExecute()Description copied from class:InjectedCommand
Subclasses may override this method to perform argument validation beyond the validation that happens automatically during the injection phase. This method is called after the context has been found to match the requirements specified via the @ link Argument} annotations and the arguments have been injected.- Overrides:
canExecute
in classAbstractPageViewCommand
- Returns:
true
if the command can/may be executed in the current context,false
otherwise.
-
isSelected
protected boolean isSelected()Description copied from class:InjectedCommand
Returns the selected state of this command. This is typically used only for commands with a meaningful selection state.- Overrides:
isSelected
in classInjectedCommand
- Returns:
- the selected state
-
getID
Description copied from interface:Command
The 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.- Returns:
- the ID of the command
-