org.jvnet.substance.api
Class SubstanceSkin.ColorSchemes

java.lang.Object
  extended by org.jvnet.substance.api.SubstanceSkin.ColorSchemes
Enclosing class:
SubstanceSkin

public static class SubstanceSkin.ColorSchemes
extends java.lang.Object

Contains information on color schemes loaded by the SubstanceSkin.getColorSchemes(URL) API. 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.

Author:
Kirill Grouchnikov

Constructor Summary
SubstanceSkin.ColorSchemes()
          Creates an object with empty list of color schemes.
SubstanceSkin.ColorSchemes(java.util.List<SubstanceColorScheme> schemes)
          Creates an object based on the specified list of color schemes.
 
Method Summary
 void add(SubstanceColorScheme scheme)
          Adds the specified color scheme to the end of the list.
 void delete(java.lang.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(java.lang.String displayName)
          Returns the color scheme based on its display name.
 void replace(java.lang.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(java.lang.String displayName)
          Moves the color scheme with the specified display name one position towards the end of the list.
 void switchWithPrevious(java.lang.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 Detail

SubstanceSkin.ColorSchemes

public SubstanceSkin.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.


SubstanceSkin.ColorSchemes

public SubstanceSkin.ColorSchemes(java.util.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 Detail

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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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.