JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class JCFlow

java.lang.Object
  |
  +--com.klg.jclass.page.JCFlow

public class JCFlow
extends Object

JCFlow controls the flow of rendered content from frame to frame, page to page, and section to section.


Field Summary
protected  com.klg.jclass.page.JCDrawStyle currentDrawStyle
          The style applied to graphics being rendered.
protected  com.klg.jclass.page.JCFrame currentFrame
          The active frame on the page currently receiving the contents of the flow.
protected  com.klg.jclass.page.JCPage currentPage
          The page currently receiving the contents of the flow.
protected  int currentPageNumber
          User-controllable page numbering (not absolute number).
protected  int currentSectionNumber
          The number of the current section in the document.
protected  com.klg.jclass.page.JCTextStyle currentTextStyle
          The style applied to text being rendered.
protected  int deferredPageCount
          Count of user-added, non-flow pages that are waiting to be added into the full page count.
protected  com.klg.jclass.page.JCDocument document
          The document to which this flow belongs.
protected  int documentPageCount
          The number of pages in the document (running count).
protected  int documentTotalPages
          The total number of pages in the document (final count).
protected  Vector floatList
          The list of large objects which are to be floated into the flow.
static int FLOW_ACTIVE
           
static int FLOW_COMPLETE
           
static int FLOW_INIT
           
protected  List flowFrameList
          An iterator over the list of flow frames on the current page.
protected  com.klg.jclass.util.JCListenerList flowListeners
          The listeners for flow events.
protected  int flowStatus
          Indicates if flow has ended.
protected  int nextFrameIndex
          The index in the flow frame list of the next frame.
protected  boolean sectionComplete
          Indicates if current section has ended.
protected  int sectionPageCount
          The number of pages in the current section (running count).
protected  int sectionTotalPages
          The total number of pages in the current section (final count).
protected  int startingPageNumber
          The number of the first page in the document -- used to start counting at numbers other than one.
 
Constructor Summary
JCFlow(com.klg.jclass.page.JCDocument doc)
          Creates a flow for the given document.
JCFlow(com.klg.jclass.page.JCDocument doc, com.klg.jclass.page.JCFlowListener fl)
          Creates a flow for the given document.
JCFlow(com.klg.jclass.page.JCDocument doc, com.klg.jclass.page.JCFlowListener fl, List templates)
          Creates a flow for the document using the given page templates and registers the given FlowListener for JCFlow events.
JCFlow(com.klg.jclass.page.JCDocument doc, List templates)
          Creates a flow for the document using the given page templates.
 
Method Summary
 void addFlowListener(com.klg.jclass.page.JCFlowListener listener)
          Adds a listener for flow events.
protected  void deferCountingNewPage(com.klg.jclass.page.JCPage newPage)
          Tracks the number of pages added but not yet part of the page count.
 void embedComponent(Component c)
          Adds a component's drawn image to the document as part of the current line.
 void embedComponent(Component c, int alignment)
          Adds a component's drawn image to the document as part of the current line.
 void embedComponent(Component c, int alignment, JCUnit.Dimension size)
          Adds a component's drawn image to the document as part of the current line.
 void embedComponent(Component c, JCUnit.Dimension size)
          Adds a component's drawn image to the document as part of the current line.
 void embedEPS(com.klg.jclass.page.EPSImage eps)
          Adds an Encapsulated PostScript image to the document as part of the current line.
 void embedEPS(com.klg.jclass.page.EPSImage eps, int alignment)
          Adds an Encapsulated PostScript image to the document as part of the current line.
 void embedEPS(com.klg.jclass.page.EPSImage eps, int alignment, JCUnit.Dimension size)
          Adds an Encapsulated PostScript image to the document as part of the current line.
 void embedEPS(com.klg.jclass.page.EPSImage eps, JCUnit.Dimension size)
          Adds an Encapsulated PostScript image to the document as part of the current line.
 void embedIcon(Icon icon)
          Adds an icon to the document as part of the current line.
 void embedIcon(Icon icon, int alignment)
          Adds an icon to the document as part of the current line.
 void embedIcon(Icon icon, int alignment, JCUnit.Dimension size)
          Adds an icon to the document as part of the current line.
 void embedIcon(Icon icon, JCUnit.Dimension size)
          Adds an icon to the document as part of the current line.
 void embedImage(Image image)
          Adds an image to the document as part of the current line.
 void embedImage(Image image, int alignment)
          Adds an image to the document as part of the current line.
 void embedImage(Image image, int alignment, JCUnit.Dimension size)
          Adds an image to the document as part of the current line.
 void embedImage(Image image, JCUnit.Dimension size)
          Adds an image to the document as part of the current line.
 void endFlow()
          Completes the document so it can be printed.
protected  void fireFrameCompleted(com.klg.jclass.page.JCFrame frame)
          Convenience method to fire the FRAME_COMPLETE event.
 void floatComponent(Component c)
          Adds a component's drawn image to the document so it is added in the next space it fits (subject to the existence of other floating objects that may precede this).
 void floatComponent(Component c, int alignment)
          Adds a component's drawn image to the document so it is added in the next space it fits (subject to the existence of other floating objects that may precede this).
 void floatComponent(Component c, int alignment, JCUnit.Dimension size)
          Adds a component's drawn image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatComponent(Component c, JCUnit.Dimension size)
          Adds a component's drawn image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatEPS(com.klg.jclass.page.EPSImage eps)
          Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatEPS(com.klg.jclass.page.EPSImage eps, int alignment)
          Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatEPS(com.klg.jclass.page.EPSImage eps, int alignment, JCUnit.Dimension size)
          Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatEPS(com.klg.jclass.page.EPSImage eps, JCUnit.Dimension size)
          Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatIcon(Icon icon)
          Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatIcon(Icon icon, int alignment)
          Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatIcon(Icon icon, int alignment, JCUnit.Dimension size)
          Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatIcon(Icon icon, JCUnit.Dimension size)
          Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatImage(Image image)
          Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatImage(Image image, int alignment)
          Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatImage(Image image, int alignment, JCUnit.Dimension size)
          Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 void floatImage(Image image, JCUnit.Dimension size)
          Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
 com.klg.jclass.page.JCDrawStyle getCurrentDrawStyle()
          Gets the draw style being applied to rendered graphics.
 com.klg.jclass.page.JCFrame getCurrentFrame()
          Gets the frame of the current page receiving data.
 com.klg.jclass.page.JCPage getCurrentPage()
          Gets the current page receiving printed data.
 int getCurrentPageNumber()
          Gets the current page number.
 int getCurrentSectionNumber()
          Gets the current section number.
 com.klg.jclass.page.JCTextStyle getCurrentTextStyle()
          Gets the text style being applied to rendered text.
 int getDocumentTotalPages()
          Gets the total number of pages in the document.
 int getSectionPageNumber()
          Gets the page number of current section.
 int getSectionTotalPages()
          Gets the total number of pages in the current section.
 List getTemplates()
          Gets a list of the template pages in the flow.
 void hRule(double percent_width)
          Draws a horizontal line across the column/frame below the current line.
 void hRule(JCUnit.Measure rule_length)
          Draws a horizontal line across the column/frame below the current line.
 boolean isFlowActive()
          Indicates if document flow is active.
 boolean isFlowComplete()
          Indicates if document flow has ended.
 boolean isSectionComplete()
          Indicates if current section has ended.
 void newColumn()
          Advances the text flow to a new column.
 void newFrame()
          Advances the text flow to a new frame.
 void newLine()
          Advances the text flow to a new line.
 void newPage()
          Advances the text flow to a new page.
 void newParagraph()
          Advances the text flow to a new line, starting a new paragraph.
 void newSection()
          Advances the text flow to a new Section.
 void print(com.klg.jclass.page.JCPageTable table)
          Prints a table to the flow (beginning at the insertion point).
protected  void print(com.klg.jclass.page.JCPageTable table, int current_row, int current_column, int last_row, int last_column)
          Begins the process of printing the specified sub-table to the flow (beginning at the insertion point).
protected  void print(com.klg.jclass.page.JCPageTable table, int current_row, int current_column, int last_row, int last_column, boolean newFlow)
          Prints the specified sub-table to the flow (beginning at the insertion point).
 void print(String text)
          Prints a line of text to the flow at the current insertion point.
 void print(com.klg.jclass.page.TextMacro macro)
          Prints a text macro.
 void removeFlowListener(com.klg.jclass.page.JCFlowListener listener)
          Removes a listener for flow events.
 void setCurrentDrawStyle(com.klg.jclass.page.JCDrawStyle style)
          Sets the draw style in which graphical objects are to be rendered.
 void setCurrentPageNumber(int number)
          Assigns the current, user-defined page number (not the absolute page number).
 void setCurrentSectionNumber(int number)
          Assigns a number to the current section.
 void setCurrentTextStyle(com.klg.jclass.page.JCTextStyle style)
          Sets the text style in which text is to be rendered.
 void tab()
          Moves to the next tab position on the current line.
protected  void updatePageNumbers(com.klg.jclass.page.JCPage newPage)
          Updates the page numbers being tracked by the flow, including the current page number and the page counts for the section and the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

protected com.klg.jclass.page.JCDocument document
The document to which this flow belongs.


currentPage

protected com.klg.jclass.page.JCPage currentPage
The page currently receiving the contents of the flow.


currentFrame

protected com.klg.jclass.page.JCFrame currentFrame
The active frame on the page currently receiving the contents of the flow.


currentPageNumber

protected int currentPageNumber
User-controllable page numbering (not absolute number).


currentSectionNumber

protected int currentSectionNumber
The number of the current section in the document.


startingPageNumber

protected int startingPageNumber
The number of the first page in the document -- used to start counting at numbers other than one.


currentTextStyle

protected com.klg.jclass.page.JCTextStyle currentTextStyle
The style applied to text being rendered.


currentDrawStyle

protected com.klg.jclass.page.JCDrawStyle currentDrawStyle
The style applied to graphics being rendered.


flowFrameList

protected List flowFrameList
An iterator over the list of flow frames on the current page.


nextFrameIndex

protected int nextFrameIndex
The index in the flow frame list of the next frame.


floatList

protected Vector floatList
The list of large objects which are to be floated into the flow.


documentPageCount

protected int documentPageCount
The number of pages in the document (running count).


sectionPageCount

protected int sectionPageCount
The number of pages in the current section (running count).


documentTotalPages

protected int documentTotalPages
The total number of pages in the document (final count).


sectionTotalPages

protected int sectionTotalPages
The total number of pages in the current section (final count).


flowListeners

protected com.klg.jclass.util.JCListenerList flowListeners
The listeners for flow events.


flowStatus

protected int flowStatus
Indicates if flow has ended.


sectionComplete

protected boolean sectionComplete
Indicates if current section has ended.


deferredPageCount

protected int deferredPageCount
Count of user-added, non-flow pages that are waiting to be added into the full page count.


FLOW_INIT

public static final int FLOW_INIT
See Also:
Constant Field Values

FLOW_ACTIVE

public static final int FLOW_ACTIVE
See Also:
Constant Field Values

FLOW_COMPLETE

public static final int FLOW_COMPLETE
See Also:
Constant Field Values
Constructor Detail

JCFlow

public JCFlow(com.klg.jclass.page.JCDocument doc)
Creates a flow for the given document.

Parameters:
doc - a document for which to initialize the flow

JCFlow

public JCFlow(com.klg.jclass.page.JCDocument doc,
              com.klg.jclass.page.JCFlowListener fl)
Creates a flow for the given document.

Parameters:
doc - a document for which to initialize the flow
fl - a FlowListener to notify of flow events

JCFlow

public JCFlow(com.klg.jclass.page.JCDocument doc,
              List templates)
Creates a flow for the document using the given page templates.

Parameters:
doc - a document for which to initialize the flow
templates - a list of page templates to use in the document

JCFlow

public JCFlow(com.klg.jclass.page.JCDocument doc,
              com.klg.jclass.page.JCFlowListener fl,
              List templates)
Creates a flow for the document using the given page templates and registers the given FlowListener for JCFlow events.

Parameters:
doc - a document for which to initialize the flow
fl - a FlowListener to notify of flow events
templates - a list of page templates to use in the document
See Also:
JCFlowEvent, JCFlowListener
Method Detail

isFlowComplete

public boolean isFlowComplete()
Indicates if document flow has ended.

Returns:
true if flow has ended

isFlowActive

public boolean isFlowActive()
Indicates if document flow is active.

Returns:
true if flow has ended

isSectionComplete

public boolean isSectionComplete()
Indicates if current section has ended.

Returns:
true if flow has ended

getSectionTotalPages

public int getSectionTotalPages()
Gets the total number of pages in the current section.

Returns:
the total page numbers of the current section

getSectionPageNumber

public int getSectionPageNumber()
Gets the page number of current section.

Returns:
the current page number of the current section

getDocumentTotalPages

public int getDocumentTotalPages()
Gets the total number of pages in the document.

Returns:
the total number to pages in the document

getCurrentPageNumber

public int getCurrentPageNumber()
Gets the current page number.

Returns:
the value to be used to number the current page

setCurrentPageNumber

public void setCurrentPageNumber(int number)
Assigns the current, user-defined page number (not the absolute page number).

Parameters:
number - the number of the current page

getCurrentSectionNumber

public int getCurrentSectionNumber()
Gets the current section number.

Returns:
the number assigned to the current section

setCurrentSectionNumber

public void setCurrentSectionNumber(int number)
Assigns a number to the current section.

Parameters:
number - the number of the current section

getCurrentPage

public com.klg.jclass.page.JCPage getCurrentPage()
Gets the current page receiving printed data.

Returns:
the page of the document currently being flowed to

getCurrentFrame

public com.klg.jclass.page.JCFrame getCurrentFrame()
Gets the frame of the current page receiving data.

Returns:
the frame to which the document is currently flowing

getCurrentTextStyle

public com.klg.jclass.page.JCTextStyle getCurrentTextStyle()
Gets the text style being applied to rendered text.

Returns:
the current text style

setCurrentTextStyle

public void setCurrentTextStyle(com.klg.jclass.page.JCTextStyle style)
Sets the text style in which text is to be rendered.

Parameters:
style - a text style for formatting printed text

getCurrentDrawStyle

public com.klg.jclass.page.JCDrawStyle getCurrentDrawStyle()
Gets the draw style being applied to rendered graphics.

Returns:
the current draw style

setCurrentDrawStyle

public void setCurrentDrawStyle(com.klg.jclass.page.JCDrawStyle style)
Sets the draw style in which graphical objects are to be rendered.

Parameters:
style - a draw style for formatting printed graphics

getTemplates

public List getTemplates()
Gets a list of the template pages in the flow.

Returns:
a name-keyed map of the page templates

print

public void print(String text)
Prints a line of text to the flow at the current insertion point.

Parameters:
text - String to flow to the document

print

public void print(com.klg.jclass.page.TextMacro macro)
Prints a text macro.

Parameters:
macro - the macro to add to the flow

print

public void print(com.klg.jclass.page.JCPageTable table)
Prints a table to the flow (beginning at the insertion point).

Parameters:
table - the table to paste into the flow

print

protected void print(com.klg.jclass.page.JCPageTable table,
                     int current_row,
                     int current_column,
                     int last_row,
                     int last_column)
Begins the process of printing the specified sub-table to the flow (beginning at the insertion point).

Parameters:
table - the table to paste into the flow
last_row -
last_column -
current_row -
current_column -

print

protected void print(com.klg.jclass.page.JCPageTable table,
                     int current_row,
                     int current_column,
                     int last_row,
                     int last_column,
                     boolean newFlow)
Prints the specified sub-table to the flow (beginning at the insertion point).

Parameters:
table - the table to paste into the flow
newFlow - true if a new flow frame has just begun; false if in the current flow frame
last_row -
last_column -
current_row -
current_column -

tab

public void tab()
Moves to the next tab position on the current line.


floatImage

public void floatImage(Image image)
Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatImage() method assumes a default size based on the pixel size of the image, and takes the horizontal alignment from the current text style.

Parameters:
image - the Image to be floated in the document

floatImage

public void floatImage(Image image,
                       int alignment)
Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatImage() method assumes a default size based on the pixel size of the image.

Parameters:
image - the Image to be floated in the document
alignment - the horizontal alignment of the image in the frame

floatImage

public void floatImage(Image image,
                       JCUnit.Dimension size)
Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatImage() method uses the current text style to specify the horizontal aligment of the image in the frame

Parameters:
image - the Image to be floated in the document
size - the dimensions of the image as it is to appear on the page

floatImage

public void floatImage(Image image,
                       int alignment,
                       JCUnit.Dimension size)
Adds an image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.

Parameters:
image - the Image to be floated in the document
alignment - the horizontal alignment of the image in the frame
size - the dimensions of the image as it is to appear on the page

floatIcon

public void floatIcon(Icon icon)
Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatIcon() method assumes a default size based on the pixel size of the icon, and takes the horizontal alignment from the current text style.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be floated in the document

floatIcon

public void floatIcon(Icon icon,
                      int alignment)
Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatIcon() method assumes a default size based on the pixel size of the icon.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be floated in the document
alignment - the horizontal alignment of the icon in the frame

floatIcon

public void floatIcon(Icon icon,
                      JCUnit.Dimension size)
Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatIcon() method uses the current text style to specify the horizontal aligment of the icon in the frame.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be floated in the document
size - the dimensions of the icon as it is to appear on the page

floatIcon

public void floatIcon(Icon icon,
                      int alignment,
                      JCUnit.Dimension size)
Adds an icon to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be floated in the document
alignment - the horizontal alignment of the icon in the frame
size - the dimensions of the icon as it is to appear on the page

floatComponent

public void floatComponent(Component c)
Adds a component's drawn image to the document so it is added in the next space it fits (subject to the existence of other floating objects that may precede this). This form of the floatComponent() method assumes a default size based on the pixel size of the component from its current geometry, and takes the horizontal alignment from the current text style.

Parameters:
c - the Component to be floated in the document

floatComponent

public void floatComponent(Component c,
                           int alignment)
Adds a component's drawn image to the document so it is added in the next space it fits (subject to the existence of other floating objects that may precede this). This form of the floatComponent() method assumes a default size based on the pixel size of the component from its current geometry.

Parameters:
c - the Component to be floated in the document
alignment - the horizontal alignment of the component in the frame

floatComponent

public void floatComponent(Component c,
                           JCUnit.Dimension size)
Adds a component's drawn image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatComponent() method takes the horizontal alignment from the current text style.

Parameters:
c - the Component to be floated in the document
size - the dimensions of the component as it is to appear on the page

floatComponent

public void floatComponent(Component c,
                           int alignment,
                           JCUnit.Dimension size)
Adds a component's drawn image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.

Parameters:
c - the Component to be floated in the document
alignment - the horizontal alignment of the component in the frame
size - the dimensions of the component as it is to appear on the page

floatEPS

public void floatEPS(com.klg.jclass.page.EPSImage eps)
Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatEPS() method takes the horizontal alignment from the current text style and assumes the EPSImage object has a size set.

Parameters:
eps - the EPS image to be floated in the document

floatEPS

public void floatEPS(com.klg.jclass.page.EPSImage eps,
                     int alignment)
Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatEPS() method assumes the EPSImage object has a size set.

Parameters:
eps - the EPS image to be floated in the document
alignment - the horizontal alignment of the image in the frame

floatEPS

public void floatEPS(com.klg.jclass.page.EPSImage eps,
                     JCUnit.Dimension size)
Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it. This form of the floatEPS() method takes the horizontal alignment from the current text style.

Parameters:
eps - the Image to be floated in the document
size - the dimensions of the image as it is to appear on the page

floatEPS

public void floatEPS(com.klg.jclass.page.EPSImage eps,
                     int alignment,
                     JCUnit.Dimension size)
Adds an Encapsulated PostScript (EPS) image to the document so it is added in the next space it fits, subject to the existence of other floating objects that may precede it.

Parameters:
eps - the EPS image to be floated in the document
alignment - the horizontal alignment of the image in the frame
size - the dimensions of the image as it is to appear on the page

embedImage

public void embedImage(Image image)
Adds an image to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image. This form of the embedImage() method assumes a default size based on the pixel size of the image, and centers the image vertically on the current line.

Parameters:
image - the Image to be embedded in the current line

embedImage

public void embedImage(Image image,
                       int alignment)
Adds an image to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image. This form of the embedImage() method assumes a default size based on the pixel size of the image.

Parameters:
image - the Image to be embedded in the current line
alignment - the vertical alignment of the image on the current line

embedImage

public void embedImage(Image image,
                       JCUnit.Dimension size)
Adds an image to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image. This form of the embedImage() method centers the image vertically on the current line.

Parameters:
image - the Image to be embedded in the current line
size - the dimensions of the image as it is to appear on the page

embedImage

public void embedImage(Image image,
                       int alignment,
                       JCUnit.Dimension size)
Adds an image to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image.

Parameters:
image - the Image to be embedded in the current line
alignment - the vertical alignment of the image on the current line
size - the dimensions of the image as it is to appear on the page

embedIcon

public void embedIcon(Icon icon)
Adds an icon to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the icon. This form of the embedIcon() method assumes a default size based on the pixel size of the icon, and centers the icon vertically on the current line.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be embedded in the current line

embedIcon

public void embedIcon(Icon icon,
                      int alignment)
Adds an icon to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the icon. This form of the embedIcon() method assumes a default size based on the pixel size of the icon.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be embedded in the current line
alignment - the vertical alignment of the icon on the current line

embedIcon

public void embedIcon(Icon icon,
                      JCUnit.Dimension size)
Adds an icon to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the icon. This form of the embedIcon() method centers the icon vertically on the current line.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be embedded in the current line
size - the dimensions of the icon as it is to appear on the page

embedIcon

public void embedIcon(Icon icon,
                      int alignment,
                      JCUnit.Dimension size)
Adds an icon to the document as part of the current line. The image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the icon.
This method only accepts instances of the ImageIcon class.

Parameters:
icon - the Icon to be embedded in the current line
alignment - the vertical alignment of the icon on the current line
size - the dimensions of the icon as it is to appear on the page

embedComponent

public void embedComponent(Component c)
Adds a component's drawn image to the document as part of the current line. The component image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the component drawing. This form of the embedComponent() method assumes a default size based on the pixel size of the component from its current geometry, and centers the component vertically on the current line.

Parameters:
c - the Component to be embedded in the current line

embedComponent

public void embedComponent(Component c,
                           int alignment)
Adds a component's drawn image to the document as part of the current line. The component image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the component drawing. This form of the embedComponent() method assumes a default size based on the pixel size of the component from its current geometry.

Parameters:
c - the Component to be embedded in the current line
alignment - the vertical alignment of the component on the current line

embedComponent

public void embedComponent(Component c,
                           JCUnit.Dimension size)
Adds a component's drawn image to the document as part of the current line. The component image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the component drawing. This form of the embedComponent() method centers the component vertically on the current line.

Parameters:
c - the Component to be embedded in the current line
size - the dimensions of the component as it is to appear on the page

embedComponent

public void embedComponent(Component c,
                           int alignment,
                           JCUnit.Dimension size)
Adds a component's drawn image to the document as part of the current line. The component image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the component drawing.

Parameters:
c - the Component to be embedded in the current line
alignment - the vertical alignment of the component on the current line
size - the dimensions of the component as it is to appear on the page

embedEPS

public void embedEPS(com.klg.jclass.page.EPSImage eps)
Adds an Encapsulated PostScript image to the document as part of the current line. The EPS image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image. This form of the embedEPS() method centers the eps image vertically on the current line and assumes a size has been provided to the eps image object.

Parameters:
eps - the EPS image to be embedded in the current line

embedEPS

public void embedEPS(com.klg.jclass.page.EPSImage eps,
                     int alignment)
Adds an Encapsulated PostScript image to the document as part of the current line. The EPS image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image. This form of the embedEPS() method assumes a size has been provided to the eps image object.

Parameters:
eps - the EPS image to be embedded in the current line
alignment - the vertical alignment of the image on the current line

embedEPS

public void embedEPS(com.klg.jclass.page.EPSImage eps,
                     JCUnit.Dimension size)
Adds an Encapsulated PostScript image to the document as part of the current line. The EPS image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image. This form of the embedEPS() method centers the eps image vertically on the current line.

Parameters:
eps - the Image to be embedded in the current line
size - the dimensions of the image as it is to appear on the page

embedEPS

public void embedEPS(com.klg.jclass.page.EPSImage eps,
                     int alignment,
                     JCUnit.Dimension size)
Adds an Encapsulated PostScript image to the document as part of the current line. The EPS image may wrap if there isn't enough horizontal space. The height of the current line will be adjusted to accomodate the image.

Parameters:
eps - the EPS image to be embedded in the current line
alignment - the vertical alignment of the image on the current line
size - the dimensions of the image as it is to appear on the page

hRule

public void hRule(double percent_width)
Draws a horizontal line across the column/frame below the current line.

Parameters:
percent_width - the percentage of the width of the column that the line covers

hRule

public void hRule(JCUnit.Measure rule_length)
Draws a horizontal line across the column/frame below the current line.

Parameters:
rule_length - the length of the line

newLine

public void newLine()
Advances the text flow to a new line.


newParagraph

public void newParagraph()
Advances the text flow to a new line, starting a new paragraph.


newColumn

public void newColumn()
Advances the text flow to a new column.


newFrame

public void newFrame()
Advances the text flow to a new frame.


newPage

public void newPage()
Advances the text flow to a new page.


newSection

public void newSection()
Advances the text flow to a new Section.


endFlow

public void endFlow()
Completes the document so it can be printed.


addFlowListener

public void addFlowListener(com.klg.jclass.page.JCFlowListener listener)
Adds a listener for flow events.

Parameters:
listener -
See Also:
JCFlowEvent, JCFlowListener

removeFlowListener

public void removeFlowListener(com.klg.jclass.page.JCFlowListener listener)
Removes a listener for flow events.

Parameters:
listener -

fireFrameCompleted

protected void fireFrameCompleted(com.klg.jclass.page.JCFrame frame)
Convenience method to fire the FRAME_COMPLETE event.

Parameters:
frame - instance of the frame completed

updatePageNumbers

protected void updatePageNumbers(com.klg.jclass.page.JCPage newPage)
Updates the page numbers being tracked by the flow, including the current page number and the page counts for the section and the document. Also sets the page number on the new page (which should be the newly added or created current page) if provided. This method is currently called by JCDocument.addPage() so that all added pages affect the page number counts. It is also called by JCFlow.endPage() in the case that any user added pages have been deferred.

Parameters:
newPage - the newly created added page (may be null if method is called from a method that does not create a page but only wishes to add in deferred pages to the page count)

deferCountingNewPage

protected void deferCountingNewPage(com.klg.jclass.page.JCPage newPage)
Tracks the number of pages added but not yet part of the page count. This is used specifically to track pages added by the user -- that is, pages that are not part of the flow -- so that they get included in the page count. They can't be added to the page count right away because the current flow page needs to have access to the correct current page number.

Parameters:
newPage - the newly created/added page that is to be deferred from page counting for the moment; if non-null, its page number will be set with the correct page number

Copyright © 2004 Quest Software Inc..
All rights reserved.