Package edu.cnu.mdi.view
Class AbstractViewInfo
java.lang.Object
edu.cnu.mdi.view.AbstractViewInfo
- Direct Known Subclasses:
DrawingViewInfo,GeometrySliceViewInfo,ImageEvolutionViewInfo,JsonViewInfo,MapViewInfo,NetworkDeclutterViewInfo,PlotViewInfo,TspDemoViewInfo
Base class for View Information.
Extend this for each View type to provide standardized documentation.
Design goals:
- Centralize look and feel (typography, spacing, section layout)
- Prefer structured data over ad-hoc HTML snippets
- Still allow optional raw HTML fragments when needed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringAccent color used for section headers.final StringGenerates an HTML string representing this view info, suitable for display in a Swing HTML component.A map of Key Combo -> Action (e.g., "Ctrl+S" -> "Save").abstract Stringprotected StringPrimary text color.abstract StringgetTitle()protected StringTitle color.Usage bullets (preferred).If you really need custom HTML for usage, you may return a raw HTML fragment here (e.g., a table, links, etc.).Usage steps (optional alternative to bullets).protected booleanIf you really need custom HTML for purpose, override this and return true.
-
Constructor Details
-
AbstractViewInfo
public AbstractViewInfo()
-
-
Method Details
-
getTitle
- Returns:
- The title shown at top of the Info dialog.
-
getPurpose
- Returns:
- Short description of what this view is for. Plain text by default.
-
getUsageBullets
Usage bullets (preferred). Each bullet should be plain text (not HTML). The framework will escape it.- Returns:
- List of usage bullets, or empty list if none.
-
getUsageSteps
Usage steps (optional alternative to bullets). Each step should be plain text (not HTML). The framework will escape it.- Returns:
- List of usage steps, or empty list if none.
-
getKeyboardShortcuts
A map of Key Combo -> Action (e.g., "Ctrl+S" -> "Save"). Keys and actions are treated as plain text.- Returns:
- Map of keyboard shortcuts, or empty map if none.
-
getTechnicalNotes
- Returns:
- Technical notes. Plain text.
-
isPurposeHtml
protected boolean isPurposeHtml()If you really need custom HTML for purpose, override this and return true. Default: purpose is escaped as plain text. -
getUsageHtml
If you really need custom HTML for usage, you may return a raw HTML fragment here (e.g., a table, links, etc.). If non-blank, it is inserted as-is. Prefer getUsageBullets() / getUsageSteps() when possible.- Returns:
- Raw HTML fragment for usage instructions, or null/blank to use structured bullets/steps.
-
getAccentColorHex
Accent color used for section headers. Keep simple; Swing HTML is limited. -
getTextColorHex
Primary text color. -
getTitleColorHex
Title color. -
getAsHTML
Generates an HTML string representing this view info, suitable for display in a Swing HTML component.- Returns:
- An HTML string representing this view info.
-