Class GeneralUISettings

java.lang.Object
org.jjazz.uisettings.api.GeneralUISettings

public class GeneralUISettings extends Object
Store general UI settings, manage the current and available Themes, the current and available Locales.
  • Field Details

    • PROP_LOCALE_UPON_RESTART

      public static final String PROP_LOCALE_UPON_RESTART
      newValue=new locale
      See Also:
    • SUPPORTED_LOCALES

      public static final Locale[] SUPPORTED_LOCALES
      The list of currently supported locales by the application.
  • Method Details

    • getInstance

      public static GeneralUISettings getInstance()
    • getThemes

      public static List<Theme> getThemes()
      Get the available themes.
      Returns:
    • getTheme

      public static Theme getTheme(String name, Theme def)
      Get the Theme with specified name.
      Parameters:
      name -
      def -
      Returns:
      Return def if no theme matching name.
    • getSessionTheme

      public Theme getSessionTheme()
      Get the theme used for this session.
      Returns:
      Can't be null
    • getThemeNameUponRestart

      public String getThemeNameUponRestart()
      Get the theme name to be used on next application start.
      Returns:
    • setThemeUponRestart

      public void setThemeUponRestart(Theme theme, boolean silent)
      Set the theme to be used on next application start.

      This will restart the application. User is asked to confirm unless silent is true.

      Parameters:
      theme -
      silent -
    • setLocaleUponRestart

      public void setLocaleUponRestart(Locale locale) throws IOException
      Set the locale to use upon next restart.

      Add or replace the --locale code in the user conf file.

      Fire a PROP_LOCALE_UPON_RESTART change event.

      Parameters:
      locale -
      Throws:
      IOException - If a problem occured
    • setChangeValueWithMouseWheelEnabled

      public void setChangeValueWithMouseWheelEnabled(boolean b)
      Users with trackpad or "touch motion" mouse like the Apple Magic mouse should set this to false.

      Because these devices don't have a "unitary" scroll unit, therefore usually values change much too fast with these devices. Register/unregister all installed components via installChangeValueWithMouseWheelSupport().

      Fire a PREF_VALUE_CHANGE_WITH_MOUSE_WHEEL change event.

      Parameters:
      b -
    • isChangeValueWithMouseWheelEnabled

      public boolean isChangeValueWithMouseWheelEnabled()
    • installChangeValueWithMouseWheelSupport

      public void installChangeValueWithMouseWheelSupport(JComponent comp, MouseWheelListener compListener)
      Helper method to register/unregister a component and its MouseWheelListener depending on the PREF_VALUE_CHANGE_WITH_MOUSE_WHEEL value changes.

      Parameters:
      comp -
      compListener -
    • getStdFont

      public Font getStdFont()
      Get the JJazzLab standard font (for latin locales only) with size=10pt and style=PLAIN.
      Returns:
    • getStdCondensedFont

      public Font getStdCondensedFont()
      Get the JJazzLab standard condensed font (for latin locales only) with size=10pt and style=PLAIN.
      Returns:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
    • isLatin

      public static final boolean isLatin(Locale locale)
    • isDarkTheme

      public static final boolean isDarkTheme()
    • getIcon

      public Icon getIcon(String key)
    • getColor

      public Color getColor(String key)
    • getFont

      public Font getFont(String key)
    • getBoolean

      public boolean getBoolean(String key)
    • getBorder

      public Border getBorder(String key)
    • getInt

      public int getInt(String key)