Class Ui

java.lang.Object
wiiuu.ui.Ui

public final class Ui extends Object
Small Swing app toolkit. Create and use on the Swing event thread. Factory controls retain Swing models/listeners, layout managers, clipboard, keyboard navigation and accessibility. A Ui instance owns a theme, not a global look-and-feel; retheme each host root explicitly.
  • Constructor Details

    • Ui

      public Ui()
    • Ui

      public Ui(UiTheme theme)
  • Method Details

    • theme

      public UiTheme theme()
    • setTheme

      public void setTheme(UiTheme theme, Component root)
      Change future controls and restyle existing toolkit controls under root, preserving their state.
    • applyTheme

      public void applyTheme(Component root)
      Apply this instance's current theme to toolkit controls in a tree, including late additions.
    • button

      public UiButton button(String text)
    • button

      public UiButton button(String text, ActionListener action)
    • primaryButton

      public UiButton primaryButton(String text)
    • primaryButton

      public UiButton primaryButton(String text, ActionListener action)
    • toggle

      public JToggleButton toggle(String text, boolean selected)
      Selected and unselected states use the same rounded painter as buttons.
    • checkBox

      public JCheckBox checkBox(String text, boolean selected)
    • label

      public JLabel label(String text)
    • label

      public JLabel label(String text, JComponent control)
      Label a form control and give it an accessible name when it has none.
    • mutedLabel

      public JLabel mutedLabel(String text)
    • heading

      public JLabel heading(String text)
    • textField

      public JTextField textField(String text, int columns)
    • textArea

      public JTextArea textArea(String text, int rows, int columns)
    • comboBox

      public <T> JComboBox<T> comboBox(T[] items)
      Uses the Swing combo-box model and popup behavior; items may have a host-supplied renderer.
    • progressBar

      public JProgressBar progressBar(int minimum, int maximum)
    • panel

      public JPanel panel(LayoutManager layout)
      Theme-coloured plain panel, useful with any Swing layout manager.
    • card

      public JPanel card(LayoutManager layout)
      Rounded content container with 16px padding; accepts any Swing layout.
    • page

      public JPanel page(LayoutManager layout)
      Gradient page container. The background cache is invalidated on resize/theme changes.
    • scrollPane

      public JScrollPane scrollPane(Component view)
    • row

      public JPanel row(Component... controls)
    • column

      public JPanel column(int gap, Component... controls)
      Vertical stack with a fixed gap, aligned to the leading edge.