public class IlvFlow extends Object
IlvFlow
object allows to add styled text and inline
graphics in a document. The IlvFlow
positions the text and
graphics on pages, according to the specified line breaks and page breaks.
A document can be associated with only one flow object.
To create a flow of text for a document use the method
IlvPrintableDocument.getFlow()
then use the methods of
the IlvFlow
class to populate the document.
If the content of the document is defined by a flow of text, the
IlvFlow
object is responsible for creating the pages
of the document. You can not add IlvPrintableObject
s to
the document on your own in this case.
IlvPrintableDocument.getFlow()
Modifier and Type | Class and Description |
---|---|
static class |
IlvFlow.TextStyle
Defines the style of text that is added to an
IlvFlow . |
Modifier and Type | Field and Description |
---|---|
static int |
BOTTOM_ALIGNMENT
Aligns bottom of graphic to bottom of line.
|
static int |
CENTER_BASELINE
Aligns origin of graphic to center baseline of line.
|
static int |
HANGING_BASELINE
Aligns origin of graphic to hanging baseline of line.
|
static int |
ROMAN_BASELINE
Aligns origin of graphic to roman baseline of line.
|
static int |
TOP_ALIGNMENT
Aligns top of graphic to top of line.
|
Modifier and Type | Method and Description |
---|---|
void |
add(IlvFlowObject object,
int alignment)
Adds the object in the current line of text using the specified
alignment on the line.
|
void |
add(Image image,
int alignment)
Add the image in the current line of text using the specified
alignment on the line.
|
void |
add(String text)
Adds the specified text to the current paragraph.
|
IlvPrintableDocument |
getDocument()
Returns the document associated with this flow.
|
void |
invalidate()
Invalidates the flow.
|
boolean |
isValid()
Indicates if the flow is valid.
|
void |
layout()
Layouts the flow of text.
|
void |
newLine()
Starts a new paragraph in the flow of text.
|
void |
newPage()
Starts a new page in the flow of text.
|
void |
setTextStyle(IlvFlow.TextStyle style)
Changes the current text style.
|
public static final int BOTTOM_ALIGNMENT
public static final int CENTER_BASELINE
public static final int HANGING_BASELINE
public static final int ROMAN_BASELINE
public static final int TOP_ALIGNMENT
public IlvPrintableDocument getDocument()
public void invalidate()
public boolean isValid()
public void layout()
public void setTextStyle(IlvFlow.TextStyle style)
style
- The new style to apply, note that this object is
cloned and thus you can continue to use this instance for
further modifications of the style.public void add(String text)
public void add(Image image, int alignment)
public void add(IlvFlowObject object, int alignment)
public void newLine()
public void newPage()
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.