gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz gzz/view/CellVobFactory.java gzz/view/DimDe...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz gzz/view/CellVobFactory.java gzz/view/DimDe...
Date: Tue, 29 Oct 2002 10:08:09 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/10/29 10:08:08

Modified files:
        gzz/view       : CellVobFactory.java DimDecorator.java 
        test/gzz/view  : renderscene.test 

Log message:
        Fix testRenderScene -- the remaining bug is not about the infinite loop 
any more

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellVobFactory.java.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/DimDecorator.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/view/renderscene.test.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gzz/gzz/view/CellVobFactory.java
diff -u gzz/gzz/view/CellVobFactory.java:1.25 
gzz/gzz/view/CellVobFactory.java:1.26
--- gzz/gzz/view/CellVobFactory.java:1.25       Tue Oct 29 02:30:58 2002
+++ gzz/gzz/view/CellVobFactory.java    Tue Oct 29 10:08:08 2002
@@ -46,7 +46,7 @@
  */
 
 public class CellVobFactory extends CellView {
-public static final String rcsid = "$Id: CellVobFactory.java,v 1.25 2002/10/29 
07:30:58 tjl Exp $";
+public static final String rcsid = "$Id: CellVobFactory.java,v 1.26 2002/10/29 
15:08:08 tjl Exp $";
     public static boolean dbg = false;
     private static void p(String s) { if(dbg) pa(s); }
     private static void pa(String s) { System.err.println(s); }
@@ -101,15 +101,9 @@
        sliceId = getSliceId(center);
     }
 
-    public void getDefaultSize(float scale, Dimension into) {
-       into.width = (int)style.getWidth("XXXXXXXXXX", scale)+10;
-       into.height = (int)style.getHeight(scale) + 10;
-    }
-
-    public Dimension getDefaultSize() {
-        Dimension d = new Dimension();
-       getDefaultSize(1, d);
-       return d;
+    public void getSize(Cell c, float scale, float[] into) {
+       into[0] = style.getWidth("XXXXXXXXXX", scale)/scale+10;
+       into[1] = style.getHeight(scale)/scale + 10;
     }
 
     /** Get an Id for the slice this Cell is in.
Index: gzz/gzz/view/DimDecorator.java
diff -u gzz/gzz/view/DimDecorator.java:1.12 gzz/gzz/view/DimDecorator.java:1.13
--- gzz/gzz/view/DimDecorator.java:1.12 Tue Oct 15 09:29:18 2002
+++ gzz/gzz/view/DimDecorator.java      Tue Oct 29 10:08:08 2002
@@ -32,14 +32,17 @@
  *  vob scene.
  */
 public class DimDecorator implements FallbackSceneDecorator {
-String rcsid = "$Id: DimDecorator.java,v 1.12 2002/10/15 13:29:18 tjl Exp $";
+String rcsid = "$Id: DimDecorator.java,v 1.13 2002/10/29 15:08:08 tjl Exp $";
     public static boolean dbg = true;
     private static void p(String s) { if(dbg) pa(s); }
     private static void pa(String s) { System.err.println(s); }
 
     static CellVobFactory cvf = new CellVobFactory();
     static TextStyle style = cvf.style;
-    static Dimension size = cvf.getDefaultSize();
+    static float[] size = new float[2];
+    static {
+       cvf.getSize(null, size);
+    }
 
     static Vob bg = new RectBgVob();
     static Vob conn = new SimpleConnection(0, 0, 0, 0, Color.red);
@@ -57,7 +60,7 @@
        for(int i=0; i<ndims; i++)
            dims[i] = fallback.dimList[win.dimsIndices[i]];
 
-       int w = size.width, h = size.height;
+       float w = size[0], h = size[1];
 
        // The coordinate system where the lines start
        int orig = sc.orthoCS(into, origKey, 0, 0, 0, 2, 2);
Index: gzz/test/gzz/view/renderscene.test
diff -u gzz/test/gzz/view/renderscene.test:1.1 
gzz/test/gzz/view/renderscene.test:1.2
--- gzz/test/gzz/view/renderscene.test:1.1      Tue Oct 29 09:50:43 2002
+++ gzz/test/gzz/view/renderscene.test  Tue Oct 29 10:08:08 2002
@@ -6,6 +6,7 @@
 
 import gzz, java
 from test.tools.tools import *
+from test.tools.gfx import *
 
 space = gzz.impl.ModularSpace(*spaceArgList())
 
@@ -35,7 +36,7 @@
 def testRenderScene():
     view = gzz.view.RowColView(0)
     cellview = gzz.view.CellVobFactory()
-    contentview = TextCellContentView(win.getGraphicsAPI().getTextStyle(
+    contentview = 
gzz.view.TextCellContentView(win.getGraphicsAPI().getTextStyle(
                                       "sans", 0, 20))
 
     vc = VC(space.getHomeCell(), cellview, contentview)




reply via email to

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