Class RelativeWindowMover

java.lang.Object
qupath.fx.controls.tour.RelativeWindowMover

public class RelativeWindowMover extends Object
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
    Constructor
    Description
    RelativeWindowMover(javafx.stage.Window window)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    attach(javafx.stage.Window owner)
    Attach to an owner window.
    void
    Detach from the current owner window.
    javafx.stage.Window
    Get the current owner window, or null if there is no owner.
    javafx.stage.Window
    Get the current window, which may be moved relative to an owner.
    void
    moveTo(double x, double y)
    Set the location of the managed window.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 coordinates
      y - new desired y location, in screen coordinates