Top Description Fields Constructors Methods
net.synedra.validatorfx

public Class GraphicDecoration

extends Object
implements Decoration
Class Inheritance
All Implemented Interfaces
net.synedra.validatorfx.Decoration
Imports
javafx.application.Platform, javafx.beans.value.ChangeListener, .WeakChangeListener, javafx.geometry.Bounds, .Pos, javafx.scene.Node, .Parent, .Scene, javafx.scene.transform.Transform

GraphicDecoration provides decoration of nodes by overlaying them with another node.
Author
[email protected]

Field Summary

Modifier and TypeField and Description
private Node
private final Node
private final ChangeListener<Boolean>
private final Pos
private ChangeListener<Scene>
private GraphicDecorationStackPane
private final ChangeListener<Transform>
private final double
private final double

Constructor Summary

AccessConstructor and Description
public
GraphicDecoration(Node
The node to overlay over the decorated node
decorationNode
)

Create GraphicDecoration that will be overlayed in the top-left corner

public
GraphicDecoration(Node
The node to overlay over the decorated node
decorationNode
,
Pos
The location of the overlay
position
)

Create GraphicDecoration

public
GraphicDecoration(Node
The node to overlay over the decorated node
decorationNode
,
Pos
The location of the overlay
position
,
double
Horizontal offset of overlay (with respect to position)
xOffset
,
double
Vertical offset of overlay (with respect to position)
yOffset
)

Create GraphicDecoration

Method Summary

Modifier and TypeMethod and Description
public void
add(Node
The node to decorate
target
)

Implements net.synedra.validatorfx.Decoration.add.

Add a decoration to the given target node

private void
private static GraphicDecorationStackPane
private void
public void
remove(Node
The node to remove decoration from
target
)

Implements net.synedra.validatorfx.Decoration.remove.

Remove a decoration from the given target node

private void
private void
setupStack(Node target)

private boolean
public static void
updateDecorations(Node
A node in the scene to update decorations for
node
)

Manually trigger an update for decorations in scene.

private void
withStack(Runnable code, Node target)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

decoratedNodeback to summary
private Node decoratedNode
decorationNodeback to summary
private final Node decorationNode
layoutListenerback to summary
private final ChangeListener<Boolean> layoutListener
posback to summary
private final Pos pos
sceneChangedListenerback to summary
private ChangeListener<Scene> sceneChangedListener
stackback to summary
private GraphicDecorationStackPane stack
transformListenerback to summary
private final ChangeListener<Transform> transformListener
xOffsetback to summary
private final double xOffset
yOffsetback to summary
private final double yOffset

Constructor Detail

GraphicDecorationback to summary
public GraphicDecoration(Node decorationNode)

Create GraphicDecoration that will be overlayed in the top-left corner

Parameters
decorationNode:Node

The node to overlay over the decorated node

GraphicDecorationback to summary
public GraphicDecoration(Node decorationNode, Pos position)

Create GraphicDecoration

Parameters
decorationNode:Node

The node to overlay over the decorated node

position:Pos

The location of the overlay

GraphicDecorationback to summary
public GraphicDecoration(Node decorationNode, Pos position, double xOffset, double yOffset)

Create GraphicDecoration

Parameters
decorationNode:Node

The node to overlay over the decorated node

position:Pos

The location of the overlay

xOffset:double

Horizontal offset of overlay (with respect to position)

yOffset:double

Vertical offset of overlay (with respect to position)

Method Detail

addback to summary
public void add(Node target)

Implements net.synedra.validatorfx.Decoration.add.

Doc from net.synedra.validatorfx.Decoration.add.

Add a decoration to the given target node

Parameters
target:Node

The node to decorate

Annotations
@Override
addOrRemoveDecorationNodeToStackback to summary
private void addOrRemoveDecorationNodeToStack()
findDecorationPaneback to summary
private static GraphicDecorationStackPane findDecorationPane(Node node)
layoutGraphicback to summary
private void layoutGraphic()
removeback to summary
public void remove(Node target)

Implements net.synedra.validatorfx.Decoration.remove.

Doc from net.synedra.validatorfx.Decoration.remove.

Remove a decoration from the given target node

Parameters
target:Node

The node to remove decoration from

Annotations
@Override
setListenerback to summary
private void setListener()
setupStackback to summary
private void setupStack(Node target)
targetVisibleback to summary
private boolean targetVisible()
updateDecorationsback to summary
public static void updateDecorations(Node node)

Manually trigger an update for decorations in scene. You should not need to call this method, because ValidatorFX should detect the need to update graphic validations. If you do need to call this method, consider filing an issue at https://github.com/effad/ValidatorFX/issues

Parameters
node:Node

A node in the scene to update decorations for

withStackback to summary
private void withStack(Runnable code, Node target)