gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob org/nongnu/libvob/lava/RectVob.java org/...


From: Asko Soukka
Subject: [Gzz-commits] libvob org/nongnu/libvob/lava/RectVob.java org/...
Date: Thu, 10 Apr 2003 16:01:49 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Asko Soukka <address@hidden>    03/04/10 16:01:49

Modified files:
        org/nongnu/libvob/lava: RectVob.java 
        org/nongnu/libvob/vobs: OvalBgVob.java RectBgVob.java 
        doc/pegboard/vob_colorable--humppake: peg.rst 
Added files:
        test/vob       : colorablevob.test 
        org/nongnu/libvob: AbstractColorableVob.java ColorableVob.java 
Removed files:
        org/nongnu/libvob/lava: AbstractColorableVob.java 
                                ColorableVob.java 

Log message:
        ColorableVob

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/test/vob/colorablevob.test?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/AbstractColorableVob.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/ColorableVob.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/lava/RectVob.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/vobs/OvalBgVob.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/vobs/RectBgVob.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/doc/pegboard/vob_colorable--humppake/peg.rst.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: libvob/doc/pegboard/vob_colorable--humppake/peg.rst
diff -u libvob/doc/pegboard/vob_colorable--humppake/peg.rst:1.1 
libvob/doc/pegboard/vob_colorable--humppake/peg.rst:1.2
--- libvob/doc/pegboard/vob_colorable--humppake/peg.rst:1.1     Mon Mar 31 
05:00:04 2003
+++ libvob/doc/pegboard/vob_colorable--humppake/peg.rst Thu Apr 10 16:01:49 2003
@@ -5,9 +5,9 @@
 :Authors:   Asko Soukka
 :Stakeholders: Benja Fallenstein, Tuomas Lukka 
 :Date-created: 2003-03-05
-:Last-Modified: $Date: 2003/03/31 10:00:04 $
-:Revision: $Revision: 1.1 $
-:Status:   Current
+:Last-Modified: $Date: 2003/04/10 20:01:49 $
+:Revision: $Revision: 1.2 $
+:Status:   Implemented
 :Scope:    Trivial
 :Type:     Feature
 
Index: libvob/org/nongnu/libvob/lava/RectVob.java
diff -u libvob/org/nongnu/libvob/lava/RectVob.java:1.3 
libvob/org/nongnu/libvob/lava/RectVob.java:1.4
--- libvob/org/nongnu/libvob/lava/RectVob.java:1.3      Tue Apr  8 07:38:40 2003
+++ libvob/org/nongnu/libvob/lava/RectVob.java  Thu Apr 10 16:01:49 2003
@@ -30,7 +30,7 @@
 
 /** A vob drawing the outline of a rectangle.
  */
-public class RectVob extends AbstractColorableVob {
+public class RectVob extends AbstractVob {
     
     public final int width, height;
    
Index: libvob/org/nongnu/libvob/vobs/OvalBgVob.java
diff -u libvob/org/nongnu/libvob/vobs/OvalBgVob.java:1.3 
libvob/org/nongnu/libvob/vobs/OvalBgVob.java:1.4
--- libvob/org/nongnu/libvob/vobs/OvalBgVob.java:1.3    Tue Apr  8 16:25:02 2003
+++ libvob/org/nongnu/libvob/vobs/OvalBgVob.java        Thu Apr 10 16:01:49 2003
@@ -41,14 +41,11 @@
  * Draws a filled (possibly with several colors) background circle,
  * surrounded by a circle of the current foreground color.
  */
-public class OvalBgVob extends AbstractVob {
-public static final String rcsid = "$Id: OvalBgVob.java,v 1.3 2003/04/08 
20:25:02 tjl Exp $";
+public class OvalBgVob extends AbstractColorableVob {
+public static final String rcsid = "$Id: OvalBgVob.java,v 1.4 2003/04/10 
20:01:49 humppake Exp $";
     public static boolean dbg = false;
     private static final void p(String s) { if(dbg) System.out.println(s); }
 
-    int NColors = 0;
-    Color[] colors;
-
     /** Background color */
     protected final Color bgColor;
 
@@ -133,7 +130,7 @@
        if(mh >= 14) g.fillOval(mx-2, my-2, mw+4, mh+4);
        else g.fillOval(mx-1, my-1, mw+2, mh+2);
 
-       if(colors == null || NColors == 0) {
+       if(colors == null || colors.length == 0) {
            g.setColor(bgColor);
            g.fillOval(mx, my, mw, mh);
        } else {
@@ -150,10 +147,10 @@
             */
            g.setColor(colors[0]);
            g.fillArc(mx, my, mw, mh, -90, 180);
-           g.setColor(colors[NColors-1]);
+           g.setColor(colors[colors.length-1]);
            g.fillArc(mx, my, mw, mh, 90, 180);
-           int lastColor = NColors-1;
-           int colorWidth = mw / NColors;
+           int lastColor = colors.length-1;
+           int colorWidth = mw / colors.length;
            float a = mw/2;
            float b = mh/2;
            for(int i=1; i<lastColor; i++) {
@@ -199,7 +196,7 @@
        if(glList == null) {
            if (!circleGLReady) prepareCircleGL(0.5f);
            String bgcall = "";
-           if(colors != null && NColors > 0) {
+           if(colors != null && colors.length > 0) {
                bgcall += glColorsString();
            } else bgcall += glRectBgString();
            
@@ -293,9 +290,9 @@
     }
 
     protected String glColorsString() {
-       double w = 1.0 / NColors;
+       double w = 1.0 / colors.length;
        String glString = "";
-       for(int i=0; i<NColors; i++) {
+       for(int i=0; i<colors.length; i++) {
            double x1 = i*w;
            double x2 = x1 + w;
            Color c = colors[i];
@@ -314,22 +311,4 @@
        }
        return glString;
     }
-
-    /** Adds one more solid color to be drawn inside
-     * the cell.
-     */
-    public boolean addColor(Color c) {
-       if(colors == null || NColors >= colors.length) {
-           Color[] n= new Color[NColors + 10];
-           if(colors != null) System.arraycopy(colors, 0, n, 0, NColors);
-           colors = n;
-       }
-       colors[NColors++] = c;
-       return false;
-    }
-    /** The currently put solid colors.
-     * null = none. There may be null references near the end
-     * of the array. Mostly useful for checking for nullness.
-     */
-    public Color[] getSolidColors() { return colors; }
 }
Index: libvob/org/nongnu/libvob/vobs/RectBgVob.java
diff -u libvob/org/nongnu/libvob/vobs/RectBgVob.java:1.3 
libvob/org/nongnu/libvob/vobs/RectBgVob.java:1.4
--- libvob/org/nongnu/libvob/vobs/RectBgVob.java:1.3    Tue Apr  8 16:25:02 2003
+++ libvob/org/nongnu/libvob/vobs/RectBgVob.java        Thu Apr 10 16:01:49 2003
@@ -40,14 +40,11 @@
  * Draws a filled (possibly with several colors) background rectangle,
  * surrounded by a rectangle of the current foreground color.
  */
-public class RectBgVob extends AbstractVob {
-public static final String rcsid = "$Id: RectBgVob.java,v 1.3 2003/04/08 
20:25:02 tjl Exp $";
+public class RectBgVob extends AbstractColorableVob {
+public static final String rcsid = "$Id: RectBgVob.java,v 1.4 2003/04/10 
20:01:49 humppake Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
-    int NColors = 0;
-    Color[] colors;
-
     /** Background color */
     protected final Color bgColor;
 
@@ -92,14 +89,14 @@
        if (mh > 14) g.fillRect(mx-2, my-2, mw+4, mh+4);
        else g.fillRect(mx-1, my-1, mw+2, mh+2);
 
-       if(colors == null || NColors == 0) {
+       if(colors == null || colors.length == 0) {
            g.setColor(bgColor);
            g.fillRect(mx, my, mw, mh);
        } else {
-           for(int i=0; i<NColors; i++) {
+           for(int i=0; i<colors.length; i++) {
                g.setColor(colors[i]);
-               g.fillRect(mx+(mw*i)/NColors, my,
-                          mw/NColors, mh);
+               g.fillRect(mx+(mw*i)/colors.length, my,
+                          mw/colors.length, mh);
            }
        }
 
@@ -121,10 +118,10 @@
         if(dbg) pa("Addtolistgl rectbg "+coordsys1);
        if(glList == null) {
            String bgcall = "";
-           if(colors != null && NColors > 0) {
-               double w = 1.0 / NColors;
+           if(colors != null && colors.length > 0) {
+               double w = 1.0 / colors.length;
 
-               for(int i=0; i<NColors; i++) {
+               for(int i=0; i<colors.length; i++) {
                    double x1 = i*w;
                    double x2 = x1 + w;
                     bgcall += (
@@ -176,24 +173,5 @@
                     "End\n" );
        return glString;
     }
-
-
-    /** Adds one more solid color to be drawn inside
-     * the cell.
-     */
-    public boolean addColor(Color c) {
-       if(colors == null || NColors >= colors.length) {
-           Color[] n= new Color[NColors + 10];
-           if(colors != null) System.arraycopy(colors, 0, n, 0, NColors);
-           colors = n;
-       }
-       colors[NColors++] = c;
-       return false;
-    }
-    /** The currently put solid colors.
-     * null = none. There may be null references near the end
-     * of the array. Mostly useful for checking for nullness.
-     */
-    public Color[] getSolidColors() { return colors; }
 }
 




reply via email to

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