Java Code Examples for javafx.scene.layout.Region#getShape()

The following examples show how to use javafx.scene.layout.Region#getShape() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskProgressIndicatorSkin.java    From archivo with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected double computePrefWidth(double height) {
    double w = 0;
    for (Node child : getChildren()) {
        if (child instanceof Region) {
            Region region = (Region) child;
            if (region.getShape() != null) {
                w = Math.max(w, region.getShape().getLayoutBounds().getMaxX());
            } else {
                w = Math.max(w, region.prefWidth(height));
            }
        }
    }
    return w;
}
 
Example 2
Source File: TaskProgressIndicatorSkin.java    From archivo with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected double computePrefHeight(double width) {
    double h = 0;
    for (Node child : getChildren()) {
        if (child instanceof Region) {
            Region region = (Region) child;
            if (region.getShape() != null) {
                h = Math.max(h, region.getShape().getLayoutBounds().getMaxY());
            } else {
                h = Math.max(h, region.prefHeight(width));
            }
        }
    }
    return h;
}
 
Example 3
Source File: StaticProgressIndicatorSkin.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected double computePrefWidth(double height) {
    double w = 0;
    for (Node child : getChildren()) {
        if (child instanceof Region) {
            Region region = (Region) child;
            if (region.getShape() != null) {
                w = Math.max(w, region.getShape().getLayoutBounds().getMaxX());
            } else {
                w = Math.max(w, region.prefWidth(height));
            }
        }
    }
    return w;
}
 
Example 4
Source File: StaticProgressIndicatorSkin.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected double computePrefHeight(double width) {
    double h = 0;
    for (Node child : getChildren()) {
        if (child instanceof Region) {
            Region region = (Region) child;
            if (region.getShape() != null) {
                h = Math.max(h, region.getShape().getLayoutBounds().getMaxY());
            } else {
                h = Math.max(h, region.prefHeight(width));
            }
        }
    }
    return h;
}