org.icepdf.core.pobjects.graphics
Class Shapes

java.lang.Object
  extended by org.icepdf.core.pobjects.graphics.Shapes

public class Shapes
extends java.lang.Object

The Shapes class hold all object that are parsed from a Page's content streams. These contained object make up a pages graphics stack which can be iterated through to paint a page's content.

This class is generally only used by the Content parser during content parsing. The class also stores points to the images found in the content as well as the text that is encoded on a page.

Since:
1.0

Field Summary
protected  OptionalContentState optionalContentState
           
protected  boolean paintAlpha
           
protected  java.util.ArrayList<DrawCmd> shapes
           
 
Constructor Summary
Shapes()
           
 
Method Summary
 void add(java.util.ArrayList<DrawCmd> shapes)
           
 void add(DrawCmd drawCmd)
           
 void contract()
          Contracts the shapes ArrayList to the actual size of the elements it contains.
 java.util.ArrayList<java.awt.Image> getImages()
          Iterates over the Shapes objects extracting all Image objects.
 PageText getPageText()
           
 java.util.ArrayList<DrawCmd> getShapes()
           
 int getShapesCount()
          Gets the number of shapes on the shapes stack.
 void interruptPaint()
           
 boolean isPaintAlpha()
           
 void paint(java.awt.Graphics2D g)
          Paint the graphics stack to the graphics context
 void setPageParent(Page parent)
           
 void setPaintAlpha(boolean paintAlpha)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

paintAlpha

protected boolean paintAlpha

shapes

protected java.util.ArrayList<DrawCmd> shapes

optionalContentState

protected OptionalContentState optionalContentState
Constructor Detail

Shapes

public Shapes()
Method Detail

getPageText

public PageText getPageText()

getShapesCount

public int getShapesCount()
Gets the number of shapes on the shapes stack.

Returns:
number of shapes on the stack

getShapes

public java.util.ArrayList<DrawCmd> getShapes()

add

public void add(java.util.ArrayList<DrawCmd> shapes)

setPageParent

public void setPageParent(Page parent)

add

public void add(DrawCmd drawCmd)

isPaintAlpha

public boolean isPaintAlpha()

setPaintAlpha

public void setPaintAlpha(boolean paintAlpha)

paint

public void paint(java.awt.Graphics2D g)
Paint the graphics stack to the graphics context

Parameters:
g - graphics context to paint to.

interruptPaint

public void interruptPaint()

getImages

public java.util.ArrayList<java.awt.Image> getImages()
Iterates over the Shapes objects extracting all Image objects.

Returns:
all images in a page's content, if any.

contract

public void contract()
Contracts the shapes ArrayList to the actual size of the elements it contains.