Enum Class Theme

java.lang.Object
java.lang.Enum<Theme>
io.github.jbastgen.stemma.app.theme.Theme
All Implemented Interfaces:
Serializable, Comparable<Theme>, Constable

public enum Theme extends Enum<Theme>
The built-in colour themes. Tokens are defined in the CSS files, see docs/design/branding.md.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    The declarations that put the accent into a window of this theme; empty when there is no accent.
    static void
    apply(javafx.scene.Scene scene, Theme theme)
    Applies the base style sheet and the one of the theme to the scene, and the accent colour to its root.
    javafx.scene.paint.Color
    color(String token)
    A colour token of this theme (the name of -st-name) as a colour, for drawing that cannot use CSS (the commit graph is painted on a canvas).
    static Theme
    fromKey(String key, Theme fallback)
    The theme with this key, or the fallback.
    key()
    Value stored in the settings file.
    static void
    The accent colour of the user as #rrggbb, or empty for the colour of the theme.
    The other theme.
    static Theme
    Returns the enum constant of this class with the specified name.
    static Theme[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LIGHT

      public static final Theme LIGHT
    • DARK

      public static final Theme DARK
  • Method Details

    • values

      public static Theme[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Theme valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • key

      public String key()
      Value stored in the settings file.
    • fromKey

      public static Theme fromKey(String key, Theme fallback)
      The theme with this key, or the fallback.
    • color

      public javafx.scene.paint.Color color(String token)
      A colour token of this theme (the name of -st-name) as a colour, for drawing that cannot use CSS (the commit graph is painted on a canvas). Read from the theme's own stylesheet, so there is one source of truth. Falls back to grey for a token that is not a plain colour.
    • toggled

      public Theme toggled()
      The other theme.
    • setAccent

      public static void setAccent(String hex)
      The accent colour of the user as #rrggbb, or empty for the colour of the theme. Applied by apply(javafx.scene.Scene, io.github.jbastgen.stemma.app.theme.Theme).
    • accentStyle

      public static String accentStyle(Theme theme)
      The declarations that put the accent into a window of this theme; empty when there is no accent.
    • apply

      public static void apply(javafx.scene.Scene scene, Theme theme)
      Applies the base style sheet and the one of the theme to the scene, and the accent colour to its root.