Back to index

wims  3.65+svn20090927
MyGraphics.java
Go to the documentation of this file.
00001 package rene.zirkel.graphics;
00002 
00003 import java.awt.*;
00004 import java.awt.image.*;
00005 
00006 import rene.zirkel.objects.*;
00007 
00008 public abstract class MyGraphics
00009 {      double W=1000,H=1000;
00010        public void setSize (double w, double h)
00011        {      W=w; H=h;
00012        } 
00013        public abstract void clearRect (int x, int y, int w, int h, Color c);
00014        public abstract void setColor (Color c);
00015        public abstract void setColor (ConstructionObject o);
00016        public abstract void setFillColor (ConstructionObject o);
00017        public abstract void setLabelColor (ConstructionObject o);
00018        public abstract void drawRect (double x, double y, double w, double h);
00019        public abstract void drawLine (double x, double y, double x1, double y1, ConstructionObject o);
00020        public abstract void drawLine (double x, double y, double x1, double y1);
00021        public abstract void drawThickLine (double x, double y, double x1, double y1);
00022        public abstract void drawArc (double x, double y, double w, double h, double a, double b);
00023        public abstract void drawArc (double x, double y, double w, double h, double a, double b,
00024               ConstructionObject o);
00025        public void drawCircleArc (double x, double y, double r, double a, double b,
00026                      ConstructionObject o)
00027        {      drawArc(x-r,y-r,2*r,2*r,a,b,o);
00028        }
00029        public abstract void drawString (String s, double x, double y);
00030        public abstract void drawOval (double x, double y, double w, double h);
00031        public abstract void drawOval (double x, double y, double w, double h,
00032               ConstructionObject o);
00033        public void drawCircle (double x, double y, double r,
00034               ConstructionObject o)
00035        {      drawOval(x-r,y-r,2*r,2*r,o);
00036        }
00037        public abstract void fillRect (double x, double y, double w, double h, 
00038               boolean outline, boolean transparent, ConstructionObject o);
00039        public abstract void fillOval (double x, double y, double w, double h, 
00040               boolean outline, boolean transparent, ConstructionObject o);
00041        public abstract void fillPolygon (double x[], double y[], int n,
00042               boolean outline, boolean tranparent, ConstructionObject o);
00043        public abstract void fillArc (double x, double y, double w, double h, double a, double b,
00044               boolean outline, boolean transparent, boolean arc, ConstructionObject o);
00045        public abstract void drawImage (Image i, int x, int y, ImageObserver o);
00046        public abstract void drawImage (Image i, int x, int y, int w, int h,
00047               ImageObserver o);
00048        public abstract void drawImage (Image i, double x, double y, double x1, double y1, 
00049                      double x2, double y2, ImageObserver o);
00050        public abstract void setDefaultFont (int size, boolean large, boolean bold);
00051        public abstract void setFont (boolean large, boolean bold);
00052        public abstract void setFont (int size, boolean bold);
00053        public abstract FontMetrics getFontMetrics ();
00054        public abstract Graphics getGraphics ();
00055        public abstract int stringAscent (String s);
00056        public abstract int stringWidth (String s);
00057        public abstract int stringHeight (String s);
00058        public abstract int drawStringExtended (String s, double x, double y);
00059 }