Class Palette

All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
Direct Known Subclasses:
EditorPalette

public class Palette extends PropCnr
A palette: a named selection of an application's palette colors, so that a designer can name a set of their own (ruling Q1, 2026-09-12). The colors themselves are the PaletteColor files under the module's style folder; a palette owns none of them, it holds one ColorReference member per color it selects. A member's name is the palette's own label for the color, by default the color's leaf name; the reference follows the color when it is renamed or moved, as every AbstractReference does.

Storage is one .iiziStyle file per palette under the module's style folder, the root tag palette, beside the paletteColor files it selects from (the FontFaces precedent: one folder extension, the file's root tag names its type). Nothing at run time reads a palette: the palette colors reach the client whether or not a palette names them; a palette is the Designer's grouping, for the chooser and the tree editor.

Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • Palette

      public Palette()
      Creates the palette property container without a name. The name must be set in all cases using the setPropertyAtom call.
    • Palette

      public Palette(Atom propertyAtom)
      Creates the palette property container with the specified name.
      Parameters:
      propertyAtom - the name of the palette, unique within its folder.
  • Method Details

    • getMembers

      public List<ColorReference> getMembers()
      Gets the members of the palette, in order.
      Returns:
      The color references, possibly empty, never null.
    • getColors

      public List<PaletteColor> getColors()
      Gets the palette colors the members resolve to, in member order, skipping the members that do not resolve.
      Returns:
      The palette colors, possibly empty, never null.
    • getMember

      public ColorReference getMember(PaletteColor color)
      Gets the member that selects a palette color.
      Parameters:
      color - The palette color.
      Returns:
      The member, or null when the palette does not select it.
    • contains

      public boolean contains(PaletteColor color)
      Checks if the palette selects a palette color.
      Parameters:
      color - The palette color.
      Returns:
      true if a member resolves to it.
    • verify

      public boolean verify(PropVerification verification)
      Verifies this palette: a member that resolves to a color another member already selects is a warning on the later member (a broken member is the reference's own property error, as for every AbstractReference).
      Specified by:
      verify in interface IGProp<GProp<?>[]>
      Overrides:
      verify in class PropCnr
      Parameters:
      verification - The property verification class.
      Returns:
      true if verification should proceed, false if disposed of and verification should not take place.