public class SEGraphUtils extends java.lang.Object implements GraphicsUtils
GraphicsUtils
GraphicsUtils
Constructor and Description |
---|
SEGraphUtils() |
Modifier and Type | Method and Description |
---|---|
java.awt.image.BufferedImage |
copyBufferedImage(java.awt.image.BufferedImage img)
Produces a copy of a buffered image with the same graphic content (pixel color)
|
java.awt.image.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.
|
java.awt.Font |
deriveFont(java.awt.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(java.awt.Graphics2D g)
Sets the rendering hints to the Graphics2D object in a way that is suitable for drawing.
|
void |
setRenderingHintsForPrinting(java.awt.Graphics2D g)
Sets the rendering hints to the Graphics2D object in a way that is suitable for printing.
|
void |
translate(java.awt.Graphics2D g,
double x,
double y)
Adds a translation operation to the Graphics2D object's transformation matrix.
|
public java.awt.image.BufferedImage copyBufferedImage(java.awt.image.BufferedImage img)
GraphicsUtils
copyBufferedImage
in interface GraphicsUtils
img
- image to be copiedpublic java.awt.image.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 java.awt.Font deriveFont(java.awt.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(java.awt.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(java.awt.Graphics2D g)
GraphicsUtils
setRenderingHintsForDrawing
in interface GraphicsUtils
g
- the Graphics2D object whose rendering hints have to be set for drawingpublic void setRenderingHintsForPrinting(java.awt.Graphics2D g)
GraphicsUtils
setRenderingHintsForPrinting
in interface GraphicsUtils
g
- the Graphics2D object whose rendering hints have to be set for printing