public abstract class VectorGraphics extends Graphics2D implements VectorGraphicsConstants
Graphics2D tempGraphics = (Graphics2D) originalGraphics.create();
tempGraphics.setStroke(originalGraphics.getStroke());
tempGraphics.rotate(...);
tempGraphics.translate(...);
...drawing methods on tempGraphics...
tempGraphics.dispose();
where originalGraphics
is the original Graphics2D
object. Note that dispose
must be called when the drawing
finishes on tempGraphics
and that no drawing should be done on
originalGraphics
until dispose
has been called.NUMBER_OF_HORIZ_ALIGNMENTS, NUMBER_OF_SYMBOLS, NUMBER_OF_VERTICAL_ALIGNMENTS, SYMBOL_BOX, SYMBOL_CIRCLE, SYMBOL_CROSS, SYMBOL_DIAMOND, SYMBOL_DN_TRIANGLE, SYMBOL_HLINE, SYMBOL_PLUS, SYMBOL_STAR, SYMBOL_UP_TRIANGLE, SYMBOL_VLINE, TEXT_BASELINE, TEXT_BOTTOM, TEXT_CENTER, TEXT_LEFT, TEXT_RIGHT, TEXT_TOP
Constructor and Description |
---|
VectorGraphics() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addRenderingHints(Map<?,?> hints) |
abstract void |
clearRect(double x,
double y,
double width,
double height) |
abstract void |
clearRect(int x,
int y,
int width,
int height) |
abstract void |
clip(Shape s) |
abstract void |
clipRect(double x,
double y,
double width,
double height) |
abstract void |
clipRect(int x,
int y,
int width,
int height) |
abstract void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy) |
abstract Graphics |
create() |
abstract Graphics |
create(double x,
double y,
double width,
double height) |
static VectorGraphics |
create(Graphics g) |
Graphics |
create(int x,
int y,
int width,
int height) |
abstract void |
dispose() |
abstract void |
draw(Shape s) |
abstract void |
drawArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
Draws an arc.
|
abstract void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) |
abstract void |
drawGlyphVector(GlyphVector g,
float x,
float y) |
abstract void |
drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y) |
abstract boolean |
drawImage(Image img,
AffineTransform xform,
ImageObserver obs) |
abstract boolean |
drawImage(Image image,
int x,
int y,
Color bgColor,
ImageObserver observer) |
abstract boolean |
drawImage(Image image,
int x,
int y,
ImageObserver observer) |
abstract boolean |
drawImage(Image image,
int x,
int y,
int width,
int height,
Color bgColor,
ImageObserver observer) |
abstract boolean |
drawImage(Image image,
int x,
int y,
int width,
int height,
ImageObserver observer) |
abstract boolean |
drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgColor,
ImageObserver observer) |
abstract boolean |
drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer) |
abstract void |
drawLine(double x1,
double y1,
double x2,
double y2)
Draws a straight line.
|
abstract void |
drawLine(int x1,
int y1,
int x2,
int y2) |
abstract void |
drawOval(double x,
double y,
double width,
double height)
Draws an oval.
|
abstract void |
drawOval(int x,
int y,
int width,
int height) |
abstract void |
drawPolygon(double[] xPoints,
double[] yPoints,
int nPoints)
Draws a polygon.
|
abstract void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
abstract void |
drawPolyline(double[] xPoints,
double[] yPoints,
int nPoints)
Draws a polyline.
|
abstract void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints) |
abstract void |
drawRect(double x,
double y,
double width,
double height)
Draws a rectangle.
|
abstract void |
drawRect(int x,
int y,
int width,
int height) |
abstract void |
drawRenderableImage(RenderableImage img,
AffineTransform xform) |
abstract void |
drawRenderedImage(RenderedImage img,
AffineTransform xform) |
abstract void |
drawRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
Draws a rounded rectangle.
|
abstract void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight) |
abstract void |
drawString(AttributedCharacterIterator iterator,
float x,
float y) |
abstract void |
drawString(AttributedCharacterIterator iterator,
int x,
int y) |
abstract void |
drawString(String str,
double x,
double y)
Draws a string.
|
abstract void |
drawString(String str,
double x,
double y,
int horizontal,
int vertical) |
abstract void |
drawString(String str,
double x,
double y,
int horizontal,
int vertical,
boolean framed,
Color frameColor,
double frameWidth,
boolean banner,
Color bannerColor)
Draws a string with a lot of parameters.
|
abstract void |
drawString(String str,
float x,
float y) |
abstract void |
drawString(String str,
int x,
int y) |
abstract void |
drawString(TagString str,
double x,
double y) |
abstract void |
drawString(TagString str,
double x,
double y,
int horizontal,
int vertical) |
abstract void |
drawString(TagString str,
double x,
double y,
int horizontal,
int vertical,
boolean framed,
Color frameColor,
double frameWidth,
boolean banner,
Color bannerColor)
Draws a TagString with a lot of parameters.
|
abstract void |
drawSymbol(double x,
double y,
double size,
int symbol) |
abstract void |
drawSymbol(int x,
int y,
int size,
int symbol) |
abstract void |
endExport() |
abstract void |
fill(Shape s) |
protected void |
fill(Shape shape,
Paint paint)
Fills an are with the given paint using in offscreen BufferedImage.
|
abstract void |
fillAndDraw(Shape s,
Color fillColor) |
abstract void |
fillAndDrawSymbol(double x,
double y,
double size,
int symbol,
Color fillColor) |
abstract void |
fillAndDrawSymbol(int x,
int y,
int size,
int symbol,
Color fillColor) |
abstract void |
fillArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
Fills an arc.
|
abstract void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) |
abstract void |
fillOval(double x,
double y,
double width,
double height)
Fills an oval.
|
abstract void |
fillOval(int x,
int y,
int width,
int height) |
abstract void |
fillPolygon(double[] xPoints,
double[] yPoints,
int nPoints)
Fills a polygon.
|
abstract void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
abstract void |
fillRect(double x,
double y,
double width,
double height)
Fills a rectangle.
|
abstract void |
fillRect(int x,
int y,
int width,
int height) |
abstract void |
fillRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
Fills a rounded rectangle.
|
abstract void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight) |
abstract void |
fillSymbol(double x,
double y,
double size,
int symbol) |
abstract void |
fillSymbol(int x,
int y,
int size,
int symbol) |
abstract Color |
getBackground() |
abstract Shape |
getClip() |
abstract Rectangle |
getClipBounds() |
abstract Rectangle |
getClipBounds(Rectangle r) |
abstract Color |
getColor() |
abstract int |
getColorMode() |
abstract Composite |
getComposite() |
abstract String |
getCreator() |
abstract GraphicsConfiguration |
getDeviceConfiguration() |
abstract Font |
getFont() |
abstract FontMetrics |
getFontMetrics(Font font) |
abstract FontRenderContext |
getFontRenderContext() |
abstract Paint |
getPaint() |
protected abstract Properties |
getProperties() |
abstract String |
getProperty(String key) |
abstract Color |
getPropertyColor(String key) |
abstract Dimension |
getPropertyDimension(String key) |
abstract double |
getPropertyDouble(String key) |
abstract int |
getPropertyInt(String key) |
abstract Rectangle |
getPropertyRectangle(String key) |
abstract Object |
getRenderingHint(RenderingHints.Key inteKey) |
abstract RenderingHints |
getRenderingHints() |
abstract Stroke |
getStroke() |
static int |
getSymbol(String name) |
static int |
getTextAlignment(String name) |
abstract AffineTransform |
getTransform() |
static double |
getXalignment(double x,
double width,
int alignment) |
static double |
getYalignment(double y,
double ascent,
double descent,
int alignment) |
abstract boolean |
hit(Rectangle rect,
Shape s,
boolean onStroke) |
protected abstract void |
initProperties(Properties defaults) |
abstract boolean |
isDeviceIndependent() |
abstract boolean |
isProperty(String key) |
abstract void |
printComment(String comment) |
abstract void |
rotate(double theta) |
abstract void |
rotate(double theta,
double x,
double y) |
abstract void |
scale(double sx,
double sy) |
abstract void |
setBackground(Color color) |
abstract void |
setClip(double x,
double y,
double width,
double height) |
abstract void |
setClip(int x,
int y,
int width,
int height) |
abstract void |
setClip(Shape clip) |
abstract void |
setColor(Color c) |
abstract void |
setColorMode(int colorMode) |
abstract void |
setComposite(Composite comp) |
abstract void |
setCreator(String creator) |
abstract void |
setDeviceIndependent(boolean isDeviceIndependent) |
abstract void |
setFont(Font font) |
abstract void |
setLineWidth(double width) |
abstract void |
setLineWidth(int width) |
abstract void |
setPaint(Paint paint) |
abstract void |
setPaintMode() |
abstract void |
setProperties(Properties newProperties) |
abstract void |
setRenderingHint(RenderingHints.Key hintKey,
Object hintValue) |
abstract void |
setRenderingHints(Map<?,?> hints) |
abstract void |
setStroke(Stroke s) |
abstract void |
setTransform(AffineTransform xform) |
abstract void |
setXORMode(Color c1) |
abstract void |
shear(double shx,
double shy) |
abstract void |
startExport() |
abstract String |
toString() |
abstract void |
transform(AffineTransform xform) |
abstract void |
translate(double tx,
double ty) |
abstract void |
translate(int x,
int y) |
draw3DRect, fill3DRect
drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipRect, getFontMetrics, hitClip
public abstract void setProperties(Properties newProperties)
protected abstract void initProperties(Properties defaults)
protected abstract Properties getProperties()
public abstract int getPropertyInt(String key)
public abstract double getPropertyDouble(String key)
public abstract boolean isProperty(String key)
public abstract void clearRect(int x, int y, int width, int height)
public abstract void clipRect(int x, int y, int width, int height)
public abstract void copyArea(int x, int y, int width, int height, int dx, int dy)
public Graphics create(int x, int y, int width, int height)
public abstract void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
public abstract boolean drawImage(Image image, int x, int y, ImageObserver observer)
public abstract boolean drawImage(Image image, int x, int y, int width, int height, ImageObserver observer)
public abstract boolean drawImage(Image image, int x, int y, Color bgColor, ImageObserver observer)
public abstract boolean drawImage(Image image, int x, int y, int width, int height, Color bgColor, ImageObserver observer)
public abstract boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
public abstract boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgColor, ImageObserver observer)
public abstract void drawLine(int x1, int y1, int x2, int y2)
public abstract void drawOval(int x, int y, int width, int height)
public abstract void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
drawPolygon
in class Graphics
public abstract void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
drawPolyline
in class Graphics
public abstract void drawRect(int x, int y, int width, int height)
public abstract void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
drawRoundRect
in class Graphics
public abstract void drawString(AttributedCharacterIterator iterator, int x, int y)
drawString
in class Graphics2D
public abstract void drawString(String str, int x, int y)
drawString
in class Graphics2D
public abstract void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
public abstract void fillOval(int x, int y, int width, int height)
public abstract void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
fillPolygon
in class Graphics
public abstract void fillRect(int x, int y, int width, int height)
public abstract void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
fillRoundRect
in class Graphics
public abstract Rectangle getClipBounds()
getClipBounds
in class Graphics
public abstract Rectangle getClipBounds(Rectangle r)
getClipBounds
in class Graphics
public abstract FontMetrics getFontMetrics(Font font)
getFontMetrics
in class Graphics
public abstract void setClip(int x, int y, int width, int height)
public abstract void setPaintMode()
setPaintMode
in class Graphics
public abstract void setXORMode(Color c1)
setXORMode
in class Graphics
public abstract void translate(int x, int y)
translate
in class Graphics2D
public abstract void addRenderingHints(Map<?,?> hints)
addRenderingHints
in class Graphics2D
public abstract void clip(Shape s)
clip
in class Graphics2D
public abstract void draw(Shape s)
draw
in class Graphics2D
public abstract void drawGlyphVector(GlyphVector g, float x, float y)
drawGlyphVector
in class Graphics2D
public abstract void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
drawImage
in class Graphics2D
public abstract boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
drawImage
in class Graphics2D
public abstract void drawRenderableImage(RenderableImage img, AffineTransform xform)
drawRenderableImage
in class Graphics2D
public abstract void drawRenderedImage(RenderedImage img, AffineTransform xform)
drawRenderedImage
in class Graphics2D
public abstract void drawString(AttributedCharacterIterator iterator, float x, float y)
drawString
in class Graphics2D
public abstract void drawString(String str, float x, float y)
drawString
in class Graphics2D
public abstract void fill(Shape s)
fill
in class Graphics2D
protected void fill(Shape shape, Paint paint)
shape
- Shape usede as clipping areapaint
- Paint usedpublic abstract Color getBackground()
getBackground
in class Graphics2D
public abstract Composite getComposite()
getComposite
in class Graphics2D
public abstract GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration
in class Graphics2D
public abstract FontRenderContext getFontRenderContext()
getFontRenderContext
in class Graphics2D
public abstract Paint getPaint()
getPaint
in class Graphics2D
public abstract Object getRenderingHint(RenderingHints.Key inteKey)
getRenderingHint
in class Graphics2D
public abstract RenderingHints getRenderingHints()
getRenderingHints
in class Graphics2D
public abstract Stroke getStroke()
getStroke
in class Graphics2D
public abstract AffineTransform getTransform()
getTransform
in class Graphics2D
public abstract boolean hit(Rectangle rect, Shape s, boolean onStroke)
hit
in class Graphics2D
public abstract void rotate(double theta)
rotate
in class Graphics2D
public abstract void rotate(double theta, double x, double y)
rotate
in class Graphics2D
public abstract void scale(double sx, double sy)
scale
in class Graphics2D
public abstract void setBackground(Color color)
setBackground
in class Graphics2D
public abstract void setComposite(Composite comp)
setComposite
in class Graphics2D
public abstract void setPaint(Paint paint)
setPaint
in class Graphics2D
public abstract void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
setRenderingHint
in class Graphics2D
public abstract void setRenderingHints(Map<?,?> hints)
setRenderingHints
in class Graphics2D
public abstract void setStroke(Stroke s)
setStroke
in class Graphics2D
public abstract void setTransform(AffineTransform xform)
setTransform
in class Graphics2D
public abstract void shear(double shx, double shy)
shear
in class Graphics2D
public abstract void transform(AffineTransform xform)
transform
in class Graphics2D
public abstract void translate(double tx, double ty)
translate
in class Graphics2D
public abstract void clearRect(double x, double y, double width, double height)
public abstract void clipRect(double x, double y, double width, double height)
public abstract Graphics create(double x, double y, double width, double height)
public abstract void drawArc(double x, double y, double width, double height, double startAngle, double arcAngle)
public abstract void drawLine(double x1, double y1, double x2, double y2)
public abstract void drawOval(double x, double y, double width, double height)
public abstract void drawPolygon(double[] xPoints, double[] yPoints, int nPoints)
public abstract void drawPolyline(double[] xPoints, double[] yPoints, int nPoints)
public abstract void drawRect(double x, double y, double width, double height)
public abstract void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
public abstract void drawSymbol(int x, int y, int size, int symbol)
public abstract void drawSymbol(double x, double y, double size, int symbol)
public abstract void fillSymbol(int x, int y, int size, int symbol)
public abstract void fillSymbol(double x, double y, double size, int symbol)
public abstract void fillAndDrawSymbol(int x, int y, int size, int symbol, Color fillColor)
public abstract void fillAndDrawSymbol(double x, double y, double size, int symbol, Color fillColor)
public abstract void drawString(String str, double x, double y)
public abstract void drawString(TagString str, double x, double y)
public abstract void drawString(String str, double x, double y, int horizontal, int vertical)
public abstract void drawString(TagString str, double x, double y, int horizontal, int vertical)
public abstract void drawString(String str, double x, double y, int horizontal, int vertical, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor)
str
- text to be drawnx
- coordinate to draw stringy
- coordinate to draw stringhorizontal
- alignment of the textvertical
- alignment of the textframed
- true if text is surrounded by a frameframeColor
- color of the frameframeWidth
- witdh of the framebanner
- true if the frame is filled by a bannerbannerColor
- color of the bannerpublic abstract void drawString(TagString str, double x, double y, int horizontal, int vertical, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor)
str
- Tagged text to be drawnx
- coordinate to draw stringy
- coordinate to draw stringhorizontal
- alignment of the textvertical
- alignment of the textframed
- true if text is surrounded by a frameframeColor
- color of the frameframeWidth
- witdh of the framebanner
- true if the frame is filled by a bannerbannerColor
- color of the bannerpublic abstract void endExport()
public abstract void fillArc(double x, double y, double width, double height, double startAngle, double arcAngle)
public abstract void fillOval(double x, double y, double width, double height)
public abstract void fillPolygon(double[] xPoints, double[] yPoints, int nPoints)
public abstract void fillRect(double x, double y, double width, double height)
public abstract void fillRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
public abstract int getColorMode()
public abstract String getCreator()
public abstract boolean isDeviceIndependent()
public abstract void printComment(String comment)
public abstract void setClip(double x, double y, double width, double height)
public abstract void setColorMode(int colorMode)
public abstract void setCreator(String creator)
public abstract void setDeviceIndependent(boolean isDeviceIndependent)
public abstract void setLineWidth(int width)
public abstract void setLineWidth(double width)
public abstract void startExport()
public static VectorGraphics create(Graphics g)
public static int getTextAlignment(String name)
public static int getSymbol(String name)
public static double getYalignment(double y, double ascent, double descent, int alignment)
public static double getXalignment(double x, double width, int alignment)
Copyright © 2014. All rights reserved.