public class SEGraphUtils extends Object implements GraphicsUtils
GraphicsUtils
GraphicsUtils
Constructor and Description |
---|
SEGraphUtils() |
Modifier and Type | Method and Description |
---|---|
BufferedImage |
copyBufferedImage(BufferedImage img)
Produces a copy of a buffered image with the same graphic content (pixel color)
|
BufferedImage |
createBufferedImage(int w,
int h,
int type)
Create a buffered Image of the given size and type.
|
PrintAttributes |
createPrintAttributes()
Creates an object that implements the PrintAttributes interface with default/trivial values.
|
Font |
deriveFont(Font srcfont,
float newheight)
Returns an istance of Font which is the same as the one provided except for the size.
|
int |
getScreenDPI()
Tries to use DPI value from gvSIG preferences.
|
void |
setRenderingHintsForDrawing(Graphics2D g)
Sets the rendering hints to the Graphics2D object in a way that is suitable for drawing.
|
void |
setRenderingHintsForPrinting(Graphics2D g)
Sets the rendering hints to the Graphics2D object in a way that is suitable for printing.
|
void |
translate(Graphics2D g,
double x,
double y)
Adds a translation operation to the Graphics2D object's transformation matrix.
|
public BufferedImage copyBufferedImage(BufferedImage img)
GraphicsUtils
copyBufferedImage
in interface GraphicsUtils
img
- image to be copiedpublic BufferedImage createBufferedImage(int w, int h, int type)
GraphicsUtils
createBufferedImage
in interface GraphicsUtils
w
- width in pixels of the requested imageh
- height in pixels of the requested imagetype
- image type (refers to bands, etc. see Image
public PrintAttributes createPrintAttributes()
GraphicsUtils
createPrintAttributes
in interface GraphicsUtils
public Font deriveFont(Font srcfont, float newheight)
GraphicsUtils
deriveFont
in interface GraphicsUtils
srcfont
- provided font to be used as modelnewheight
- height in pixels of the new fonrpublic int getScreenDPI()
getScreenDPI
in interface GraphicsUtils
public void translate(Graphics2D g, double x, double y)
GraphicsUtils
translate
in interface GraphicsUtils
g
- Object whose transformation matrix has to be modifiedx
- horizontal offset of the translationy
- vertical offset of the translationpublic void setRenderingHintsForDrawing(Graphics2D g)
GraphicsUtils
setRenderingHintsForDrawing
in interface GraphicsUtils
g
- the Graphics2D object whose rendering hints have to be set for drawingpublic void setRenderingHintsForPrinting(Graphics2D g)
GraphicsUtils
setRenderingHintsForPrinting
in interface GraphicsUtils
g
- the Graphics2D object whose rendering hints have to be set for printing