|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Graphics
java.awt.Graphics2D
com.davisor.graphics.AnnotatedGraphics2D
AnnotatedGraphics2D adds selected rendering operation
logging to abritary java.awt.Graphics2D
instances. This is usefull when graphics needs to be rendered on
several different targets simultaneously. A typical example would
be an image map assosiated with an image: the image holds the
actual rendering result, while the image map defines one or more
hotspot areas on that image.
AnnotatedGraphics2D delegates rendering calls to an
underlying member Graphics2D object which is expected
to carry out the actual rendering. In addition to rendering call
delegation, AnnotatedGraphics2D also records selected
rendering shapes calls for later inspection. Recorded shapes can
later be accessed with the getAnnotatedShapes() method.
The member Graphics2D object is typically expected to
be an "ordinary" Graphics2D object that renders
graphics to an image buffer or screen. It can however be also
another special Graphics2D object, even another
instance of AnnotatedGraphics2D.
The selection mechanism that chooses which method calls are
recorder and which are not uses the current Paint
value to make the call. In particular, all graphics rendering
operations that would paint something with a paint instance that
implement the AnnotatedPaint interface are
recorded. The current paint is controlled with the standard
setPaint(Paint) method.
The recorded shapes are made serializable so that the list returned
by getAnnotatedShapes() can be serialized, too. Shape
serialization is implemented by storing the shapes as IndirectAnnotatedSerializableShape objects.
For a thorough description of Graphics2D rendering
methods, please refer to standard Java AWT documentation.
getAnnotatedShapes(),
AnnotatedPaint,
BetterPath| Field Summary | |
static int |
ANNOTATION
Index for annotation (2). |
protected java.awt.Graphics2D |
M_g
Graphics context for which all drawing operations are delegated. |
protected java.util.LinkedList |
M_log
Shapes drawn with annotated data. |
static int |
SHAPE
Index for shapes (0). |
static int |
SHAPEOBJECTS
Number of elements in each object created with annotated paint (3). |
static int |
TRANSFORM
Index for transform (1). |
| Constructor Summary | |
AnnotatedGraphics2D(java.awt.Graphics2D g)
Constructs a new AnnotatedGraphics2D object. |
|
| Method Summary | |
void |
addRenderingHints(java.util.Map hints)
Sets the values of an arbitrary number of preferences for the rendering algorithms. |
void |
clearRect(int x,
int y,
int width,
int height)
Clears the specified rectangle by filling it with the background color of the current drawing surface. |
void |
clip(java.awt.Shape s)
Intersects the current Clip with the interior of the
specified Shape and sets the Clip to the
resulting intersection. |
void |
clipRect(int x,
int y,
int width,
int height)
Intersects the current clip with the specified rectangle. |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
Copies an area of the component by a distance specified by dx and dy. |
java.awt.Graphics |
create()
Creates a new Graphics object based on this Graphics object, but with a new translation and clip area. |
void |
dispose()
Disposes of this graphic's context and releases any system resources that it is using. |
void |
draw(java.awt.Shape s)
Strokes the outline of a Shape using the settings of
the current Graphics2D context.
|
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Draws the outline of a circular or elliptical arc covering the specified rectangle. |
void |
drawGlyphVector(java.awt.font.GlyphVector g,
float x,
float y)
Renders the text of the specified GlyphVector using the
Graphics2D context's rendering attributes.
|
void |
drawImage(java.awt.image.BufferedImage img,
java.awt.image.BufferedImageOp op,
int x,
int y)
Renders a BufferedImage that is filtered with a
BufferedImageOp.
|
boolean |
drawImage(java.awt.Image img,
java.awt.geom.AffineTransform xform,
java.awt.image.ImageObserver obs)
Renders an image, applying a transform from image space to user space before drawing. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.Color bgcolor,
java.awt.image.ImageObserver observer)
Draws as much of the specified image as is currently available. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.image.ImageObserver observer)
Draws as much of the specified image as is currently available. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int width,
int height,
java.awt.Color bgcolor,
java.awt.image.ImageObserver observer)
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int width,
int height,
java.awt.image.ImageObserver observer)
Draws as much of the specified image as has already been scaled to fit inside the specified rectangle. |
boolean |
drawImage(java.awt.Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
java.awt.Color bgcolor,
java.awt.image.ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination's drawable surface. |
boolean |
drawImage(java.awt.Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
java.awt.image.ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination's drawable surface. |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line, using the current color, between the points (x1, y1) and (x2, y2) in this graphic's context's coordinate system. |
void |
drawOval(int x,
int y,
int width,
int height)
Draws the outline of an oval. |
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
Draws a closed polygon defined by arrays of x and y coordinates. |
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
Draws a sequence of connected lines defined by arrays of x and y coordinates. |
void |
drawRenderableImage(java.awt.image.renderable.RenderableImage img,
java.awt.geom.AffineTransform xform)
Renders a RenderableImage, applying a transform from
image space to user space before drawing.
|
void |
drawRenderedImage(java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform)
Renders a RenderedImage, applying a transform from image
space to user space before drawing.
|
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draws an outlined round-cornered rectangle using this graphics context's current color. |
void |
drawString(java.text.AttributedCharacterIterator iterator,
float x,
float y)
Renders the text of the specified iterator, using the Graphics2D context's current Paint.
|
void |
drawString(java.text.AttributedCharacterIterator iterator,
int x,
int y)
Renders the text of the specified iterator, using the Graphics2D context's current Paint.
|
void |
drawString(java.lang.String str,
float x,
float y)
Renders the text specified by the specified String,
using the current Font and Paint
attributes in the Graphics2D context.
|
void |
drawString(java.lang.String str,
int x,
int y)
Renders the text of the specified String, using the
current Font and Paint attributes in
the Graphics2D context.
|
void |
fill(java.awt.Shape s)
Fills the interior of a Shape using the settings of
the Graphics2D context.
|
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
Fills a circular or elliptical arc covering the specified rectangle. |
void |
fillOval(int x,
int y,
int width,
int height)
Fills an oval bounded by the specified rectangle with the current color. |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
Fills a closed polygon defined by arrays of x and y coordinates. |
void |
fillRect(int x,
int y,
int width,
int height)
Fills the specified rectangle. |
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Fills the specified rounded corner rectangle with the current color. |
java.util.List |
getAnnotatedShapes()
Gets the current list of recorded annotated shapes. |
java.awt.Color |
getBackground()
Returns the background color used for clearing a region. |
java.awt.Shape |
getClip()
Gets the current clipping area. |
java.awt.Rectangle |
getClipBounds()
Returns the bounding rectangle of the current clipping area. |
java.awt.Color |
getColor()
Gets this graphic's context's current color. |
java.awt.Composite |
getComposite()
Returns the current Composite in the
Graphics2D context. |
java.awt.GraphicsConfiguration |
getDeviceConfiguration()
Returns the device configuration associated with this Graphics2D. |
java.awt.Font |
getFont()
Gets the current font. |
java.awt.FontMetrics |
getFontMetrics(java.awt.Font font)
Gets the font metrics for the specified font. |
java.awt.font.FontRenderContext |
getFontRenderContext()
Get the rendering context of the Font within this
Graphics2D context. |
java.awt.Paint |
getPaint()
Returns the current Paint of the
Graphics2D context. |
java.lang.Object |
getRenderingHint(java.awt.RenderingHints.Key hintKey)
Returns the value of a single preference for the rendering algorithms. |
java.awt.RenderingHints |
getRenderingHints()
Gets the preferences for the rendering algorithms. |
java.awt.Stroke |
getStroke()
Returns the current Stroke in the
Graphics2D context. |
java.awt.geom.AffineTransform |
getTransform()
Returns a copy of the current Transform in the
Graphics2D context. |
boolean |
hit(java.awt.Rectangle rect,
java.awt.Shape s,
boolean onStroke)
Checks whether or not the specified Shape intersects
with the specified Rectangle, which is in the device
space. |
protected void |
record(java.awt.Shape s,
com.davisor.core.Annotated a)
Records given shape with given annotation information. |
protected void |
record(java.awt.Shape s,
com.davisor.core.Annotated a,
float x,
float y)
Translates and records given shape. |
protected void |
record(java.awt.Shape s,
com.davisor.core.Annotated a,
java.awt.Stroke stroke)
Strokes and records given shape. |
protected void |
record(java.lang.String str,
com.davisor.core.Annotated a,
float x,
float y)
Translates and records the bounding box of given string. |
void |
rotate(double theta)
Concatenates the current Graphics2D
Transform with a rotation transform. |
void |
rotate(double theta,
double x,
double y)
Concatenates the current Graphics2D
Transform with a translated rotation transform. |
void |
scale(double sx,
double sy)
Concatenates the current Graphics2D
Transform with a scaling transformation. |
void |
setBackground(java.awt.Color color)
Sets the background color for the Graphics2D context. |
void |
setClip(int x,
int y,
int width,
int height)
Sets the current clip to the rectangle specified by the given coordinates. |
void |
setClip(java.awt.Shape clip)
Sets the current clipping area to an arbitrary clip shape. |
void |
setColor(java.awt.Color color)
Sets this graphic's context's current color to the specified color. |
void |
setComposite(java.awt.Composite comp)
Sets the Composite for the Graphics2D context. |
void |
setFont(java.awt.Font font)
Sets this graphic's context's font to the specified font. |
void |
setPaint(java.awt.Paint paint)
Sets the Paint attribute for the
Graphics2D context. |
void |
setPaintMode()
Sets the paint mode of this graphic's context to overwrite the destination with this graphic's context's current color. |
void |
setRenderingHint(java.awt.RenderingHints.Key hintKey,
java.lang.Object hintValue)
Sets the value of a single preference for the rendering algorithms. |
void |
setRenderingHints(java.util.Map hints)
Replaces the values of all preferences for the rendering algorithms with the specified hints. |
void |
setStroke(java.awt.Stroke s)
Sets the Stroke for the Graphics2D context. |
void |
setTransform(java.awt.geom.AffineTransform Tx)
Sets the Transform in the Graphics2D
context. |
void |
setXORMode(java.awt.Color c1)
Sets the paint mode of this graphic's context to alternate between this graphic's context's current color and the new specified color. |
void |
shear(double shx,
double shy)
Concatenates the current Graphics2D
Transform with a shearing transform. |
void |
transform(java.awt.geom.AffineTransform Tx)
Composes an AffineTransform object with the
Transform in this Graphics2D according
to the rule last-specified-first-applied. |
void |
translate(double tx,
double ty)
Concatenates the current Graphics2D
Transform with a translation transform. |
void |
translate(int x,
int y)
Translates the origin of the Graphics2D context to the
point (x, y) in the current coordinate system. |
| Methods inherited from class java.awt.Graphics2D |
draw3DRect, fill3DRect |
| Methods inherited from class java.awt.Graphics |
create, drawBytes, drawChars, drawPolygon, drawRect, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int SHAPE
public static final int TRANSFORM
public static final int ANNOTATION
public static final int SHAPEOBJECTS
protected java.awt.Graphics2D M_g
protected java.util.LinkedList M_log
| Constructor Detail |
public AnnotatedGraphics2D(java.awt.Graphics2D g)
AnnotatedGraphics2D object.
| Method Detail |
public void clearRect(int x,
int y,
int width,
int height)
The cleared rectangle is not recorded, even if the current
backgroud paint would implement AnnotatedPaint
interface.
public void clipRect(int x,
int y,
int width,
int height)
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
The copied area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
public java.awt.Graphics create()
This method call is delegated directly to the underlying
Graphics2D object. In particular, the returned new
Graphics object will NOT be annotated, at least by this
AnnotatedGraphics2D instance.
public void dispose()
public void drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
The arc is never recorded, since it uses the current
Color, not Paint. To record an arc,
create an arc shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public boolean drawImage(java.awt.Image img,
int x,
int y,
java.awt.Color bgcolor,
java.awt.image.ImageObserver observer)
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
public boolean drawImage(java.awt.Image img,
int x,
int y,
java.awt.image.ImageObserver observer)
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
public boolean drawImage(java.awt.Image img,
int x,
int y,
int width,
int height,
java.awt.Color bgcolor,
java.awt.image.ImageObserver observer)
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
public boolean drawImage(java.awt.Image img,
int x,
int y,
int width,
int height,
java.awt.image.ImageObserver observer)
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
public boolean drawImage(java.awt.Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
java.awt.Color bgcolor,
java.awt.image.ImageObserver observer)
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
public boolean drawImage(java.awt.Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
java.awt.image.ImageObserver observer)
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
public void drawLine(int x1,
int y1,
int x2,
int y2)
The line is never recorded, since it uses the current
Color, not Paint. To record a line,
create a line shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void drawOval(int x,
int y,
int width,
int height)
The oval is never recorded, since it uses the current
Color, not Paint. To record an oval,
create an oval shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
The polygon is never recorded, since it uses the current
Color, not Paint. To record a polygon,
create a polygon shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
The polyline is never recorded, since it uses the current
Color, not Paint. To record a polyline,
create a polyline shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
The rounded rectangle is never recorded, since it uses the
current Color, not Paint. To record a
rounded rectangle, create a rounded rectangle shape, and
draw or fill it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
The arc is never recorded, since it uses the current
Color, not Paint. To record an arc,
create an arc shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void fillOval(int x,
int y,
int width,
int height)
The oval is never recorded, since it uses the current
Color, not Paint. To record an oval,
create an oval shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
The polygon is never recorded, since it uses the current
Color, not Paint. To record a polygon,
create a polygon shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void fillRect(int x,
int y,
int width,
int height)
The rectangle is never recorded, since it uses the current
Color, not Paint. To record a rectangle,
create a rectangle shape, and draw or fill
it.
draw(java.awt.Shape),
fill(java.awt.Shape)
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
The rounded rectangle is never recorded, since it uses the
current Color, not Paint. To record a
rounded rectangle, create a rounded rectangle shape, and
draw or fill it.
draw(java.awt.Shape),
fill(java.awt.Shape)public java.awt.Shape getClip()
public java.awt.Rectangle getClipBounds()
public java.awt.Color getColor()
public java.awt.Font getFont()
public java.awt.FontMetrics getFontMetrics(java.awt.Font font)
public void setClip(int x,
int y,
int width,
int height)
public void setClip(java.awt.Shape clip)
public void setColor(java.awt.Color color)
Setting the color has no effect whatsoever to the annotation
mechanism. To control annotation, apply paints that do or do not
implement AnnotatedPaint interface to the
setPaint method.
setPaint(java.awt.Paint)public void setFont(java.awt.Font font)
public void setPaintMode()
public void setXORMode(java.awt.Color c1)
public void addRenderingHints(java.util.Map hints)
hints - the rendering hints to be setpublic void clip(java.awt.Shape s)
Clip with the interior of the
specified Shape and sets the Clip to the
resulting intersection.
s - the Shape to be intersected with the
current Clip. If s is
null, this method clears the current
Clip.public void draw(java.awt.Shape s)
Shape using the settings of
the current Graphics2D context.
If drawing is successfull, and current paint or given shape is annotated, the drawn shape is stroked and recorded. If both the paint and shape are annotated, paint annotation takes preferences.
s - the Shape to be renderedclip(java.awt.Shape),
getStroke(),
record(Shape,Annotated,Stroke),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setPaint(java.awt.Paint),
setStroke(java.awt.Stroke),
setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform),
AnnotatedPaint,
AnnotatedShape
public void drawGlyphVector(java.awt.font.GlyphVector g,
float x,
float y)
GlyphVector using the
Graphics2D context's rendering attributes.
If drawing is successfull, and current paint is annotated, the glyph vector visual bounds are recorded.
g - the GlyphVector to be renderedx - glypth X -coordinatey - glypth Y -coordinaterecord(Shape,Annotated,float,float),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setPaint(java.awt.Paint),
setTransform(java.awt.geom.AffineTransform),
AnnotatedPaint,
GlyphVector,
Graphics.setColor(java.awt.Color)
public void drawImage(java.awt.image.BufferedImage img,
java.awt.image.BufferedImageOp op,
int x,
int y)
BufferedImage that is filtered with a
BufferedImageOp.
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
op - the filter to be applied to the image before renderingimg - the BufferedImage to be renderedx - image upper left corner X -coordinatey - image upper left corner Y -coordinateclip(java.awt.Shape),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform)
public boolean drawImage(java.awt.Image img,
java.awt.geom.AffineTransform xform,
java.awt.image.ImageObserver obs)
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
img - the Image to be renderedxform - the transformation from image space to user spaceobs - the ImageObserver to be notified as more of
the Image is converted
true if the Image is fully
loaded and completely rendered; false if the
Image is still being loaded.clip(java.awt.Shape),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform)
public void drawRenderableImage(java.awt.image.renderable.RenderableImage img,
java.awt.geom.AffineTransform xform)
RenderableImage, applying a transform from
image space to user space before drawing.
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
img - the image to be renderedxform - the transformation from image space to user spaceclip(java.awt.Shape),
drawRenderedImage(java.awt.image.RenderedImage, java.awt.geom.AffineTransform),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform)
public void drawRenderedImage(java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform)
RenderedImage, applying a transform from image
space to user space before drawing.
The image area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
img - the image to be renderedxform - the transformation from image space to user spaceclip(java.awt.Shape),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform)
public void drawString(java.text.AttributedCharacterIterator iterator,
float x,
float y)
Graphics2D context's current Paint.
The text area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
iterator - the iterator whose text is to be renderedx - string X -coordinatey - string Y -coordinatesetClip(int, int, int, int),
setComposite(java.awt.Composite),
setPaint(java.awt.Paint),
setTransform(java.awt.geom.AffineTransform),
Graphics.setColor(java.awt.Color)
public void drawString(java.text.AttributedCharacterIterator iterator,
int x,
int y)
Graphics2D context's current Paint.
The text area is not recorded, even if it would contain
material painted with a paint that implemented
AnnotatedPaint interface.
iterator - the iterator whose text is to be renderedx - string X -coordinatey - string Y -coordinatesetClip(int, int, int, int),
setComposite(java.awt.Composite),
setPaint(java.awt.Paint),
setTransform(java.awt.geom.AffineTransform),
Graphics.setColor(java.awt.Color)
public void drawString(java.lang.String str,
float x,
float y)
String,
using the current Font and Paint
attributes in the Graphics2D context.
If drawing is successfull, and current paint is annotated, the visual bounds of the string are recorded.
str - the string to be renderedx - string X -coordinatey - string Y -coordinaterecord(String,Annotated,float,float),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setPaint(java.awt.Paint),
setTransform(java.awt.geom.AffineTransform),
AnnotatedPaint,
Graphics.setColor(java.awt.Color),
Graphics.setFont(java.awt.Font)
public void drawString(java.lang.String str,
int x,
int y)
String, using the
current Font and Paint attributes in
the Graphics2D context.
If drawing is successfull, and current paint is annotated, the visual bounds of the string are recorded.
str - the string to be renderedx - string X -coordinatey - string Y -coordinate
java.lang.NullPointerException - if str is
nullrecord(String,Annotated,float,float),
AnnotatedPaint,
Graphics.drawBytes(byte[], int, int, int, int),
Graphics.drawChars(char[], int, int, int, int)public void fill(java.awt.Shape s)
Shape using the settings of
the Graphics2D context.
If drawing is successfull, and current paint or given shape is annotated, the shape interior is recorded. If both the paint and shape are annotated, paint annotation takes preferences.
s - the Shape to be filledclip(java.awt.Shape),
record(Shape,Annotated),
setClip(int, int, int, int),
setComposite(java.awt.Composite),
setPaint(java.awt.Paint),
setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform),
AnnotatedPaint,
AnnotatedShapepublic java.awt.Color getBackground()
Graphics2D Color,
which defines the background color.setBackground(java.awt.Color)public java.awt.Composite getComposite()
Composite in the
Graphics2D context.
Graphics2D
Composite, which defines a compositing style.setComposite(java.awt.Composite)public java.awt.GraphicsConfiguration getDeviceConfiguration()
Graphics2D.
public java.awt.font.FontRenderContext getFontRenderContext()
Font within this
Graphics2D context.
FontRenderContext,
Font.createGlyphVector(java.awt.font.FontRenderContext, char[])public java.awt.Paint getPaint()
Paint of the
Graphics2D context.
Graphics2D Paint,
which defines a color or a pattern.setPaint(java.awt.Paint),
Graphics.setColor(java.awt.Color)public java.lang.Object getRenderingHint(java.awt.RenderingHints.Key hintKey)
hintKey - the key corresponding to the hint to get.
RenderingHints class.RenderingHintspublic java.awt.RenderingHints getRenderingHints()
RenderingHints
that contains the current preferences.RenderingHintspublic java.awt.Stroke getStroke()
Stroke in the
Graphics2D context.
Graphics2D Stroke,
which defines the line style.setStroke(java.awt.Stroke)public java.awt.geom.AffineTransform getTransform()
Transform in the
Graphics2D context.
AffineTransform in the
Graphics2D context.setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform)
public boolean hit(java.awt.Rectangle rect,
java.awt.Shape s,
boolean onStroke)
Shape intersects
with the specified Rectangle, which is in the device
space.
rect - the area in the 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. If the flag is true, the
Stroke outline is tested. If the flag is
false, the filled Shape is tested.
true if there is a hit; false
otherwise.clip(java.awt.Shape),
draw(java.awt.Shape),
fill(java.awt.Shape),
setClip(int, int, int, int),
setStroke(java.awt.Stroke),
setTransform(java.awt.geom.AffineTransform),
transform(java.awt.geom.AffineTransform)public void rotate(double theta)
Graphics2D
Transform with a rotation transform.
theta - the angle of rotation in radians
public void rotate(double theta,
double x,
double y)
Graphics2D
Transform with a translated rotation transform.
theta - the angle of rotation in radiansx - string X -coordinatey - string Y -coordinate
public void scale(double sx,
double sy)
Graphics2D
Transform with a scaling transformation.
sx - the amount by which X coordinates in subsequent
rendering operations are multiplied relative to previous
rendering operations.sy - the amount by which Y coordinates in subsequent
rendering operations are multiplied relative to previous
rendering operations.public void setBackground(java.awt.Color color)
Graphics2D context.
color - the background color that is used in
subsequent calls to clearRectgetBackground(),
Graphics.clearRect(int, int, int, int)public void setComposite(java.awt.Composite comp)
Composite for the Graphics2D context.
comp - the Composite object to be used for rendering
java.lang.SecurityException - if a custom Composite
object is being used to render the screen, and a security manager
is set and its checkPermission method does not allow
the operation.Graphics.setXORMode(java.awt.Color),
Graphics.setPaintMode()public void setPaint(java.awt.Paint paint)
Paint attribute for the
Graphics2D context.
paint - the Paint object to be used to generate
color during the rendering process, or nullGraphics.setColor(java.awt.Color),
GradientPaint
public void setRenderingHint(java.awt.RenderingHints.Key hintKey,
java.lang.Object hintValue)
hintKey - the key of the hint to be set.hintValue - the value indicating preferences for the specified
hint category.RenderingHintspublic void setRenderingHints(java.util.Map hints)
hints.
hints - the rendering hints to be setRenderingHintspublic void setStroke(java.awt.Stroke s)
Stroke for the Graphics2D context.
s - the Stroke object to be used to stroke a
Shape during the rendering processBasicStrokepublic void setTransform(java.awt.geom.AffineTransform Tx)
Transform in the Graphics2D
context.
Tx - the AffineTransform object to be used in the
rendering processtransform(java.awt.geom.AffineTransform),
AffineTransform
public void shear(double shx,
double shy)
Graphics2D
Transform with a shearing transform.
shx - the multiplier by which coordinates are shifted in
the positive X axis direction as a function of their Y coordinateshy - the multiplier by which coordinates are shifted in
the positive Y axis direction as a function of their X coordinatepublic void transform(java.awt.geom.AffineTransform Tx)
AffineTransform object with the
Transform in this Graphics2D according
to the rule last-specified-first-applied.
Tx - the AffineTransform object to be composed with
the current TransformsetTransform(java.awt.geom.AffineTransform),
AffineTransform
public void translate(int x,
int y)
Graphics2D context to the
point (x, y) in the current coordinate system.
x - X offsety - Y offset
public void translate(double tx,
double ty)
Graphics2D
Transform with a translation transform.
tx - the distance to translate along the x-axisty - the distance to translate along the y-axispublic java.util.List getAnnotatedShapes()
AnnotatedShape objects,
with the annotation information as label, and the corresponding
shape as assosiated object.
The list elements are arranged in last-in-first-out (LIFO) order, so that shapes drawn last are encountered first when traversing the list from beginning to end.
The returned list object refers directly to the list object this
AnnotatedGraphics2D uses to store the recorded
shapes. Any modifications to the list will therefore affect the
this AnnotatedGraphics2D instance, too. Likewise,
drawing and recording shapes through this context while inspecting
the returned list will instantly modify the content of the list.
The returned list of shapes is guaranteed to be serializable.
record(Shape,Annotated)
protected void record(java.awt.Shape s,
com.davisor.core.Annotated a)
s - shape to be annotateda - annotation the shape is to be annotated withgetAnnotatedShapes(),
IndirectAnnotatedSerializableShape
protected void record(java.awt.Shape s,
com.davisor.core.Annotated a,
java.awt.Stroke stroke)
s - shape to be annotateda - annotation the shape is to be annotated withstroke - the stroke the shape is to be stroked withrecord(Shape,Annotated)
protected void record(java.awt.Shape s,
com.davisor.core.Annotated a,
float x,
float y)
s - shape to be annotateda - annotation the shape is to be annotated withx - translation x -amounty - translation y -amountrecord(Shape,Annotated)
protected void record(java.lang.String str,
com.davisor.core.Annotated a,
float x,
float y)
str - string content of the bounding box to be annotateda - annotation the bounding box is to be annotated withx - translation x -amounty - translation y -amountrecord(Shape,Annotated,float,float)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||