org.apache.batik.css.engine.value.svg12
Class DeviceColor

java.lang.Object
  extended by org.apache.batik.css.engine.value.AbstractValue
      extended by 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.


Field Summary
protected  float[] colors
          The colors.
protected  int count
          The color count.
static String DEVICE_CMYK_COLOR_FUNCTION
           
static String DEVICE_GRAY_COLOR_FUNCTION
           
static String DEVICE_NCHANNEL_COLOR_FUNCTION
           
static String DEVICE_RGB_COLOR_FUNCTION
           
protected  boolean nChannel
           
 
Constructor Summary
DeviceColor(boolean nChannel)
          Creates a new DeviceColor.
 
Method Summary
 void append(float c)
          Appends a color to the list.
 float getColor(int i)
          Returns the color at the given index.
 String getCssText()
          A string representation of the current value.
 short getCssValueType()
          Implements Value.getCssValueType().
 int getNumberOfColors()
          Returns the number of colors.
 boolean isNChannel()
          Indicates whether this color uses an N-Channel color space.
 String toString()
          
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEVICE_GRAY_COLOR_FUNCTION

public static final String DEVICE_GRAY_COLOR_FUNCTION
See Also:
Constant Field Values

DEVICE_RGB_COLOR_FUNCTION

public static final String DEVICE_RGB_COLOR_FUNCTION
See Also:
Constant Field Values

DEVICE_CMYK_COLOR_FUNCTION

public static final String DEVICE_CMYK_COLOR_FUNCTION
See Also:
Constant Field Values

DEVICE_NCHANNEL_COLOR_FUNCTION

public static final 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.

Constructor Detail

DeviceColor

public DeviceColor(boolean nChannel)
Creates a new DeviceColor.

Parameters:
nChannel - true for a device-nchannel() color, false for Gray, RGB and CMYK
Method Detail

getCssValueType

public short getCssValueType()
Implements Value.getCssValueType().

Specified by:
getCssValueType in interface Value
Overrides:
getCssValueType in class AbstractValue

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 DOMException
Returns the number of colors.

Throws:
DOMException

getColor

public float getColor(int i)
               throws DOMException
Returns the color at the given index.

Throws:
DOMException

getCssText

public String getCssText()
A string representation of the current value.


append

public void append(float c)
Appends a color to the list.


toString

public String toString()

Overrides:
toString in class Object


Copyright © 2017 Apache Software Foundation. All Rights Reserved.