| |
|
| java.lang.Object org.columba.core.print.cPrintObject org.columba.core.print.cHTMLPart
cHTMLPart | public class cHTMLPart extends cPrintObject (Code) | | Class for representing a HTML print object. Objects of this
type is intended for inclusion in cDocument objects for printing.
Division into multiple pages represented by cPage is supported.
author: Karl Peder Olesen (karlpeder), 20030601 |
Constructor Summary | |
public | cHTMLPart() Creates a new empty HTML print object. | public | cHTMLPart(boolean scaleAllowed) |
Method Summary | |
public cPrintObject | breakBlock(cUnit w, cUnit maxHeight) Divides (breaks) this HTML print object into a remainder (which fits
inside the given max height) and the rest. | public cSize | getSize(cUnit maxWidth) Returns the size of this HTML print object subject to the
given width.
If scaling is allowed, and the contents can not be fitted inside
the given width, the content is scaled to fit before the size is
returned, i.e. | public void | print(Graphics2D g) Prints the contents of this HTML print object using the supplied
Graphics2D object.
Parameters: g - Used for rendering (i.e. | public void | setHTML(HTMLDocument html) Sets the HTML document to be printed. | public void | setHTML(URL url) Sets the HTML document to be printed. | protected void | setStartY(cUnit y) Sets the starting position in y-direction. |
cHTMLPart | public cHTMLPart()(Code) | | Creates a new empty HTML print object.
As default, scaling the print to fit is not allowed
|
cHTMLPart | public cHTMLPart(boolean scaleAllowed)(Code) | | Creates a new empty HTML print object and sets whether scaling is allowed
Parameters: scaleAllowed - If true, the print is allowed to "scale to fit" |
getSize | public cSize getSize(cUnit maxWidth)(Code) | | Returns the size of this HTML print object subject to the
given width.
If scaling is allowed, and the contents can not be fitted inside
the given width, the content is scaled to fit before the size is
returned, i.e. the scaled size is returned.
NB: The height returned will always be from the starting point
(which could be different from the top) to the end of the current
content, independent on whether everything will or can be printed
on onto one page.
Parameters: maxWidth - Max. allowable width this print object can occupy See Also: org.columba.core.print.cPrintObject.getSize(org.columba.core.print.cUnit) |
setHTML | public void setHTML(HTMLDocument html)(Code) | | Sets the HTML document to be printed.
Parameters: html - HTML document to be printed |
setHTML | public void setHTML(URL url) throws IOException(Code) | | Sets the HTML document to be printed.
Precondition: The URL given contains a HTML document
Parameters: url - url to file with HTML document throws: IOException - if errors occur while reading HTML document from file |
setStartY | protected void setStartY(cUnit y)(Code) | | Sets the starting position in y-direction. A starting position != 0 is used
when printing anything but the first page. This bookkeeping is usually done
internally when creating pagebreaks using the method breakBlock.
Therefore this method has not been made public.
Parameters: y - Starting position in y-direction |
|
|
|