Package org.pushingpixels.substance.api

# Class SubstanceSkin.ColorSchemes

java.lang.Object
org.pushingpixels.substance.api.SubstanceSkin.ColorSchemes

Enclosing class:
  `SubstanceSkin`

public static class SubstanceSkin.ColorSchemes extends Object
Contains information on color schemes loaded by the `SubstanceSkin.getColorSchemes(URL)` and `SubstanceSkin.getColorSchemes(String)` APIs. Note that the custom skins should only use the `get(String)` API. The rest of the API is currently internal and is used in the Jitterbug visual editor.

## Constructor Summary

Constructors
Constructor
Description
`ColorSchemes()`
Creates an object with empty list of color schemes.
`ColorSchemes(List<SubstanceColorScheme> schemes)`
Creates an object based on the specified list of color schemes.

## Method Summary

Modifier and Type
Method
Description
`void`
`add(SubstanceColorScheme scheme)`
Adds the specified color scheme to the end of the list.
`void`
`delete(String displayName)`
Deletes the color scheme that has the specified display name.
`SubstanceColorScheme`
`get(int index)`
Returns the color scheme at the specified index.
`SubstanceColorScheme`
`get(String displayName)`
Returns the color scheme based on its display name.
`void`
`replace(String displayName, SubstanceColorScheme scheme)`
Finds the index of the color scheme that has the specified display name and replaces it with (possibly another) color scheme.
`int`
`size()`
Returns the number of color schemes in this object.
`void`
`switchWithNext(String displayName)`
Moves the color scheme with the specified display name one position towards the end of the list.
`void`
`switchWithPrevious(String displayName)`
Moves the color scheme with the specified display name one position towards the beginning of the list.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ColorSchemes

public ColorSchemes()
Creates an object with empty list of color schemes. This method is for internal use only and should not be used in custom application skins.

### ColorSchemes

public ColorSchemes(List<SubstanceColorScheme> schemes)
Creates an object based on the specified list of color schemes. This method is for internal use only and should not be used in custom application skins.

Parameters:
  `schemes` - List of color schemes.

## Method Details

### size

public int size()
Returns the number of color schemes in this object. This method is for internal use only and should not be used in custom application skins.

Returns:
  The number of color schemes in this object.

### get

public SubstanceColorScheme get(int index)
Returns the color scheme at the specified index. This method is for internal use only and should not be used in custom application skins.

Parameters:
  `index` - Index.
Returns:
  Color scheme at the specified index.

### get

public SubstanceColorScheme get(String displayName)
Returns the color scheme based on its display name. This method is the only API that is published for use in custom application skins.

Parameters:
  `displayName` - Display name of a color scheme.
Returns:
  The color scheme with the matching display name.

### replace

public void replace(String displayName, SubstanceColorScheme scheme)
Finds the index of the color scheme that has the specified display name and replaces it with (possibly another) color scheme. This method is for internal use only and should not be used in custom application skins.

Parameters:
  `displayName` - Display name of a color scheme.
  `scheme` - Color scheme that will replace the existing color scheme (based on the display name) at the same index in the list.

### delete

public void delete(String displayName)
Deletes the color scheme that has the specified display name. This method is for internal use only and should not be used in custom application skins.

Parameters:
  `displayName` - Display name of the color scheme to delete from the list.

### add

public void add(SubstanceColorScheme scheme)
Adds the specified color scheme to the end of the list. This method is for internal use only and should not be used in custom application skins.

Parameters:
  `scheme` - Color scheme to add to the end of the list.

### switchWithPrevious

public void switchWithPrevious(String displayName)
Moves the color scheme with the specified display name one position towards the beginning of the list. This method is for internal use only and should not be used in custom application skins.

Parameters:
  `displayName` - Display name of the color scheme to move one position towards the beginning of the list.

### switchWithNext

public void switchWithNext(String displayName)
Moves the color scheme with the specified display name one position towards the end of the list. This method is for internal use only and should not be used in custom application skins.

Parameters:
  `displayName` - Display name of the color scheme to move one position towards the end of the list.