Class WindowMemory

java.lang.Object
io.github.jbastgen.stemma.app.config.WindowMemory

public final class WindowMemory extends Object
Keeps the size the window has when it is in its normal state (feature 62), so it can be saved when Stemma ends: a maximized, full-screen or minimized window does not count, and one that is closed while maximized leaves the size it had before. JavaFX tells the new size of a window that is being maximized slightly before it says so, so the sizes of the last moments are not trusted: the one from before them is.
  • Constructor Details

    • WindowMemory

      public WindowMemory(WindowMemory.State state, LongSupplier nanos)
      Parameters:
      state - the window
      nanos - a clock; a parameter so tests can control time
  • Method Details

    • sizeChanged

      public void sizeChanged()
      The window got another width or height.
    • stateChanged

      public void stateChanged()
      The window was maximized, made full screen or minimized, or went back to normal.
    • last

      public WindowSizing.Size last()
      The size to save: the size of the window if it is normal, else the one it had before it was maximized (or null when that is not known: then what was saved before stays).