public class EMFRenderer extends Object
Modifier and Type | Field and Description |
---|---|
static double |
TWIP_SCALE
Each logical unit is mapped to one twentieth of a
printer's point (1/1440 inch, also called a twip).
|
Constructor and Description |
---|
EMFRenderer(EMFInputStream is)
Constructs the renderer.
|
Modifier and Type | Method and Description |
---|---|
void |
clip(Shape shape) |
void |
closeFigure()
closes and appends the current open figure to the
path
|
void |
closePath()
closes the path opened by
BeginPath |
void |
drawImage(BufferedImage image,
AffineTransform transform) |
void |
drawImage(BufferedImage image,
int x,
int y,
int width,
int height) |
void |
drawOrAppend(Shape s) |
void |
drawOrAppendText(String text,
double x,
double y)
draws the text
|
void |
drawShape(Shape shape) |
void |
fillAndDrawOrAppend(Shape s) |
void |
fillShape(Shape shape) |
void |
fixViewportSize()
Logical units are mapped to arbitrary units with equally scaled axes;
that is, one unit along the x-axis is equal to one unit along the y-axis.
|
int |
getArcDirection() |
Point |
getBrushOrigin() |
Shape |
getClip() |
GeneralPath |
getFigure() |
GDIObject |
getGDIObject(int index) |
Shape |
getInitialClip() |
AffineTransform |
getMapModeTransform() |
float |
getMeterLimit() |
GeneralPath |
getPath() |
AffineTransform |
getPathTransform() |
Stroke |
getPenStroke() |
Dimension |
getSize()
Gets the size of a canvas which would be required to render the EMF.
|
int |
getTextAlignMode() |
AffineTransform |
getTransform() |
int |
getWindingRule() |
void |
paint(Graphics2D g2)
Paints the EMF onto the provided graphics context.
|
void |
resetTransformation() |
void |
retoreDC()
Retores a saved state.
|
void |
saveDC()
Stores the current state.
|
void |
setArcDirection(int arcDirection) |
void |
setBkMode(int bkMode) |
void |
setBrushOrigin(Point brushOrigin) |
void |
setBrushPaint(Paint brushPaint) |
void |
setClip(Shape shape) |
void |
setFigure(GeneralPath figure) |
void |
setFont(Font font) |
void |
setMapModeIsotropic(boolean mapModeIsotropic) |
void |
setMapModeTransform(AffineTransform mapModeTransform) |
void |
setMeterLimit(int meterLimit) |
void |
setPath(GeneralPath path) |
void |
setPathTransform(AffineTransform pathTransform) |
void |
setPenPaint(Paint penPaint) |
void |
setPenStroke(Stroke penStroke) |
void |
setRop2(int rop2) |
void |
setScaleMode(int scaleMode) |
void |
setTextAlignMode(int textAlignMode) |
void |
setTextColor(Color textColor) |
void |
setTransform(AffineTransform at) |
void |
setUseCreatePen(boolean useCreatePen) |
void |
setViewportOrigin(Point viewportOrigin) |
void |
setViewportSize(Dimension viewportSize) |
void |
setWindingRule(int windingRule) |
void |
setWindowOrigin(Point windowOrigin) |
void |
setWindowSize(Dimension windowSize) |
void |
storeGDIObject(int index,
GDIObject tag) |
void |
transform(AffineTransform transform) |
public static double TWIP_SCALE
public EMFRenderer(EMFInputStream is) throws IOException
is
- the input stream to read the EMF records from.IOException
- if an error occurs reading the header.public Dimension getSize()
public void paint(Graphics2D g2)
g2
- the graphics context to paint onto.public void saveDC()
SaveDC
public void retoreDC()
RestoreDC
public void closeFigure()
public void fixViewportSize()
public void drawOrAppendText(String text, double x, double y)
text
- Textx
- x-Positiony
- y-Positionpublic void closePath()
BeginPath
public void setFont(Font font)
public AffineTransform getTransform()
public void transform(AffineTransform transform)
public void resetTransformation()
public void setTransform(AffineTransform at)
public void setClip(Shape shape)
public void clip(Shape shape)
public Shape getClip()
public void drawImage(BufferedImage image, AffineTransform transform)
public void drawImage(BufferedImage image, int x, int y, int width, int height)
public void drawShape(Shape shape)
public void fillShape(Shape shape)
public void fillAndDrawOrAppend(Shape s)
public void drawOrAppend(Shape s)
public int getWindingRule()
public GeneralPath getFigure()
public void setFigure(GeneralPath figure)
public GeneralPath getPath()
public void setPath(GeneralPath path)
public Shape getInitialClip()
public AffineTransform getPathTransform()
public void setPathTransform(AffineTransform pathTransform)
public void setWindingRule(int windingRule)
public void setMapModeIsotropic(boolean mapModeIsotropic)
public AffineTransform getMapModeTransform()
public void setMapModeTransform(AffineTransform mapModeTransform)
public void setWindowOrigin(Point windowOrigin)
public void setViewportOrigin(Point viewportOrigin)
public void setViewportSize(Dimension viewportSize)
public void setWindowSize(Dimension windowSize)
public GDIObject getGDIObject(int index)
public void storeGDIObject(int index, GDIObject tag)
public void setUseCreatePen(boolean useCreatePen)
public void setPenPaint(Paint penPaint)
public Stroke getPenStroke()
public void setPenStroke(Stroke penStroke)
public void setBrushPaint(Paint brushPaint)
public float getMeterLimit()
public void setMeterLimit(int meterLimit)
public void setTextColor(Color textColor)
public void setRop2(int rop2)
public void setBkMode(int bkMode)
public int getTextAlignMode()
public void setTextAlignMode(int textAlignMode)
public void setScaleMode(int scaleMode)
public Point getBrushOrigin()
public void setBrushOrigin(Point brushOrigin)
public void setArcDirection(int arcDirection)
public int getArcDirection()
Copyright © 2014. All rights reserved.