|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.jaret.util.ui.table.renderer.RendererBase
public abstract class RendererBase
Base implementation for renderers that support both screen and printer rendering. It's main purpose is scaling beetween screen and printer coordinates (based on 96dpi for the screen).
Field Summary | |
---|---|
protected org.eclipse.swt.printing.Printer |
_printer
printer if used. |
protected double |
_scaleX
x scaling for transformation beetwenn screen and printer. |
protected double |
_scaleY
y scaling for transformation beetwenn screen and printer. |
protected static double |
SCREEN_DPI_X
constant for scaling: screen resolution x. |
protected static double |
SCREEN_DPI_Y
constant for scaling: screen resolution y. |
Constructor Summary | |
---|---|
RendererBase(org.eclipse.swt.printing.Printer printer)
May be constructed without printer (supplying null). |
Method Summary | |
---|---|
org.eclipse.swt.printing.Printer |
getPrinter()
Retrieve the printer device. |
double |
getScaleX()
Retrieve the x scale factor. |
double |
getScaleY()
Retrieve the y scale factor. |
protected void |
restoreGCAttributes(org.eclipse.swt.graphics.GC gc)
Helper method to restore attribute values saved with saveGCAttributes . |
protected void |
saveGCAttributes(org.eclipse.swt.graphics.GC gc)
Helper method saving several GC attributes to loal variables. |
int |
scaleX(int in)
Scale an x coordinate/size from screen to printer. |
int |
scaleY(int in)
Scale an y coordinate/size from screen to printer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.eclipse.swt.printing.Printer _printer
protected static final double SCREEN_DPI_X
protected static final double SCREEN_DPI_Y
protected double _scaleX
protected double _scaleY
Constructor Detail |
---|
public RendererBase(org.eclipse.swt.printing.Printer printer)
printer
- or null
Method Detail |
---|
public int scaleX(int in)
in
- corodinate/size to scale
public double getScaleX()
public int scaleY(int in)
in
- corodinate/size to scale
public double getScaleY()
public org.eclipse.swt.printing.Printer getPrinter()
null
otherwiseprotected void saveGCAttributes(org.eclipse.swt.graphics.GC gc)
restoreGCAttributes
.
gc
- GC to save attributes forprotected void restoreGCAttributes(org.eclipse.swt.graphics.GC gc)
saveGCAttributes
.
gc
- GC to restore attributes for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |