|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.fx.print.PageRect
| Field Summary | |
protected Graphics |
buffer
|
protected double |
height
|
protected Image |
image
|
protected double |
width
|
protected double |
x
|
protected double |
xDPI
|
protected double |
y
|
protected double |
yDPI
|
| Constructor Summary | |
PageRect()
|
|
| Method Summary | |
void |
adjustForPen(double penSize,
Rect source)
|
Rect |
adjustForPen(double penSize,
Rect source,
Rect destination)
|
boolean |
allocateScalingBuffer(int destWidth,
int destHeight)
Attempt to allocate enough buffer space to allow the entire PageRect can be scaled from the dimensions of the allocated image buffer to an Image of the specified destination dimensions. |
boolean |
allocateScalingBuffer(int sourceWidth,
int sourceHeight,
int destWidth,
int destHeight,
boolean usesAlpha)
Attempt to allocate enough buffer space to allow the entire PageRect can be scaled from the specified source dimensions to an Image of the specified destination dimensions. |
int |
getBufferHeight()
Returns the height of the buffer in pixels. |
int |
getBufferWidth()
Returns the width of the buffer in pixels. |
Graphics |
getGraphics()
Returns the graphics that you use to draw on. |
double |
getHeightOnPaper()
Returns the height of the PageRect in Points (1/72 of an inch). |
Image |
getImage()
This returns the Image that was used to store images drawn if an Image was used for storing the drawn data. |
Image |
getScaledImage(int destWidth,
int destHeight)
This is used to get a scaled version of the data that was drawn into the PageRect via the Graphics returned by getGraphics(). |
Graphics |
getSourceGraphics()
Returns a graphics that you use to copy data from. |
double |
getWidthOnPaper()
Returns the width of the PageRect in Points (1/72 of an inch). |
double |
getX()
Returns the x location of the PageRect in Points (1/72 of an inch) in relation to the top-left corner of the paper. |
double |
getXDPI()
Returns the DPI of the buffer horizontally. |
double |
getXPointToPixelScale()
Return the factor that will convert values in Point co-ordinates to pixel co-ordinates horizontally. |
double |
getY()
Returns the y location of the PageRect in Points (1/72 of an inch) in relation to the top-left corner of the paper. |
double |
getYDPI()
Returns the DPI of the buffer horizontally. |
double |
getYPointToPixelScale()
Return the factor that will convert values in Point co-ordinates to pixel co-ordinates horizontally. |
boolean |
isWithin(double x,
double y)
Returns true if the specified co-ordinate in Points is within this PageRect. |
boolean |
isWithin(double x,
double y,
double width,
double height)
Returns true if the specified rectangle in Points intersects with this PageRect. |
int |
scaleDimension(double pointSize)
Scale a dimension value in Points (1/72 of an inch) into the correct number of pixels for this PageRect - but the return value will always be a minimum of 1. |
Rect |
scaleToPixels(PointRect pr,
Rect destination)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
protected double width
protected double height
protected double x
protected double y
protected double xDPI
protected double yDPI
protected Image image
protected Graphics buffer
| Constructor Detail |
public PageRect()
| Method Detail |
public boolean allocateScalingBuffer(int sourceWidth,
int sourceHeight,
int destWidth,
int destHeight,
boolean usesAlpha)
Returns true if this was successful, false if not. If this method is successful, then the method getScaled image will successfully return a scaled image without running out of resources or memory.
public boolean allocateScalingBuffer(int destWidth,
int destHeight)
Returns true if this was successful, false if not. If this method is successful, then the method getScaled image will successfully return a scaled image without running out of resources or memory.
This version of the method can only be called after the PageRect has already had its buffer Image setup.
public Image getScaledImage(int destWidth,
int destHeight)
Only call this if a call to allocateScalingBuffer() had succeeded, and only use the same destWidth and destHeight used in that method call. The returned scaled image will be re-used the next time getScaledImage() is called.
public Image getImage()
public double getWidthOnPaper()
public double getHeightOnPaper()
public double getX()
public double getY()
public Graphics getGraphics()
public Graphics getSourceGraphics()
public int getBufferWidth()
public int getBufferHeight()
public double getXDPI()
public double getYDPI()
public double getXPointToPixelScale()
public double getYPointToPixelScale()
public boolean isWithin(double x,
double y)
x - the x co-ordinate in Points (1/72 of an inch).y - the y co-ordinate in Points (1/72 of an inch).
public boolean isWithin(double x,
double y,
double width,
double height)
x - the x co-ordinate in Points (1/72 of an inch).y - the y co-ordinate in Points (1/72 of an inch).width - the width in Points (1/72 of an inch).height - the height in Points (1/72 of an inch).
public Rect scaleToPixels(PointRect pr,
Rect destination)
public int scaleDimension(double pointSize)
public Rect adjustForPen(double penSize,
Rect source,
Rect destination)
public void adjustForPen(double penSize,
Rect source)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||