public class RenderingSurfaceAid extends Object
Constructor and Description |
---|
RenderingSurfaceAid(int width,
int height,
int pad,
double x0,
double y0,
double x1,
double y1)
Constructs a graphics surface (BufferedImage) and resources for a
coordinate system appropriate for the presentation of a rectangular region
defined by the specified coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
drawFrame(Color c) |
void |
fillBackground(Color c) |
BufferedImage |
getBufferedImage()
Gets the buffered image associated with this drawing surface
|
AffineTransform |
getCartesianToPixelTransform()
Gets the affine transform for mapping Cartesian coordinates to pixel
coordinates.
|
Rectangle2D |
getDomainRectangle()
Gets the rectangle for the drawing area corresponding to the coordinate
domain that was specified for the constructor.
|
Graphics2D |
getGraphics2D()
Get the Graphics2D object associated with this drawing surface.
|
double |
getPixelsPerUnit()
Gets the distance in pixels across one unit of distance in
the Cartesian coordinate system.
|
AffineTransform |
getPixelToCartesianTransform()
Gets the affine transform for mapping pixel coordinates to Cartesian
coordinates.
|
double |
getUnitsPerPixel()
Gets the distance across a pixel in the corresponding Cartesian
coordinate system.
|
public RenderingSurfaceAid(int width, int height, int pad, double x0, double y0, double x1, double y1)
width
- the width of the drawing surface, in pixelsheight
- the height of the drawing surface, in pixelspad
- an arbitrary padding to be added to each side of the rectangle,
in pixelsx0
- Cartesian x coordinate for the lower-left corner of the domainy0
- Cartesian y coordinate for the lower-left corner of the domainx1
- Cartesian x coordinate for the upper-right corner of the domainy1
- Cartesian y coordinate for the upper-right corner of the domainpublic AffineTransform getCartesianToPixelTransform()
public AffineTransform getPixelToCartesianTransform()
public Rectangle2D getDomainRectangle()
public BufferedImage getBufferedImage()
public Graphics2D getGraphics2D()
public double getUnitsPerPixel()
public double getPixelsPerUnit()
public void fillBackground(Color c)
public void drawFrame(Color c)
Copyright © 2021. All rights reserved.