APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.effect

public Class SepiaTone

extends Effect
Class Inheritance
Imports
javafx.beans.property.DoubleProperty, .DoublePropertyBase, .ObjectProperty, javafx.scene.Node, com.sun.javafx.util.Utils, com.sun.javafx.effect.EffectDirtyBits, com.sun.javafx.geom.BaseBounds, com.sun.javafx.geom.transform.BaseTransform, com.sun.javafx.scene.BoundsAccessor

A filter that produces a sepia tone effect, similar to antique photographs.

Example:

SepiaTone sepiaTone = new SepiaTone();
sepiaTone.setLevel(0.7);

Image image = new Image("boat.jpg");
ImageView imageView = new ImageView(image);
imageView.setFitWidth(200);
imageView.setPreserveRatio(true);
imageView.setEffect(sepiaTone);

The code above applied on this image:

A photo

produces the following:

The visual effect of SepiaTone on photo

Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private ObjectProperty<Effect>
input

The input for this Effect.

private DoubleProperty
level

The level value, which controls the intensity of the sepia effect.

Constructor Summary

AccessConstructor and Description
public
SepiaTone()

Creates a new instance of SepiaTone with default parameters.

public
SepiaTone(double
the level value, which controls the intensity of the effect
level
)

Creates a new instance of SepiaTone with the specified level.

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
pack-priv Effect
copy()

Implements abstract javafx.scene.effect.Effect.copy.

pack-priv SepiaTone
pack-priv BaseBounds
getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)

Implements abstract javafx.scene.effect.Effect.getBounds.

Returns bounds of given node with applied effect.

public final Effect
public final double
public final ObjectProperty<Effect>
public final DoubleProperty
public final void
public final void
setLevel(double value)

pack-priv void
Inherited from javafx.scene.effect.Effect:
containsCycleseffectBoundsChangedgetInputBoundsgetKernelSizegetPeergetShadowBoundsmarkDirtysynctransformBounds

Field Detail

inputback to summary
private ObjectProperty<Effect> input

The input for this Effect. If set to null, or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.

Default Value
null
levelback to summary
private DoubleProperty level

The level value, which controls the intensity of the sepia effect.

      Min: 0.0f
      Max: 1.0f
  Default: 1.0f
 Identity: 0.0f
Default Value
1.0f

Constructor Detail

SepiaToneback to summary
public SepiaTone()

Creates a new instance of SepiaTone with default parameters.

SepiaToneback to summary
public SepiaTone(double level)

Creates a new instance of SepiaTone with the specified level.

Parameters
level:double

the level value, which controls the intensity of the effect

Since
JavaFX 2.1

Method Detail

checkChainContainsback to summary
pack-priv boolean checkChainContains(Effect e)

Implements abstract javafx.scene.effect.Effect.checkChainContains.

Annotations
@Override
copyback to summary
pack-priv Effect copy()

Implements abstract javafx.scene.effect.Effect.copy.

Annotations
@Override
createPeerback to summary
pack-priv SepiaTone createPeer()

Implements abstract javafx.scene.effect.Effect.createPeer.

Annotations
@Override
getBoundsback to summary
pack-priv BaseBounds getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)

Implements abstract javafx.scene.effect.Effect.getBounds.

Doc from javafx.scene.effect.Effect.getBounds.

Returns bounds of given node with applied effect. We *never* pass null in as a bounds. This method will NOT take a null bounds object. The returned value may be the same bounds object passed in, or it may be a new object.

Annotations
@Override
getInputback to summary
public final Effect getInput()
getLevelback to summary
public final double getLevel()
inputPropertyback to summary
public final ObjectProperty<Effect> inputProperty()
levelPropertyback to summary
public final DoubleProperty levelProperty()
setInputback to summary
public final void setInput(Effect value)
setLevelback to summary
public final void setLevel(double value)
updateback to summary
pack-priv void update()

Implements abstract javafx.scene.effect.Effect.update.

Annotations
@Override