org.icepdf.core.pobjects.graphics
Class PatternColor

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.graphics.PColorSpace
          extended by org.icepdf.core.pobjects.graphics.PatternColor

public class PatternColor
extends PColorSpace

Pattern colour implements PColorSpace but is more of a parser placeholder for dealing with 'cs' token which sets a pattern Colour space. The pattern color space can either define a Pattern dictionary which contains valid pattern object which are then specified by the 'scn' or 'SCN' tokens. The pattern can also define straight up color space rgb, gray, N etc.

If the PatternColor contains dictionary of Pattern Object from the pages resources then this object is created with the corrisponding dictionary reference.

Since:
1.0

Field Summary
static Name PATTERN_KEY
           
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, FORM_TYPE_KEY, inited, isDeleted, isNew, LENGTH_KEY, library, SUBTYPE_KEY, TYPE_KEY
 
Constructor Summary
PatternColor(Library library, java.util.HashMap entries)
          Creates a new instance of PatternColor.
 
Method Summary
 java.awt.Color getColor(float[] f, boolean fillAndStroke)
          Not applicable to a Pattern Colour space.
 int getNumComponents()
          Not applicable to a Pattern Colour space.
 Pattern getPattern()
           
 Pattern getPattern(Reference reference)
           
 PColorSpace getPColorSpace()
           
 void setPattern(Pattern pattern)
           
 void setPColorSpace(PColorSpace PColorSpace)
           
 
Methods inherited from class org.icepdf.core.pobjects.graphics.PColorSpace
getColor, getColorSpace, getColorSpace, getDescription, normaliseComponentsToFloats, reverse, reverseInPlace, reverseInPlace
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getPObjectReference, init, isDeleted, isNew, setDeleted, setNew, setPObjectReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PATTERN_KEY

public static final Name PATTERN_KEY
Constructor Detail

PatternColor

public PatternColor(Library library,
                    java.util.HashMap entries)
Creates a new instance of PatternColor.

Parameters:
library - document library.
entries - dictionary entries.
Method Detail

getNumComponents

public int getNumComponents()
Not applicable to a Pattern Colour space.

Specified by:
getNumComponents in class PColorSpace
Returns:
value of zero

getColor

public java.awt.Color getColor(float[] f,
                               boolean fillAndStroke)
Not applicable to a Pattern Colour space.

Specified by:
getColor in class PColorSpace
Parameters:
f - any value.
Returns:
always returns null.

getPattern

public Pattern getPattern(Reference reference)

getPColorSpace

public PColorSpace getPColorSpace()

setPColorSpace

public void setPColorSpace(PColorSpace PColorSpace)

getPattern

public Pattern getPattern()

setPattern

public void setPattern(Pattern pattern)