|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Graphics | +--voji.utils.CopyGraphics | +--voji.utils.PageGraphics
This class coveres another Graphics
object
giving page dimensions, a resolution and a page number to it.
The page number is counted automatically.
Constructor Summary | |
PageGraphics()
Creates a new empty PageGraphics instance |
|
PageGraphics(java.awt.Graphics graphics,
java.awt.Dimension dimension,
int dpi)
Creates a new PageGraphics instance
using the Graphics object,
page dimensions and
page resolution |
|
PageGraphics(java.awt.PrintJob printJob)
Creates a new PageGraphics instance
using a PrintJob |
Method Summary | |
java.awt.Graphics |
create()
Creates a new PageGraphics instance as a copy
of the current object |
java.awt.Dimension |
getPageDimension()
Returns the current page dimensions |
int |
getPageNumber()
Returns the current page number |
int |
getPageResolution()
Returns the current page resolution |
void |
setAll(java.awt.Graphics graphics,
java.awt.Dimension dimension,
int dpi)
Sets all necessary parameters at once |
void |
setAll(java.awt.PrintJob printJob)
Sets all necessary parameters at once |
void |
setGraphics(java.awt.Graphics graphics)
Sets the current sub Graphics object. |
void |
setPageDimension(java.awt.Dimension dimension)
Sets the current page dimensions |
void |
setPageNumber(int number)
Sets the current page number. |
void |
setPageResolution(int dpi)
Sets the current page resolution |
int |
toPixels(double length)
Returns the number of pixels of the given length |
java.lang.String |
toString()
Returns a String object representing this object's value |
Methods inherited from class voji.utils.CopyGraphics |
addGraphics, addGraphics, clearRect, clipRect, copyArea, dispose, drawArc, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRoundRect, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, finalize, getClip, getClipBounds, getColor, getFont, getFontMetrics, removeGraphics, setClip, setClip, setColor, setFont, setPaintMode, setXORMode, translate |
Methods inherited from class java.awt.Graphics |
create, draw3DRect, drawBytes, drawChars, drawPolygon, drawRect, fill3DRect, fillPolygon, getClipBounds, getClipRect, getFontMetrics, hitClip |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PageGraphics()
PageGraphics
instance
public PageGraphics(java.awt.Graphics graphics, java.awt.Dimension dimension, int dpi)
PageGraphics
instance
using the Graphics
object,
page dimensions and
page resolution
graphics
- the Graphics
object to coverdimension
- the new page dimensions (in pixels)dpi
- the new page resolution in pixels per inch (DPI)setAll(Graphics,Dimension,int)
public PageGraphics(java.awt.PrintJob printJob)
PageGraphics
instance
using a PrintJob
printJob
- the PrintJob
where to take
the Graphics
object,
page dimensions and page resolution fromsetAll(PrintJob)
Method Detail |
public java.awt.Graphics create()
PageGraphics
instance as a copy
of the current object
create
in class CopyGraphics
public java.lang.String toString()
String
object representing this object's value
toString
in class CopyGraphics
public void setAll(java.awt.Graphics graphics, java.awt.Dimension dimension, int dpi)
graphics
- the new Graphics
object to coverdimension
- the new page dimensions (in pixels)dpi
- the new page resolution in pixels per inch (DPI)public void setAll(java.awt.PrintJob printJob)
printJob
- the PrintJob
where to take
the Graphics
object,
page dimensions and page resolution frompublic java.awt.Dimension getPageDimension()
public void setPageDimension(java.awt.Dimension dimension)
public int getPageResolution()
public void setPageResolution(int dpi)
dpi
- the new page resolution in pixels per inch (DPI)public int toPixels(double length)
length
- the length using the current page resolutions
length
public int getPageNumber()
public void setPageNumber(int number)
number
- the new page numbersetGraphics(Graphics)
public void setGraphics(java.awt.Graphics graphics)
Graphics
object.
Each direct or indirect call to this function
increases the current page number.
setGraphics
in class CopyGraphics
graphics
- the new sub Graphics
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |