public class JAVAGraphics2D extends VectorGraphics implements org.freehep.util.io.LineNumberWriter.LineNumberListener
Modifier and Type | Field and Description |
---|---|
static String |
COMPLETE_IMAGE_PATHS
if set to true image in the resulting .java file
are referenced by complete path of creation,
default false
|
static String |
EMBED_IMAGES
if set to true images are stored as byte[] inside the .java file,
default false.
|
static String |
PACKAGE_NAME |
static String |
version |
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 |
---|---|
|
JAVAGraphics2D(File file,
Component component) |
|
JAVAGraphics2D(File file,
Dimension size) |
protected |
JAVAGraphics2D(JAVAGraphics2D graphics) |
|
JAVAGraphics2D(OutputStream os,
Component component) |
|
JAVAGraphics2D(OutputStream os,
Dimension size) |
Modifier and Type | Method and Description |
---|---|
void |
addRenderingHints(Map<?,?> hints) |
void |
clearRect(double x,
double y,
double width,
double height) |
void |
clearRect(int x,
int y,
int width,
int height) |
void |
clip(Shape s) |
void |
clipRect(double x,
double y,
double width,
double height) |
void |
clipRect(int x,
int y,
int width,
int height) |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy) |
Graphics |
create() |
Graphics |
create(double x,
double y,
double width,
double height) |
Graphics |
create(int x,
int y,
int width,
int height) |
void |
dispose() |
void |
draw(Shape s) |
void |
draw3DRect(int x,
int y,
int width,
int height,
boolean raised) |
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 |
drawBytes(byte[] data,
int offset,
int length,
int x,
int y) |
void |
drawChars(char[] data,
int offset,
int length,
int x,
int y) |
void |
drawGlyphVector(GlyphVector g,
float x,
float y) |
void |
drawImage(BufferedImage img,
BufferedImageOp op,
int x,
int y) |
boolean |
drawImage(Image img,
AffineTransform xform,
ImageObserver obs) |
boolean |
drawImage(Image image,
int x,
int y,
Color bgColor,
ImageObserver observer) |
boolean |
drawImage(Image image,
int x,
int y,
ImageObserver observer) |
boolean |
drawImage(Image image,
int x,
int y,
int width,
int height,
Color bgColor,
ImageObserver observer) |
boolean |
drawImage(Image image,
int x,
int y,
int width,
int height,
ImageObserver observer) |
boolean |
drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgColor,
ImageObserver observer) |
boolean |
drawImage(Image image,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer) |
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 |
drawPolygon(Polygon p) |
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 |
drawRenderableImage(RenderableImage img,
AffineTransform xform) |
void |
drawRenderedImage(RenderedImage img,
AffineTransform xform) |
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,
float x,
float y)
Creates an Java-output using an AttributedString.
|
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y) |
void |
drawString(String str,
double x,
double y)
Draws a string.
|
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 a string with a lot of parameters.
|
void |
drawString(String str,
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 a TagString with a lot of parameters.
|
void |
drawSymbol(double x,
double y,
double size,
int symbol) |
void |
drawSymbol(int x,
int y,
int size,
int symbol) |
void |
endExport() |
void |
fill(Shape s) |
void |
fill3DRect(int x,
int y,
int width,
int height,
boolean raised) |
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 |
fillPolygon(Polygon p) |
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) |
void |
finalize() |
Color |
getBackground() |
Shape |
getClip() |
Rectangle |
getClipBounds() |
Rectangle |
getClipBounds(Rectangle r) |
Color |
getColor()
Deprecated.
probably forwards to getClipBounds()
|
int |
getColorMode() |
Composite |
getComposite() |
String |
getCreator() |
static Properties |
getDefaultProperties() |
GraphicsConfiguration |
getDeviceConfiguration() |
Font |
getFont() |
FontMetrics |
getFontMetrics() |
FontMetrics |
getFontMetrics(Font font)
Deprecated.
|
FontRenderContext |
getFontRenderContext() |
Paint |
getPaint() |
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) |
Object |
getRenderingHint(RenderingHints.Key key) |
RenderingHints |
getRenderingHints() |
Stroke |
getStroke() |
AffineTransform |
getTransform() |
boolean |
hit(Rectangle rect,
Shape s,
boolean onStroke) |
boolean |
hitClip(int x,
int y,
int width,
int height) |
protected void |
initProperties(Properties defaults) |
boolean |
isDeviceIndependent() |
boolean |
isProperty(String key) |
void |
lineNumberReached(org.freehep.util.io.LineNumberWriter.LineNumberEvent event) |
void |
printComment(String comment) |
void |
rotate(double theta) |
void |
rotate(double theta,
double x,
double y) |
void |
scale(double sx,
double sy) |
void |
setBackground(Color c) |
void |
setClip(double x,
double y,
double width,
double height) |
void |
setClip(int x,
int y,
int width,
int height) |
void |
setClip(Shape clip) |
void |
setColor(Color c) |
void |
setColorMode(int colorMode) |
void |
setComposite(Composite c) |
void |
setCreator(String creator) |
static void |
setDefaultProperties(Properties newProperties) |
void |
setDeviceIndependent(boolean isDeviceIndependent) |
void |
setFont(Font font) |
void |
setLineWidth(double width) |
void |
setLineWidth(int width) |
void |
setPaint(Paint p) |
void |
setPaintMode() |
void |
setProperties(Properties newProperties) |
void |
setRenderingHint(RenderingHints.Key hintKey,
Object hintValue) |
void |
setRenderingHints(Map<?,?> hints) |
void |
setStroke(Stroke s) |
void |
setTransform(AffineTransform xform) |
void |
setXORMode(Color c1) |
void |
shear(double shx,
double shy) |
void |
startExport() |
String |
toString() |
void |
transform(AffineTransform xform) |
void |
translate(double tx,
double ty) |
void |
translate(int x,
int y) |
create, fill, getSymbol, getTextAlignment, getXalignment, getYalignment
getClipRect
public static final String PACKAGE_NAME
public static final String COMPLETE_IMAGE_PATHS
public static final String EMBED_IMAGES
public static final String version
public JAVAGraphics2D(File file, Dimension size) throws FileNotFoundException
FileNotFoundException
public JAVAGraphics2D(File file, Component component) throws FileNotFoundException
FileNotFoundException
public JAVAGraphics2D(OutputStream os, Dimension size)
public JAVAGraphics2D(OutputStream os, Component component)
protected JAVAGraphics2D(JAVAGraphics2D graphics)
public static Properties getDefaultProperties()
public static void setDefaultProperties(Properties newProperties)
public void setProperties(Properties newProperties)
setProperties
in class VectorGraphics
protected void initProperties(Properties defaults)
initProperties
in class VectorGraphics
public Properties getProperties()
getProperties
in class VectorGraphics
public String getProperty(String key)
getProperty
in class VectorGraphics
public Color getPropertyColor(String key)
getPropertyColor
in class VectorGraphics
public Rectangle getPropertyRectangle(String key)
getPropertyRectangle
in class VectorGraphics
public Dimension getPropertyDimension(String key)
getPropertyDimension
in class VectorGraphics
public int getPropertyInt(String key)
getPropertyInt
in class VectorGraphics
public double getPropertyDouble(String key)
getPropertyDouble
in class VectorGraphics
public boolean isProperty(String key)
isProperty
in class VectorGraphics
public void clearRect(int x, int y, int width, int height)
clearRect
in class VectorGraphics
public void clipRect(int x, int y, int width, int height)
clipRect
in class VectorGraphics
public void copyArea(int x, int y, int width, int height, int dx, int dy)
copyArea
in class VectorGraphics
public Graphics create()
create
in class VectorGraphics
public Graphics create(int x, int y, int width, int height)
create
in class VectorGraphics
public Graphics create(double x, double y, double width, double height)
create
in class VectorGraphics
public void dispose()
dispose
in class VectorGraphics
public void draw3DRect(int x, int y, int width, int height, boolean raised)
draw3DRect
in class Graphics2D
public void fill3DRect(int x, int y, int width, int height, boolean raised)
fill3DRect
in class Graphics2D
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
drawArc
in class VectorGraphics
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
fillArc
in class VectorGraphics
public void drawBytes(byte[] data, int offset, int length, int x, int y)
public void drawChars(char[] data, int offset, int length, int x, int y)
public boolean drawImage(Image image, int x, int y, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image image, int x, int y, int width, int height, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image image, int x, int y, Color bgColor, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image image, int x, int y, int width, int height, Color bgColor, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
drawImage
in class VectorGraphics
public boolean drawImage(Image image, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgColor, ImageObserver observer)
drawImage
in class VectorGraphics
public void drawLine(int x1, int y1, int x2, int y2)
drawLine
in class VectorGraphics
public void drawOval(int x, int y, int width, int height)
drawOval
in class VectorGraphics
public void fillOval(int x, int y, int width, int height)
fillOval
in class VectorGraphics
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
drawPolygon
in class VectorGraphics
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
fillPolygon
in class VectorGraphics
public void drawPolygon(Polygon p)
drawPolygon
in class Graphics
public void fillPolygon(Polygon p)
fillPolygon
in class Graphics
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
drawPolyline
in class VectorGraphics
public void drawRect(int x, int y, int width, int height)
drawRect
in class VectorGraphics
public void fillRect(int x, int y, int width, int height)
fillRect
in class VectorGraphics
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
drawRoundRect
in class VectorGraphics
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
fillRoundRect
in class VectorGraphics
public void drawString(AttributedCharacterIterator iterator, int x, int y)
drawString
in class VectorGraphics
public void drawString(String str, int x, int y)
drawString
in class VectorGraphics
public Shape getClip()
getClip
in class VectorGraphics
public Rectangle getClipBounds()
getClipBounds
in class VectorGraphics
public Rectangle getClipBounds(Rectangle r)
getClipBounds
in class VectorGraphics
public Color getColor()
getColor
in class VectorGraphics
public Font getFont()
getFont
in class VectorGraphics
public FontMetrics getFontMetrics()
getFontMetrics
in class Graphics
public FontMetrics getFontMetrics(Font font)
getFontMetrics
in class VectorGraphics
font
- public boolean hitClip(int x, int y, int width, int height)
public void setClip(int x, int y, int width, int height)
setClip
in class VectorGraphics
public void setClip(Shape clip)
setClip
in class VectorGraphics
public void setColor(Color c)
setColor
in class VectorGraphics
public void setFont(Font font)
setFont
in class VectorGraphics
public void setPaintMode()
setPaintMode
in class VectorGraphics
public void setXORMode(Color c1)
setXORMode
in class VectorGraphics
public String toString()
toString
in class VectorGraphics
public void translate(int x, int y)
translate
in class VectorGraphics
public void addRenderingHints(Map<?,?> hints)
addRenderingHints
in class VectorGraphics
public void clip(Shape s)
clip
in class VectorGraphics
public void draw(Shape s)
draw
in class VectorGraphics
public void drawGlyphVector(GlyphVector g, float x, float y)
drawGlyphVector
in class VectorGraphics
public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
drawImage
in class VectorGraphics
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
drawImage
in class VectorGraphics
public void drawRenderableImage(RenderableImage img, AffineTransform xform)
drawRenderableImage
in class VectorGraphics
public void drawRenderedImage(RenderedImage img, AffineTransform xform)
drawRenderedImage
in class VectorGraphics
public void drawString(AttributedCharacterIterator iterator, float x, float y)
drawString
in class VectorGraphics
iterator
- String with TextAttributesx
- x-position for drawingy
- y-position for drawingpublic void drawString(String str, float x, float y)
drawString
in class VectorGraphics
public void fill(Shape s)
fill
in class VectorGraphics
public Color getBackground()
getBackground
in class VectorGraphics
public Composite getComposite()
getComposite
in class VectorGraphics
public GraphicsConfiguration getDeviceConfiguration()
getDeviceConfiguration
in class VectorGraphics
public FontRenderContext getFontRenderContext()
getFontRenderContext
in class VectorGraphics
public Paint getPaint()
getPaint
in class VectorGraphics
public Object getRenderingHint(RenderingHints.Key key)
getRenderingHint
in class VectorGraphics
public RenderingHints getRenderingHints()
getRenderingHints
in class VectorGraphics
public Stroke getStroke()
getStroke
in class VectorGraphics
public AffineTransform getTransform()
getTransform
in class VectorGraphics
public boolean hit(Rectangle rect, Shape s, boolean onStroke)
hit
in class VectorGraphics
public void rotate(double theta)
rotate
in class VectorGraphics
public void rotate(double theta, double x, double y)
rotate
in class VectorGraphics
public void scale(double sx, double sy)
scale
in class VectorGraphics
public void setBackground(Color c)
setBackground
in class VectorGraphics
public void setComposite(Composite c)
setComposite
in class VectorGraphics
public void setPaint(Paint p)
setPaint
in class VectorGraphics
public void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
setRenderingHint
in class VectorGraphics
public void setRenderingHints(Map<?,?> hints)
setRenderingHints
in class VectorGraphics
public void setStroke(Stroke s)
setStroke
in class VectorGraphics
public void setTransform(AffineTransform xform)
setTransform
in class VectorGraphics
public void shear(double shx, double shy)
shear
in class VectorGraphics
public void transform(AffineTransform xform)
transform
in class VectorGraphics
public void translate(double tx, double ty)
translate
in class VectorGraphics
public void clearRect(double x, double y, double width, double height)
clearRect
in class VectorGraphics
public void clipRect(double x, double y, double width, double height)
clipRect
in class VectorGraphics
public void drawArc(double x, double y, double width, double height, double startAngle, double arcAngle)
VectorGraphics
drawArc
in class VectorGraphics
public void drawLine(double x1, double y1, double x2, double y2)
VectorGraphics
drawLine
in class VectorGraphics
public void drawOval(double x, double y, double width, double height)
VectorGraphics
drawOval
in class VectorGraphics
public void drawPolygon(double[] xPoints, double[] yPoints, int nPoints)
VectorGraphics
drawPolygon
in class VectorGraphics
public void drawPolyline(double[] xPoints, double[] yPoints, int nPoints)
VectorGraphics
drawPolyline
in class VectorGraphics
public void drawRect(double x, double y, double width, double height)
VectorGraphics
drawRect
in class VectorGraphics
public void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
VectorGraphics
drawRoundRect
in class VectorGraphics
public void drawSymbol(int x, int y, int size, int symbol)
drawSymbol
in class VectorGraphics
public void fillAndDrawSymbol(int x, int y, int size, int symbol, Color fillColor)
fillAndDrawSymbol
in class VectorGraphics
public void drawSymbol(double x, double y, double size, int symbol)
drawSymbol
in class VectorGraphics
public void fillSymbol(int x, int y, int size, int symbol)
fillSymbol
in class VectorGraphics
public void fillSymbol(double x, double y, double size, int symbol)
fillSymbol
in class VectorGraphics
public void fillAndDrawSymbol(double x, double y, double size, int symbol, Color fillColor)
fillAndDrawSymbol
in class VectorGraphics
public void drawString(String str, double x, double y)
VectorGraphics
drawString
in class VectorGraphics
public void drawString(TagString str, double x, double y)
drawString
in class VectorGraphics
public void drawString(String str, double x, double y, int horizontal, int vertical)
drawString
in class VectorGraphics
public void drawString(TagString str, double x, double y, int horizontal, int vertical)
drawString
in class VectorGraphics
public void drawString(String str, double x, double y, int horizontal, int vertical, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor)
VectorGraphics
drawString
in class VectorGraphics
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 void drawString(TagString str, double x, double y, int horizontal, int vertical, boolean framed, Color frameColor, double frameWidth, boolean banner, Color bannerColor)
VectorGraphics
drawString
in class VectorGraphics
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 void fillAndDraw(Shape s, Color fillColor)
fillAndDraw
in class VectorGraphics
public void fillArc(double x, double y, double width, double height, double startAngle, double arcAngle)
VectorGraphics
fillArc
in class VectorGraphics
public void fillOval(double x, double y, double width, double height)
VectorGraphics
fillOval
in class VectorGraphics
public void fillPolygon(double[] xPoints, double[] yPoints, int nPoints)
VectorGraphics
fillPolygon
in class VectorGraphics
public void fillRect(double x, double y, double width, double height)
VectorGraphics
fillRect
in class VectorGraphics
public void fillRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
VectorGraphics
fillRoundRect
in class VectorGraphics
public int getColorMode()
getColorMode
in class VectorGraphics
public String getCreator()
getCreator
in class VectorGraphics
public boolean isDeviceIndependent()
isDeviceIndependent
in class VectorGraphics
public void printComment(String comment)
printComment
in class VectorGraphics
public void setClip(double x, double y, double width, double height)
setClip
in class VectorGraphics
public void setColorMode(int colorMode)
setColorMode
in class VectorGraphics
public void setCreator(String creator)
setCreator
in class VectorGraphics
public void setDeviceIndependent(boolean isDeviceIndependent)
setDeviceIndependent
in class VectorGraphics
public void setLineWidth(int width)
setLineWidth
in class VectorGraphics
public void setLineWidth(double width)
setLineWidth
in class VectorGraphics
public void startExport()
startExport
in class VectorGraphics
public void endExport()
endExport
in class VectorGraphics
public void lineNumberReached(org.freehep.util.io.LineNumberWriter.LineNumberEvent event)
lineNumberReached
in interface org.freehep.util.io.LineNumberWriter.LineNumberListener
Copyright © 2014. All rights reserved.