cs349 - s10 - Lecture 31

CS349 - Implementing User Interfaces - Spring 2010

Public Service Annoucements

  1. Assignment 3 reminder.
  2. Assignment 4.

Lecture 31 - Java2D

java.awt.Graphics

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

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

abstract voidcopyArea(int x, int y, int width, int height, int dx, int dy)

abstract Graphics
create()

Graphics
create(int x, int y, int width, int height)

abstract void
dispose()

void
draw3DRect(int x, int y, int width, int height, boolean raised)

abstract 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)

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

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

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

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

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

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

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

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

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

void
drawPolygon(Polygon p)

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

void
drawRect(int x, int y, int width, int height)

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

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

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

void
fill3DRect(int x, int y, int width, int height, boolean raised)

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

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

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

void
fillPolygon(Polygon p)

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

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

void
finalize()

abstract Shape
getClip()

abstract Rectangle
getClipBounds()

Rectangle
getClipBounds(Rectangle r)

Returns the bounding rectangle of the current clipping area.

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

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

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

void
fill3DRect(int x, int y, int width, int height, boolean raised)

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

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

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

void
fillPolygon(Polygon p)

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

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

abstract Shape
getClip()

abstract Rectangle
getClipBounds()

Rectangle
getClipBounds(Rectangle r)

java.awt.Graphics2D

abstract void
addRenderingHints(Map hints)

abstract void
clip(Shape s)

abstract void
draw(Shape s)

void
draw3DRect(int x, int y, int width, int height, boolean raised)

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

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

Renders a BufferedImage that is filtered with a BufferedImageOp.

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

abstract void
drawRenderableImage(RenderableImage img, AffineTransform xform)

abstract void
drawRenderedImage(RenderedImage img, AffineTransform xform)

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

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

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

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

abstract void
fill(Shape s)

void
fill3DRect(int x, int y, int width, int height, boolean raised)

abstract Color
getBackground()

abstract Composite
getComposite()

abstract GraphicsConfiguration
getDeviceConfiguration()

abstract FontRenderContext
getFontRenderContext()

abstract Paint
getPaint()

abstract Object
getRenderingHint(RenderingHints.Key hintKey)

abstract RenderingHints
getRenderingHints()

abstract Stroke
getStroke()

abstract AffineTransform
getTransform()

Returns a copy of the current Transform in the Graphics2D context.

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

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
setComposite(Composite comp)

abstract void
setPaint(Paint paint)

abstract void
setRenderingHint(RenderingHints.Key hintKey, Object hintValue)

abstract void
setRenderingHints(Map hints)

abstract void
setStroke(Stroke s)

abstract void
setTransform(AffineTransform Tx)

abstract voidshear(double shx, double shy)

abstract void
transform(AffineTransform Tx)

abstract void
translate(double tx, double ty)

abstract void
translate(int x, int y)

Classes et al. You Might Care About

AffineTransform

RenderingHints

Paint

Composite

Shape

FontRenderContex

DeviceConfiguration

GlyphVector


Return to: