Package qupath.fx.controls.tour
Class RelativeWindowMover
java.lang.Object
qupath.fx.controls.tour.RelativeWindowMover
Helper class to move a window relative to another window.
On macOS, windows already move relative to their owner windows - but this does not happen on Windows or Linux.
This class makes it possible to achieve similar behavior. It also makes it possible to move a window relative to a different window from its original owner.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattach(javafx.stage.Window owner) Attach to an owner window.voiddetach()Detach from the current owner window.javafx.stage.WindowgetOwner()Get the current owner window, or null if there is no owner.javafx.stage.WindowGet the current window, which may be moved relative to an owner.voidmoveTo(double x, double y) Set the location of the managed window.
-
Constructor Details
-
RelativeWindowMover
public RelativeWindowMover(javafx.stage.Window window) Constructor.- Parameters:
window- the window that should be moved relative to another window
-
-
Method Details
-
attach
public void attach(javafx.stage.Window owner) Attach to an owner window.- Parameters:
owner- the owner to use; when the owner moves, the current window should move by the same amount.
-
detach
public void detach()Detach from the current owner window. -
getOwner
public javafx.stage.Window getOwner()Get the current owner window, or null if there is no owner.- Returns:
-
getWindow
public javafx.stage.Window getWindow()Get the current window, which may be moved relative to an owner.- Returns:
-
moveTo
public void moveTo(double x, double y) Set the location of the managed window.- Parameters:
x- new desired x location, in screen coordinatesy- new desired y location, in screen coordinates
-