Package org.apache.sis.io.wkt
Class Colors
Object
Colors
- All Implemented Interfaces:
- Serializable,- Cloneable
The colors to use for formatting Well Known Text (WKT) objects.
 Colors are identified by their names and can be mapped to 
ElementKind.
 The currently supported color names are:
 - "red",- "green",- "yellow",- "blue",- "magenta",- "cyan",- "gray".
- Since:
- 0.4
- See Also:
Defined in the sis-referencing module
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ColorsThe default colors used byFormattableObject.print().static final ColorsEmphases on identification information (name and identifiers) only.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()Returns a clone of thisColors.booleanCompares thisColorswith the given object for equality.final StringgetName(ElementKind key) Returns the color for the given syntactic element.intReturns a hash code value for this object.voidsetName(ElementKind key, String color) Sets the color of the given syntactic element from a color name.
- 
Field Details- 
DEFAULTThe default colors used byFormattableObject.print(). Those colors give better results on aConsolewith black background. This map is immutable.- See Also:
 
- 
NAMINGEmphases on identification information (name and identifiers) only. This map is immutable.
 
- 
- 
Constructor Details- 
Colorspublic Colors()Creates a new, initially empty, set of colors.
- 
ColorsCreates a new set of colors initialized to a copy of the given one.- Parameters:
- colors- the set of colors to copy.
 
 
- 
- 
Method Details- 
setNameSets the color of the given syntactic element from a color name. The color names supported in the current implementation are"red","green","yellow","blue","magenta","cyan"and"gray", case-insensitive.- Parameters:
- key- the syntactic element for which to set the color.
- color- the color to give to the specified element, or- nullif none.
- Throws:
- IllegalArgumentException- if the given color name is not recognized.
- UnsupportedOperationException- if this- Colorsinstance is immutable.
 
- 
getNameReturns the color for the given syntactic element.- Parameters:
- key- the syntactic element for which to get the color.
- Returns:
- the color of the specified element, or nullif none.
 
- 
cloneReturns a clone of thisColors.
- 
equalsCompares thisColorswith the given object for equality.
- 
hashCodepublic int hashCode()Returns a hash code value for this object.
 
-