Back to index

wims  3.65+svn20090927
MyGraphicsFig.java
Go to the documentation of this file.
00001 package rene.zirkel.graphics;
00002 
00003 import java.awt.*;
00004 import java.awt.image.*;
00005 import java.io.*;
00006 
00007 import rene.gui.Global;
00008 import rene.zirkel.ZirkelFrame;
00009 import rene.zirkel.objects.*;
00010 
00015 class MyFontMetrics extends FontMetrics
00016 {      public MyFontMetrics ()
00017        {      super(new Font("Courier",10,Font.PLAIN)); // a dummy font.
00018        }
00019        
00020        public int stringWidth (String s)
00021        {      return s.length()*10; 
00022        }
00023        
00024        public int getHeight()
00025        {      return 12; 
00026        }
00027        
00028        public int getAscent()
00029        {      return 2; 
00030        }
00031        
00032 }
00033 
00038 public class MyGraphicsFig extends MyGraphics
00039 {
00040        PrintWriter Out; 
00041        final static int STROKE_NORMAL=1,STROKE_THIN=1,STROKE_THICK=2; 
00042        final static int STYLE_NORMAL=0,STYLE_THIN=1,STYLE_THICK=0; 
00043        int Stroke=STROKE_NORMAL; 
00044        int Red,Green,Blue; 
00045        MyFontMetrics MFM; 
00046        int yoffset=6000; 
00047        String[] FigColorsArray; 
00048        int FigLastcolor=31; 
00049        int FigColor=0; 
00050        int FigFillcolor=0; 
00051        int FigLinestyle=STYLE_NORMAL; 
00052        int FigLayer=10000; 
00053        boolean PushLayer=true;
00054        int xfactor=15; 
00055        int yfactor=15; 
00056        StringBuffer FigFirstpart; 
00057        StringBuffer FigLastpart; 
00058        
00059        public MyGraphicsFig (PrintWriter out, int w, int h)
00060        {
00061               FigFirstpart=new StringBuffer(); 
00062               FigLastpart=new StringBuffer(); 
00063               //     FigFirstpart.append("#primera linea\n");
00064               //     FigFirstpart.append("#segona linea\n");
00065               FigFirstpart.append("#FIG 3.2\n"); 
00066               FigFirstpart.append("Landscape\n"); 
00067               FigFirstpart.append("Center\n"); 
00068               FigFirstpart.append("Metric\n"); 
00069               FigFirstpart.append("A4\n"); 
00070               FigFirstpart.append("100.00\n"); 
00071               FigFirstpart.append("Single\n"); 
00072               FigFirstpart.append("-2\n"); 
00073               FigFirstpart.append("1200 2\n"); 
00074               MFM=new MyFontMetrics(); 
00075               Out=out; 
00076               FigColorsArray=new String[543]; 
00077        }
00078        
00079        public void close ()
00080        {
00081               append("#End\n"); 
00082               Out.print(FigFirstpart); 
00083               Out.print(FigLastpart); 
00084        }
00085        
00086        String ColorString (Color c)
00087        {
00088               int r,g,b; 
00089               String str,stg,stb,coded="#"; 
00090               str=Integer.toHexString(c.getRed()); 
00091               if (str.length()==1) {
00092                      str="0"+str; 
00093               }
00094               stg=Integer.toHexString(c.getGreen()); 
00095               if (stg.length()==1) {
00096                      stg="0"+stg; 
00097               }
00098               stb=Integer.toHexString(c.getBlue()); 
00099               if (stb.length()==1) {
00100                      stb="0"+stb; 
00101               }
00102               //     coded.concat(str);//.concat(stg).concat(stb);
00103               coded+=str; 
00104               coded+=stg; 
00105               coded+=stb; 
00106               //     append(coded);
00107               return coded; 
00108        }
00109        
00110        
00111        public void setColor (Color c)
00112        {
00113               String codedcolor=ColorString(c); 
00114               boolean newcolor=true; 
00115               for (int i=32; i<= FigLastcolor; i++) {
00116                      if (codedcolor.equals(FigColorsArray[i])) {
00117                             FigColor=i; 
00118                             newcolor=false; 
00119                             break; 
00120                      }
00121               }
00122               if (newcolor) {
00123                      FigLastcolor+=1; 
00124                      FigColor=FigLastcolor; 
00125                      FigColorsArray[FigLastcolor]=codedcolor; 
00126                      FigFirstpart.append("0 "); 
00127                      //         Out.print("0 ");
00128                      FigFirstpart.append(FigLastcolor); 
00129                      FigFirstpart.append(" "); 
00130                      //         Out.print(FigLastcolor);Out.print(" ");
00131                      FigFirstpart.append(codedcolor); 
00132                      FigFirstpart.append("\n"); 
00133                      //         Out.println(codedcolor);
00134               }
00135        }
00136        
00137        public void setFillcolor (Color c)
00138        {
00139               String codedcolor=ColorString(c); 
00140               boolean newcolor=true; 
00141               for (int i=32; i<= FigLastcolor; i++) {
00142                      if (codedcolor.equals(FigColorsArray[i])) {
00143                             FigFillcolor=i; 
00144                             newcolor=false; 
00145                             break; 
00146                      }
00147               }
00148               if (newcolor) {
00149                      FigLastcolor+=1; 
00150                      FigFillcolor=FigLastcolor; 
00151                      FigColorsArray[FigLastcolor]=codedcolor; 
00152                      FigFirstpart.append("0 "); 
00153                      //         Out.print("0 ");
00154                      FigFirstpart.append(FigLastcolor); 
00155                      FigFirstpart.append(" "); 
00156                      //         Out.print(FigLastcolor);Out.print(" ");
00157                      FigFirstpart.append(codedcolor); 
00158                      FigFirstpart.append("\n"); 
00159                      //         Out.println(codedcolor);
00160               }
00161        }
00162        
00163        
00164        
00165        public void setColor (ConstructionObject o)
00166        {
00167               if (o.isJobTarget()) setColor(ZirkelFrame.TargetColor); 
00168               else if (o.selected()) setColor(ZirkelFrame.SelectColor); 
00169               else
00170               {      if (o.getColorType()==ConstructionObject.THIN)
00171                      {      int i=o.getColorIndex(); 
00172                             if (o.isHidden()) setColor(ZirkelFrame.BrighterLightColors[i]); 
00173                             else setColor(ZirkelFrame.LightColors[i]); 
00174                      }
00175                      else
00176                      {      int i=o.getColorIndex(); 
00177                             if (o.isHidden()) setColor(ZirkelFrame.BrighterColors[i]); 
00178                             else setColor(ZirkelFrame.Colors[i]); 
00179                      }
00180                      if (o.getColorType()==ConstructionObject.THIN)
00181                      {
00182                             Stroke=STROKE_THIN; 
00183                             FigLinestyle=STYLE_THIN; 
00184                      }
00185                      else if (o.getColorType()==ConstructionObject.THICK)
00186                      {
00187                             Stroke=STROKE_THICK; 
00188                             FigLinestyle=STYLE_THICK; 
00189                      }
00190                      else
00191                      {
00192                             Stroke=STROKE_NORMAL; 
00193                             FigLinestyle=STYLE_NORMAL; 
00194                      }
00195               }
00196        }
00197        
00198        public void setFillColor (ConstructionObject o)
00199        {      if (o.isJobTarget()) setFillcolor(ZirkelFrame.TargetColor); 
00200               else
00201               {      if (o.getColorType()!=ConstructionObject.THICK)
00202                      {      int i=o.getColorIndex(); 
00203                             if (o.isHidden()) setFillcolor(ZirkelFrame.BrighterLightColors[i]); 
00204                             else setFillcolor(ZirkelFrame.LightColors[i]); 
00205                      }
00206                      else
00207                      {      int i=o.getColorIndex(); 
00208                             if (o.isHidden()) setFillcolor(ZirkelFrame.BrighterColors[i]); 
00209                             else setFillcolor(ZirkelFrame.Colors[i]); 
00210                      }
00211               }
00212        }
00213        
00214        public void setLabelColor (ConstructionObject o)
00215        {      if (o.labelSelected()) setColor(ZirkelFrame.SelectColor);
00216               else if (o.isFilled())
00217               {      int type=o.getColorType();
00218                      o.setColorType(ConstructionObject.NORMAL);
00219                      setColor(o);
00220                      o.setColorType(type);
00221               }
00222               else setColor(o);
00223        }
00224 
00225        public void clearRect (int x, int y, int w, int h, Color c) {}
00226        
00227        public void drawRect (double x, double y, double w, double h)
00228        {
00229               append("# drawRect"); 
00230               append("\n"); 
00231               append("2 2 "); 
00232               //     append(FigLinestyle);append(" ");
00233               append(0); append(" "); 
00234               append(Stroke); append(" "); 
00235               append(FigColor); append(" "); 
00236               append(FigFillcolor); append(" "); 
00237               append(pushLayer()); 
00238               append(" 0 -1 0.000 0 0 -1 0 0 5"); 
00239               append("\n"); 
00240               append(xfactor*x); append(" "); 
00241               append(yfactor*y); append(" "); 
00242               append(xfactor*(x+w)-1); append(" "); 
00243               append(yfactor*y); append(" "); 
00244               append(xfactor*(x+w)-1); append(" "); 
00245               append((yfactor*(y+h)-1)); append(" "); 
00246               append(xfactor*x); append(" "); 
00247               append((yfactor*(y+h)-1)); append(" "); 
00248               append(xfactor*x); append(" "); 
00249               append(yfactor*y); 
00250               append("\n"); 
00251        }
00252        
00253        public void drawLine (double x, double y, double x1, double y1)
00254        {
00255               append("# drawLine"); 
00256               append("\n"); 
00257               append("2 1 "); 
00258               //     append(FigLinestyle);append(" ");
00259               append(0); append(" "); 
00260               append(Stroke); append(" "); 
00261               append(FigColor); append(" "); 
00262               append(FigFillcolor); append(" "); 
00263               append(pushLayer()); 
00264               append(" 0 -1 0.000 0 0 -1 0 0 2"); 
00265               append("\n"); 
00266               //     append("2 2 0 1 0 1 50 0 20 0.000 0 0 -1 0 0 2");
00267               append(xfactor*x); append(" "); 
00268               append(yfactor*y); append(" "); 
00269               append(xfactor*x1); append(" "); 
00270               append(yfactor*y1); 
00271               append("\n"); 
00272        }
00273        
00274        public void drawThickLine (double x, double y, double x1, double y1)
00275        {
00276               append("# drawThickLine"); 
00277               append("\n"); 
00278               append("2 1 "); 
00279               //     append(FigLinestyle);append(" ");
00280               append(0); append(" "); 
00281               append(STROKE_THICK); append(" "); 
00282               append(FigColor); append(" "); 
00283               append(FigFillcolor); append(" "); 
00284               append(pushLayer()); 
00285               append(" 0 -1 0.000 0 0 -1 0 0 2"); 
00286               append("\n"); 
00287               //     append("2 2 0 1 0 1 50 0 20 0.000 0 0 -1 0 0 2");
00288               append(xfactor*x); append(" "); 
00289               append(yfactor*y); append(" "); 
00290               append(xfactor*x1); append(" "); 
00291               append(yfactor*y1); 
00292               append("\n"); 
00293        }
00294        
00295        public void drawLine (double x, double y, double x1, double y1, ConstructionObject o)
00296        {
00297               append("# drawLine ConstructionObject"); 
00298               append("\n"); 
00299               append("2 1 "); 
00300               append(FigLinestyle); append(" "); 
00301               append(Stroke); append(" "); 
00302               append(FigColor); append(" "); 
00303               append(FigFillcolor); append(" "); 
00304               append(pushLayer()); 
00305               append(" 0 -1 0.000 0 0 -1 0 0 2"); 
00306               append("\n"); 
00307               //     append("2 1 0 1 0 1 50 0 -1 0.000 0 0 -1 0 0 2");
00308               append(xfactor*x); append(" "); 
00309               append(yfactor*y); append(" "); 
00310               append(xfactor*x1); append(" "); 
00311               append(yfactor*y1); 
00312               append("\n"); 
00313        }
00314        
00315        
00316        public void drawArc (double x, double y, double w, double h, double a, double b)
00317        {
00318               append("# drawArc"); 
00319               append("\n"); 
00320               int x1,x2,x3,y1,y2,y3; 
00321               double cx,cy,rx,ry,arad,brad; 
00322               rx=(double)(w)/2; 
00323               ry=(double)(h)/2; 
00324               cx=x+rx; 
00325               cy=y+ry; 
00326               arad=a*Math.PI/180.0; 
00327               brad=b*Math.PI/180.0; 
00328               x1=(int)(cx+rx*Math.cos(arad)); 
00329               y1=(int)(cy+ry*Math.sin(arad)); 
00330               x2=(int)(cx+rx*Math.cos(arad+brad/2)); 
00331               y2=(int)(cy+ry*Math.sin(arad+brad/2)); 
00332               x3=(int)(cx+rx*Math.cos(arad+brad)); 
00333               y3=(int)(cy+ry*Math.sin(arad+brad)); 
00334               append("5 1 "); 
00335               append(FigLinestyle); append(" "); 
00336               append(Stroke); append(" "); 
00337               append(FigColor); append(" "); 
00338               append(FigFillcolor); append(" "); 
00339               append(pushLayer()); 
00340               append(" 0 -1 0.000 0 1 0 0 "); 
00341               append(xfactor*cx); append(" "); 
00342               append(yfactor*cy); append(" "); 
00343               append(xfactor*x1); append(" "); 
00344               append(yfactor*y1); append(" "); 
00345               append(xfactor*x2); append(" "); 
00346               append(yfactor*y2); append(" "); 
00347               append(xfactor*x3); append(" "); 
00348               append(yfactor*y3); 
00349               append("\n"); 
00350        }
00351        
00352        public void drawArc (double x, double y, double w, double h, double a, double b,
00353               ConstructionObject o)
00354        {
00355               append("# drawArc ConstructionObject"); 
00356               append("\n"); 
00357               int x1,x2,x3,y1,y2,y3; 
00358               double cx,cy,rx,ry,arad,brad; 
00359               rx=(double)(w)/2; 
00360               ry=(double)(h)/2; 
00361               cx=x+rx; 
00362               cy=y+ry; 
00363               arad=a*Math.PI/180.0; 
00364               brad=b*Math.PI/180.0; 
00365               x1=(int)(cx+rx*Math.cos(arad)); 
00366               y1=(int)(cy-ry*Math.sin(arad)); 
00367               x2=(int)(cx+rx*Math.cos(arad+brad/2)); 
00368               y2=(int)(cy-ry*Math.sin(arad+brad/2)); 
00369               x3=(int)(cx+rx*Math.cos(arad+brad)); 
00370               y3=(int)(cy-ry*Math.sin(arad+brad)); 
00371               append("5 1 "); 
00372               append(FigLinestyle); append(" "); 
00373               append(Stroke); append(" "); 
00374               append(FigColor); append(" "); 
00375               append(FigColor); append(" "); 
00376               append(pushLayer()); 
00377               append(" 0 -1 0.000 0 1 0 0 "); 
00378               //     append("5 1 0 1 0 7 50 0 -1 0.000 0 1 0 0 ");
00379               append(xfactor*cx); append(" "); 
00380               append(yfactor*cy); append(" "); 
00381               append(xfactor*x1); append(" "); 
00382               append(yfactor*y1); append(" "); 
00383               append(xfactor*x2); append(" "); 
00384               append(yfactor*y2); append(" "); 
00385               append(xfactor*x3); append(" "); 
00386               append(yfactor*y3); 
00387               append("\n"); 
00388        }
00389        
00390        public FontMetrics getFontMetrics ()
00391        {      return MFM; 
00392        }
00393        
00394        public void drawString (String s, double x, double y)
00395        {
00396               append("#drawString"); 
00397               append("\n"); 
00398               append("4 0 "); 
00399               append(FigColor); append(" "); 
00400               append(pushLayer()); 
00401               append(" 0 4 12 0.000 2 0 0 "); 
00402               append(xfactor*x); append(" "); 
00403               append(yfactor*(y+10)); append(" "); 
00404               append(s); 
00405               append("\\001"); 
00406               append("\n"); 
00407        }
00408        
00409        public void drawOval (double x, double y, double w, double h)
00410        {
00411               double cx,cy,rx,ry; 
00412               rx=(double)(w)/2; 
00413               ry=(double)(h)/2; 
00414               cx=x+rx; 
00415               cy=y+ry; 
00416               append("#drawOval"); 
00417               append("\n"); 
00418               append("1 1 "); 
00419               append(0); append(" "); 
00420               append(Stroke); append(" "); 
00421               append(FigColor); append(" "); 
00422               append(FigFillcolor); append(" "); 
00423               append(pushLayer()); 
00424               append(" 0 -1 0.000 1 0.000 "); 
00425               append((int)(xfactor*cx)); append(" "); 
00426               append((int)(yfactor*cy)); append(" "); 
00427               append((int)(xfactor*rx)); append(" "); 
00428               append((int)(yfactor*ry)); append(" "); 
00429               append("0 0 0 0"); 
00430               append("\n"); 
00431        }
00432        
00433        public void drawOval (double x, double y, double w, double h,
00434               ConstructionObject o)
00435        {
00436               double cx,cy,rx,ry; 
00437               rx=(double)(w)/2; 
00438               ry=(double)(h)/2; 
00439               cx=x+rx; 
00440               cy=y+ry; 
00441               append("#drawOval ConstructionObject"); 
00442               append("\n"); 
00443               append("1 1 "); 
00444               append(FigLinestyle); append(" "); 
00445               append(Stroke); append(" "); 
00446               append(FigColor); append(" "); 
00447               append(FigFillcolor); append(" "); 
00448               append(pushLayer()); 
00449               append(" 0 -1 0.000 1 0.000 "); 
00450               append((int)(xfactor*cx)); append(" "); 
00451               append((int)(yfactor*cy)); append(" "); 
00452               append((int)(xfactor*rx)); append(" "); 
00453               append((int)(yfactor*ry)); append(" "); 
00454               append("0 0 0 0"); 
00455               append("\n"); 
00456        }
00457        
00458        
00459        public void fillRect (double x, double y, double w, double h,
00460               boolean outline, boolean transparent, ConstructionObject o)
00461        {      
00462               setColor(o);
00463               setFillColor(o);
00464               append("# fillRect"); 
00465               append("\n"); 
00466               append("2 2 "); 
00467               append(outline?FigLinestyle:STYLE_NORMAL); append(" "); 
00468               append(Stroke); append(" "); 
00469               append(FigColor); append(" "); 
00470               append(FigFillcolor); append(" "); 
00471               append(pushLayer()); 
00472               if (transparent) append(" 0 20 0.000 0 0 -1 0 0 5"); 
00473               else append(" 0 30 0.000 0 0 -1 0 0 5"); 
00474               append("\n"); 
00475               append(xfactor*x); append(" "); 
00476               append(yfactor*y); append(" "); 
00477               append(xfactor*(x+w)-1); append(" "); 
00478               append(yfactor*y); append(" "); 
00479               append(xfactor*(x+w)-1); append(" "); 
00480               append(yfactor*(y+h)-1); append(" "); 
00481               append(xfactor*x); append(" "); 
00482               append(yfactor*(y+h)-1); append(" "); 
00483               append(xfactor*x); append(" "); 
00484               append(yfactor*y); 
00485               append("\n"); 
00486        }
00487        
00488        public void fillArc (double x, double y, double w, double h, double a, double b,
00489               boolean outline, boolean transparent, boolean arc, ConstructionObject o)
00490        {
00491               setColor(o);
00492               setFillColor(o);
00493               append("#fillArc2"); 
00494               append("\n"); 
00495               int x1,x2,x3,y1,y2,y3; 
00496               double cx,cy,rx,ry,arad,brad; 
00497               rx=(double)(w-1)/2; 
00498               ry=(double)(h-1)/2; 
00499               cx=x+rx; 
00500               cy=y+ry; 
00501               arad=a*Math.PI/180.0; 
00502               brad=b*Math.PI/180.0; 
00503               x1=(int)(cx+rx*Math.cos(arad)); 
00504               y1=(int)(cy-ry*Math.sin(arad)); 
00505               x2=(int)(cx+rx*Math.cos(arad+brad/2)); 
00506               y2=(int)(cy-ry*Math.sin(arad+brad/2)); 
00507               x3=(int)(cx+rx*Math.cos(arad+brad)); 
00508               y3=(int)(cy-ry*Math.sin(arad+brad)); 
00509               append("5 2 "); 
00510               append(outline?FigLinestyle:STYLE_NORMAL); append(" "); 
00511               append(Stroke); append(" "); 
00512               append(FigColor); append(" "); 
00513               append(FigFillcolor); append(" "); 
00514               append(pushLayer()); 
00515               if (transparent) append(" 0 20 0.000 0 1 0 0 "); 
00516               else append(" 0 30 0.000 0 1 0 0 "); 
00517               append(xfactor*cx); append(" "); 
00518               append(yfactor*cy); append(" "); 
00519               append(xfactor*x1); append(" "); 
00520               append(yfactor*y1); append(" "); 
00521               append(xfactor*x2); append(" "); 
00522               append(yfactor*y2); append(" "); 
00523               append(xfactor*x3); append(" "); 
00524               append(yfactor*y3); 
00525               append("\n"); 
00526        }
00527        
00528        public void fillOval (double x, double y, double w, double h,
00529               boolean outline, boolean transparent, ConstructionObject o)
00530        {
00531               setColor(o);
00532               setFillColor(o);
00533               append("#fillOval"); 
00534               append("\n"); 
00535               double cx,cy,rx,ry; 
00536               rx=(double)(w-1)/2; 
00537               ry=(double)(h-1)/2; 
00538               cx=x+rx; 
00539               cy=y+ry; 
00540               append("1 1 "); 
00541               append(outline?FigLinestyle:STYLE_NORMAL); append(" "); 
00542               append(Stroke); append(" "); 
00543               append(FigColor); append(" "); 
00544               append(FigFillcolor); append(" "); 
00545               append(pushLayer()); 
00546               if (transparent) append(" 0 20 0.000 1 0.000 "); 
00547               else append(" 0 30 0.000 1 0.000 "); 
00548               append((int)(xfactor*cx)); append(" "); 
00549               append((int)(yfactor*cy)); append(" "); 
00550               append((int)(xfactor*rx)); append(" "); 
00551               append((int)(yfactor*ry)); append(" "); 
00552               append("0 0 0 0"); 
00553               append("\n"); 
00554        }
00555        
00556        public void fillPolygon (double x[], double y[], int n,
00557               boolean outline, boolean transparent, ConstructionObject o)
00558        {
00559               setColor(o);
00560               setFillColor(o);
00561               append("#fillPolygon"); 
00562               append("\n"); 
00563               append("2 1 "); 
00564               append(outline?FigLinestyle:STYLE_NORMAL);
00565                      append(" "); 
00566               append(Stroke); append(" "); 
00567               append(FigColor); append(" "); 
00568               append(FigFillcolor); append(" "); 
00569               append(pushLayer()); 
00570               if (transparent) append(" 0 20 0.000 0 0 -1 0 0 "); 
00571               else append(" 0 30 0.000 0 0 -1 0 0 "); 
00572               append(n+1); 
00573               append("\n"); 
00574               for (int i=0; i < n; i++) {
00575                      append(xfactor*x[i]); append(" "); 
00576                      append(yfactor*y[i]); append(" "); 
00577               }
00578               append(xfactor*x[0]); append(" "); 
00579               append(yfactor*y[0]); append(" "); 
00580               append("\n"); 
00581        }
00582        
00583        public void setLayer (int n)
00584        {      FigLayer=n; 
00585        }
00586 
00587        void append (String s)
00588        {      FigLastpart.append(s);
00589        }
00590        void append (int n)
00591        {      FigLastpart.append(""+n);
00592        }
00593        void append (double x)
00594        {      FigLastpart.append(""+((int)x));
00595        }
00596        
00597        public int pushLayer ()
00598        {      if (PushLayer) FigLayer--;
00599               return FigLayer;
00600        }
00601 
00602        public void pushLayer (boolean flag)
00603        {      PushLayer=flag;
00604        }
00605 
00606        public void drawImage (Image i, int x, int y, ImageObserver o)
00607        {
00608        }
00609        public void drawImage (Image i, int x, int y, int w, int h, ImageObserver o)
00610        {
00611        }
00612 
00613        public void setFont (int h, boolean bold)
00614        {
00615        }
00616 
00617        int fsize;
00618        boolean flarge,fbold;
00619        int ffactor=Global.getParameter("ffactor",130);
00620        
00621        public void setDefaultFont (int h, boolean large, boolean bold)
00622        {      fsize=h; flarge=large; fbold=bold;
00623               setFont(large,bold);
00624        }
00625        
00626        public void setFont (boolean large, boolean bold)
00627        {      int size=fsize;
00628               if (large) size=size*ffactor/100;
00629               if (flarge) size=size*ffactor/100;
00630               setFont(size,bold || fbold);
00631        }
00632 
00633        public void drawImage (Image i, double x, double y, double x1, double y1, 
00634                      double x2, double y2, ImageObserver o)
00635        {
00636        }
00637 
00638        public Graphics getGraphics() {
00639               return null;
00640        }
00641 
00642        public int stringWidth(String s) 
00643        {      return getFontMetrics().stringWidth(s);
00644        }
00645 
00646        public int stringHeight(String s) 
00647        {      return getFontMetrics().getHeight();
00648        }
00649 
00650        public int drawStringExtended(String s, double x, double y) 
00651        {      drawString(s,x,y+getFontMetrics().getAscent());
00652               return getFontMetrics().getHeight(); 
00653        }
00654 
00655        public int stringAscent(String s) 
00656        {      return getFontMetrics().getAscent();
00657        }
00658 
00659 }