JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.page
Class JCPage

java.lang.Object
  |
  +--com.klg.jclass.page.PageArea
        |
        +--com.klg.jclass.page.JCPage

public class JCPage
extends PageArea

JCPage describes a page in a JCDocument.


Field Summary
protected  boolean firstTemplate
          Indicates if a template page is marked to be used as the first page.
protected  List flowFrameList
          List of frames on the page (in order) belonging to the document's flow.
protected  com.klg.jclass.page.JCPage flowPageTemplate
          Page template from which to generate the next page (flowing).
protected  com.klg.jclass.page.JCPage flowSectionTemplate
          Next page's template on a section break.
protected  int orientation
          Indicates the orientation of the page -- automatic, portrait or landscape.
static int ORIENTATION_AUTOMATIC
          The orientation of this JCPage is to be determined by its dimensions.
static int ORIENTATION_LANDSCAPE
          The orientation of this JCPage is landscape.
static int ORIENTATION_PORTRAIT
          The orientation of this JCPage is portrait.
static int PAGE_TYPE_DELETED
          A JCPage left as a marker in place of a deleted (flushed) page.
static int PAGE_TYPE_DOCUMENT
          A JCPage which is a normal page in a JCDocument.
static int PAGE_TYPE_TEAR_OFF
          A JCPage which appears in a document, but is not numbered or counted.
static int PAGE_TYPE_TEMPLATE
          A JCPage used as a template page (not counted or printed).
protected  int pageNumber
          User-controllable page numbering (not an absolute number).
protected  int pageType
          Distinguishes template and document pages.
protected  String templateName
          Name of the template this page was copied from.
 
Fields inherited from class com.klg.jclass.page.PageArea
background, color, document, frameList, layoutStatus, location, name, size
 
Constructor Summary
JCPage()
          Creates a blank page with unspecified size and no contents.
JCPage(com.klg.jclass.page.JCDocument doc)
          Creates a blank page in a given document with unspecified size and no contents.
JCPage(String name)
          Creates a named page with unspecified size and no contents.
JCPage(String name, com.klg.jclass.page.JCDocument doc)
          Creates in a document a named page with unspecified size and no contents.
JCPage(String name, com.klg.jclass.page.JCDocument doc, com.klg.jclass.page.JCPage template_page)
          Creates a page with the given name and contents copied from a template, and makes the new page owned by the given document.
JCPage(String name, com.klg.jclass.page.JCDocument doc, JCUnit.Point location, JCUnit.Dimension size)
          Creates in a document a named page with the given size and media offset.
JCPage(String name, com.klg.jclass.page.JCPage template_page)
          Creates a page with the given name and contents copied from a template.
JCPage(String name, JCUnit.Point location, JCUnit.Dimension size)
          Creates a named page with the given size and media offset.
 
Method Summary
 void delete()
          Deletes the contents of the page, leaving a minimal page object.
 void draw(Graphics2D gc)
          Draws the page.
 List getFlowFrameList()
          Gets the list of flow frames on this page.
 com.klg.jclass.page.JCPage getFlowPageTemplate()
          Gets the name of the page template from which the next page is to be cloned.
 com.klg.jclass.page.JCPage getFlowSectionTemplate()
          Gets the page template from which a new page is to be cloned.
 int getOrientation()
          Internal use only.
 int getPageNumber()
          Gets the number which is to be used to evaluate the pagenumber macro.
 Rectangle2D getPageSize()
          Gets the page's size and position and returns the information in the form of a rectangle.
 int getPageType()
          Gets the page type.
protected  String getTemplateName()
          Gets the name of the page template from which this page was cloned.
 boolean isFirstTemplate()
          Finds out if this page template is the first one or not.
 void setFirstTemplate(boolean is_first)
          Specifies if this page template is to be used for the first flow page.
 void setFlowFrameList(List flow)
          Sets the frame flow list.
 void setFlowPageTemplate(com.klg.jclass.page.JCPage template)
          Sets the page template from which the next page is to be cloned.
 void setFlowSectionTemplate(com.klg.jclass.page.JCPage template)
          Sets the page template from which a new page is to be cloned if the page is terminated with a flow section break.
protected  void setOrientation(int orient)
          Internal use only.
 void setPageNumber(int page_number)
          Sets the number which is to be used to evaluate the pagenumber macro.
 void setPageType(int page_type)
          Sets the page type.
protected  void setTemplateName(String template_name)
          Sets the name of the page template from which this page was cloned.
 
Methods inherited from class com.klg.jclass.page.PageArea
calcLayoutStatus, drawEvalWatermark, getBackground, getColor, getDocument, getFrameList, getLayoutStatus, getLocation, getName, getSize, setColor, setDocument, setFrameList, setLayoutStatus, setLocation, setName, setSize, stringToFrame, updateLayoutStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageNumber

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


flowFrameList

protected List flowFrameList
List of frames on the page (in order) belonging to the document's flow.


flowPageTemplate

protected com.klg.jclass.page.JCPage flowPageTemplate
Page template from which to generate the next page (flowing).


flowSectionTemplate

protected com.klg.jclass.page.JCPage flowSectionTemplate
Next page's template on a section break.


pageType

protected int pageType
Distinguishes template and document pages.


templateName

protected String templateName
Name of the template this page was copied from.


firstTemplate

protected boolean firstTemplate
Indicates if a template page is marked to be used as the first page.


orientation

protected int orientation
Indicates the orientation of the page -- automatic, portrait or landscape.


PAGE_TYPE_TEMPLATE

public static final int PAGE_TYPE_TEMPLATE
A JCPage used as a template page (not counted or printed).

See Also:
Constant Field Values

PAGE_TYPE_DOCUMENT

public static final int PAGE_TYPE_DOCUMENT
A JCPage which is a normal page in a JCDocument.

See Also:
Constant Field Values

PAGE_TYPE_TEAR_OFF

public static final int PAGE_TYPE_TEAR_OFF
A JCPage which appears in a document, but is not numbered or counted.

See Also:
Constant Field Values

PAGE_TYPE_DELETED

public static final int PAGE_TYPE_DELETED
A JCPage left as a marker in place of a deleted (flushed) page.

See Also:
Constant Field Values

ORIENTATION_AUTOMATIC

public static final int ORIENTATION_AUTOMATIC
The orientation of this JCPage is to be determined by its dimensions.

See Also:
Constant Field Values

ORIENTATION_PORTRAIT

public static final int ORIENTATION_PORTRAIT
The orientation of this JCPage is portrait.

See Also:
Constant Field Values

ORIENTATION_LANDSCAPE

public static final int ORIENTATION_LANDSCAPE
The orientation of this JCPage is landscape.

See Also:
Constant Field Values
Constructor Detail

JCPage

public JCPage()
Creates a blank page with unspecified size and no contents.


JCPage

public JCPage(com.klg.jclass.page.JCDocument doc)
Creates a blank page in a given document with unspecified size and no contents.

Parameters:
doc - the document to which this page belongs

JCPage

public JCPage(String name)
Creates a named page with unspecified size and no contents.

Parameters:
name - the name to assign to the page

JCPage

public JCPage(String name,
              com.klg.jclass.page.JCDocument doc)
Creates in a document a named page with unspecified size and no contents.

Parameters:
name - the name to assign to the page
doc - the document to which this page belongs

JCPage

public JCPage(String name,
              JCUnit.Point location,
              JCUnit.Dimension size)
Creates a named page with the given size and media offset.

Parameters:
name - the name to assign to the page
location - the offset of the printable page relative to the media
size - the dimensions of the page

JCPage

public JCPage(String name,
              com.klg.jclass.page.JCDocument doc,
              JCUnit.Point location,
              JCUnit.Dimension size)
Creates in a document a named page with the given size and media offset.

Parameters:
name - the name to assign to the page
doc - the document to which this page belongs
location - the offset of the printable page relative to the media
size - the dimensions of the page

JCPage

public JCPage(String name,
              com.klg.jclass.page.JCPage template_page)
Creates a page with the given name and contents copied from a template.

Parameters:
name - the name to assign to the page
template_page - a template page for initial page layout and contents

JCPage

public JCPage(String name,
              com.klg.jclass.page.JCDocument doc,
              com.klg.jclass.page.JCPage template_page)
Creates a page with the given name and contents copied from a template, and makes the new page owned by the given document.

Parameters:
name - the name to assign to the page
doc - the document which is to own this page
template_page - a template page for initial page layout and contents
Method Detail

getPageNumber

public int getPageNumber()
Gets the number which is to be used to evaluate the pagenumber macro.

Returns:
Number which is to be used to label the page

setPageNumber

public void setPageNumber(int page_number)
Sets the number which is to be used to evaluate the pagenumber macro.

Parameters:
page_number - number which is to be used to label the page

getFlowPageTemplate

public com.klg.jclass.page.JCPage getFlowPageTemplate()
Gets the name of the page template from which the next page is to be cloned.

Returns:
name of the template page this page was copied from

setFlowPageTemplate

public void setFlowPageTemplate(com.klg.jclass.page.JCPage template)
Sets the page template from which the next page is to be cloned.

Parameters:
template - template page

getFlowSectionTemplate

public com.klg.jclass.page.JCPage getFlowSectionTemplate()
Gets the page template from which a new page is to be cloned. If the page is terminated with a flow section break, gets the page template from which this page was cloned.

Returns:
the template page this page was copied from

setFlowSectionTemplate

public void setFlowSectionTemplate(com.klg.jclass.page.JCPage template)
Sets the page template from which a new page is to be cloned if the page is terminated with a flow section break.

Parameters:
template - the template page

getFlowFrameList

public List getFlowFrameList()
Gets the list of flow frames on this page.

Returns:
ordered list of flow frames this page contains

setFlowFrameList

public void setFlowFrameList(List flow)
Sets the frame flow list.

Parameters:
flow - the frames (appearing on this page) which are used by the flow

isFirstTemplate

public boolean isFirstTemplate()
Finds out if this page template is the first one or not.

Returns:
true if this template page is marked to be used first

setFirstTemplate

public void setFirstTemplate(boolean is_first)
Specifies if this page template is to be used for the first flow page.

Parameters:
is_first - true if this page will be the first template used in the flow

getTemplateName

protected String getTemplateName()
Gets the name of the page template from which this page was cloned.

Returns:
name of the template page this page was copied from

setTemplateName

protected void setTemplateName(String template_name)
Sets the name of the page template from which this page was cloned.

Parameters:
template_name - the unique name of a template page

getOrientation

public int getOrientation()
Internal use only. Gets the page orientation. Valid values are AUTOMATIC (to be determined by the page size), PORTRAIT, or LANDSCAPE.

Returns:
the orientation of this page

setOrientation

protected void setOrientation(int orient)
Internal use only. Sets the page orientation. Valid values are AUTOMATIC (to be determined by the page size), PORTRAIT, or LANDSCAPE.

Parameters:
orient - the orientation of this page

getPageType

public int getPageType()
Gets the page type.

Returns:
the type of page this is (document, template, tear-off)

setPageType

public void setPageType(int page_type)
Sets the page type. Possible values are currently JCPage.PAGE_TYPE_TEMPLATE and JCPage.PAGE_TYPE_DOCUMENT.

Parameters:
page_type - indicates if this is a document or template page

getPageSize

public Rectangle2D getPageSize()
Gets the page's size and position and returns the information in the form of a rectangle.

Returns:
a rectangle2D specifying the page offset and size

delete

public void delete()
Deletes the contents of the page, leaving a minimal page object. This enables us to flush pages as they are printed, conserving memory.


draw

public void draw(Graphics2D gc)
Draws the page.

Overrides:
draw in class PageArea
Parameters:
gc - the graphics object into which we are printing

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