Purpose

The module DynamicStylePalette provides a StylePalette with a adjustable number of style entries.

All style entries can be edited. The edited styles are persisted on saving the network where the module is in.

Usage

The dynamic style palette can be filled by three means:

  • Attach an existing StylePalette or DynamicStylePalette to copy the styles.
  • Use the GUI of the module to add new styles and to adjust their parameters.
  • Use the field stylesString to set a generated string for all styles.

Details

The field stylesString is the field interface to the internal style palette.

It reflects the styles and their parameters if the styles have been copied by an attached StylePalette or if the styles have been added via the GUI. Also, changing the string itself (interactively or by scripting) changes the output style palette and the list of styles on the module’s GUI.

The format of the styles string is as follows:

  • Each style is a list of parameters described below and each style is separated from the next by a comma.
  • The list of parameters for one style is:
    • colorR colorG colorB lineStyle lineWidth markerType markerSize antiAlias name
      • colorR, colorG, colorB: float values in [0,1]
      • lineStyle: int in [0,3] (as None, Solid, Dashed, and Dotted)
      • lineWidth: int
      • markerType: int in [0,7] (as None, Dot, Asterisk, Circle, Square, Triangle, Plus, and Cross)
      • markerSize: int
      • antiAlias: int, with 0 = false, other = true
      • name: string, can contain commas and spaces, but must not contain quotes or escape characters

Windows

Default Panel

../../../Modules/ML/MLBase/mhelp/Images/Screenshots/DynamicStylePalette._default.png

Input Fields

inStylePalette

name: inStylePalette, type: StylePalette(MLBase)

Output Fields

outStylePalette

name: outStylePalette, type: StylePalette(MLBase)

Parameter Fields

Visible Fields

Update From Parameters

name: updateFromParameters, type: Trigger

If pressed, the list on the GUI and the output style palette are recomputed based on the stylesString.

Auto read input StylePalette

name: autoReadInStylePalette, type: Bool, default: TRUE

If checked, the stylesString and the output style palette are updated if the input StylePalette changes.

Auto apply parameters

name: autoApply, type: Bool, default: TRUE

If checked, the module updates the stylesString, the GUI, and the output StylePalette on changing the Num. Styles.

Read In Style Palette

name: readInStylePalette, type: Trigger

If pressed, the attached StylePalette is read in anew, leading to an update of the stylesString, the GUI, and the output StylePalette.

StylePalette is valid

name: stylePaletteValid, type: Bool, persistent: no

Shows whether the output StylePalette is valid.

Num. Styles

name: numStylePaletteEntries, type: Integer, default: 0

Sets the number of styles.

Num. Reserved Entries

name: numReservedEntries, type: Integer, default: 0

Sets the number of reserved entries.

Enable Editing

name: enableEditing, type: Bool, default: TRUE

If checked, the list view showing the styles permits editing the style parameters.

Hidden Fields

stylesString

name: stylesString, type: String

listViewString

name: listViewString, type: String