Class Theme

java.lang.Object
net.mcreator.ui.laf.themes.Theme

public class Theme extends Object

A Theme can change images MCreator will use and redefine the colors and the style of BlocklyPanel and RSyntaxTextAreaStyler by creating a new ColorScheme

.
  • Field Details

    • id

      protected transient String id
  • Constructor Details

    • Theme

      public Theme()
  • Method Details

    • current

      public static Theme current()
    • init

      protected Theme init()
    • getFlatLafTheme

      public String getFlatLafTheme()
    • applyFlatLafOverrides

      public void applyFlatLafOverrides(Map<String,String> overrides)
    • applyUIDefaultsOverrides

      public void applyUIDefaultsOverrides(UIDefaults table)
    • getID

      public String getID()
      The ID is the theme's registry name. It is used to differentiate each theme in the code. This ID is also the main folder's name of the theme.
      Returns:

      The theme's ID

    • getName

      public String getName()
      Returns:

      Its displayed name

    • getDescription

      public String getDescription()
      Returns:

      A description displayed in the ThemesPanel if provided.

    • getCredits

      @Nullable public String getCredits()
      Returns:

      A String with optional credits to give to someone.

    • getVersion

      @Nullable public String getVersion()
      Returns:

      The theme's version if provided

    • getFont

      public Font getFont()
    • getConsoleFont

      public Font getConsoleFont()
    • getIcon

      public ImageIcon getIcon()
      This icon is only with ThemesPanel.
      Returns:

      An ImageIcon representing the plugin.

    • setIcon

      public void setIcon(ImageIcon icon)

      To be detected, the name of the image file needs to be "icon.png" located into the main folder.

      Parameters:
      icon -

      An ImageIcon to display in ThemesPanel

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getBackgroundColor

      public Color getBackgroundColor()
      Returns:
      Background of UI panels
    • getAltBackgroundColor

      public Color getAltBackgroundColor()
      Returns:
      Background of components (e.g. text fields, checkboxes and sound selectors)
    • getSecondAltBackgroundColor

      public Color getSecondAltBackgroundColor()
      Returns:
      Second background color used (e.g. workspace background)
    • getForegroundColor

      public Color getForegroundColor()
      Returns:

      Color used for most of texts

    • getAltForegroundColor

      public Color getAltForegroundColor()
      Returns:

      Secondary text color

    • getInterfaceAccentColor

      public Color getInterfaceAccentColor()
      Returns:

      Returns the interfaceAccentColor if defined by theme, otherwise the one defined by the user in PreferencesData