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

The following examples show how to use javafx.scene.layout.Region#applyCss() . 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: JFXTextAreaSkin.java    From JFoenix with Apache License 2.0 6 votes vote down vote up
@Override
protected void layoutChildren(final double x, final double y, final double w, final double h) {
    super.layoutChildren(x, y, w, h);

    final double height = getSkinnable().getHeight();
    linesWrapper.layoutLines(x, y, w, h, height, promptText == null ? 0 : promptText.getLayoutBounds().getHeight() + 3);
    errorContainer.layoutPane(x, height + linesWrapper.focusedLine.getHeight(), w, h);
    linesWrapper.updateLabelFloatLayout();


    if (invalid) {
        invalid = false;
        // set the default background of text area viewport to white
        Region viewPort = (Region) scrollPane.getChildrenUnmodifiable().get(0);
        viewPort.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT,
            CornerRadii.EMPTY,
            Insets.EMPTY)));
        // reapply css of scroll pane in case set by the user
        viewPort.applyCss();
        errorContainer.invalid(w);
        // focus
        linesWrapper.invalid();
    }
}
 
Example 2
Source File: JFXTextAreaSkinAndroid.java    From JFoenix with Apache License 2.0 6 votes vote down vote up
@Override
protected void layoutChildren(final double x, final double y, final double w, final double h) {
    super.layoutChildren(x, y, w, h);

    final double height = getSkinnable().getHeight();
    linesWrapper.layoutLines(x, y, w, h, height, promptText == null ? 0 : promptText.getLayoutBounds().getHeight() + 3);
    errorContainer.layoutPane(x, height + linesWrapper.focusedLine.getHeight(), w, h);
    linesWrapper.updateLabelFloatLayout();


    if (invalid) {
        invalid = false;
        // set the default background of text area viewport to white
        Region viewPort = (Region) scrollPane.getChildrenUnmodifiable().get(0);
        viewPort.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT,
            CornerRadii.EMPTY,
            Insets.EMPTY)));
        // reapply css of scroll pane in case set by the user
        viewPort.applyCss();
        errorContainer.invalid(w);
        // focus
        linesWrapper.invalid();
    }
}
 
Example 3
Source File: JFXTextAreaSkinBisqStyle.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected void layoutChildren(final double x, final double y, final double w, final double h) {
    super.layoutChildren(x, y, w, h);

    final double height = getSkinnable().getHeight();
    final double width = getSkinnable().getWidth();
    linesWrapper.layoutLines(x - 2, y - 2, width, h, height, promptText == null ? 0 : promptText.getLayoutBounds().getHeight() + 3);
    errorContainer.layoutPane(x, height + linesWrapper.focusedLine.getHeight(), width, h);
    linesWrapper.updateLabelFloatLayout();

    if (invalid) {
        invalid = false;
        // set the default background of text area viewport to white
        Region viewPort = (Region) scrollPane.getChildrenUnmodifiable().get(0);
        viewPort.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT,
                CornerRadii.EMPTY,
                Insets.EMPTY)));
        // reapply css of scroll pane in case set by the user
        viewPort.applyCss();
        errorContainer.invalid(w);
        // focus
        linesWrapper.invalid();
    }
}