# Class ColorParameters

java.lang.Object
jspecview.common.Parameters
jspecview.common.ColorParameters

Direct Known Subclasses:
  `AwtParameters, JsParameters`

public abstract class ColorParameters extends Parameters
This a representation of the Display Scheme for the spectral display.

Author:
  Debbie-Ann Facey, Khari A. Bryan, Prof Robert J. Lancashire

## Field Summary

Fields
Modifier and Type
Field
Description
`static GenericColor`
`BLACK`
`static GenericColor`
`BLUE`
`static GenericColor`
`DARK_GRAY`
`static final String[]`
`defaultPlotColorNames`
`static final GenericColor[]`
`defaultPlotColors`
`String`
`displayFontName`
`Map<ScriptToken, GenericColor>`
`elementColors`
`boolean`
`isDefault`
`static GenericColor`
`LIGHT_GRAY`
`GenericColor[]`
`plotColors`
`static GenericColor`
`RED`
`String`
`titleFontName`
`static GenericColor`
`WHITE`

### Fields inherited from class Parameters

`htBooleans, integralDrawAll, integralMinY, integralOffset, integralRange, name, peakListInterpolation, peakListThreshold, precision, viewOffset`

## Constructor Summary

Constructors
Constructor
Description
`ColorParameters()`

## Method Summary

Modifier and Type
Method
Description
`ColorParameters`
`copy()`
Returns a copy of this `DisplayScheme`
`abstract ColorParameters`
`copy(String newName)`
Returns a copy of this `DisplayScheme` with a new name
`protected abstract GenericColor`
`getColor1(int rgb)`
`protected abstract GenericColor`
`getColor3(int r, int g, int b)`
`GenericColor`
`getColorFromString(String name)`
`GenericColor`
`getElementColor(ScriptToken st)`
Gets the color of an element in the scheme
`String`
`getFontName(ScriptToken st, String value)`
`protected GenericColor[]`
`getPlotColors(String plotColorsStr)`
`protected abstract boolean`
`isValidFontName(String value)`
`void`
`set(PanelData pd, ScriptToken st, String value)`
`GenericColor`
`setColor(ScriptToken st, GenericColor color)`
Sets the color of an element
`protected GenericColor`
`setColorFromString(ScriptToken st, String value)`
`ColorParameters`
`setElementColors(ColorParameters p)`
`void`
`setFor(JSVPanel jsvp, ColorParameters ds, boolean includeMeasures)`

### Methods inherited from class Parameters

`getBoolean, getBooleans, getTFToggle, isMatch, isTrue, putInfo, setBoolean, setName, setP`

### Methods inherited from class Object

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

## Field Details

### titleFontName

public String titleFontName

### displayFontName

public String displayFontName

### elementColors

public Map<ScriptToken, GenericColor> elementColors

### plotColors

public GenericColor[] plotColors

### isDefault

public boolean isDefault

### BLACK

public static GenericColor BLACK

### RED

public static GenericColor RED

### LIGHT_GRAY

public static GenericColor LIGHT_GRAY

### DARK_GRAY

public static GenericColor DARK_GRAY

### BLUE

public static GenericColor BLUE

### WHITE

public static GenericColor WHITE

### defaultPlotColors

public static final GenericColor[] defaultPlotColors

### defaultPlotColorNames

public static final String[] defaultPlotColorNames

## Constructor Details

### ColorParameters

public ColorParameters()

## Method Details

### getColor3

protected abstract GenericColor getColor3(int r, int g, int b)

### getColor1

protected abstract GenericColor getColor1(int rgb)

### isValidFontName

protected abstract boolean isValidFontName(String value)

### setFor

public void setFor(JSVPanel jsvp, ColorParameters ds, boolean includeMeasures)

### set

public void set(PanelData pd, ScriptToken st, String value)

### getElementColor

public GenericColor getElementColor(ScriptToken st)
Gets the color of an element in the scheme

Parameters:
  `st` -
Returns:
  the `Color` of the element

### setColor

public GenericColor setColor(ScriptToken st, GenericColor color)
Sets the color of an element

Parameters:
  `st` -
  `color` - the color the element should have
Returns:
  color object

### copy

public abstract ColorParameters copy(String newName)
Returns a copy of this `DisplayScheme` with a new name

Parameters:
  `newName` - the new name
Returns:
  a copy of this `DisplayScheme` with a new name

### copy

public ColorParameters copy()
Returns a copy of this `DisplayScheme`

Returns:
  a copy of this `DisplayScheme`

### setElementColors

public ColorParameters setElementColors(ColorParameters p)

### getColorFromString

public GenericColor getColorFromString(String name)

### getPlotColors

protected GenericColor[] getPlotColors(String plotColorsStr)

Parameters:
  `plotColorsStr` -
Returns:
  Color[]

### setColorFromString

protected GenericColor setColorFromString(ScriptToken st, String value)

Parameters:
  `st` -
  `value` -
Returns:
  color object

### getFontName

public String getFontName(ScriptToken st, String value)

Parameters:
  `st` -
  `value` -
Returns:
  font object