|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Graphics java.awt.Graphics2D org.freehep.graphics2d.VectorGraphics
The drawing methods which are guaranteed to work for the various output formats of the VectorGraphics system on the Java 2 platform. All methods are re-declared abstract, since this class inherits from Graphics2D and we would not want to actually or accidentally use any of those methods, except for the ones noted. Some int methods need to call their super.methods otherwise the compiler cannot make a distinction if it needs to convert int to doubles or call the super int method. Note that many of these routines modify the current transformation matrix. To guard against unintended side effects the following method should be used:
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.
Field Summary |
Fields inherited from interface org.freehep.graphics2d.VectorGraphicsConstants |
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 Summary | |
VectorGraphics()
|
Method Summary | |
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)
|
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)
|
Methods inherited from class java.awt.Graphics2D |
draw3DRect, fill3DRect |
Methods inherited from class java.awt.Graphics |
drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipRect, getFontMetrics, hitClip |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public VectorGraphics()
Method Detail |
public abstract void setProperties(Properties newProperties)
protected abstract void initProperties(Properties defaults)
protected abstract Properties getProperties()
public abstract String getProperty(String key)
public abstract Color getPropertyColor(String key)
public abstract Rectangle getPropertyRectangle(String key)
public abstract Dimension getPropertyDimension(String key)
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 abstract Graphics create()
public Graphics create(int x, int y, int width, int height)
public abstract void dispose()
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)
public abstract void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
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)
public abstract void drawString(AttributedCharacterIterator iterator, int x, int y)
public abstract void drawString(String str, int x, int y)
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)
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)
public abstract Shape getClip()
public abstract Rectangle getClipBounds()
public abstract Rectangle getClipBounds(Rectangle r)
public abstract Color getColor()
public abstract Font getFont()
public abstract FontMetrics getFontMetrics(Font font)
public abstract void setClip(int x, int y, int width, int height)
public abstract void setClip(Shape clip)
public abstract void setColor(Color c)
public abstract void setFont(Font font)
public abstract void setPaintMode()
public abstract void setXORMode(Color c1)
public abstract String toString()
public abstract void translate(int x, int y)
public abstract void addRenderingHints(Map hints)
public abstract void clip(Shape s)
public abstract void draw(Shape s)
public abstract void drawGlyphVector(GlyphVector g, float x, float y)
public abstract void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
public abstract boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
public abstract void drawRenderableImage(RenderableImage img, AffineTransform xform)
public abstract void drawRenderedImage(RenderedImage img, AffineTransform xform)
public abstract void drawString(AttributedCharacterIterator iterator, float x, float y)
public abstract void drawString(String str, float x, float y)
public abstract void fill(Shape s)
public abstract Color getBackground()
public abstract Composite getComposite()
public abstract GraphicsConfiguration getDeviceConfiguration()
public abstract FontRenderContext getFontRenderContext()
public abstract Paint getPaint()
public abstract Object getRenderingHint(RenderingHints.Key inteKey)
public abstract RenderingHints getRenderingHints()
public abstract Stroke getStroke()
public abstract AffineTransform getTransform()
public abstract boolean hit(Rectangle rect, Shape s, boolean onStroke)
public abstract void rotate(double theta)
public abstract void rotate(double theta, double x, double y)
public abstract void scale(double sx, double sy)
public abstract void setBackground(Color color)
public abstract void setComposite(Composite comp)
public abstract void setPaint(Paint paint)
public abstract void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
public abstract void setRenderingHints(Map hints)
public abstract void setStroke(Stroke s)
public abstract void setTransform(AffineTransform xform)
public abstract void shear(double shx, double shy)
public abstract void transform(AffineTransform xform)
public abstract void translate(double tx, double ty)
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 fillAndDraw(Shape s, Color fillColor)
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)
|
FreeHEP API Version current |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |