Class ModernTheme
java.lang.Object
privbot.ui.ModernTheme
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classChip-style toggle for small filters/sort options.static classRule Studio–style filter chip: JButton with active state and rounded rect paint.static classLogo/mark label (used in headers, similar to Rule Studio's icon + title).static classBadge label with a mutable accent color (useful for live status badges).static classModern styled button with hover effects.static classModern scroll bar UI.static classModern text field with placeholder support.static classModern Toggle Switch (replaces JCheckBox).static classToggle button that paints background + text in one pass (no super.paintComponent) to avoid glitch. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorHighlight accent (cyan).static final ColorDanger, errors and Stop (red).static final ColorDark red for danger fills.static final ColorInformational accent (blue).static final ColorCondition accent (orange).static final ColorPrimary action accent (indigo).static final ColorPrimary accent under the mouse.static final ColorSpecial accent (purple).static final ColorSuccess, enabled and running (green).static final ColorDark green for success fills.static final ColorWarnings and paused states (amber).static final ColorDarkest background: the main canvas.static final ColorCard and elevated surface.static final ColorCard surface under the mouse.static final ColorRaised surfaces: dropdowns, popups, tooltips.static final ColorHeader and status bars.static final ColorInput field background.static final ColorSidebar and panel background.static final ColorToolbar background.static final ColorDefault border.static final ColorFocus ring.static final ColorSubtle separators.static final FontBody text (13 pt).static final FontBold body text and button labels (13 pt).static final FontLarge display headings (24 pt bold).static final FontEmoji/icon glyphs (14 pt).static final FontMonospaced values and logs (12 pt).static final FontSmall labels (11 pt).static final FontSubtitles and sidebar headers (14 pt semibold).static final FontBadges and section captions (10 pt).static final FontTitles (18 pt semibold).static final ColorAction node accent in flow editors.static final ColorAction node fill in flow editors.static final ColorCondition node accent in flow editors.static final ColorCondition node fill in flow editors.static final intCorner radius: 12 px.static final intCorner radius: 8 px.static final intCorner radius: 4 px.static final intCorner radius: 16 px.static final intSpacing: 16 px.static final intSpacing: 12 px.static final intSpacing: 8 px.static final intSpacing: 24 px.static final intSpacing: 4 px.static final intSpacing: 32 px.static final intSpacing: 2 px.static final ColorDark text for light or saturated backgrounds.static final ColorMuted text, still readable onBG_CARD.static final ColorMain text (near white).static final ColorSecondary text and labels. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStatic helpers only; protected so legacy themes can extend it. -
Method Summary
Modifier and TypeMethodDescriptionstatic intaddFormRow(JPanel form, int row, String labelText, JComponent component) Adds a label + component row to a GridBagLayout form panel.static ColorAddsamountto each RGB channel (capped at 255), keeping alpha.static JLabelcreateBadge(String text, Color color) Static pill badge tinted withcolor; usecreateDynamicBadge(java.lang.String, java.awt.Color)when it changes.static JPanelCreates a rounded "card" surface panel used throughout PrivBot GUIs.static JPanelcreateCardPanel(int padding) createCardPanel()withpaddingpixels of inner padding on every side.static ModernTheme.ChipTogglecreateChip(String text, Color accent) AModernTheme.ChipTogglefor small filters and sort options.static ModernTheme.ModernButtoncreateDangerButton(String text) Red button for Stop and destructive actions.static ModernTheme.ModernBadgecreateDynamicBadge(String text, Color accent) AModernTheme.ModernBadgewhose text and colour can change, e.g.static ModernTheme.FilterChipcreateFilterChip(String text, boolean active) AModernTheme.FilterChipfor filter bars and tab strips.static JPanelCreates an empty GridBagLayout panel for building forms withaddFormRow(javax.swing.JPanel, int, java.lang.String, javax.swing.JComponent).static ModernTheme.ModernButtoncreateGhostButton(String text) Transparent button that shows the card colour on hover.static JLabelcreateLabel(String text) Body-text label inTEXT_PRIMARY.static JComponentcreateMark(String text, Color accent) AModernTheme.MarkLabel: a small lettered logo tile for headers.static JLabelcreateMutedLabel(String text) Small muted label for hints and captions.static JPopupMenuPopup menu items styled like Rule Studio (hover background + subtle border).static JMenuItemcreatePopupMenuItem(String text, ActionListener listener) Menu item forcreatePopupMenu()with a rounded hover highlight;listenermay be null.static ModernTheme.ModernButtoncreatePrimaryButton(String text) Primary action button (indigo).static JScrollPanecreateScrollPane(Component view) Borderless scroll pane with thin themed scroll bars and a 16 px wheel step.static ModernTheme.ModernButtoncreateSecondaryButton(String text) Secondary button on the card colour.static JPanelcreateSection(String title) Creates a titled section panel with a card background and outlined border.static JPanelCreates a body panel for collapsible sections or content areas.static JComponentOne-pixel horizontal separator inBORDER_SUBTLE.static JToggleButtonToggle button with custom paint to avoid repaint glitch.static JLabelcreateSubtitle(String text) Subtitle label (FONT_SUBTITLE, secondary colour).static ModernTheme.ModernButtoncreateSuccessButton(String text) Green button with dark text, for Start/confirm actions.static ModernTheme.ModernTextFieldcreateTextField(String placeholder) Themed text field showingplaceholderwhile empty.static JLabelcreateTitle(String text) Title label (FONT_TITLE).static JButtoncreateToolbarButton(String text, String icon, Color accentColor) Workflow-toolbar style button (used by Rule Engine and other editors/tools).static ColorSubtractsamountfrom each RGB channel (floored at 0), keeping alpha.static voiddrawIcon(Graphics2D g2, String iconKey, int x, int y, int size, Color color) Draw a simple vector icon using Graphics2D.static voidstyleComboBox(JComboBox<?> box) Styles a JComboBox to match the modern theme, including the popup menu.static voidstyleInput(JComponent component) Applies standard input styling (background, foreground, font, border) to a component.static voidstyleSpinner(JSpinner spinner) Applies the input colours, font and border to a spinner and its editor field.static Colorcolorwith alphaalpha; must be 0..255 (not clamped, unlikeGearTheme.withAlpha(java.awt.Color, int)).static JComponentwrapSectionBlock(JComponent component) Wraps a component in a panel with bottom spacing, for use in vertical layouts.
-
Field Details
-
BG_CANVAS
Darkest background: the main canvas. -
BG_SIDEBAR
Sidebar and panel background. -
BG_CARD
Card and elevated surface. -
BG_CARD_HOVER
Card surface under the mouse. -
BG_INPUT
Input field background. -
BG_ELEVATED
Raised surfaces: dropdowns, popups, tooltips. -
BG_HEADER
Header and status bars. -
BG_TOOLBAR
Toolbar background. -
ACCENT_PRIMARY
Primary action accent (indigo). -
ACCENT_PRIMARY_HOVER
Primary accent under the mouse. -
ACCENT_SUCCESS
Success, enabled and running (green). -
ACCENT_SUCCESS_MUTED
Dark green for success fills. -
ACCENT_WARNING
Warnings and paused states (amber). -
ACCENT_DANGER
Danger, errors and Stop (red). -
ACCENT_DANGER_MUTED
Dark red for danger fills. -
ACCENT_INFO
Informational accent (blue). -
ACCENT_PURPLE
Special accent (purple). -
ACCENT_CYAN
Highlight accent (cyan). -
ACCENT_ORANGE
Condition accent (orange). -
TEXT_PRIMARY
Main text (near white). -
TEXT_SECONDARY
Secondary text and labels. -
TEXT_MUTED
-
TEXT_INVERSE
Dark text for light or saturated backgrounds. -
BORDER_DEFAULT
Default border. -
BORDER_FOCUS
Focus ring. -
BORDER_SUBTLE
Subtle separators. -
NODE_CONDITION
Condition node accent in flow editors. -
NODE_ACTION
Action node accent in flow editors. -
NODE_CONDITION_BG
Condition node fill in flow editors. -
NODE_ACTION_BG
Action node fill in flow editors. -
FONT_DISPLAY
Large display headings (24 pt bold). -
FONT_TITLE
Titles (18 pt semibold). -
FONT_SUBTITLE
Subtitles and sidebar headers (14 pt semibold). -
FONT_BODY
Body text (13 pt). -
FONT_BODY_BOLD
Bold body text and button labels (13 pt). -
FONT_SMALL
Small labels (11 pt). -
FONT_TINY
Badges and section captions (10 pt). -
FONT_MONO
Monospaced values and logs (12 pt). -
FONT_ICON
Emoji/icon glyphs (14 pt). -
SPACE_XXS
public static final int SPACE_XXSSpacing: 2 px.- See Also:
-
SPACE_XS
public static final int SPACE_XSSpacing: 4 px.- See Also:
-
SPACE_SM
public static final int SPACE_SMSpacing: 8 px.- See Also:
-
SPACE_MD
public static final int SPACE_MDSpacing: 12 px.- See Also:
-
SPACE_LG
public static final int SPACE_LGSpacing: 16 px.- See Also:
-
SPACE_XL
public static final int SPACE_XLSpacing: 24 px.- See Also:
-
SPACE_XXL
public static final int SPACE_XXLSpacing: 32 px.- See Also:
-
RADIUS_SM
public static final int RADIUS_SMCorner radius: 4 px.- See Also:
-
RADIUS_MD
public static final int RADIUS_MDCorner radius: 8 px.- See Also:
-
RADIUS_LG
public static final int RADIUS_LGCorner radius: 12 px.- See Also:
-
RADIUS_XL
public static final int RADIUS_XLCorner radius: 16 px.- See Also:
-
-
Constructor Details
-
ModernTheme
protected ModernTheme()Static helpers only; protected so legacy themes can extend it.
-
-
Method Details
-
createLabel
Body-text label inTEXT_PRIMARY. Like every factory here, call it on the EDT. -
createTitle
Title label (FONT_TITLE). -
createSubtitle
Subtitle label (FONT_SUBTITLE, secondary colour). -
createMutedLabel
-
createPrimaryButton
Primary action button (indigo). -
createSecondaryButton
Secondary button on the card colour. -
createSuccessButton
Green button with dark text, for Start/confirm actions. -
createDangerButton
Red button for Stop and destructive actions. -
createGhostButton
Transparent button that shows the card colour on hover. -
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
Themed text field showingplaceholderwhile empty. -
createScrollPane
Borderless scroll pane with thin themed scroll bars and a 16 px wheel step. -
createBadge
Static pill badge tinted withcolor; usecreateDynamicBadge(java.lang.String, java.awt.Color)when it changes. -
createDynamicBadge
AModernTheme.ModernBadgewhose text and colour can change, e.g. a live status. -
createMark
AModernTheme.MarkLabel: a small lettered logo tile for headers. -
createPopupMenu
Popup menu items styled like Rule Studio (hover background + subtle border). -
createPopupMenuItem
Menu item forcreatePopupMenu()with a rounded hover highlight;listenermay be null. -
createSeparator
One-pixel horizontal separator inBORDER_SUBTLE. -
createToolbarButton
-
createChip
AModernTheme.ChipTogglefor small filters and sort options. -
createFilterChip
AModernTheme.FilterChipfor filter bars and tab strips. -
createCardPanel
Creates a rounded "card" surface panel used throughout PrivBot GUIs. The returned panel is non-opaque and paints its own background. -
createCardPanel
createCardPanel()withpaddingpixels of inner padding on every side. -
createSection
-
createSectionBody
Creates a body panel for collapsible sections or content areas. Uses BoxLayout (Y_AXIS) with sidebar background and subtle border. -
createFormPanel
Creates an empty GridBagLayout panel for building forms withaddFormRow(javax.swing.JPanel, int, java.lang.String, javax.swing.JComponent). -
addFormRow
Adds a label + component row to a GridBagLayout form panel.- Parameters:
form- the form panel (fromcreateFormPanel())row- the current row indexlabelText- the label textcomponent- the input component (JTextField, JComboBox, JSpinner, etc.)- Returns:
- the next row index
-
wrapSectionBlock
Wraps a component in a panel with bottom spacing, for use in vertical layouts. -
styleInput
Applies standard input styling (background, foreground, font, border) to a component. -
brighten
-
darken
-
withAlpha
colorwith alphaalpha; must be 0..255 (not clamped, unlikeGearTheme.withAlpha(java.awt.Color, int)). -
styleComboBox
Styles a JComboBox to match the modern theme, including the popup menu. -
styleSpinner
Applies the input colours, font and border to a spinner and its editor field. -
drawIcon
Draw a simple vector icon using Graphics2D. Supported keys: GEAR, SWORD, BOLT, LIST, SETTINGS, PLUS, TRASH, CHECK, XNote: 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.
-