Class GradationCurveCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
GradationActionCommand
Hint:
To work properly this command needs a PageView instance in the Context object.
The following named command parameters exists and can be used to configure the command behavior.
| Description | Command Parameter Name | Possible Parameter Values |
|---|---|---|
| gradation curve description | curve | a customized curve specification (how to define a customized curve is described below) |
Scope to apply to curve (inherited from AbstractDocumentCommand) |
scope | PAGE, DOCUMENT (default = DOCUMENT) |
The definition of a customized gradation curve should be given as the following example describes.
As an example take a look at a simple gradation given by four points:
- point.0.x=0, point.0.y=0
- point.1.x=53, point.1.y=101
- point.2.x=131, point.2.y=61
- point.4.x=255, point.4.y=255
This one could be defined by listing each point one after the other delimited by commas in the
command properties:
SimpleGradation =com.levigo.jadice.addon.gradation.ApplyGradationCommand
SimpleGradation.param.curve=0,0,53,101,131,61,255,255
If the points are not set or set to values, which can not translated into points, a neutral
gradation is assumed, excepted by NEUTRAL curve, which as mentioned above do not need any point
definition.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.levigo.jadice.web.client.commands.AbstractDocumentCommand
AbstractDocumentCommand.Scope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanChecks if this command can be executed.protected voidexecute()This method is called in order to execute the command.protected GradationCurveThis utility method is intended to get a lookup gradation curve to check the current applied settings.getCurve()protected GradationCurveCreates a gradation curve instance defined by command parameter points.voidMethods inherited from class com.levigo.jadice.web.client.commands.AbstractDocumentCommand
getDocument, getID, 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
-
GradationCurveCommand
public GradationCurveCommand()
-
-
Method Details
-
canExecute
protected boolean canExecute()Description copied from class:AbstractDocumentCommandChecks if this command can be executed.- Overrides:
canExecutein classAbstractDocumentCommand- Returns:
- true, if
InjectedCommand.execute(java.util.Collection<java.lang.Object>)can be called, false else
-
execute
protected void execute()Description copied from class:InjectedCommandThis 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:
executein classInjectedCommand
-
getGradationCurve
Creates a gradation curve instance defined by command parameter points. If the points are not defined or set to any value which cannot be translated into gradation points, a neutral gradation will be returned.- Returns:
- GradationCurve defined by command parameters
-
getCurrentGradationCurve
This utility method is intended to get a lookup gradation curve to check the current applied settings.It is a shortcut for
RenderControls.getImageRenderSettings()andImageRenderSettings.getGradationCurve().- Returns:
- GradationCurve
-
setCurve
-
getCurve
-