java.lang.Object
io.github.jbastgen.stemma.app.ui.widget.Ui

public final class Ui extends Object
Small factory helpers for the controls used throughout the UI.
  • Method Summary

    Modifier and Type
    Method
    Description
    static javafx.scene.control.Button
    button(String text, String variant, Runnable action)
     
    static javafx.scene.control.Button
    button(String text, String variant, String iconPath, Runnable action)
    A button with an icon in front of its text; the icon follows the text colour of the variant.
    static javafx.scene.layout.Region
    dot(double d, String token)
    A round dot in a colour of the theme.
    static javafx.scene.control.Label
    ellipsis(javafx.scene.control.Label l)
    A label that shrinks with an ellipsis instead of forcing its container wider.
    static javafx.scene.layout.Region
    fixed(double w, double h)
    A region of a fixed size.
    static String
    font(double size, int weight, boolean mono, String token)
    Style string for custom nodes (inputs etc.).
    static javafx.scene.layout.HBox
    hbox(double gap, javafx.geometry.Pos pos, javafx.scene.Node... children)
    A row of nodes.
    static javafx.scene.control.Button
    iconButton(String path, double iconSize, String variant, String tooltip, Runnable action)
    A button with an icon only; the variant names the style, the tool tip is not translated here.
    static javafx.scene.control.TextField
    input(String prompt, String value)
    A one-line input with a translated prompt.
    static javafx.scene.control.Label
    label(String text, double size, int weight, String token)
    A translated label in the Geist font; the token names the colour of the theme.
    static void
    Registers the bundled Geist fonts.
    static javafx.scene.control.Label
    mono(String text, double size, int weight, String token)
    A label in the monospaced font; not translated.
    static javafx.scene.layout.StackPane
    searchField(javafx.scene.control.TextField field, double width)
    Search field with a leading magnifier icon.
    static javafx.scene.layout.Region
    A region that takes the room that is left in a row.
    static javafx.scene.control.ProgressIndicator
    spinner(double size)
    A small spinner that shows something runs in the background.
    static javafx.scene.layout.Region
    vline(double h, double hMargin)
    A thin vertical line.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • loadFonts

      public static void loadFonts()
      Registers the bundled Geist fonts. Safe to call repeatedly.
    • label

      public static javafx.scene.control.Label label(String text, double size, int weight, String token)
      A translated label in the Geist font; the token names the colour of the theme.
    • mono

      public static javafx.scene.control.Label mono(String text, double size, int weight, String token)
      A label in the monospaced font; not translated.
    • font

      public static String font(double size, int weight, boolean mono, String token)
      Style string for custom nodes (inputs etc.).
    • ellipsis

      public static javafx.scene.control.Label ellipsis(javafx.scene.control.Label l)
      A label that shrinks with an ellipsis instead of forcing its container wider.
    • spacer

      public static javafx.scene.layout.Region spacer()
      A region that takes the room that is left in a row.
    • fixed

      public static javafx.scene.layout.Region fixed(double w, double h)
      A region of a fixed size.
    • vline

      public static javafx.scene.layout.Region vline(double h, double hMargin)
      A thin vertical line.
    • hbox

      public static javafx.scene.layout.HBox hbox(double gap, javafx.geometry.Pos pos, javafx.scene.Node... children)
      A row of nodes.
    • button

      public static javafx.scene.control.Button button(String text, String variant, Runnable action)
      Parameters:
      variant - one of "primary", "secondary", "ghost", "danger-ghost"
    • spinner

      public static javafx.scene.control.ProgressIndicator spinner(double size)
      A small spinner that shows something runs in the background.
    • button

      public static javafx.scene.control.Button button(String text, String variant, String iconPath, Runnable action)
      A button with an icon in front of its text; the icon follows the text colour of the variant.
    • iconButton

      public static javafx.scene.control.Button iconButton(String path, double iconSize, String variant, String tooltip, Runnable action)
      A button with an icon only; the variant names the style, the tool tip is not translated here.
    • input

      public static javafx.scene.control.TextField input(String prompt, String value)
      A one-line input with a translated prompt.
    • searchField

      public static javafx.scene.layout.StackPane searchField(javafx.scene.control.TextField field, double width)
      Search field with a leading magnifier icon.
    • dot

      public static javafx.scene.layout.Region dot(double d, String token)
      A round dot in a colour of the theme.