gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gzz/vob/vobs OvalBgVob.java


From: Asko Soukka
Subject: [Gzz-commits] gzz/gzz/vob/vobs OvalBgVob.java
Date: Thu, 05 Dec 2002 15:30:15 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Asko Soukka <address@hidden>    02/12/05 15:30:15

Modified files:
        gzz/vob/vobs   : OvalBgVob.java 

Log message:
        colored stripes in OvalBgVob also on AWT

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/vobs/OvalBgVob.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: gzz/gzz/vob/vobs/OvalBgVob.java
diff -u gzz/gzz/vob/vobs/OvalBgVob.java:1.6 gzz/gzz/vob/vobs/OvalBgVob.java:1.7
--- gzz/gzz/vob/vobs/OvalBgVob.java:1.6 Thu Dec  5 15:16:42 2002
+++ gzz/gzz/vob/vobs/OvalBgVob.java     Thu Dec  5 15:30:15 2002
@@ -41,7 +41,7 @@
  */
 
 public class OvalBgVob extends Vob {
-public static final String rcsid = "$Id: OvalBgVob.java,v 1.6 2002/12/05 
20:16:42 humppake Exp $";
+public static final String rcsid = "$Id: OvalBgVob.java,v 1.7 2002/12/05 
20:30:15 humppake Exp $";
     public static boolean dbg = false;
     static final void p(String s) { if(dbg) System.out.println(s); }
     static final void pa(String s) { System.out.println(s); }
@@ -88,6 +88,17 @@
            g.setColor(bg);
            g.fillOval(mx, my, mw, mh);
        } else {
+           /** Draws solids as colored stripes. Each stripe is composed of
+            * on filled rectangle and two filled arcs. Drawing proceeds from
+            * the boundaries to the centre. Two stripes at time. If there is
+            * odd number of stripes the centered stipes is drawn as two
+            * pieces.  __
+            *         /__ first arc
+            *  one    |  |rectangle
+            *  sripe  |__|
+            *         \__ second arc
+            *
+            */
            g.setColor(solids[0]);
            g.fillArc(mx, my, mw, mh, -90, 180);
            g.setColor(solids[nsolids-1]);
@@ -101,12 +112,14 @@
                float h = b * (float)Math.sqrt(1-(Math.pow(w,2)/Math.pow(a, 
2)));
                int arc = 90 - (int)((180/Math.PI) * Math.atan2(h*(a/b),w));
 
+               // stripe on the left
                g.setColor(solids[i]);
                g.fillRect((int)(mx+(i*solidwidth)), (int)(my+(b-h)),
                           (int)w, (int)(h*2));
                g.fillArc(mx, my, mw, mh, 90, arc);
                g.fillArc(mx, my, mw, mh, -90-arc, arc);
                
+               // stripe on the right
                g.setColor(solids[lastsolid-1]);
                g.fillRect((int)(mx+a), (int)(my+(b-h)), (int)w, (int)(h*2));
                g.fillArc(mx, my, mw, mh, 90-arc, arc);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]