public class EnhancedColor
extends java.lang.Object
implements java.io.Externalizable
| Modifier and Type | Field and Description |
|---|---|
java.lang.Integer |
colorIndex
Index of the color in a color table.
|
ColorRgb |
colorRgb
RGB color.
|
| Constructor and Description |
|---|
EnhancedColor()
Default constructor.
|
EnhancedColor(ColorRgb colorRgb)
Creates an enhnaced color backed by an RGB color.
|
EnhancedColor(int colorIndex)
Creates an enhnaced color backed by a color index.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Integer |
getColorIndex(EnhancedColor enhancedColor)
Get color index of the given enhanced color, if any.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
static ColorRgb |
resolveColor(EnhancedColor enhancedColor,
Window<?> window)
Resolve RGB color this enhanced color represents in the specified window.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
public ColorRgb colorRgb
public java.lang.Integer colorIndex
public EnhancedColor()
public EnhancedColor(ColorRgb colorRgb)
colorRgb - RGB color.public EnhancedColor(int colorIndex)
colorIndex - Index of the color in a color table.public static ColorRgb resolveColor(EnhancedColor enhancedColor, Window<?> window)
enhancedColor - Enhanced color to resolve. Can be null.window - Target window.null if
enhancedColor is null or it is backed by an invalid color index.public static java.lang.Integer getColorIndex(EnhancedColor enhancedColor)
enhancedColor - Enhanced color. Can be null.null if enhancedColor is <
code>null or it is backed by an RGB color.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - The output destination to which fields will be saved.java.io.IOException - In case of I/O errors.public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - The input source from which fields will be restored.java.io.IOException - In case of I/O errors.java.lang.ClassNotFoundException - If payload can't be instantiated.