Skip to main content

Class JtvColorGroup

public class JtvColorGroup

A named colour group used by JtvColorDialog.

TColorGroup represents a named category of palette entries (e.g., "Desktop", "Menus"). Each group owns a list of JtvColorItem objects that identify the individual palette slots within that category.

The index field tracks which item in this group was most recently focused in the colour item list, so the dialog can restore that position.

org.viktor44.jtvision.dialogs.JtvColorGroup

Summary​

Constructors​

VisibilitySignature
publicJtvColorGroup(String nm)
publicJtvColorGroup(String nm, JtvColorItem itm)

Fields​

ModifiersField nameType
protectednameString
protectedindexint
protecteditemsList<org.viktor44.jtvision.dialogs.JtvColorItem>

Methods​

ModifiersMethod signatureReturn type
publicaddItem(JtvColorItem item)org.viktor44.jtvision.dialogs.JtvColorGroup
public staticappendItem(JtvColorGroup g, JtvColorItem i)org.viktor44.jtvision.dialogs.JtvColorGroup
publicgetName()String
publicgetIndex()int
publicsetIndex(int index)void
publicgetItems()List<org.viktor44.jtvision.dialogs.JtvColorItem>

Constructors​

JtvColorGroup(String nm)​

Creates a colour group with the given name and no items.

Parameters

  • nm - the display name

JtvColorGroup(String nm, JtvColorItem itm)​

Creates a colour group with a specified initial item.

Parameters

  • nm - the display name
  • itm - an initial item to add to the group, or null

Fields​

String name​

The display name shown in the colour group list.

int index​

The index of the most recently focused item within this group's item list. Used to restore the selection when switching between groups.

List<org.viktor44.jtvision.dialogs.JtvColorItem> items​

The list of JtvColorItem objects belonging to this group.

Methods​

addItem(JtvColorItem item)​

Adds item to this group's item list and returns this group for chaining.

Parameters

  • item - the item to add

Returns

this group

appendItem(JtvColorGroup g, JtvColorItem i)​

Adds item i to group g's item list.

Parameters

  • g - the group to add the item to; if null this is a no-op
  • i - the item to add

Returns

g (unchanged reference)

getName()​

The display name shown in the colour group list.

getIndex()​

The index of the most recently focused item within this group's item list. Used to restore the selection when switching between groups.

setIndex(int index)​

The index of the most recently focused item within this group's item list. Used to restore the selection when switching between groups.

Parameters

  • index

getItems()​

The list of JtvColorItem objects belonging to this group.