if (dockSide == DOCK_LEFT) {
if (lastDocked == DOCK_LEFT) {
return;
}
ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
Screen screen = screensForRectangle.get(0);
Rectangle2D visualBounds = screen.getVisualBounds();
// Dock Left
double x = visualBounds.getMinX();
double y = visualBounds.getMinY();
double width = visualBounds.getWidth() / 2;
double height = visualBounds.getHeight();
undecorator.setDockFeedbackVisible(x, y, width, height);
lastDocked = DOCK_LEFT;
} // Dock Right
else if (dockSide == DOCK_RIGHT) {
if (lastDocked == DOCK_RIGHT) {
return;
}
ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
Screen screen = screensForRectangle.get(0);
Rectangle2D visualBounds = screen.getVisualBounds();
// Dock Right (visualBounds = (javafx.geometry.Rectangle2D) Rectangle2D [minX = 1440.0, minY=300.0, maxX=3360.0, maxY=1500.0, width=1920.0, height=1200.0])
double x = visualBounds.getMinX() + visualBounds.getWidth() / 2;
double y = visualBounds.getMinY();
double width = visualBounds.getWidth() / 2;
double height = visualBounds.getHeight();
undecorator.setDockFeedbackVisible(x, y, width, height);
lastDocked = DOCK_RIGHT;
} // Dock top
else if (dockSide == DOCK_TOP) {
if (lastDocked == DOCK_TOP) {
return;
}
ObservableList<Screen> screensForRectangle = Screen.getScreensForRectangle(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight());
Screen screen = screensForRectangle.get(0);
Rectangle2D visualBounds = screen.getVisualBounds();
// Dock Left
double x = visualBounds.getMinX();
double y = visualBounds.getMinY();
double width = visualBounds.getWidth();
double height = visualBounds.getHeight();