Package limn.backend

Record Class WindowConfig

java.lang.Object
java.lang.Record
limn.backend.WindowConfig
Record Components:
title - title bar text
width - initial width in logical points
height - initial height in logical points
visible - false for offscreen/screenshot rendering or windows positioned before NativeWindow.show()
resizable - whether the user may resize the window
decorated - native title bar/border (false for popups)
floating - always-on-top (popups, tooltips)
transparent - transparent framebuffer: pixels with alpha < 1 composite over whatever is behind the window (rounded popup corners, translucent panels)
focusOnShow - whether NativeWindow.show() steals input focus (false keeps focus in the parent: combo popups)

public record WindowConfig(String title, int width, int height, boolean visible, boolean resizable, boolean decorated, boolean floating, boolean transparent, boolean focusOnShow) extends Record
Initial configuration for a NativeWindow.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WindowConfig(String title, int width, int height, boolean visible, boolean resizable)
    Regular window (decorated, focus on show, opaque).
    WindowConfig(String title, int width, int height, boolean visible, boolean resizable, boolean decorated, boolean floating, boolean transparent, boolean focusOnShow)
    Creates an instance of a WindowConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the decorated record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the floating record component.
    boolean
    Returns the value of the focusOnShow record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the height record component.
    of(String title, int width, int height)
    Visible, resizable, decorated window.
    popup(int width, int height)
    Undecorated, floating, transparent, non-focus-stealing window, created hidden so it can be positioned before NativeWindow.show(): the shape of a combo/menu popup.
    boolean
    Returns the value of the resizable record component.
    styled(String title, int width, int height, WindowStyle style, boolean floating, boolean focusOnShow)
    A styled window created hidden (position, then NativeWindow.show()).
    Returns the value of the title record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the transparent record component.
    boolean
    Returns the value of the visible record component.
    int
    Returns the value of the width record component.
    withVisible(boolean newVisible)
    A copy that starts shown or hidden.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WindowConfig

      public WindowConfig(String title, int width, int height, boolean visible, boolean resizable, boolean decorated, boolean floating, boolean transparent, boolean focusOnShow)
      Creates an instance of a WindowConfig record class.
      Parameters:
      title - the value for the title record component
      width - the value for the width record component
      height - the value for the height record component
      visible - the value for the visible record component
      resizable - the value for the resizable record component
      decorated - the value for the decorated record component
      floating - the value for the floating record component
      transparent - the value for the transparent record component
      focusOnShow - the value for the focusOnShow record component
    • WindowConfig

      public WindowConfig(String title, int width, int height, boolean visible, boolean resizable)
      Regular window (decorated, focus on show, opaque).
  • Method Details

    • of

      public static WindowConfig of(String title, int width, int height)
      Visible, resizable, decorated window. The common case.
    • popup

      public static WindowConfig popup(int width, int height)
      Undecorated, floating, transparent, non-focus-stealing window, created hidden so it can be positioned before NativeWindow.show(): the shape of a combo/menu popup.
    • styled

      public static WindowConfig styled(String title, int width, int height, WindowStyle style, boolean floating, boolean focusOnShow)
      A styled window created hidden (position, then NativeWindow.show()).
      Parameters:
      style - decoration/translucency (see WindowStyle)
      floating - always-on-top
      focusOnShow - whether showing it steals input focus
    • withVisible

      public WindowConfig withVisible(boolean newVisible)
      A copy that starts shown or hidden.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • title

      public String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • visible

      public boolean visible()
      Returns the value of the visible record component.
      Returns:
      the value of the visible record component
    • resizable

      public boolean resizable()
      Returns the value of the resizable record component.
      Returns:
      the value of the resizable record component
    • decorated

      public boolean decorated()
      Returns the value of the decorated record component.
      Returns:
      the value of the decorated record component
    • floating

      public boolean floating()
      Returns the value of the floating record component.
      Returns:
      the value of the floating record component
    • transparent

      public boolean transparent()
      Returns the value of the transparent record component.
      Returns:
      the value of the transparent record component
    • focusOnShow

      public boolean focusOnShow()
      Returns the value of the focusOnShow record component.
      Returns:
      the value of the focusOnShow record component