[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./TODO gzz/client/Fallback.java gzz/view/Ce...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz ./TODO gzz/client/Fallback.java gzz/view/Ce... |
Date: |
Wed, 30 Oct 2002 14:10:18 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/30 14:10:17
Modified files:
. : TODO
gzz/client : Fallback.java
gzz/view : Cell1DBuoyHook.java CellInBox.java
CellVobFactory.java LollipopCellVobFactory.java
RowColView.java ViewContext.java
VobVanishingClient.java ZZViewContext.java
gzz/vob : Box.java VobScene.java
test/tools : gfx.py
Added files:
doc/pegboard/view_split--tjl: peg.rst
gzz/view : AbstractViewContext.java
CoordinatePlaneView.java
test/gzz/view : coordinateplane.test
Log message:
Various Pp-related changes
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.339&tr2=1.340&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/view_split--tjl/peg.rst?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/Fallback.java.diff?tr1=1.48&tr2=1.49&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/AbstractViewContext.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CoordinatePlaneView.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/Cell1DBuoyHook.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellInBox.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellVobFactory.java.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LollipopCellVobFactory.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/RowColView.java.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/ViewContext.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/VobVanishingClient.java.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/ZZViewContext.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/Box.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/VobScene.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/view/coordinateplane.test?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/tools/gfx.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: gzz/TODO
diff -u gzz/TODO:1.339 gzz/TODO:1.340
--- gzz/TODO:1.339 Wed Oct 30 06:26:40 2002
+++ gzz/TODO Wed Oct 30 14:10:17 2002
@@ -132,7 +132,8 @@
tjl:
- PP [deadline 5.11]
- refactor
- - separate objects on paper from coordinates and scale.
+ - tests for box activation
+ - implement using the new gzz.view classes
- make it work again
- bindings
- mouse click coordinates
Index: gzz/gzz/client/Fallback.java
diff -u gzz/gzz/client/Fallback.java:1.48 gzz/gzz/client/Fallback.java:1.49
--- gzz/gzz/client/Fallback.java:1.48 Sun Oct 27 19:17:54 2002
+++ gzz/gzz/client/Fallback.java Wed Oct 30 14:10:17 2002
@@ -73,7 +73,7 @@
* It implements a subset of the 0.6.0 bindings.
*/
public class Fallback {
-public static final String rcsid = "$Id: Fallback.java,v 1.48 2002/10/28
00:17:54 benja Exp $";
+public static final String rcsid = "$Id: Fallback.java,v 1.49 2002/10/30
19:10:17 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
@@ -195,10 +195,10 @@
public boolean isMarked(Cell c) {
return DefaultBinder.markedCells.contains(c);
}
- public CellView getCellView() {
+ public CellInBox getCellView() {
return cellView;
}
- public CellContentView getCellContentView() {
+ public CellInBox getCellContentView() {
return cellContentView;
}
public Cell getWindow() {
Index: gzz/gzz/view/Cell1DBuoyHook.java
diff -u gzz/gzz/view/Cell1DBuoyHook.java:1.2
gzz/gzz/view/Cell1DBuoyHook.java:1.3
--- gzz/gzz/view/Cell1DBuoyHook.java:1.2 Tue Oct 29 16:21:25 2002
+++ gzz/gzz/view/Cell1DBuoyHook.java Wed Oct 30 14:10:17 2002
@@ -31,16 +31,27 @@
* XXX Tjl Doc
*/
public class Cell1DBuoyHook implements CellPlacementHook {
-public static final String rcsid = "$Id: Cell1DBuoyHook.java,v 1.2 2002/10/29
21:21:25 benja Exp $";
+public static final String rcsid = "$Id: Cell1DBuoyHook.java,v 1.3 2002/10/30
19:10:17 tjl Exp $";
public static boolean dbg = true;
private static void pa(String s) { System.err.println(s); }
- Dim d_clone;
- Dim d_assoc;
- Buoy4Floater leftfloater;
- Buoy4Floater rightfloater;
+ /** A simple interface for placing buoys.
+ */
+ public interface Floater {
+ /** Create a buoy.
+ * @param b The box of the anchor.
+ * @param c The cell which is the center of the new buoy.
+ * @param connectedFrom The cell which was placed
+ */
+ void buoy(Box b, Cell c, Cell connectedFrom);
+ }
+
+ private Dim d_clone;
+ private Dim d_assoc;
+ private Floater leftfloater;
+ private Floater rightfloater;
- public Cell1DBuoyHook(Buoy4Floater leftfloater, Buoy4Floater rightfloater,
+ public Cell1DBuoyHook(Floater leftfloater, Floater rightfloater,
Dim d_clone, Dim d_assoc) {
this.leftfloater = leftfloater;
this.rightfloater = rightfloater;
@@ -56,20 +67,10 @@
if(dbg) pa("BUOYS: LINKS");
if(dbg) pa("left: "+left+" right: "+right);
if(right != null) {
- /*
- int cs = rightfloater.buoyCoordsys(anchor,
- keyer.getBrowseEntry(
- right.getRootclone(), assoc, right));
- placeBuoyContents(vs, cs, right);
- */
+ rightfloater.buoy(b, right.h(d_clone), c);
}
if(left != null) {
- /*
- int cs = leftfloater.buoyCoordsys(anchor,
- keyer.getBrowseEntry(
- left.getRootclone(), assoc, left));
- placeBuoyContents(vs, cs, left);
- */
+ leftfloater.buoy(b, left.h(d_clone), c);
}
}
Index: gzz/gzz/view/CellInBox.java
diff -u gzz/gzz/view/CellInBox.java:1.2 gzz/gzz/view/CellInBox.java:1.3
--- gzz/gzz/view/CellInBox.java:1.2 Tue Oct 29 16:21:25 2002
+++ gzz/gzz/view/CellInBox.java Wed Oct 30 14:10:17 2002
@@ -34,12 +34,12 @@
* the default implementations call each other.
*/
public abstract class CellInBox {
-public static final String rcsid = "$Id: CellInBox.java,v 1.2 2002/10/29
21:21:25 benja Exp $";
+public static final String rcsid = "$Id: CellInBox.java,v 1.3 2002/10/30
19:10:17 tjl Exp $";
/** Place the contents of one cell into the given coord system.
* The coordsys given shall be a mapping from the rectangle
* (0,w)x(0,h) onto the screen.
*/
- public abstract void place(Cell c, VobScene sc, Box b,
+ public abstract void place(Cell c, VobScene vs, Box b,
ViewContext context);
/** Get the default size of the cell.
Index: gzz/gzz/view/CellVobFactory.java
diff -u gzz/gzz/view/CellVobFactory.java:1.26
gzz/gzz/view/CellVobFactory.java:1.27
--- gzz/gzz/view/CellVobFactory.java:1.26 Tue Oct 29 10:08:08 2002
+++ gzz/gzz/view/CellVobFactory.java Wed Oct 30 14:10:17 2002
@@ -46,7 +46,7 @@
*/
public class CellVobFactory extends CellView {
-public static final String rcsid = "$Id: CellVobFactory.java,v 1.26 2002/10/29
15:08:08 tjl Exp $";
+public static final String rcsid = "$Id: CellVobFactory.java,v 1.27 2002/10/30
19:10:17 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); }
@@ -134,7 +134,7 @@
if(d_clone == null)
throw new NullPointerException("clone dim not set in
CellVobFactory");
- final CellContentView ccv =
+ final CellInBox ccv =
cellContentView != null ? cellContentView :
context.getCellContentView();
final RectBgVob bg = new RectBgVob();
Index: gzz/gzz/view/LollipopCellVobFactory.java
diff -u gzz/gzz/view/LollipopCellVobFactory.java:1.2
gzz/gzz/view/LollipopCellVobFactory.java:1.3
--- gzz/gzz/view/LollipopCellVobFactory.java:1.2 Tue Oct 29 02:30:58 2002
+++ gzz/gzz/view/LollipopCellVobFactory.java Wed Oct 30 14:10:17 2002
@@ -37,7 +37,7 @@
/** A factory for making ball-and-stick aka lollipop cell vobs. */
public class LollipopCellVobFactory extends CellVobFactory {
-public static final String rcsid = "$Id: LollipopCellVobFactory.java,v 1.2
2002/10/29 07:30:58 tjl Exp $";
+public static final String rcsid = "$Id: LollipopCellVobFactory.java,v 1.3
2002/10/30 19:10:17 tjl Exp $";
/** Add the vobs that make up an image of a cell
* into the given coordinate
@@ -54,7 +54,7 @@
if(d_clone == null)
throw new NullPointerException("clone dim not set in
LollipopCellVobFactory");
- final CellContentView ccv =
+ final CellInBox ccv =
cellContentView != null ? cellContentView :
context.getCellContentView();
/** Uses OvalBgVob as the ball. */
Index: gzz/gzz/view/RowColView.java
diff -u gzz/gzz/view/RowColView.java:1.9 gzz/gzz/view/RowColView.java:1.10
--- gzz/gzz/view/RowColView.java:1.9 Tue Oct 29 02:30:58 2002
+++ gzz/gzz/view/RowColView.java Wed Oct 30 14:10:17 2002
@@ -46,7 +46,7 @@
}
public void render(VobScene sc, int into, ViewContext context) {
- CellView fact = context.getCellView();
+ CellInBox fact = context.getCellView();
Dimension size = sc.getSize();
Dimension cellSize = new Dimension();
Index: gzz/gzz/view/ViewContext.java
diff -u gzz/gzz/view/ViewContext.java:1.4 gzz/gzz/view/ViewContext.java:1.5
--- gzz/gzz/view/ViewContext.java:1.4 Tue Oct 1 09:06:10 2002
+++ gzz/gzz/view/ViewContext.java Wed Oct 30 14:10:17 2002
@@ -41,7 +41,7 @@
*/
public interface ViewContext {
-String rcsid = "$Id: ViewContext.java,v 1.4 2002/10/01 13:06:10 benja Exp $";
+String rcsid = "$Id: ViewContext.java,v 1.5 2002/10/30 19:10:17 tjl Exp $";
/** Get the accursed cell. */
Cell getAccursed();
@@ -66,8 +66,8 @@
boolean isMarked(Cell c);
View getView();
- CellView getCellView();
- CellContentView getCellContentView();
+ CellInBox getCellView();
+ CellInBox getCellContentView();
/** Get the maincell of the window, if available.
* This cell can be used to acquire more metadata about how to
Index: gzz/gzz/view/VobVanishingClient.java
diff -u gzz/gzz/view/VobVanishingClient.java:1.19
gzz/gzz/view/VobVanishingClient.java:1.20
--- gzz/gzz/view/VobVanishingClient.java:1.19 Tue Oct 29 02:30:58 2002
+++ gzz/gzz/view/VobVanishingClient.java Wed Oct 30 14:10:17 2002
@@ -100,7 +100,7 @@
}
ViewContext context;
- CellView cvf;
+ CellInBox cvf;
float[] s = new float[2];
public Object getVobSize(Cell c, float fract, int flags, Dimension outDim)
{
Index: gzz/gzz/view/ZZViewContext.java
diff -u gzz/gzz/view/ZZViewContext.java:1.4 gzz/gzz/view/ZZViewContext.java:1.5
--- gzz/gzz/view/ZZViewContext.java:1.4 Tue Oct 1 09:06:10 2002
+++ gzz/gzz/view/ZZViewContext.java Wed Oct 30 14:10:17 2002
@@ -38,7 +38,7 @@
*/
public class ZZViewContext implements ViewContext {
-String rcsid = "$Id: ZZViewContext.java,v 1.4 2002/10/01 13:06:10 benja Exp $";
+String rcsid = "$Id: ZZViewContext.java,v 1.5 2002/10/30 19:10:17 tjl Exp $";
public final Cell window;
@@ -70,11 +70,11 @@
throw new UnsupportedOperationException("not implemented");
}
- public CellView getCellView() {
+ public CellInBox getCellView() {
throw new UnsupportedOperationException("not implemented");
}
- public CellContentView getCellContentView() {
+ public CellInBox getCellContentView() {
throw new UnsupportedOperationException("not implemented");
}
Index: gzz/gzz/vob/Box.java
diff -u gzz/gzz/vob/Box.java:1.5 gzz/gzz/vob/Box.java:1.6
--- gzz/gzz/vob/Box.java:1.5 Tue Oct 29 09:09:32 2002
+++ gzz/gzz/vob/Box.java Wed Oct 30 14:10:17 2002
@@ -46,7 +46,7 @@
* }
* </pre>
*/
-public class Box {
+public class Box implements Cloneable {
/** The key used to put the unitcoordsys under whcoordsys.
*/
static public final Object UNITCOORDSYSKEY = new Object();
@@ -60,6 +60,10 @@
int culledwhcoordsys;
int unitcoordsys;
+ public String toString() {
+ return "[Box: "+vs+" "+w+" "+h+" "+whcoordsys+" "+culledwhcoordsys+" "+
+ unitcoordsys+"]\n";
+ }
/** Set this box to a new box.
* @param vs The vobscene to use
@@ -80,6 +84,15 @@
this.cullTo = cull;
}
+ /** Activate the unitcoordsys of this box.
+ * Convenience; defined to be equivalent to
+ * <pre>
+ * vs.activate(getUnitCoordsys())
+ * </pre>
+ */
+ public void activate() {
+ vs.activate(getUnitCoordsys());
+ }
/** Create the unit square coordsys.
*/
@@ -100,9 +113,11 @@
*/
public int getWHCoordsys() {
if(cullTo >= 0) {
- // XXX Fill in when three-component cull is done
-// if(culledwhcoordsys < 0)
-// culledwhcoordsys = vs.
+ if(culledwhcoordsys < 0)
+ culledwhcoordsys =
+ ((gzz.gfx.gl.GLVobCoorder)vs.coords).cull(
+ whcoordsys, getUnitCoordsys(), cullTo);
+ return culledwhcoordsys;
}
return whcoordsys;
}
@@ -123,6 +138,14 @@
unitcoordsys = -1;
w = bw;
h = bh;
+ }
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch(Exception e) {
+ return null;
+ }
}
}
Index: gzz/gzz/vob/VobScene.java
diff -u gzz/gzz/vob/VobScene.java:1.12 gzz/gzz/vob/VobScene.java:1.13
--- gzz/gzz/vob/VobScene.java:1.12 Tue Oct 15 09:29:19 2002
+++ gzz/gzz/vob/VobScene.java Wed Oct 30 14:10:17 2002
@@ -110,6 +110,16 @@
map.put(v, c);
}
+ /** Cause the given coordinate system to be considered when
+ * getCSAt() is called.
+ */
+ public void activate(int cs) {
+ coords.activate(cs);
+ }
+ public void activate(Object key) {
+ coords.activate(matcher.getCS(key));
+ }
+
public Object getKeyAt(float x, float y, float[] targetcoords) {
return null;
}
Index: gzz/test/tools/gfx.py
diff -u gzz/test/tools/gfx.py:1.7 gzz/test/tools/gfx.py:1.8
--- gzz/test/tools/gfx.py:1.7 Tue Oct 29 10:35:51 2002
+++ gzz/test/tools/gfx.py Wed Oct 30 14:10:17 2002
@@ -78,3 +78,19 @@
if abs(dst[i]-dstlist[i]) > delta:
raise str([srclist, dstlist, dst, i, dst[i], dstlist[i]])
+
+class CellInBox_ConstFlat(gzz.view.CellInBox):
+ """A CellInBox that places white rectbgvobs of constant size.
+ """
+ bgv = gzz.vob.RectBgVob()
+ def __init__(self, w, h):
+ self.w = w
+ self.h = h
+ print "CBCF init"
+ def getSize(self, *args):
+ args[-1][0] = self.w
+ args[-1][1] = self.h
+ print "CBCF getsize",args
+ def place(self, cell, vs, box, context):
+ print "Place: ", box
+ vs.map.put(self.bgv, box.getUnitCoordsys())
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./TODO gzz/client/Fallback.java gzz/view/Ce...,
Tuomas J. Lukka <=