edu.virginia.cs.mng.hypercast.demo
Class MGraphics

java.lang.Object
  |
  +--edu.virginia.cs.mng.hypercast.demo.MGraphics

public class MGraphics
extends java.lang.Object

MGraphics class. This class is used as a wrapper for standard Java Graphics class. Its core member is g, a Graphics object. It also adds two members, penwidth and penstate. It defines and implements some methods to draw various geometrical shapes, such as line, oval, polygon, rect, roundrect, etc.


Field Summary
(package private)  java.awt.Graphics g
           
(package private) static int PEN_BOXED
           
(package private) static int PEN_ROUNDED
           
(package private) static int PEN_STUB
           
(package private)  int penstate
           
(package private)  int penwidth
           
 
Constructor Summary
MGraphics(java.awt.Graphics newg)
           
 
Method Summary
 void clipRect(int x, int y, int width, int height)
           
 boolean drawImage(java.awt.Image i, int x, int y, java.awt.image.ImageObserver a)
           
 void drawLine(int x1, int y1, int x2, int y2)
           
 void drawOval(int x, int y, int width, int height)
           
 void drawPolygon(int[] xs, int[] ys, int len)
           
 void drawPolygon(java.awt.Polygon p)
           
 void drawRect(int x, int y, int width, int height)
           
 void drawRoundRect(int x, int y, int w, int h, int aw, int ah)
           
 void drawString(java.lang.String str, int x, int y)
           
 void fill3DRect(int x, int y, int width, int height, boolean up)
           
 void fillOval(int x, int y, int width, int height)
           
 void fillPolygon(int[] xs, int[] ys, int len)
           
 void fillPolygon(java.awt.Polygon p)
           
 void fillRect(int x, int y, int width, int height)
           
 void fillRoundRect(int x, int y, int w, int h, int aw, int ah)
           
 java.awt.Rectangle getClipBounds()
           
 java.awt.Font getFont()
           
 java.awt.FontMetrics getFontMetrics()
           
 java.awt.Graphics getGraphics()
           
 int getPenStyle()
           
 int getPenWidth()
           
 void setColor(java.awt.Color c)
           
 void setFont(java.awt.Font f)
           
 void setPaintMode()
           
 void setPenStyle(int style)
           
 void setPenWidth(int width)
           
 void setXORMode(java.awt.Color c)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

PEN_ROUNDED

static final int PEN_ROUNDED

PEN_STUB

static final int PEN_STUB

PEN_BOXED

static final int PEN_BOXED

g

java.awt.Graphics g

penwidth

int penwidth

penstate

int penstate
Constructor Detail

MGraphics

public MGraphics(java.awt.Graphics newg)
Method Detail

getGraphics

public java.awt.Graphics getGraphics()

setPenWidth

public void setPenWidth(int width)

getPenWidth

public int getPenWidth()

setPenStyle

public void setPenStyle(int style)

getPenStyle

public int getPenStyle()

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(java.awt.Polygon p)

drawPolygon

public void drawPolygon(int[] xs,
                        int[] ys,
                        int len)

drawRect

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

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int aw,
                          int ah)

drawString

public void drawString(java.lang.String str,
                       int x,
                       int y)

fill3DRect

public void fill3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean up)

fillOval

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

fillPolygon

public void fillPolygon(java.awt.Polygon p)

fillPolygon

public void fillPolygon(int[] xs,
                        int[] ys,
                        int len)

fillRect

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

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int aw,
                          int ah)

setColor

public void setColor(java.awt.Color c)

setFont

public void setFont(java.awt.Font f)

setPaintMode

public void setPaintMode()

setXORMode

public void setXORMode(java.awt.Color c)

getFontMetrics

public java.awt.FontMetrics getFontMetrics()

getFont

public java.awt.Font getFont()

clipRect

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

getClipBounds

public java.awt.Rectangle getClipBounds()

drawImage

public boolean drawImage(java.awt.Image i,
                         int x,
                         int y,
                         java.awt.image.ImageObserver a)