Interface WidgetKit


public interface WidgetKit
A theme's look for the pieces built-in editor layouts are made of. Layouts decide where pieces go and what clicks do; the kit decides what each piece looks like, in each WidgetState.
  • Method Details

    • metrics

      KitMetrics metrics()
    • textPaint

      GuiPaint textPaint(TextRole role)
    • trackPaint

      default GuiPaint trackPaint()
      Returns:
      What a slider's track is filled with past its value. The built-in gradient editor fills the tags of its stops with it too.
    • surface

      void surface(GuiPainter painter, Surface surface, Rect bounds, WidgetState state)
      Fills a rectangle as the given kind of surface.
    • finishPanels

      default void finishPanels(GuiPainter painter)
      Finishes the panels drawn since the last call, for effects drawn over a whole panel such as outlines. Built-in layouts call it at the end of each editor.
    • icon

      default void icon(GuiPainter painter, GuiIcon icon, double x, double y, GuiPaint paint)
    • button

      default void button(GuiPainter painter, Rect bounds, String label, EditorButton.Role role, WidgetState state)
      A button with its label centered. By default a Surface.BUTTON with the label in the normal text color, muted while disabled, whatever the role.
    • slider

      void slider(GuiPainter painter, Rect bounds, String label, String value, double fraction, WidgetState state)
      A labelled slider showing its value, with step buttons on either side of the track.
      Parameters:
      fraction - Position of the value, 0 to 1
    • hueSlider

      void hueSlider(GuiPainter painter, Rect bounds, String label, String value, double hue, WidgetState state)
      Parameters:
      hue - 0 to 1
    • sliderTrack

      Rect sliderTrack(Rect bounds)
      Returns:
      Where a slider drawn in bounds takes clicks and drags along its track
    • sliderStep

      Rect sliderStep(GuiPainter painter, Rect bounds, int direction)
      Parameters:
      direction - -1 for the decrease button, 1 for the increase button
      Returns:
      Where a slider drawn in bounds takes clicks on that step button
    • toggle

      void toggle(GuiPainter painter, Rect bounds, String label, boolean on, WidgetState state)
      A labelled switch.
    • saturationBrightness

      void saturationBrightness(GuiPainter painter, Rect bounds, float hue, float saturation, float brightness, WidgetState state)
      A saturation and brightness square for one hue, with a marker at the chosen point.
    • saturationBrightnessArea

      Rect saturationBrightnessArea(Rect bounds)
      Returns:
      Where a square drawn in bounds takes clicks and drags
    • textField

      default void textField(GuiPainter painter, Rect bounds, TextFieldState field, String placeholder, boolean masked, WidgetState state)
      A text field: its box, its text clipped to the box, and a caret while focused.
    • textField

      void textField(GuiPainter painter, Rect bounds, TextFieldState field, String placeholder, boolean masked, double textScale, WidgetState state)