fenfire-commits
[Top][All Lists]
Advanced

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

[ff-cvs] libvob/org/nongnu/libvob/vobs TextVob.java text...


From: Matti Katila
Subject: [ff-cvs] libvob/org/nongnu/libvob/vobs TextVob.java text...
Date: Mon, 08 Sep 2003 03:32:48 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Branch:         
Changes by:     Matti Katila <address@hidden>   03/09/08 03:32:47

Modified files:
        org/nongnu/libvob/vobs: TextVob.java textvob.test 

Log message:
        fixing empty test. removed String color argument from constructor 
because it was added by me and is only mess

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/vobs/TextVob.java.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/vobs/textvob.test.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: libvob/org/nongnu/libvob/vobs/TextVob.java
diff -u libvob/org/nongnu/libvob/vobs/TextVob.java:1.8 
libvob/org/nongnu/libvob/vobs/TextVob.java:1.9
--- libvob/org/nongnu/libvob/vobs/TextVob.java:1.8      Mon Aug 25 03:02:32 2003
+++ libvob/org/nongnu/libvob/vobs/TextVob.java  Mon Sep  8 03:32:47 2003
@@ -54,7 +54,7 @@
  * XXX Diagram!
  */
 public class TextVob extends HBox.VobHBox {
-String rcsid = "$Id: TextVob.java,v 1.8 2003/08/25 07:02:32 tjl Exp $";
+String rcsid = "$Id: TextVob.java,v 1.9 2003/09/08 07:32:47 mudyc Exp $";
     public static boolean dbg = false;
     private static void pa(String s) { System.err.println(s); }
 
@@ -76,9 +76,9 @@
      *                         If false, the text will be comfortably within 
the box.
      */
     public TextVob(TextStyle style, String text, boolean baselined) {
-       this(style, text, baselined, (String)null);
+       this(style, text, baselined, (Color)null);
     }
-
+    
     /** Same as another constructor but in GL side you can give the color 
      * with string like "Color 1 0.5 0.5"
      * @param color OpenGL Color used to draw the text.
@@ -87,23 +87,13 @@
        super();
        this.style = style;
        this.baselined = baselined;
-       this.text = text;
-
+       this.text = (text != null ? text: "");
        this.color = color;
        if (color != null)
            this.colorString ="Color "+ ColorUtil.colorGLString(color);
     }
-
-    public TextVob(TextStyle style, String text, boolean baselined, String 
color) {
-       super();
-       this.style = style;
-       this.baselined = baselined;
-       this.text = text;
-
-       this.colorString = color;
-    }
-
-
+    
+    
     /** Create a non-baselined text vob.
      */
     public TextVob(TextStyle style, String text) {
@@ -111,16 +101,12 @@
     }
 
     public TextVob(TextStyle style, String text, boolean baselined, Object 
key) {
-        this(style, text, baselined, (String)null);
+        this(style, text, baselined, (Color)null);
        this.key = key;
     }
     public TextVob(TextStyle style, String text, boolean baselined, Object 
key, Color color) {
         this(style, text, baselined, color);
        this.color = color;
-       this.key = key;
-    }
-    public TextVob(TextStyle style, String text, boolean baselined, Object 
key, String color) {
-        this(style, text, baselined, color);
        this.key = key;
     }
 
Index: libvob/org/nongnu/libvob/vobs/textvob.test
diff -u libvob/org/nongnu/libvob/vobs/textvob.test:1.1 
libvob/org/nongnu/libvob/vobs/textvob.test:1.2
--- libvob/org/nongnu/libvob/vobs/textvob.test:1.1      Mon Sep  8 00:35:13 2003
+++ libvob/org/nongnu/libvob/vobs/textvob.test  Mon Sep  8 03:32:47 2003
@@ -76,6 +76,26 @@
        """The bottom side."""
        checkAvgColor(100, 100+text_height+text_depth+10, text_width, 10, (255, 
0, 0), delta=1)
 
+def testEmpty():
+    """ Empty string has been found to jam the machine elsewhere.
+    This test convinces that the problem isn't in TextVob.
+    """
+    text_scale = 1
+    vs = getvs()
+    size = vs.getSize()
+    vs.map.put(vob.vobs.SolidBackdropVob(Color.red))
+    textvob = vob.vobs.TextVob(sty1, None)
+    
+    text_width = int(textvob.getWidth(text_scale))
+    text_height = int(textvob.getHeight(text_scale))
+    text_depth = int(textvob.getDepth(text_scale))
+    
+    cs = vs.orthoBoxCS(0, "window",  0, 100, 100, 1, 1, size.width, 
size.height)
+    cs_text = vs.orthoCS(cs, "text", 0, 0, 0, text_height + text_depth, 
text_height + text_depth)
+    vs.map.put(textvob, cs_text)
+    render(vs)
+
+
 
 
 # : vim: set syntax=python :




reply via email to

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