public abstract class AbstractVectorGraphics extends VectorGraphics
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| Modifier | Constructor and Description |
|---|---|
|
AbstractVectorGraphics() |
protected |
AbstractVectorGraphics(AbstractVectorGraphics graphics) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearRect(int x,
int y,
int width,
int height) |
protected abstract Shape |
createShape(double[] xPoints,
double[] yPoints,
int nPoints,
boolean close)
Creates a polyline/polygon shape from a set of points.
|
protected Shape |
createShape(int[] xPoints,
int[] yPoints,
int nPoints,
boolean close,
boolean biased)
Creates a polyline/polygon shape from a set of points.
|
void |
drawArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
Draws an arc.
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) |
void |
drawLine(double x1,
double y1,
double x2,
double y2)
Draws a straight line.
|
void |
drawLine(int x1,
int y1,
int x2,
int y2) |
void |
drawOval(double x,
double y,
double width,
double height)
Draws an oval.
|
void |
drawOval(int x,
int y,
int width,
int height) |
void |
drawPolygon(double[] xPoints,
double[] yPoints,
int nPoints)
Draws a polygon.
|
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
drawPolyline(double[] xPoints,
double[] yPoints,
int nPoints)
Draws a polyline.
|
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
drawRect(double x,
double y,
double width,
double height)
Draws a rectangle.
|
void |
drawRect(int x,
int y,
int width,
int height) |
void |
drawRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
Draws a rounded rectangle.
|
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight) |
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y) |
void |
drawString(String str,
double x,
double y,
int horizontal,
int vertical) |
void |
drawString(String str,
double x,
double y,
int horizontal,
int vertical,
boolean framed,
Color frameColor,
double frameWidth,
boolean banner,
Color bannerColor)
Draws frame, banner and aligned text inside
|
void |
drawString(String s,
float x,
float y) |
void |
drawString(String str,
int x,
int y) |
void |
drawString(TagString str,
double x,
double y) |
void |
drawString(TagString str,
double x,
double y,
int horizontal,
int vertical) |
void |
drawString(TagString str,
double x,
double y,
int horizontal,
int vertical,
boolean framed,
Color frameColor,
double frameWidth,
boolean banner,
Color bannerColor)
Draws the tagged string parsed by a
TagHandler and adds a
border specified by the parameters |
void |
drawSymbol(double x,
double y,
double size,
int symbol) |
void |
drawSymbol(int x,
int y,
int size,
int symbol) |
protected void |
drawSymbol(VectorGraphics g,
double x,
double y,
double size,
int symbol) |
void |
fillAndDraw(Shape s,
Color fillColor) |
void |
fillAndDrawSymbol(double x,
double y,
double size,
int symbol,
Color fillColor) |
void |
fillAndDrawSymbol(int x,
int y,
int size,
int symbol,
Color fillColor) |
void |
fillArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
Fills an arc.
|
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle) |
void |
fillOval(double x,
double y,
double width,
double height)
Fills an oval.
|
void |
fillOval(int x,
int y,
int width,
int height) |
void |
fillPolygon(double[] xPoints,
double[] yPoints,
int nPoints)
Fills a polygon.
|
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints) |
void |
fillRect(double x,
double y,
double width,
double height)
Fills a rectangle.
|
void |
fillRect(int x,
int y,
int width,
int height) |
void |
fillRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
Fills a rounded rectangle.
|
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight) |
void |
fillSymbol(double x,
double y,
double size,
int symbol) |
void |
fillSymbol(int x,
int y,
int size,
int symbol) |
protected void |
fillSymbol(VectorGraphics g,
double x,
double y,
double size,
int symbol) |
Color |
getBackground()
Gets the background color.
|
Color |
getColor()
Gets the current color.
|
int |
getColorMode() |
String |
getCreator() |
Font |
getFont()
Gets the current font.
|
Paint |
getPaint()
Gets the current paint.
|
protected Color |
getPrintColor(Color color)
Returns a printColor created from the original printColor, based on the
ColorMode.
|
protected Properties |
getProperties() |
String |
getProperty(String key) |
Color |
getPropertyColor(String key) |
Dimension |
getPropertyDimension(String key) |
double |
getPropertyDouble(String key) |
Insets |
getPropertyInsets(String key) |
int |
getPropertyInt(String key) |
Rectangle |
getPropertyRectangle(String key) |
boolean |
hit(Rectangle rect,
Shape s,
boolean onStroke)
Checks whether or not the specified
Shape intersects
the specified Rectangle, which is in device
space. |
protected void |
initProperties(Properties defaults) |
boolean |
isDeviceIndependent() |
boolean |
isProperty(String key) |
void |
rotate(double theta,
double x,
double y) |
void |
setBackground(Color color)
Sets the background color.
|
void |
setColor(Color color)
Sets the current color and the current paint.
|
void |
setColorMode(int colorMode) |
void |
setCreator(String creator) |
void |
setDeviceIndependent(boolean isDeviceIndependent) |
void |
setFont(Font font)
Sets the current font.
|
void |
setLineWidth(double width) |
void |
setLineWidth(int width) |
void |
setPaint(Paint paint)
Sets the current paint.
|
void |
setProperties(Properties newProperties) |
void |
translate(int x,
int y) |
addRenderingHints, clearRect, clip, clipRect, clipRect, copyArea, create, create, create, create, dispose, draw, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawRenderableImage, drawRenderedImage, drawString, drawString, endExport, fill, fill, getClip, getClipBounds, getClipBounds, getComposite, getDeviceConfiguration, getFontMetrics, getFontRenderContext, getRenderingHint, getRenderingHints, getStroke, getSymbol, getTextAlignment, getTransform, getXalignment, getYalignment, printComment, rotate, scale, setClip, setClip, setClip, setComposite, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, setXORMode, shear, startExport, toString, transform, translatedraw3DRect, fill3DRectdrawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipRect, getFontMetrics, hitClippublic AbstractVectorGraphics()
protected AbstractVectorGraphics(AbstractVectorGraphics graphics)
public void setProperties(Properties newProperties)
setProperties in class VectorGraphicsprotected void initProperties(Properties defaults)
initProperties in class VectorGraphicsprotected Properties getProperties()
getProperties in class VectorGraphicspublic String getProperty(String key)
getProperty in class VectorGraphicspublic Color getPropertyColor(String key)
getPropertyColor in class VectorGraphicspublic Rectangle getPropertyRectangle(String key)
getPropertyRectangle in class VectorGraphicspublic Dimension getPropertyDimension(String key)
getPropertyDimension in class VectorGraphicspublic int getPropertyInt(String key)
getPropertyInt in class VectorGraphicspublic double getPropertyDouble(String key)
getPropertyDouble in class VectorGraphicspublic boolean isProperty(String key)
isProperty in class VectorGraphicspublic String getCreator()
getCreator in class VectorGraphicspublic void setCreator(String creator)
setCreator in class VectorGraphicspublic boolean isDeviceIndependent()
isDeviceIndependent in class VectorGraphicspublic void setDeviceIndependent(boolean isDeviceIndependent)
setDeviceIndependent in class VectorGraphicspublic Font getFont()
getFont in class VectorGraphicspublic void setFont(Font font)
setFont in class VectorGraphicsfont - to be setpublic void drawSymbol(int x,
int y,
int size,
int symbol)
drawSymbol in class VectorGraphicspublic void fillSymbol(int x,
int y,
int size,
int symbol)
fillSymbol in class VectorGraphicspublic void fillAndDrawSymbol(int x,
int y,
int size,
int symbol,
Color fillColor)
fillAndDrawSymbol in class VectorGraphicspublic void drawSymbol(double x,
double y,
double size,
int symbol)
drawSymbol in class VectorGraphicsprotected void drawSymbol(VectorGraphics g, double x, double y, double size, int symbol)
public void fillSymbol(double x,
double y,
double size,
int symbol)
fillSymbol in class VectorGraphicsprotected void fillSymbol(VectorGraphics g, double x, double y, double size, int symbol)
public void fillAndDrawSymbol(double x,
double y,
double size,
int symbol,
Color fillColor)
fillAndDrawSymbol in class VectorGraphicspublic void fillAndDraw(Shape s, Color fillColor)
fillAndDraw in class VectorGraphicspublic void clearRect(int x,
int y,
int width,
int height)
clearRect in class VectorGraphicspublic void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in class VectorGraphicspublic void drawRect(int x,
int y,
int width,
int height)
drawRect in class VectorGraphicspublic void fillRect(int x,
int y,
int width,
int height)
fillRect in class VectorGraphicspublic void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
drawArc in class VectorGraphicspublic void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
fillArc in class VectorGraphicspublic void drawOval(int x,
int y,
int width,
int height)
drawOval in class VectorGraphicspublic void fillOval(int x,
int y,
int width,
int height)
fillOval in class VectorGraphicspublic void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
drawRoundRect in class VectorGraphicspublic void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
fillRoundRect in class VectorGraphicspublic void translate(int x,
int y)
translate in class VectorGraphicspublic void setLineWidth(int width)
setLineWidth in class VectorGraphicspublic void setLineWidth(double width)
setLineWidth in class VectorGraphicspublic void drawString(String str, int x, int y)
drawString in class VectorGraphicspublic void drawString(String s, float x, float y)
drawString in class VectorGraphicspublic void drawString(AttributedCharacterIterator iterator, int x, int y)
drawString in class VectorGraphicspublic void drawString(String str, double x, double y, int horizontal, int vertical, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor)
drawString in class VectorGraphicsstr - 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 void drawString(TagString str, double x, double y, int horizontal, int vertical, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor)
TagHandler and adds a
border specified by the parametersdrawString in class VectorGraphicsstr - 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 void drawString(String str, double x, double y, int horizontal, int vertical)
drawString in class VectorGraphicspublic void drawString(TagString str, double x, double y)
drawString in class VectorGraphicspublic void drawString(TagString str, double x, double y, int horizontal, int vertical)
drawString in class VectorGraphicspublic int getColorMode()
getColorMode in class VectorGraphicspublic void setColorMode(int colorMode)
setColorMode in class VectorGraphicspublic Color getBackground()
getBackground in class VectorGraphicspublic void setBackground(Color color)
setBackground in class VectorGraphicscolor - background color to be setpublic void setColor(Color color)
setColor in class VectorGraphicscolor - to be setpublic Color getColor()
getColor in class VectorGraphicspublic void setPaint(Paint paint)
setPaint in class VectorGraphicspaint - to be setpublic Paint getPaint()
getPaint in class VectorGraphicsprotected Color getPrintColor(Color color)
public void rotate(double theta,
double x,
double y)
rotate in class VectorGraphicspublic void drawArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
VectorGraphicsdrawArc in class VectorGraphicspublic void drawLine(double x1,
double y1,
double x2,
double y2)
VectorGraphicsdrawLine in class VectorGraphicspublic void drawOval(double x,
double y,
double width,
double height)
VectorGraphicsdrawOval in class VectorGraphicspublic void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolyline in class VectorGraphicspublic void drawPolyline(double[] xPoints,
double[] yPoints,
int nPoints)
VectorGraphicsdrawPolyline in class VectorGraphicspublic void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolygon in class VectorGraphicspublic void drawPolygon(double[] xPoints,
double[] yPoints,
int nPoints)
VectorGraphicsdrawPolygon in class VectorGraphicspublic void drawRect(double x,
double y,
double width,
double height)
VectorGraphicsdrawRect in class VectorGraphicspublic void drawRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
VectorGraphicsdrawRoundRect in class VectorGraphicspublic void fillArc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle)
VectorGraphicsfillArc in class VectorGraphicspublic void fillOval(double x,
double y,
double width,
double height)
VectorGraphicsfillOval in class VectorGraphicspublic void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
fillPolygon in class VectorGraphicspublic void fillPolygon(double[] xPoints,
double[] yPoints,
int nPoints)
VectorGraphicsfillPolygon in class VectorGraphicspublic void fillRect(double x,
double y,
double width,
double height)
VectorGraphicsfillRect in class VectorGraphicspublic void fillRoundRect(double x,
double y,
double width,
double height,
double arcWidth,
double arcHeight)
VectorGraphicsfillRoundRect in class VectorGraphicsprotected abstract Shape createShape(double[] xPoints, double[] yPoints, int nPoints, boolean close)
xPoints - X coordinates of the polyline.yPoints - Y coordinates of the polyline.nPoints - number of points of the polyline.close - is shape closedprotected Shape createShape(int[] xPoints, int[] yPoints, int nPoints, boolean close, boolean biased)
xPoints - X coordinates of the polyline.yPoints - Y coordinates of the polyline.nPoints - number of points of the polyline.close - is shape closedpublic boolean hit(Rectangle rect, Shape s, boolean onStroke)
Shape intersects
the specified Rectangle, which is in device
space.hit in class VectorGraphicsrect - the area in device space to check for a hits - the Shape to check for a hitonStroke - flag used to choose between testing the stroked or the filled shape.Graphics2D.hit(Rectangle, Shape, boolean)Copyright © 2014. All rights reserved.