public class WMFGraphics2D extends BaseGraphics2D
Unit :the default WMFGraphics2D is scaled so that a unit of 1.0 (1 point) is worth 20 twips (or 1/72 inch). That is, 1 unit is one typographical point.
However, the "inner" scale of WMFGraphics2D (as seen throught getAffineTransform().getScaleX() for instance is 1 graphic unit = 1 twips.
IMPORTANT : improve pen handling. Pen should be as shared as possible. Store them in an array, and delete those who don't survive a gc restore.
Remarks for implementation: dispose() is called if the Graphics2D is finalized. It should be called explicitely too. Hence, you must be sure dispose can be called any number of time without problems.
| Constructor and Description |
|---|
WMFGraphics2D(java.io.File f,
java.awt.geom.Dimension2D dims)
Creates a WMFGraphics2D in the file f.
|
WMFGraphics2D(RandomAccessStream stream,
java.awt.geom.Dimension2D dims)
Create a WMF graphics which will be stored in stream.
|
WMFGraphics2D(RandomAccessStream out,
int width,
int height) |
WMFGraphics2D(java.lang.String fname,
java.awt.geom.Dimension2D dims)
Creates a WMFGraphics2D in the file fname.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy) |
java.awt.Graphics |
create()
Create a clone of this graphics2d, rendering into the same picture.
|
void |
dispose() |
void |
draw(java.awt.Shape shape)
Draws a shape.
|
boolean |
drawImage(java.awt.Image img,
java.awt.geom.AffineTransform xform,
java.awt.image.ImageObserver obs) |
void |
drawRenderedImage(java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform) |
void |
fill(java.awt.Shape shape)
fill a shape.
|
double |
getPrecision() |
short |
getWMFLineWidth() |
void |
setPaintMode() |
void |
setPrecision(double precision)
Sets the maximal error between theoretical curves and what is drawn.
|
void |
setProperties(java.util.Properties properties)
Communicates properties (which can be used as a generic system for
parameters) to the graphic system.
|
void |
setStroke(java.awt.Stroke stroke) |
void |
setXORMode(java.awt.Color c1)
Switches to Xor mode.
|
addRenderingHints, clearRect, clip, clipRect, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRenderableImage, drawRoundRect, drawString, drawString, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getClip, getClipBounds, getColor, getComposite, getDeviceConfiguration, getFont, getFontMetrics, getFontRenderContext, getPaint, getPathFor, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setPaint, setRenderingHint, setRenderingHints, setTransform, shear, transform, translate, translatepublic WMFGraphics2D(java.io.File f,
java.awt.geom.Dimension2D dims)
throws java.io.IOException
f - dims - : graphics dimensions, in points.java.io.IOExceptionpublic WMFGraphics2D(java.lang.String fname,
java.awt.geom.Dimension2D dims)
throws java.io.IOException
fname - path of the filedims - dimensions, expressed in pointsjava.io.IOExceptionpublic WMFGraphics2D(RandomAccessStream stream, java.awt.geom.Dimension2D dims) throws java.io.IOException
stream - dims - dimensions, expressed in pointsjava.io.IOExceptionpublic WMFGraphics2D(RandomAccessStream out, int width, int height) throws java.io.IOException
java.io.IOExceptionpublic void draw(java.awt.Shape shape)
BaseGraphics2DA basic, probably very suboptimal implementation of draw, which calls fill(shape). For the sake of efficiency, you should probably rewrite it.
draw in class BaseGraphics2DGraphics2D.draw(Shape)public void fill(java.awt.Shape shape)
fill in class BaseGraphics2Dpublic double getPrecision()
public short getWMFLineWidth()
public void setPrecision(double precision)
precision - public void setStroke(java.awt.Stroke stroke)
setStroke in class BaseGraphics2Dpublic void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
copyArea in class BaseGraphics2Dpublic java.awt.Graphics create()
BaseGraphics2Dreturn new MyGraphicsType(this);as implementation.
create in class BaseGraphics2DGraphics.create()public void dispose()
dispose in class BaseGraphics2Dpublic boolean drawImage(java.awt.Image img,
java.awt.geom.AffineTransform xform,
java.awt.image.ImageObserver obs)
drawImage in class BaseGraphics2Dpublic void drawRenderedImage(java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform)
drawRenderedImage in class BaseGraphics2Dpublic void setPaintMode()
setPaintMode in class BaseGraphics2Dpublic void setXORMode(java.awt.Color c1)
BaseGraphics2DsetXORMode in class BaseGraphics2DGraphics.setXORMode(java.awt.Color)public void setProperties(java.util.Properties properties)
BaseGraphics2DsetProperties in class BaseGraphics2D