Substance API

View all client properties.


Working with color schemes

public static ColorScheme getActiveColorScheme()
     Returns the current color scheme for components in active visual state.

public static ColorScheme getDefaultColorScheme()
     Returns the current color scheme for components in default visual state.

public static ColorScheme getDisabledColorScheme()
     Returns the current color scheme for components in disabled visual state.


Working with themes

public static Map<String, ThemeInfo> getAllThemes()
     Returns all available themes.

public static SubstanceTheme getTheme()
     Returns the current theme.

public static String getCurrentThemeName()
     Returns the current color theme name.

public static boolean setCurrentTheme(String themeClassName)
     Sets new theme.

public static boolean setCurrentTheme(ThemeInfo themeInfo)
     Sets new theme.

public static boolean setCurrentTheme(SubstanceTheme theme)
     Sets new theme.

public static void registerThemeChangeListener(
      ThemeChangeListener themeChangeListener)

     Registers a new listener on theme change.

public static void unregisterThemeChangeListener(
      ThemeChangeListener themeChangeListener)

     Unregisters a listener on theme change.

public static void addMixedTheme(SubstanceMixTheme mixedTheme)
     Globally registers a new mixed theme.

public static void addMixedTheme(SubstanceTheme... themes)
     Globally registers a new mixed theme.

public static void addMixedThemeBy(SubstanceTheme mainTheme)
     Globally registers a collection of mixed themes.

public static void removeMixedTheme(SubstanceMixTheme mixedTheme)
     Globally unregisters the specified mixed theme.

public static void removeMixedThemeBy(SubstanceTheme mainTheme)
     Globally unregisters a collection of mixed themes.

public static boolean hasMixedThemes()
     Checks whether there are any mixed themes registered globally.


Working with watermarks

public static Map<String, WatermarkInfo> getAllWatermarks()
     Returns all available watermarks.

public static SubstanceWatermark getCurrentWatermark()
     Returns the current watermark.

public static String getCurrentWatermarkName()
     Returns the current watermark name.

public static boolean setCurrentWatermark(String watermarkClassName)
     Sets new watermark.

public static boolean setCurrentWatermark(
      SubstanceWatermark currentWatermark)

     Sets new watermark.

public static void registerWatermarkChangeListener(
      WatermarkChangeListener watermarkChangeListener)

     Registers a new listener on watermark change.

public static void unregisterWatermarkChangeListener(
      WatermarkChangeListener watermarkChangeListener)

     Unregisters listener on watermark change.

public static ImageWatermarkKind getImageWatermarkKind()
     Returns the global kind for image-based watermarks.

public static float getImageWatermarkOpacity()
     Returns the global opacity for image-based watermarks.

public static void setImageWatermarkKind(ImageWatermarkKind kind)
     Sets the global kind for image-based watermarks.

public static void setImageWatermarkOpacity(float opacity)
     Sets the global opacity for image-based watermarks.


Working with skins

public static Map<String, SkinInfo> getAllSkins()
     Returns all available skins.

public static boolean setSkin(String skinClassName)
     Sets the specified skin.

public static boolean setSkin(SubstanceSkin skin)
     Sets the specified skin.

public static void registerSkinChangeListener(
      SkinChangeListener skinChangeListener)

     Registers a new listener on skin change.

public static void unregisterSkinChangeListener(
      SkinChangeListener skinChangeListener)

     Unregisters a listener on skin change.


Working with button shapers

public static Map<String, ButtonShaperInfo> getAllButtonShapers()
     Returns all available button shapers.

public static SubstanceButtonShaper getCurrentButtonShaper()
     Returns the current button shaper.

public static String getCurrentButtonShaperName()
     Returns the current button shaper name.

public static boolean setCurrentButtonShaper(String buttonShaperClassName)
     Sets new button shaper.

public static boolean setCurrentButtonShaper(
      SubstanceButtonShaper currentButtonShaper)

     Sets new button shaper.

public static void registerButtonShaperChangeListener(
      ButtonShaperChangeListener buttonShaperChangeListener)

     Registers a new listener on button shaper change.

public static void unregisterButtonShaperChangeListener(
      ButtonShaperChangeListener buttonShaperChangeListener)

     Unregisters a listener on button shaper change.


Working with gradient painters

public static Map<String, GradientPainterInfo> getAllGradientPainters()
     Returns all available gradient painters.

public static SubstanceGradientPainter getCurrentGradientPainter()
     Returns the current gradient painter.

public static String getCurrentGradientPainterName()
     Returns the current gradient painter name.

public static boolean setCurrentGradientPainter(
      String gradientPainterClassName)

     Sets new gradient painter.

public static boolean setCurrentGradientPainter(
      SubstanceGradientPainter currentGradientPainter)

     Sets new gradient painter.

public static void registerGradientPainterChangeListener(
      GradientPainterChangeListener gradientPainterChangeListener)

     Registers a new listener on gradient painter change.

public static void unregisterGradientPainterChangeListener(
      GradientPainterChangeListener gradientPainterChangeListener)

     Unregisters a listener on gradient painter change.


Working with title painters

public static Map<String, TitlePainterInfo> getAllTitlePainters()
     Returns all available title painters.

public static SubstanceTitlePainter getCurrentTitlePainter()
     Returns the current title painter.

public static String getCurrentTitlePainterName()
     Returns the current title painter name.

public static boolean setCurrentTitlePainter(String titlePainterClassName)
     Sets new title painter.

public static boolean setCurrentTitlePainter(
      SubstanceTitlePainter currentTitlePainter)

     Sets new title painter.

public static void registerTitlePainterChangeListener(
      TitlePainterChangeListener titlePainterChangeListener)

     Registers a new listener on title painter change.

public static void unregisterTitlePainterChangeListener(
      TitlePainterChangeListener titlePainterChangeListener)

     Unregisters a listener on title painter change.


Working with fonts

public static FontPolicy getFontPolicy()
     Looks up and retrieves the FontPolicy used by the Substance family.

public static void setFontPolicy(FontPolicy fontPolicy)
     Sets the FontPolicy to be used with Substance family.

public static String getFontFamilyName()
     This method has been deprecated in version 3.3 and will be removed in version 4.0.
     Returns the font family name that best matches the current environment.

public static int getBasicFontSize()
     This method has been deprecated in version 3.3 and will be removed in version 4.0.
     Returns the base font size.

public static boolean isBasicFontBold()
     This method has been deprecated in version 3.3 and will be removed in version 4.0.
     Returns indication whether the base font is bold.

public static void setBasicFontSize(int value)
     This method has been deprecated in version 3.3 and will be removed in version 4.0.
     Sets the new basic font size.

public static void setFontSizeExtra(int value)
     This method has been deprecated in version 3.3 and will be removed in version 4.0.
     Sets the new extra font size.


Working with tab closing

public static Set<BaseTabCloseListener> getAllTabCloseListeners()
     Returns the set of all listeners registered on tab-close events on all tabbed panes.

public static Set<BaseTabCloseListener> getAllTabCloseListeners(
      JTabbedPane tabbedPane)

     Returns all listeners registered on tab closing of the specified tabbed pane.

public static void registerTabCloseChangeListener(
      BaseTabCloseListener tabCloseListener)

     Registers the specified listener on tab-close events on all tabbed panes.

public static void registerTabCloseChangeListener(JTabbedPane tabbedPane,
      BaseTabCloseListener tabCloseListener)

     Registers the specified listener on tab-close events on the specified tabbed pane.

public static void unregisterTabCloseChangeListener(
      BaseTabCloseListener tabCloseListener)

     Unregisters the specified listener on tab-close events on all tabbed panes.

public static void unregisterTabCloseChangeListener(JTabbedPane tabbedPane,
      BaseTabCloseListener tabCloseListener)

     Unregisters the specified listener on tab-close events on the specified tabbed pane.


Additional APIs

public static void permanentlyShowHeapStatusPanel(JRootPane pane)
     Makes the heap status panels appear permanently on the specified title pane and removes the corresponding check box menu items from the system menu.

public static void permanentlyHideHeapStatusPanel(JRootPane pane)
     Makes the heap status panels disappear permanently on the specified title pane and removes the corresponding check box menu items from the system menu.

public static void showMenuSearchPanels()
     Shows menu search panels on all open frames.

public static void hideMenuSearchPanels()
     Hides menu search panels on all open frames.

public static void setRootPaneCustomTitleButtons(JRootPane rootPane,
      List<TitleButtonInfo> infoList)

     Registers custom title pane buttons for the specified root pane.

public static void removeRootPaneCustomTitleButtons(JRootPane rootPane)
     Removes all custom title pane buttons registered on the specified root pane.