Class AbstractViewInfo

java.lang.Object
edu.cnu.mdi.view.AbstractViewInfo
Direct Known Subclasses:
DrawingViewInfo, GeometrySliceViewInfo, ImageEvolutionViewInfo, JsonViewInfo, MapViewInfo, NetworkDeclutterViewInfo, PlotViewInfo, TspDemoViewInfo

public abstract class AbstractViewInfo extends Object
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 Details

    • AbstractViewInfo

      public AbstractViewInfo()
  • Method Details

    • getTitle

      public abstract String getTitle()
      Returns:
      The title shown at top of the Info dialog.
    • getPurpose

      public abstract String getPurpose()
      Returns:
      Short description of what this view is for. Plain text by default.
    • getUsageBullets

      public List<String> 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

      public List<String> 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

      public Map<String,String> 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

      public String getTechnicalNotes()
      Returns:
      Technical notes. Plain text.
    • getFooter

      public String getFooter()
      Returns:
      Footer text. 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

      public String 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

      protected String getAccentColorHex()
      Accent color used for section headers. Keep simple; Swing HTML is limited.
    • getTextColorHex

      protected String getTextColorHex()
      Primary text color.
    • getTitleColorHex

      protected String getTitleColorHex()
      Title color.
    • getAsHTML

      public final String 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.