Separator control.
Separator
| Modifier and Type | Field and Description |
|---|---|
| private static final double | DEFAULT_LENGTH
Separator's have no intrinsic length, so we need to hard code some sort of default preferred size when a separator is not otherwise being resized. |
| private final Region | line
The region to use for rendering the line. |
| Access | Constructor and Description |
|---|---|
| public | SeparatorSkin(Separator
The control that this skin should be installed onto. control)Creates a new SeparatorSkin instance, installing the necessary child
nodes into the Control |
| Modifier and Type | Method and Description |
|---|---|
| protected double | computeMaxHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Computes the maximum allowable height of the Skin, based on the provided width. |
| protected double | computeMaxWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Computes the maximum allowable width of the Skin, based on the provided height. |
| protected double | computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Computes the minimum allowable height of the Skin, based on the provided width. |
| protected double | computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Computes the minimum allowable width of the Skin, based on the provided height. |
| protected double | computePrefHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Calculates the preferred height of this |
| protected double | computePrefWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset)
Overrides javafx. Calculates the preferred width of this |
| public void | dispose()
Overrides javafx. Implements javafx. Called when a previously installed skin is about to be removed from its associated control. |
| protected void | layoutChildren(final double x, final double y, final double w, final double h)
Overrides javafx. We only need to deal with the single "line" child region. |
| DEFAULT_LENGTH | back to summary |
|---|---|
| private static final double DEFAULT_LENGTH Separator's have no intrinsic length, so we need to hard code some sort of default preferred size when a separator is not otherwise being resized. This is the default length to use (height when vertical, width when horizontal) for computing the preferred width/height. | |
| line | back to summary |
|---|---|
| private final Region line The region to use for rendering the line. The line is specified via CSS. By default we use a single stroke to render the line, but the programmer could use images or whatnot from CSS instead. | |
| SeparatorSkin | back to summary |
|---|---|
| public SeparatorSkin(Separator control) Creates a new SeparatorSkin instance, installing the necessary child
nodes into the Control
| |
| computeMaxHeight | back to summary |
|---|---|
| protected double computeMaxHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the maximum allowable height of the Skin, based on the provided width.
| |
| computeMaxWidth | back to summary |
|---|---|
| protected double computeMaxWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the maximum allowable width of the Skin, based on the provided height.
| |
| computeMinHeight | back to summary |
|---|---|
| protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the minimum allowable height of the Skin, based on the provided width.
| |
| computeMinWidth | back to summary |
|---|---|
| protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the minimum allowable width of the Skin, based on the provided height.
| |
| computePrefHeight | back to summary |
|---|---|
| protected double computePrefHeight(double w, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Calculates the preferred height of this
| |
| computePrefWidth | back to summary |
|---|---|
| protected double computePrefWidth(double h, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Calculates the preferred width of this
| |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides javafx. Implements javafx. Doc from javafx. Called when a previously installed skin is about to be removed from its associated control.
This allows the skin to do clean up, like removing listeners and bindings, and undo any changes
to the control's properties.
After this method completes,
Calling
| |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren(final double x, final double y, final double w, final double h) Overrides javafx. We only need to deal with the single "line" child region. The important thing here is that we want a horizontal separator to have a line which is as wide as the separator (less the left/right padding), but as thin as it can be (based on its own pref height). The same idea for a vertical separator. It should be as tall as the separator (less the top and bottom padding) but as thin as can be (the pref width of the line). Then position the line within the separator such that the alignment properties are honored.
| |