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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Checks if this command can be executed.protected void
execute()
This method is called in order to execute the command.protected GradationCurve
This utility method is intended to get a lookup gradation curve to check the current applied settings.getCurve()
protected GradationCurve
Creates a gradation curve instance defined by command parameter points.void
Methods inherited from class com.levigo.jadice.web.client.commands.AbstractDocumentCommand
getDocument, getID, getRenderControls, getScope, setScope
Methods inherited from class com.levigo.jadice.web.client.commands.AbstractMouseCommand
clearInjections, isDoubleClicked, setMouseEvent
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, execute, getKey, isSelected, 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
-
GradationCurveCommand
public GradationCurveCommand()
-
-
Method Details
-
canExecute
protected boolean canExecute()Description copied from class:AbstractDocumentCommand
Checks if this command can be executed.- Overrides:
canExecute
in 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: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
-
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
-