UI Components
The owned Swing toolkit and N3Theme design tokens — shared widgets, diagnostic panels, accessibility rules, and test previews for n3Client plugin panels.
Catalog of the Swing toolkit owned by base-api/src/main/java/dev/n3u/model/ui/ and how it binds to the design tokens in the repository root DESIGN.md. Consumers are the n3Client settings/diagnostic panels, the bundled plugin panels, and the standalone manager UI. Source of truth: docs/development/ui-components.md in the n3Client repository.
Token source: DESIGN.md → N3Theme
Root DESIGN.md is the design-token source (colors, typography, radii, spacing, component specs, frontmatter name: n3Client). N3Theme (base-api/src/main/java/dev/n3u/model/ui/N3Theme.java) is the Java mirror; its class javadoc states it is "mirrored from the Storm web identity (web.storm.n3u.dev, apps/web/public/app.css)". Token groups:
| Group | Constants | Meaning |
|---|---|---|
| Ground/surfaces | PAPER 0x090B08, PANEL 0x131711, PANEL_2 0x181D15, WELL 0x060805, RAISE 0x1C2318 | green-graphite plate hierarchy |
| Structure | RULE, RULE_2, RULE_SOFT, RAISE_RULE, INNER_HIGHLIGHT | hairline rules and inner highlights |
| Ink | INK 0xF5F4EA, INK_2, MUTE, MUTE_2 | text hierarchy |
| Signal | SIGNAL 0xD9F24E, SIGNAL_INK, SIGNAL_HOVER | the one chartreuse action/live-state color — "action and live state only, never decorative" (source comment) |
| States | OK 0x5FE0B0, WARN 0xFFA94D, BAD 0xFF8A93, COOL 0xA8C79A, Tone enum (OK/WARN/BAD/NEUTRAL) | state colors — "always paired with a word, never color alone" |
Typography follows DESIGN.md §typography through resolved families (Segoe UI Variable Display/Segoe UI for display, Segoe UI Variable Text/Segoe UI for sans, Cascadia Mono/Consolas for mono); resolveFamily falls back to its last candidate, so the display/sans chains end at Dialog and the mono chain at Monospaced (N3Theme.java:117-119,150). N3Theme.brandIcon(int) wraps ClientBranding.icon(size) as an Icon.
When a token is missing, extend both DESIGN.md and N3Theme together; do not hard-code colors in panels.
Shared widgets — model/ui/components/
| Class | Surface | Notes |
|---|---|---|
NFrame | base JFrame for owned windows | both constructors already call setupFrame(String) — subclasses must NOT call it again (the setupFrame javadoc is misleading; a second call re-runs initComponents and registers a second set of window/resize listeners) |
NPluginPanel | sidebar plugin panel base | PANEL_WIDTH = 225, SCROLLBAR_WIDTH = 17, BORDER_OFFSET = 6; wraps content in a scroll pane (wrappedPanel, scrollPane); grid layout via ReflectBuilder on net.runelite.client.ui.DynamicGridLayout |
ToggleSlider | owned switch | exposes AccessibleToggle (AccessibleJPanel implementing AccessibleAction) — this is what gives Space/Enter operation and an exposed checked state |
FancyButton | JButton with themed painting | new FancyButton(String text) |
FancyCard | titled card | new FancyCard(String title, String subText) |
FancyDropdown | combo box (generic) | custom BasicComboBoxUI, renderer and popup subclasses |
FancySpinner | integer/double spinner | two public constructors: (String, int, int, int) and (String, double, double, double, double) |
FancyDualSpinner | paired range spinner | used for min/max style inputs |
CollapsiblePanel | expandable section | toggleExpanded(), setExpanded(boolean), addContent(Component), addVerticalStrut(int) |
OptionPanel | options container panel | base panel for option-style layouts |
Owned panels and diagnostic tools — model/ui/
| Class | Surface | Notes |
|---|---|---|
N3ClientOptionsPanel | n3Client settings panel (NPluginPanel, singleton via getInstance()) | owns the client-level switches: headless, packet logging (sent/mouse/server), menu-action logging, name logging, logger visibility, bank cache, mouse-movement send/trajectory record; hosts the transports editor (toggleTransportsEditor()) and listens to menu actions and PacketSent/PacketReceived events |
N3ClientInfoPanel | client info sidebar panel (NPluginPanel) | status/about surface |
PlatformInfoViewer | diagnostic frame (NFrame, singleton) | toggle(), postUpdate(Map) |
DistanceDebugger | diagnostic frame (NFrame, singleton) | isOn(), getDistanceMode(), per-entity enables (players/NPCs/tile objects/tile items); interaction is through Swing actions — the class holds no event subscriptions |
The manager UI reuses the same tokens: ManagerApp imports dev.n3u.model.ui.N3Theme and dev.n3u.util.ClientBranding (manager/src/main/java/dev/n3u/manager/ui/ManagerApp.java:3-4).
Usage rules
- Build panels from these widgets and
N3Themeconstants; the shared look (Storm palette + typography across diagnostic tools) is a checked property of the UI audit, not a suggestion — seedocs/FEATURES.md§"Desktop controls and UI validation" in the repository and the linked audit evidence. - Owned switches must keep their accessibility behavior (Space/Enter, exposed checked state) —
ToggleSliderprovides it;SharedControlsTest(plugins/src/test/java/dev/n3u/plugins/preview/SharedControlsTest.java) keeps the shared controls honest.
Tests and previews
The plugins test source set renders real panels against the main compile classpath (plugins/build.gradle.kts test dependencies): PluginPanelsPreviewTest, SharedControlsTest, AddLegacyAccountPanelTest. Regenerate visual previews with .\gradlew.bat :plugins:renderUiPreview → build/reports/n3-ui. Synthetic previews and deterministic tests do not establish live/native rendering acceptance; those limits are recorded in docs/development/evidence/UI_UX_AUDIT_2026-11-06.md in the repository.
Development Testing
How the n3Client automated suite is organized — per-module test roots, conventions, the fresh-root policy, the manager security scan wall, and how to run the tests.
About This Site
How this documentation site is updated — pages live in the site repository, guides stay the source of truth, and pushing deploys.