FloatMap.
 For each pixel in the output, the corresponding data from the
 mapData is retrieved, scaled and offset by the scale
 and offset attributes, scaled again by the size of the
 source input image and used as an offset from the destination pixel
 to retrieve the pixel data from the source input.
 
 dst[x, y] = src[(x, y) + (offset + scale * map[x, y]) * (srcw, srch)]
 
 A value of (0.0, 0.0) would specify no offset for the
 pixel data whereas a value of (0.5, 0.5) would specify
 an offset of half of the source image size.
 
 Note that the mapping is the offset from a destination pixel to
 the source pixel location from which it is sampled which means that
 filling the map with all values of 0.5 would displace the
 image by half of its size towards the upper left since each destination
 pixel would contain the data that comes from the source pixel below and
 to the right of it.
 
 Also note that this effect does not adjust the coordinates of input
 events or any methods that measure containment on a Node.
 The results of mouse picking and the containment methods are undefined
 when a Node has a DisplacementMap effect in place.
 
Example:
 int width = 220;
 int height = 100;
 FloatMap floatMap = new FloatMap();
 floatMap.setWidth(width);
 floatMap.setHeight(height);
 for (int i = 0; i < width; i++) {
     double v = (Math.sin(i / 20.0 * Math.PI) - 0.5) / 40.0;
     for (int j = 0; j < height; j++) {
         floatMap.setSamples(i, j, 0.0f, (float) v);
     }
 }
 DisplacementMap displacementMap = new DisplacementMap();
 displacementMap.setMapData(floatMap);
 Text text = new Text();
 text.setX(40.0);
 text.setY(80.0);
 text.setText("Wavy Text");
 text.setFill(Color.web("0x3b596d"));
 text.setFont(Font.font(null, FontWeight.BOLD, 50));
 text.setEffect(displacementMap);The code above produces the following:
  
 
- Since:
- JavaFX 2.0
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<Effect>The input for thisEffect.final ObjectProperty<FloatMap>The map data for thisEffect.final DoublePropertyThe offset by which all x coordinate offset values in theFloatMapare displaced after they are scaled.final DoublePropertyThe offset by which all y coordinate offset values in theFloatMapare displaced after they are scaled.final DoublePropertyThe scale factor by which all x coordinate offset values in theFloatMapare multiplied.final DoublePropertyThe scale factor by which all y coordinate offset values in theFloatMapare multiplied.final BooleanPropertyDefines whether values taken from outside the edges of the map "wrap around" or not.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new instance of DisplacementMap with default parameters.DisplacementMap(FloatMap mapData) Creates a new instance of DisplacementMap with the specified mapData.DisplacementMap(FloatMap mapData, double offsetX, double offsetY, double scaleX, double scaleY) Creates a new instance of DisplacementMap with the specified mapData, offsetX, offsetY, scaleX, and scaleY.
- 
Method SummaryModifier and TypeMethodDescriptionfinal EffectgetInput()Gets the value of theinputproperty.final FloatMapGets the value of themapDataproperty.final doubleGets the value of theoffsetXproperty.final doubleGets the value of theoffsetYproperty.final doubleGets the value of thescaleXproperty.final doubleGets the value of thescaleYproperty.final ObjectProperty<Effect>The input for thisEffect.final booleanisWrap()Gets the value of thewrapproperty.final ObjectProperty<FloatMap>The map data for thisEffect.final DoublePropertyThe offset by which all x coordinate offset values in theFloatMapare displaced after they are scaled.final DoublePropertyThe offset by which all y coordinate offset values in theFloatMapare displaced after they are scaled.final DoublePropertyThe scale factor by which all x coordinate offset values in theFloatMapare multiplied.final DoublePropertyThe scale factor by which all y coordinate offset values in theFloatMapare multiplied.final voidSets the value of theinputproperty.final voidsetMapData(FloatMap value) Sets the value of themapDataproperty.final voidsetOffsetX(double value) Sets the value of theoffsetXproperty.final voidsetOffsetY(double value) Sets the value of theoffsetYproperty.final voidsetScaleX(double value) Sets the value of thescaleXproperty.final voidsetScaleY(double value) Sets the value of thescaleYproperty.final voidsetWrap(boolean value) Sets the value of thewrapproperty.final BooleanPropertyDefines whether values taken from outside the edges of the map "wrap around" or not.
- 
Property Details- 
inputThe input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.- Default value:
- null
- See Also:
 
- 
mapDataThe map data for thisEffect.- Default value:
- an empty map
- See Also:
 
- 
scaleXThe scale factor by which all x coordinate offset values in theFloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0- Default value:
- 1.0
- See Also:
 
- 
scaleYThe scale factor by which all y coordinate offset values in theFloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0- Default value:
- 1.0
- See Also:
 
- 
offsetXThe offset by which all x coordinate offset values in theFloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
 
- 
offsetYThe offset by which all y coordinate offset values in theFloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0- Default value:
- 0.0
- See Also:
 
- 
wrapDefines whether values taken from outside the edges of the map "wrap around" or not.Min: n/a Max: n/a Default: false Identity: n/a- Default value:
- false
- See Also:
 
 
- 
- 
Constructor Details- 
DisplacementMappublic DisplacementMap()Creates a new instance of DisplacementMap with default parameters.
- 
DisplacementMapCreates a new instance of DisplacementMap with the specified mapData.- Parameters:
- mapData- the map data for this displacement map effect
- Since:
- JavaFX 2.1
 
- 
DisplacementMappublic DisplacementMap(FloatMap mapData, double offsetX, double offsetY, double scaleX, double scaleY) Creates a new instance of DisplacementMap with the specified mapData, offsetX, offsetY, scaleX, and scaleY.- Parameters:
- mapData- the map data for this displacement map effect
- offsetX- the offset by which all x coordinate offset values in the- FloatMapare displaced after they are scaled
- offsetY- the offset by which all y coordinate offset values in the- FloatMapare displaced after they are scaled
- scaleX- the scale factor by which all x coordinate offset values in the- FloatMapare multiplied
- scaleY- the scale factor by which all y coordinate offset values in the- FloatMapare multiplied
- Since:
- JavaFX 2.1
 
 
- 
- 
Method Details- 
setInputSets the value of theinputproperty.- Property description:
- The input for this Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.
- Default value:
- null
- Parameters:
- value- the value for the- inputproperty
- See Also:
 
- 
getInputGets the value of theinputproperty.- Property description:
- The input for this Effect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.
- Default value:
- null
- Returns:
- the value of the inputproperty
- See Also:
 
- 
inputPropertyThe input for thisEffect. If set tonull, or left unspecified, a graphical image of theNodeto which theEffectis attached will be used as the input.- Default value:
- null
- Returns:
- the inputproperty
- See Also:
 
- 
setMapDataSets the value of themapDataproperty.- Property description:
- The map data for this Effect.
- Default value:
- an empty map
- Parameters:
- value- the value for the- mapDataproperty
- See Also:
 
- 
getMapDataGets the value of themapDataproperty.- Property description:
- The map data for this Effect.
- Default value:
- an empty map
- Returns:
- the value of the mapDataproperty
- See Also:
 
- 
mapDataPropertyThe map data for thisEffect.- Default value:
- an empty map
- Returns:
- the mapDataproperty
- See Also:
 
- 
setScaleXpublic final void setScaleX(double value) Sets the value of thescaleXproperty.- Property description:
- The scale factor by which all x coordinate offset values in the
 FloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0
- Default value:
- 1.0
- Parameters:
- value- the value for the- scaleXproperty
- See Also:
 
- 
getScaleXpublic final double getScaleX()Gets the value of thescaleXproperty.- Property description:
- The scale factor by which all x coordinate offset values in the
 FloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0
- Default value:
- 1.0
- Returns:
- the value of the scaleXproperty
- See Also:
 
- 
scaleXPropertyThe scale factor by which all x coordinate offset values in theFloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0- Default value:
- 1.0
- Returns:
- the scaleXproperty
- See Also:
 
- 
setScaleYpublic final void setScaleY(double value) Sets the value of thescaleYproperty.- Property description:
- The scale factor by which all y coordinate offset values in the
 FloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0
- Default value:
- 1.0
- Parameters:
- value- the value for the- scaleYproperty
- See Also:
 
- 
getScaleYpublic final double getScaleY()Gets the value of thescaleYproperty.- Property description:
- The scale factor by which all y coordinate offset values in the
 FloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0
- Default value:
- 1.0
- Returns:
- the value of the scaleYproperty
- See Also:
 
- 
scaleYPropertyThe scale factor by which all y coordinate offset values in theFloatMapare multiplied.Min: n/a Max: n/a Default: 1.0 Identity: 1.0- Default value:
- 1.0
- Returns:
- the scaleYproperty
- See Also:
 
- 
setOffsetXpublic final void setOffsetX(double value) Sets the value of theoffsetXproperty.- Property description:
- The offset by which all x coordinate offset values in the
 FloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
- value- the value for the- offsetXproperty
- See Also:
 
- 
getOffsetXpublic final double getOffsetX()Gets the value of theoffsetXproperty.- Property description:
- The offset by which all x coordinate offset values in the
 FloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the offsetXproperty
- See Also:
 
- 
offsetXPropertyThe offset by which all x coordinate offset values in theFloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0- Default value:
- 0.0
- Returns:
- the offsetXproperty
- See Also:
 
- 
setOffsetYpublic final void setOffsetY(double value) Sets the value of theoffsetYproperty.- Property description:
- The offset by which all y coordinate offset values in the
 FloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Parameters:
- value- the value for the- offsetYproperty
- See Also:
 
- 
getOffsetYpublic final double getOffsetY()Gets the value of theoffsetYproperty.- Property description:
- The offset by which all y coordinate offset values in the
 FloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0
- Default value:
- 0.0
- Returns:
- the value of the offsetYproperty
- See Also:
 
- 
offsetYPropertyThe offset by which all y coordinate offset values in theFloatMapare displaced after they are scaled.Min: n/a Max: n/a Default: 0.0 Identity: 0.0- Default value:
- 0.0
- Returns:
- the offsetYproperty
- See Also:
 
- 
setWrappublic final void setWrap(boolean value) Sets the value of thewrapproperty.- Property description:
- Defines whether values taken from outside the edges of the map
 "wrap around" or not.
 Min: n/a Max: n/a Default: false Identity: n/a
- Default value:
- false
- Parameters:
- value- the value for the- wrapproperty
- See Also:
 
- 
isWrappublic final boolean isWrap()Gets the value of thewrapproperty.- Property description:
- Defines whether values taken from outside the edges of the map
 "wrap around" or not.
 Min: n/a Max: n/a Default: false Identity: n/a
- Default value:
- false
- Returns:
- the value of the wrapproperty
- See Also:
 
- 
wrapPropertyDefines whether values taken from outside the edges of the map "wrap around" or not.Min: n/a Max: n/a Default: false Identity: n/a- Default value:
- false
- Returns:
- the wrapproperty
- See Also:
 
 
-