|
PDF Clown 0.1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pdfclown.documents.contents.ContentScanner
public final class ContentScanner
Content objects scanner.
It wraps a content objects collection
to scan its graphics state
through an oriented cursor.
Scanning is performed at an arbitrary depth, according to the content objects nesting:
each depth level corresponds to a scan level so that at any time it's possible
to seamlessly navigate across the levels (see getParentLevel()
,
getChildLevel()
).
Scanning can be either "dry" (simulation of graphics state stacking without actual rendering)
or "wet" (rendering over a given device context
).
Nested Class Summary | |
---|---|
static class |
ContentScanner.GraphicsObjectWrapper<TDataObject extends ContentObject>
Object information. |
static class |
ContentScanner.GraphicsState
Graphics state [PDF:1.6:4.3]. |
static interface |
ContentScanner.IListener
Content scanner listener. |
static class |
ContentScanner.InlineImageWrapper
Inline image information. |
static class |
ContentScanner.TextStringWrapper
Text string information. |
static class |
ContentScanner.TextWrapper
Text information. |
static class |
ContentScanner.XObjectWrapper
External object information. |
Constructor Summary | |
---|---|
ContentScanner(Contents contents)
Instantiates a top-level content scanner. |
|
ContentScanner(FormXObject formXObject,
ContentScanner parentLevel)
Instantiates a child-level content scanner for external form . |
|
ContentScanner(IContentContext contentContext)
Instantiates a top-level content scanner. |
Method Summary | |
---|---|
void |
addListener(ContentScanner.IListener listener)
Adds the specified listener. |
Dimension2D |
getCanvasSize()
Gets the size of the current imageable area. |
ContentScanner |
getChildLevel()
Gets the current child scan level. |
IContentContext |
getContentContext()
Gets the content context associated to the content objects collection. |
Contents |
getContents()
Gets the content objects collection this scanner is inspecting. |
ContentObject |
getCurrent()
Gets the current content object. |
ContentScanner.GraphicsObjectWrapper<?> |
getCurrentWrapper()
Gets the current content object's information. |
int |
getIndex()
Gets the current position. |
CompositeObject |
getParent()
Gets the current parent object. |
ContentScanner |
getParentLevel()
Gets the parent scan level. |
Graphics2D |
getRenderContext()
Gets the rendering context. |
Shape |
getRenderObject()
Gets the rendering object. |
ContentScanner |
getRootLevel()
Gets the root scan level. |
ContentScanner.GraphicsState |
getState()
Gets the graphics state applied to the current content object. |
void |
insert(Collection<? extends ContentObject> objects)
Inserts content objects at the current position. |
void |
insert(ContentObject object)
Inserts a content object at the current position. |
boolean |
isRootLevel()
Gets whether this level is the root of the hierarchy. |
boolean |
move(int index)
Moves to the object at the given position. |
void |
moveEnd()
Moves after the last object. |
boolean |
moveFirst()
Moves to the first object. |
boolean |
moveLast()
Moves to the last object. |
boolean |
moveNext()
Moves to the next object. |
void |
moveStart()
Moves before the first object. |
protected void |
notifyStart()
Notifies the scan start to listeners. |
ContentObject |
remove()
Removes the content object at the current position. |
boolean |
removeListener(ContentScanner.IListener listener)
Removes the specified listener. |
void |
render(Graphics2D renderContext,
Dimension2D renderSize)
Renders the contents into the specified context. |
void |
render(Graphics2D renderContext,
Dimension2D renderSize,
Shape renderObject)
Renders the contents into the specified object. |
ContentObject |
setCurrent(ContentObject value)
Replaces the content object at the current position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentScanner(Contents contents)
contents
- Content objects collection to scan.public ContentScanner(IContentContext contentContext)
contentContext
- Content context containing the content objects collection to scan.public ContentScanner(FormXObject formXObject, ContentScanner parentLevel)
external form
.
formXObject
- External form.parentLevel
- Parent scan level.Method Detail |
---|
public void addListener(ContentScanner.IListener listener)
listener
- Listener to add.public Dimension2D getCanvasSize()
It can be either the user-space area (dry scanning) or the device-space area (wet scanning).
public ContentScanner getChildLevel()
getParentLevel()
,
getRootLevel()
public IContentContext getContentContext()
public Contents getContents()
public ContentObject getCurrent()
getIndex()
,
getParent()
public ContentScanner.GraphicsObjectWrapper<?> getCurrentWrapper()
getCurrent()
public int getIndex()
getCurrent()
public CompositeObject getParent()
getCurrent()
public ContentScanner getParentLevel()
getChildLevel()
,
getRootLevel()
public Graphics2D getRenderContext()
null
in case of dry scanning.public Shape getRenderObject()
null
in case of scanning outside a shape.public ContentScanner getRootLevel()
getChildLevel()
,
getParentLevel()
public ContentScanner.GraphicsState getState()
public void insert(ContentObject object)
public void insert(Collection<? extends ContentObject> objects)
After the insertion is complete, the lastly-inserted content object is at the current position.
public boolean isRootLevel()
public boolean move(int index)
index
- New position.
public void moveEnd()
public boolean moveFirst()
public boolean moveLast()
public boolean moveNext()
public void moveStart()
public ContentObject remove()
public boolean removeListener(ContentScanner.IListener listener)
listener
- Listener to remove.
public void render(Graphics2D renderContext, Dimension2D renderSize)
renderContext
- Rendering context.renderSize
- Rendering canvas size.public void render(Graphics2D renderContext, Dimension2D renderSize, Shape renderObject)
renderContext
- Rendering context.renderSize
- Rendering canvas size.renderObject
- Rendering object.public ContentObject setCurrent(ContentObject value)
protected void notifyStart()
|
PDF Clown 0.1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |