public class VerticalLayout extends Object implements Layout
divided. Any given VerticalLayoutHint will be taken
into account to calculate the position, width, alignment etc.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
removeLeadingEmptyVerticalSpace |
| Constructor and Description |
|---|
VerticalLayout() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
drawReletivePartAndMovePosition(RenderContext renderContext,
Drawable drawable,
LayoutHint layoutHint,
boolean movePosition)
Actually draws the (drawble) part at the
RenderContext.getCurrentPosition() and - depending on flag
movePosition - moves to the new Y position. |
protected float |
getTargetWidth(RenderContext renderContext) |
protected boolean |
isPositionTopOfPage(RenderContext renderContext)
Indicates if the current position is the top of page.
|
boolean |
isRemoveLeadingEmptyVerticalSpace()
|
protected void |
layoutAndDrawReleative(RenderContext renderContext,
Drawable drawable,
LayoutHint layoutHint)
Adjusts the width of the drawable (if it is
WidthRespecting), and
divides it onto multiple pages if necessary. |
protected Drawable |
removeLeadingEmptyVerticalSpace(Drawable drawable,
RenderContext renderContext)
Removes empty space (e.g.
|
void |
render(RenderContext renderContext,
Drawable drawable,
LayoutHint layoutHint) |
boolean |
render(RenderContext renderContext,
Element element,
LayoutHint layoutHint)
Renders an element.
|
protected void |
renderAbsolute(RenderContext renderContext,
Drawable drawable,
LayoutHint layoutHint,
Position position)
Draws at the given position, ignoring all layouting rules.
|
protected void |
renderReleative(RenderContext renderContext,
Drawable drawable,
LayoutHint layoutHint)
Renders the drawable at the
current position. |
void |
setRemoveLeadingEmptyVerticalSpace(boolean removeLeadingEmptyLines)
Indicates if empty space (e.g.
|
protected void |
turnPage(RenderContext renderContext)
Turns to the next area, usually a page.
|
public boolean isRemoveLeadingEmptyVerticalSpace()
true if empty space (e.g. empty lines) should be
removed at the begin of a page.public void setRemoveLeadingEmptyVerticalSpace(boolean removeLeadingEmptyLines)
Drawable.removeLeadingEmptyVerticalSpace()removeLeadingEmptyLines - true if space should be removed.protected void turnPage(RenderContext renderContext) throws IOException
renderContext - the render context.IOException - by pdfbox.protected float getTargetWidth(RenderContext renderContext)
renderContext - the render context.public boolean render(RenderContext renderContext, Element element, LayoutHint layoutHint) throws IOException
Rendererrender in interface RendererrenderContext - the render context.element - the element to draw.layoutHint - the associated layout hinttrue if the layout is able to render the element.IOException - by pdfboxpublic void render(RenderContext renderContext, Drawable drawable, LayoutHint layoutHint) throws IOException
IOExceptionprotected void renderAbsolute(RenderContext renderContext, Drawable drawable, LayoutHint layoutHint, Position position) throws IOException
renderContext - the context providing all rendering state.drawable - the drawable to draw.layoutHint - the layout hint used to layout.position - the left upper position to start drawing at.IOException - by pdfboxprotected void renderReleative(RenderContext renderContext, Drawable drawable, LayoutHint layoutHint) throws IOException
current position. This method is responsible taking any top or bottom
margin described by the (Vertical-)LayoutHint into account. The actual
rendering of the drawable is performed by
layoutAndDrawReleative(RenderContext, Drawable, LayoutHint).renderContext - the context providing all rendering state.drawable - the drawable to draw.layoutHint - the layout hint used to layout.IOException - by pdfboxprotected void layoutAndDrawReleative(RenderContext renderContext, Drawable drawable, LayoutHint layoutHint) throws IOException
WidthRespecting), and
divides it onto multiple pages if necessary. Actual drawing is delegated
to
drawReletivePartAndMovePosition(RenderContext, Drawable, LayoutHint, boolean)
.renderContext - the context providing all rendering state.drawable - the drawable to draw.layoutHint - the layout hint used to layout.IOException - by pdfboxprotected void drawReletivePartAndMovePosition(RenderContext renderContext, Drawable drawable, LayoutHint layoutHint, boolean movePosition) throws IOException
RenderContext.getCurrentPosition() and - depending on flag
movePosition - moves to the new Y position. Any left or
right margin is taken into account to calculate the position and
alignment.renderContext - the context providing all rendering state.drawable - the drawable to draw.layoutHint - the layout hint used to layout.movePosition - indicates if the position should be moved (vertically) after
drawing.IOException - by pdfboxprotected boolean isPositionTopOfPage(RenderContext renderContext)
renderContext - the render context.true if the current position is top of page.protected Drawable removeLeadingEmptyVerticalSpace(Drawable drawable, RenderContext renderContext) throws IOException
Drawable.removeLeadingEmptyVerticalSpace()drawable - the drawable to process.renderContext - the render context.IOException - by pdfboxCopyright © 2021. All rights reserved.