public interface DecorationSupport
DecorationSupport is an interface that indicates a Region can be a host for decorations created by Decorator. DecorationPane is a host for decorations and it will cover majorities of the use cases for
decorations. However, in cases of TableColumnHeader, TableCell, ListCell, TreeCell, etc. that are inside a VirtualFlow, using DecorationPane directly is not practical. That's why we abstracted this interface so that
those regions can implement it to provide its own dedicated support for decorations.
Both methods below are on the <code>Region</code> but as protected so we can't call them directly from outside. So by exposing them on this interface, we can call them from outside so that we can add decoration nodes and position them at the location we wanted.
When you implement this interface, all your need to do is to add the following implementation of both methods.
public ObservableList<Node> getChildren() {
return super.getChildren();
}
public void positionInArea(Node child, double areaX, double areaY, double areaWidth, double areaHeight, double
areaBaselineOffset, HPos halignment, VPos valignment) {
super.positionInArea(child, areaX, areaY, areaWidth, areaHeight, areaBaselineOffset, halignment, valignment);
}
more details.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
STYLE_CLASS_DECORATION_SUPPORT |
| Modifier and Type | Method and Description |
|---|---|
javafx.collections.ObservableList<javafx.scene.Node> |
getChildren()
Gets the children of the region.
|
void |
positionInArea(javafx.scene.Node child,
double areaX,
double areaY,
double areaWidth,
double areaHeight,
double areaBaselineOffset,
javafx.geometry.HPos halignment,
javafx.geometry.VPos valignment)
This is a protected method on
Region. |
static final java.lang.String STYLE_CLASS_DECORATION_SUPPORT
javafx.collections.ObservableList<javafx.scene.Node> getChildren()
Parent's getChildren method is protected so the implementation of this
method could simply call super.getChildren().void positionInArea(javafx.scene.Node child,
double areaX,
double areaY,
double areaWidth,
double areaHeight,
double areaBaselineOffset,
javafx.geometry.HPos halignment,
javafx.geometry.VPos valignment)
Region. The implementation of this method could simply call
super.positionInArea(...) with the exact same parameters.child - the child being positioned within this regionareaX - the horizontal offset of the layout area relative to this regionareaY - the vertical offset of the layout area relative to this regionareaWidth - the width of the layout areaareaHeight - the height of the layout areaareaBaselineOffset - the baseline offset to be used if VPos is BASELINEhalignment - the horizontal alignment for the child within the areavalignment - the vertical alignment for the child within the area