Class SchemePreview

java.lang.Object
com.iizigo.panel.SchemePreview

public final class SchemePreview extends Object
The theme preview of a Panel Editor (THEME-DESIGN section 5, phase B3): beside the saved theme choice - the family and the mode the "Theme and Client" menu stores in the preference store - an editor can preview the panel in any shipped family and mode without changing the saved choice. The preview is per editor, never stored, and cleared by choosing the saved theme again or by a change of the saved choice.
Author:
Christopher Mindus
  • Constructor Details

    • SchemePreview

      public SchemePreview()
      Creates the preview: none.
  • Method Details

    • set

      public boolean set(UISchemes.Family family, UISchemes.Mode mode, String savedFamily, String savedMode)
      Sets the preview.
      Parameters:
      family - The family, or null to clear the preview.
      mode - The mode: light or dark; auto previews as light, since the Designer has no OS preference to follow.
      savedFamily - The saved family name, for the change report.
      savedMode - The saved mode name, for the change report.
      Returns:
      true when the effective scheme changed.
    • clear

      public boolean clear(String savedFamily, String savedMode)
      Clears the preview: the saved choice shows again.
      Parameters:
      savedFamily - The saved family name, for the change report.
      savedMode - The saved mode name, for the change report.
      Returns:
      true when the effective scheme changed.
    • savedChoiceChanged

      public boolean savedChoiceChanged()
      Called when the saved choice changed: the preview ends, so the editor shows the new saved choice at once (the owner's ruling Q-1, 2026-09-28).
      Returns:
      true when a preview was ended.
    • isPreviewing

      public boolean isPreviewing()
      Checks if a preview is set.
      Returns:
      true when a preview is shown instead of the saved choice.
    • getPreview

      public UISchemes.Scheme getPreview()
      Gets the preview.
      Returns:
      The preview, or null for the saved choice.
    • isPreviewing

      public boolean isPreviewing(UISchemes.Family family, UISchemes.Mode mode)
      Checks if a family and mode is the preview shown.
      Parameters:
      family - The family.
      mode - The mode.
      Returns:
      true when that family and mode is previewed.
    • effective

      public String effective(String savedFamily, String savedMode)
      Gets the scheme the editor shows: the preview when set, the saved choice otherwise.
      Parameters:
      savedFamily - The saved family name.
      savedMode - The saved mode name.
      Returns:
      The scheme as "family/mode".