public class SEGraphUtils extends Object implements GraphicsUtils
GraphicsUtilsGraphicsUtils| 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)
GraphicsUtilscopyBufferedImage in interface GraphicsUtilsimg - image to be copiedpublic BufferedImage createBufferedImage(int w, int h, int type)
GraphicsUtilscreateBufferedImage in interface GraphicsUtilsw - width in pixels of the requested imageh - height in pixels of the requested imagetype - image type (refers to bands, etc. see Imagepublic PrintAttributes createPrintAttributes()
GraphicsUtilscreatePrintAttributes in interface GraphicsUtilspublic Font deriveFont(Font srcfont, float newheight)
GraphicsUtilsderiveFont in interface GraphicsUtilssrcfont - provided font to be used as modelnewheight - height in pixels of the new fonrpublic int getScreenDPI()
getScreenDPI in interface GraphicsUtilspublic void translate(Graphics2D g, double x, double y)
GraphicsUtilstranslate in interface GraphicsUtilsg - Object whose transformation matrix has to be modifiedx - horizontal offset of the translationy - vertical offset of the translationpublic void setRenderingHintsForDrawing(Graphics2D g)
GraphicsUtilssetRenderingHintsForDrawing in interface GraphicsUtilsg - the Graphics2D object whose rendering hints have to be set for drawingpublic void setRenderingHintsForPrinting(Graphics2D g)
GraphicsUtilssetRenderingHintsForPrinting in interface GraphicsUtilsg - the Graphics2D object whose rendering hints have to be set for printing