Class ModernTheme

java.lang.Object
privbot.ui.ModernTheme

public class ModernTheme extends Object
PrivBot UI design system (EasyFlow). This is the shared, cross-plugin theme used for all PrivBot GUIs moving forward. Keep additions backwards compatible and avoid client-fork dependencies.
  • Field Details

    • BG_CANVAS

      public static final Color BG_CANVAS
      Darkest background: the main canvas.
    • BG_SIDEBAR

      public static final Color BG_SIDEBAR
      Sidebar and panel background.
    • BG_CARD

      public static final Color BG_CARD
      Card and elevated surface.
    • BG_CARD_HOVER

      public static final Color BG_CARD_HOVER
      Card surface under the mouse.
    • BG_INPUT

      public static final Color BG_INPUT
      Input field background.
    • BG_ELEVATED

      public static final Color BG_ELEVATED
      Raised surfaces: dropdowns, popups, tooltips.
    • BG_HEADER

      public static final Color BG_HEADER
      Header and status bars.
    • BG_TOOLBAR

      public static final Color BG_TOOLBAR
      Toolbar background.
    • ACCENT_PRIMARY

      public static final Color ACCENT_PRIMARY
      Primary action accent (indigo).
    • ACCENT_PRIMARY_HOVER

      public static final Color ACCENT_PRIMARY_HOVER
      Primary accent under the mouse.
    • ACCENT_SUCCESS

      public static final Color ACCENT_SUCCESS
      Success, enabled and running (green).
    • ACCENT_SUCCESS_MUTED

      public static final Color ACCENT_SUCCESS_MUTED
      Dark green for success fills.
    • ACCENT_WARNING

      public static final Color ACCENT_WARNING
      Warnings and paused states (amber).
    • ACCENT_DANGER

      public static final Color ACCENT_DANGER
      Danger, errors and Stop (red).
    • ACCENT_DANGER_MUTED

      public static final Color ACCENT_DANGER_MUTED
      Dark red for danger fills.
    • ACCENT_INFO

      public static final Color ACCENT_INFO
      Informational accent (blue).
    • ACCENT_PURPLE

      public static final Color ACCENT_PURPLE
      Special accent (purple).
    • ACCENT_CYAN

      public static final Color ACCENT_CYAN
      Highlight accent (cyan).
    • ACCENT_ORANGE

      public static final Color ACCENT_ORANGE
      Condition accent (orange).
    • TEXT_PRIMARY

      public static final Color TEXT_PRIMARY
      Main text (near white).
    • TEXT_SECONDARY

      public static final Color TEXT_SECONDARY
      Secondary text and labels.
    • TEXT_MUTED

      public static final Color TEXT_MUTED
      Muted text, still readable on BG_CARD.
    • TEXT_INVERSE

      public static final Color TEXT_INVERSE
      Dark text for light or saturated backgrounds.
    • BORDER_DEFAULT

      public static final Color BORDER_DEFAULT
      Default border.
    • BORDER_FOCUS

      public static final Color BORDER_FOCUS
      Focus ring.
    • BORDER_SUBTLE

      public static final Color BORDER_SUBTLE
      Subtle separators.
    • NODE_CONDITION

      public static final Color NODE_CONDITION
      Condition node accent in flow editors.
    • NODE_ACTION

      public static final Color NODE_ACTION
      Action node accent in flow editors.
    • NODE_CONDITION_BG

      public static final Color NODE_CONDITION_BG
      Condition node fill in flow editors.
    • NODE_ACTION_BG

      public static final Color NODE_ACTION_BG
      Action node fill in flow editors.
    • FONT_DISPLAY

      public static final Font FONT_DISPLAY
      Large display headings (24 pt bold).
    • FONT_TITLE

      public static final Font FONT_TITLE
      Titles (18 pt semibold).
    • FONT_SUBTITLE

      public static final Font FONT_SUBTITLE
      Subtitles and sidebar headers (14 pt semibold).
    • FONT_BODY

      public static final Font FONT_BODY
      Body text (13 pt).
    • FONT_BODY_BOLD

      public static final Font FONT_BODY_BOLD
      Bold body text and button labels (13 pt).
    • FONT_SMALL

      public static final Font FONT_SMALL
      Small labels (11 pt).
    • FONT_TINY

      public static final Font FONT_TINY
      Badges and section captions (10 pt).
    • FONT_MONO

      public static final Font FONT_MONO
      Monospaced values and logs (12 pt).
    • FONT_ICON

      public static final Font FONT_ICON
      Emoji/icon glyphs (14 pt).
    • SPACE_XXS

      public static final int SPACE_XXS
      Spacing: 2 px.
      See Also:
    • SPACE_XS

      public static final int SPACE_XS
      Spacing: 4 px.
      See Also:
    • SPACE_SM

      public static final int SPACE_SM
      Spacing: 8 px.
      See Also:
    • SPACE_MD

      public static final int SPACE_MD
      Spacing: 12 px.
      See Also:
    • SPACE_LG

      public static final int SPACE_LG
      Spacing: 16 px.
      See Also:
    • SPACE_XL

      public static final int SPACE_XL
      Spacing: 24 px.
      See Also:
    • SPACE_XXL

      public static final int SPACE_XXL
      Spacing: 32 px.
      See Also:
    • RADIUS_SM

      public static final int RADIUS_SM
      Corner radius: 4 px.
      See Also:
    • RADIUS_MD

      public static final int RADIUS_MD
      Corner radius: 8 px.
      See Also:
    • RADIUS_LG

      public static final int RADIUS_LG
      Corner radius: 12 px.
      See Also:
    • RADIUS_XL

      public static final int RADIUS_XL
      Corner radius: 16 px.
      See Also:
  • Constructor Details

    • ModernTheme

      protected ModernTheme()
      Static helpers only; protected so legacy themes can extend it.
  • Method Details

    • createLabel

      public static JLabel createLabel(String text)
      Body-text label in TEXT_PRIMARY. Like every factory here, call it on the EDT.
    • createTitle

      public static JLabel createTitle(String text)
      Title label (FONT_TITLE).
    • createSubtitle

      public static JLabel createSubtitle(String text)
      Subtitle label (FONT_SUBTITLE, secondary colour).
    • createMutedLabel

      public static JLabel createMutedLabel(String text)
      Small muted label for hints and captions.
    • createPrimaryButton

      public static ModernTheme.ModernButton createPrimaryButton(String text)
      Primary action button (indigo).
    • createSecondaryButton

      public static ModernTheme.ModernButton createSecondaryButton(String text)
      Secondary button on the card colour.
    • createSuccessButton

      public static ModernTheme.ModernButton createSuccessButton(String text)
      Green button with dark text, for Start/confirm actions.
    • createDangerButton

      public static ModernTheme.ModernButton createDangerButton(String text)
      Red button for Stop and destructive actions.
    • createGhostButton

      public static ModernTheme.ModernButton createGhostButton(String text)
      Transparent button that shows the card colour on hover.
    • createStyledToggleButton

      public static JToggleButton createStyledToggleButton()
      Toggle button with custom paint to avoid repaint glitch. Use for power toggles (PLUGIN ON/OFF, ENGINE ON/OFF). Call setText/setBackground/setForeground as usual.
    • createTextField

      public static ModernTheme.ModernTextField createTextField(String placeholder)
      Themed text field showing placeholder while empty.
    • createScrollPane

      public static JScrollPane createScrollPane(Component view)
      Borderless scroll pane with thin themed scroll bars and a 16 px wheel step.
    • createBadge

      public static JLabel createBadge(String text, Color color)
      Static pill badge tinted with color; use createDynamicBadge(java.lang.String, java.awt.Color) when it changes.
    • createDynamicBadge

      public static ModernTheme.ModernBadge createDynamicBadge(String text, Color accent)
      A ModernTheme.ModernBadge whose text and colour can change, e.g. a live status.
    • createMark

      public static JComponent createMark(String text, Color accent)
      A ModernTheme.MarkLabel: a small lettered logo tile for headers.
    • createPopupMenu

      public static JPopupMenu createPopupMenu()
      Popup menu items styled like Rule Studio (hover background + subtle border).
    • createPopupMenuItem

      public static JMenuItem createPopupMenuItem(String text, ActionListener listener)
      Menu item for createPopupMenu() with a rounded hover highlight; listener may be null.
    • createSeparator

      public static JComponent createSeparator()
      One-pixel horizontal separator in BORDER_SUBTLE.
    • createToolbarButton

      public static JButton createToolbarButton(String text, String icon, Color accentColor)
      Workflow-toolbar style button (used by Rule Engine and other editors/tools).
    • createChip

      public static ModernTheme.ChipToggle createChip(String text, Color accent)
      A ModernTheme.ChipToggle for small filters and sort options.
    • createFilterChip

      public static ModernTheme.FilterChip createFilterChip(String text, boolean active)
      A ModernTheme.FilterChip for filter bars and tab strips.
    • createCardPanel

      public static JPanel createCardPanel()
      Creates a rounded "card" surface panel used throughout PrivBot GUIs. The returned panel is non-opaque and paints its own background.
    • createCardPanel

      public static JPanel createCardPanel(int padding)
      createCardPanel() with padding pixels of inner padding on every side.
    • createSection

      public static JPanel createSection(String title)
      Creates a titled section panel with a card background and outlined border. Suitable for grouping related form fields.
    • createSectionBody

      public static JPanel createSectionBody()
      Creates a body panel for collapsible sections or content areas. Uses BoxLayout (Y_AXIS) with sidebar background and subtle border.
    • createFormPanel

      public static JPanel createFormPanel()
      Creates an empty GridBagLayout panel for building forms with addFormRow(javax.swing.JPanel, int, java.lang.String, javax.swing.JComponent).
    • addFormRow

      public static int addFormRow(JPanel form, int row, String labelText, JComponent component)
      Adds a label + component row to a GridBagLayout form panel.
      Parameters:
      form - the form panel (from createFormPanel())
      row - the current row index
      labelText - the label text
      component - the input component (JTextField, JComboBox, JSpinner, etc.)
      Returns:
      the next row index
    • wrapSectionBlock

      public static JComponent wrapSectionBlock(JComponent component)
      Wraps a component in a panel with bottom spacing, for use in vertical layouts.
    • styleInput

      public static void styleInput(JComponent component)
      Applies standard input styling (background, foreground, font, border) to a component.
    • brighten

      public static Color brighten(Color color, int amount)
      Adds amount to each RGB channel (capped at 255), keeping alpha.
    • darken

      public static Color darken(Color color, int amount)
      Subtracts amount from each RGB channel (floored at 0), keeping alpha.
    • withAlpha

      public static Color withAlpha(Color color, int alpha)
      color with alpha alpha; must be 0..255 (not clamped, unlike GearTheme.withAlpha(java.awt.Color, int)).
    • styleComboBox

      public static void styleComboBox(JComboBox<?> box)
      Styles a JComboBox to match the modern theme, including the popup menu.
    • styleSpinner

      public static void styleSpinner(JSpinner spinner)
      Applies the input colours, font and border to a spinner and its editor field.
    • drawIcon

      public static void drawIcon(Graphics2D g2, String iconKey, int x, int y, int size, Color color)
      Draw a simple vector icon using Graphics2D. Supported keys: GEAR, SWORD, BOLT, LIST, SETTINGS, PLUS, TRASH, CHECK, X

      Note: the keys actually drawn are GEAR/SETTINGS, SWORD/COMBAT/COMBAT_STYLES, BOLT/AUTO_SPEC, LIST/MENU/GEAR_SETS, PLUS/ADD, TRASH/DELETE and PK/AUTO_PK/TARGET (case-insensitive). CHECK and X, and any other key, draw nothing.