multivalent.std

Class GraphicsWrap

public abstract class GraphicsWrap extends Graphics2D

Some, but not many, kinds of Lenses are easiest to implement as subclasses of Graphics, as remarked in "Debugging Lenses", UIST 97, Hudson/Rodenstein/Smith, but every method of java.awt.Graphics2D is abstract; GraphicsWrap provides a conveniently subclassable Graphics2D.

Version: $Revision: 1.2 $ $Date: 2002/02/01 04:07:12 $

See Also:

Field Summary
protected Graphics2Dwrapped_
Constructor Summary
protected GraphicsWrap(Graphics2D wrapped)
Method Summary
voidaddRenderingHints(Map hints)
voidclearRect(int x, int y, int width, int height)
voidclip(Shape s)
voidclipRect(int x, int y, int width, int height)
voidcopyArea(int x, int y, int width, int height, int dx, int dy)
abstract Graphicscreate()
Subclasses should define as something like "return new ((Graphics2D)wrapped_.create());".
voiddispose()
voiddraw(Shape s)
voiddrawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
voiddrawGlyphVector(GlyphVector g, float x, float y)
booleandrawImage(Image img, int x, int y, ImageObserver observer)
booleandrawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
booleandrawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
booleandrawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
booleandrawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
voiddrawImage(BufferedImage img, BufferedImageOp op, int x, int y)
booleandrawImage(Image img, AffineTransform xform, ImageObserver obs)
voiddrawLine(int x1, int y1, int x2, int y2)
voiddrawOval(int x, int y, int width, int height)
voiddrawPolygon(int[] xPoints, int[] yPoints, int nPoints)
voiddrawPolyline(int[] xPoints, int[] yPoints, int nPoints)
voiddrawRenderableImage(RenderableImage img, AffineTransform xform)
voiddrawRenderedImage(RenderedImage img, AffineTransform xform)
voiddrawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
voiddrawString(String str, int x, int y)
voiddrawString(AttributedCharacterIterator iterator, int x, int y)
voiddrawString(AttributedCharacterIterator iterator, float x, float y)
voiddrawString(String s, float x, float y)
voidfill(Shape s)
voidfillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
voidfillOval(int x, int y, int width, int height)
voidfillPolygon(int[] xPoints, int[] yPoints, int nPoints)
voidfillRect(int x, int y, int width, int height)
voidfillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
ColorgetBackground()
ShapegetClip()
RectanglegetClipBounds()
ColorgetColor()
CompositegetComposite()
GraphicsConfigurationgetDeviceConfiguration()
FontgetFont()
FontMetricsgetFontMetrics()
FontMetricsgetFontMetrics(Font f)
FontRenderContextgetFontRenderContext()
PaintgetPaint()
ObjectgetRenderingHint(Key hintKey)
RenderingHintsgetRenderingHints()
StrokegetStroke()
AffineTransformgetTransform()
booleanhit(Rectangle rect, Shape s, boolean onStroke)
voidrotate(double theta)
voidrotate(double theta, double x, double y)
voidscale(double sx, double sy)
voidsetBackground(Color color)
voidsetClip(int x, int y, int width, int height)
voidsetClip(Shape clip)
voidsetColor(Color c)
voidsetComposite(Composite comp)
voidsetFont(Font font)
voidsetPaint(Paint paint)
voidsetPaintMode()
voidsetRenderingHint(Key hintKey, Object hintValue)
voidsetRenderingHints(Map hints)
voidsetStroke(Stroke s)
voidsetTransform(AffineTransform Tx)
voidsetXORMode(Color c1)
voidshear(double shx, double shy)
StringtoString()
voidtransform(AffineTransform Tx)
voidtranslate(int x, int y)
voidtranslate(double tx, double ty)

Field Detail

wrapped_

protected Graphics2D wrapped_

Constructor Detail

GraphicsWrap

protected GraphicsWrap(Graphics2D wrapped)

Method Detail

addRenderingHints

public void addRenderingHints(Map hints)

clearRect

public void clearRect(int x, int y, int width, int height)

clip

public void clip(Shape s)

clipRect

public void clipRect(int x, int y, int width, int height)

copyArea

public void copyArea(int x, int y, int width, int height, int dx, int dy)

create

public abstract Graphics create()
Subclasses should define as something like "return new ((Graphics2D)wrapped_.create());".

dispose

public void dispose()

draw

public void draw(Shape s)

drawArc

public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)

drawGlyphVector

public void drawGlyphVector(GlyphVector g, float x, float y)

drawImage

public boolean drawImage(Image img, int x, int y, ImageObserver observer)

drawImage

public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)

drawImage

public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)

drawImage

public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)

drawImage

public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)

drawImage

public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)

drawImage

public void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)

drawImage

public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)

drawLine

public void drawLine(int x1, int y1, int x2, int y2)

drawOval

public void drawOval(int x, int y, int width, int height)

drawPolygon

public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)

drawPolyline

public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)

drawRenderableImage

public void drawRenderableImage(RenderableImage img, AffineTransform xform)

drawRenderedImage

public void drawRenderedImage(RenderedImage img, AffineTransform xform)

drawRoundRect

public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)

drawString

public void drawString(String str, int x, int y)

drawString

public void drawString(AttributedCharacterIterator iterator, int x, int y)

drawString

public void drawString(AttributedCharacterIterator iterator, float x, float y)

drawString

public void drawString(String s, float x, float y)

fill

public void fill(Shape s)

fillArc

public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)

fillOval

public void fillOval(int x, int y, int width, int height)

fillPolygon

public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)

fillRect

public void fillRect(int x, int y, int width, int height)

fillRoundRect

public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)

getBackground

public Color getBackground()

getClip

public Shape getClip()

getClipBounds

public Rectangle getClipBounds()

getColor

public Color getColor()

getComposite

public Composite getComposite()

getDeviceConfiguration

public GraphicsConfiguration getDeviceConfiguration()

getFont

public Font getFont()

getFontMetrics

public FontMetrics getFontMetrics()

getFontMetrics

public FontMetrics getFontMetrics(Font f)

getFontRenderContext

public FontRenderContext getFontRenderContext()

getPaint

public Paint getPaint()

getRenderingHint

public Object getRenderingHint(Key hintKey)

getRenderingHints

public RenderingHints getRenderingHints()

getStroke

public Stroke getStroke()

getTransform

public AffineTransform getTransform()

hit

public boolean hit(Rectangle rect, Shape s, boolean onStroke)

rotate

public void rotate(double theta)

rotate

public void rotate(double theta, double x, double y)

scale

public void scale(double sx, double sy)

setBackground

public void setBackground(Color color)

setClip

public void setClip(int x, int y, int width, int height)

setClip

public void setClip(Shape clip)

setColor

public void setColor(Color c)

setComposite

public void setComposite(Composite comp)

setFont

public void setFont(Font font)

setPaint

public void setPaint(Paint paint)

setPaintMode

public void setPaintMode()

setRenderingHint

public void setRenderingHint(Key hintKey, Object hintValue)

setRenderingHints

public void setRenderingHints(Map hints)

setStroke

public void setStroke(Stroke s)

setTransform

public void setTransform(AffineTransform Tx)

setXORMode

public void setXORMode(Color c1)

shear

public void shear(double shx, double shy)

toString

public String toString()

transform

public void transform(AffineTransform Tx)

translate

public void translate(int x, int y)

translate

public void translate(double tx, double ty)