use of javafx.scene.layout.Region in project TestFX by TestFX.
the class BoundsQueryUtilsTest method setupRegion.
private static void setupRegion() {
region = new Region();
region.setMaxSize(0, 0);
region.setBackground(new Background(new BackgroundFill(Color.RED, null, null)));
// nodeBounds(), nodeBoundsInLocal()
region.setPadding(new Insets(0, 0, 0, PADDING_LEFT));
region.setBorder(new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, null, // nodeBounds(), nodeBoundsInLocal()
new BorderWidths(0, 0, 0, BORDER_LEFT))));
// nodeBoundsInParent()
StackPane.setMargin(region, new Insets(0, 0, 0, MARGIN_LEFT));
}
use of javafx.scene.layout.Region in project TestFX by TestFX.
the class DebugUtilsTest method showFiredEventsInErrorMessage.
@Test
public void showFiredEventsInErrorMessage() throws TimeoutException {
// given:
Stage stage = FxToolkit.setupStage(stage0 -> stage0.setScene(new Scene(new Region(), 300, 300)));
interact(stage::show);
moveTo(stage).moveBy(20, 20);
// and:
FiredEvents events = FiredEvents.beginStoringFiredEventsOf(stage);
moveBy(1, 0);
events.stopStoringFiredEvents();
// when:
AssertionError error = getThrownErrorPostMapper(showFiredEvents(events, INDENT));
// then:
assertThat(error.getMessage(), containsString("MouseEvent"));
assertThat(error.getMessage(), not(containsString("ScrollEvent")));
}
use of javafx.scene.layout.Region in project TestFX by TestFX.
the class StageHideDeadlockBug method setup.
@Before
public void setup() throws Exception {
FxToolkit.setupStage(stage -> stage.setScene(new Scene(new Region(), 500, 500)));
FxToolkit.showStage();
}
use of javafx.scene.layout.Region in project JFoenix by jfoenixadmin.
the class JFXTextAreaSkinAndroid method layoutChildren.
@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);
linesWrapper.layoutPrompt(x, y, w, h);
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();
}
}
use of javafx.scene.layout.Region in project JFoenix by jfoenixadmin.
the class JFXAutoCompletePopup method show.
public void show(Node node) {
if (!isShowing()) {
if (node.getScene() == null || node.getScene().getWindow() == null)
throw new IllegalStateException("Can not show popup. The node must be attached to a scene/window.");
Window parent = node.getScene().getWindow();
this.show(parent, parent.getX() + node.localToScene(0, 0).getX() + node.getScene().getX(), parent.getY() + node.localToScene(0, 0).getY() + node.getScene().getY() + ((Region) node).getHeight());
((JFXAutoCompletePopupSkin<T>) getSkin()).animate();
}
}
Aggregations