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 interated through to paint a page's content.

This class is genearlly 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  java.util.Vector<java.lang.Object> shapes
           
 
Constructor Summary
Shapes()
           
 
Method Summary
 void add(java.lang.Object o)
          Add a new object to the Shapes stack.
 void addClipCommand()
          Adds a new clip command to the graphics stack.
 void addDrawCommand()
          Adds a new draw command to the graphics stack.
 void addFillCommand()
          Adds a new fill command to the graphics stack.
 void addNoClipCommand()
          Adds a new no clip command to the graphics stack.
 void contract()
           
 void dispose()
          Clean up.
 java.util.Vector getImages()
          Gets all the images that where found when parsing the pages' content.
 PageText getPageText()
           
 int getShapesCount()
          Gets the number of shapes on the shapes stack.
 void paint(java.awt.Graphics2D g)
          Paint the graphics stack to the graphics context
 void paint(java.awt.Graphics2D g, PageViewComponentImpl.PagePainter pagePainter)
          Paint the graphics stack to the graphics context
 void setPageParent(Page parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shapes

protected java.util.Vector<java.lang.Object> shapes
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

setPageParent

public void setPageParent(Page parent)

dispose

public void dispose()
Clean up.


add

public void add(java.lang.Object o)
Add a new object to the Shapes stack.

Parameters:
o - object to add to the graphics stack.

addDrawCommand

public void addDrawCommand()
Adds a new draw command to the graphics stack. When the paint method encounters this object the current geometric shape is drawn.


addFillCommand

public void addFillCommand()
Adds a new fill command to the graphics stack. When the paint method encouters this object the current geometric shape is filled with the current fill colour.


addClipCommand

public void addClipCommand()
Adds a new clip command to the graphics stack. When the paint method encounters this object the current geometic shape is used as the new clip shape.


addNoClipCommand

public void addNoClipCommand()
Adds a new no clip command to the graphics stack.


paint

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

Parameters:
g - graphics context to paint to.

paint

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

Parameters:
g - graphics context to paint to.
pagePainter - parent page painter

getImages

public java.util.Vector getImages()
Gets all the images that where found when parsing the pages' content. Each element in the Vector represents a separate image.

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

contract

public void contract()