Class DeviceColor
- java.lang.Object
-
- org.apache.batik.css.engine.value.AbstractValue
-
- org.apache.batik.css.engine.value.svg12.DeviceColor
-
- All Implemented Interfaces:
Value
public class DeviceColor extends AbstractValue
This class represents an device-specific color value.- Version:
- $Id: DeviceColor.java 1617286 2014-08-11 14:03:51Z lbernardo $
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]colorsThe colors.protected intcountThe color count.static java.lang.StringDEVICE_CMYK_COLOR_FUNCTIONstatic java.lang.StringDEVICE_GRAY_COLOR_FUNCTIONstatic java.lang.StringDEVICE_NCHANNEL_COLOR_FUNCTIONstatic java.lang.StringDEVICE_RGB_COLOR_FUNCTIONprotected booleannChannel
-
Constructor Summary
Constructors Constructor Description DeviceColor(boolean nChannel)Creates a new DeviceColor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(float c)Appends a color to the list.floatgetColor(int i)Returns the color at the given index.java.lang.StringgetCssText()A string representation of the current value.shortgetCssValueType()ImplementsValue.getCssValueType().intgetNumberOfColors()Returns the number of colors.booleanisNChannel()Indicates whether this color uses an N-Channel color space.java.lang.StringtoString()-
Methods inherited from class org.apache.batik.css.engine.value.AbstractValue
createDOMException, getBlue, getBottom, getFloatValue, getGreen, getIdentifier, getLeft, getLength, getListStyle, getPrimitiveType, getRed, getRight, getSeparator, getStringValue, getTop, item
-
-
-
-
Field Detail
-
DEVICE_GRAY_COLOR_FUNCTION
public static final java.lang.String DEVICE_GRAY_COLOR_FUNCTION
- See Also:
- Constant Field Values
-
DEVICE_RGB_COLOR_FUNCTION
public static final java.lang.String DEVICE_RGB_COLOR_FUNCTION
- See Also:
- Constant Field Values
-
DEVICE_CMYK_COLOR_FUNCTION
public static final java.lang.String DEVICE_CMYK_COLOR_FUNCTION
- See Also:
- Constant Field Values
-
DEVICE_NCHANNEL_COLOR_FUNCTION
public static final java.lang.String DEVICE_NCHANNEL_COLOR_FUNCTION
- See Also:
- Constant Field Values
-
nChannel
protected boolean nChannel
-
count
protected int count
The color count.
-
colors
protected float[] colors
The colors.
-
-
Method Detail
-
getCssValueType
public short getCssValueType()
ImplementsValue.getCssValueType().- Specified by:
getCssValueTypein interfaceValue- Overrides:
getCssValueTypein classAbstractValue
-
isNChannel
public boolean isNChannel()
Indicates whether this color uses an N-Channel color space.- Returns:
- true if N-Channel is used
-
getNumberOfColors
public int getNumberOfColors() throws org.w3c.dom.DOMExceptionReturns the number of colors.- Throws:
org.w3c.dom.DOMException
-
getColor
public float getColor(int i) throws org.w3c.dom.DOMExceptionReturns the color at the given index.- Throws:
org.w3c.dom.DOMException
-
getCssText
public java.lang.String getCssText()
A string representation of the current value.
-
append
public void append(float c)
Appends a color to the list.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-