/[gzz]/gzz/gzz/vob/OvalBgVob.java
ViewVC logotype

Diff of /gzz/gzz/vob/OvalBgVob.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by humppake, Fri Oct 18 06:45:15 2002 UTC revision 1.3 by humppake, Fri Oct 18 12:46:39 2002 UTC
# Line 32  import gzz.gfx.gl.*; Line 32  import gzz.gfx.gl.*;
32  import java.awt.*;  import java.awt.*;
33  import java.awt.event.*;  import java.awt.event.*;
34  import java.util.*;  import java.util.*;
35    import java.lang.Math;
36  import gzz.client.GraphicsAPI;  import gzz.client.GraphicsAPI;
37    
38  /** A vob which is a circular background and frame.  /** A vob which is a circular background and frame.
# Line 53  public static final String rcsid = "$Id$ Line 54  public static final String rcsid = "$Id$
54          if (!texLoaded) {          if (!texLoaded) {
55              String[] texparam = {"type", "8"};              String[] texparam = {"type", "8"};
56              tex = GL.createTexture();              tex = GL.createTexture();
             /** XXX Should texture's size be relative to vob's physical size?  
              * If so, texture should be reloaded always when greater needed.  
              * Currently texture is loaded only once.  
              */  
57              tex.shade(128, 128, 0, 1, "ALPHA", "ALPHA", "geometric", texparam);              tex.shade(128, 128, 0, 1, "ALPHA", "ALPHA", "geometric", texparam);
58              texLoaded = true;              texLoaded = true;
59          }          }
# Line 99  public static final String rcsid = "$Id$ Line 96  public static final String rcsid = "$Id$
96              g.setColor(bg);              g.setColor(bg);
97              g.fillOval(mx, my, mw, mh);              g.fillOval(mx, my, mw, mh);
98          } else {          } else {
99                int arc = 360 / nsolids;
100              for(int i=0; i<nsolids; i++) {              for(int i=0; i<nsolids; i++) {
101                  g.setColor(solids[i]);                  g.setColor(solids[i]);
102                  g.fillOval(mx+(mw*i)/nsolids, my, mw/nsolids, mh);                  g.fillArc(mx, my, mw, mh, -90 + arc * (i-1), arc);
103              }              }
104          }          }
105    
106          if(drawBorder) {          if(drawBorder) {
107              g.setColor(info1.getMixedFgColor());              g.setColor(info1.getMixedFgColor());
108              g.drawOval(mx, my, mw-1, mh-1);              if(mh >= 14) g.drawOval(mx-1, my-1, mw+2, mh+2);
109              if(mh >= 14) {              else g.drawOval(mx, my, mw, mh);
                 g.drawOval(mx+1, my+1, mw-3, mh-3);  
             }  
110          }          }
111    
112          g.setColor(oldfg);          g.setColor(oldfg);
# Line 126  public static final String rcsid = "$Id$ Line 122  public static final String rcsid = "$Id$
122              if (!texLoaded) loadTex();              if (!texLoaded) loadTex();
123              String bgcall = "";              String bgcall = "";
124              if(nsolids > 0) {              if(nsolids > 0) {
125                    double arc = (2*Math.PI) / nsolids;
126                  double w = 1.0 / nsolids;                  double w = 1.0 / nsolids;
127                  for(int i=0; i<nsolids; i++) {                  for(int i=0; i<nsolids; i++) {
128                      double x1 = i*w;                      double x1 = i*w;
# Line 199  public static final String rcsid = "$Id$ Line 196  public static final String rcsid = "$Id$
196       * of the array. Mostly useful for checking for nullness.       * of the array. Mostly useful for checking for nullness.
197       */       */
198      public Color[] getSolidColors() { return solids; }      public Color[] getSolidColors() { return solids; }
   
199  }  }
200    
201    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26