[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gzz modules/pp2/PPCanvasCursor.java modules...
From: |
Matti Katila |
Subject: |
[Gzz-commits] gzz/gzz modules/pp2/PPCanvasCursor.java modules... |
Date: |
Sun, 09 Feb 2003 09:21:23 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Matti Katila <address@hidden> 03/02/09 09:21:22
Modified files:
gzz/modules/pp2: PPCanvasCursor.java SinglePaper.java
realppview.py
gzz/view : CoordinatePlaneView.java
gzz/view/buoy : PPLinker.java
Log message:
ok, still buoys are not good
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp2/PPCanvasCursor.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp2/SinglePaper.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/modules/pp2/realppview.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CoordinatePlaneView.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/PPLinker.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
Patches:
Index: gzz/gzz/modules/pp2/PPCanvasCursor.java
diff -u gzz/gzz/modules/pp2/PPCanvasCursor.java:1.7
gzz/gzz/modules/pp2/PPCanvasCursor.java:1.8
--- gzz/gzz/modules/pp2/PPCanvasCursor.java:1.7 Sun Feb 9 02:14:17 2003
+++ gzz/gzz/modules/pp2/PPCanvasCursor.java Sun Feb 9 09:21:22 2003
@@ -25,6 +25,7 @@
import gzz.modules.pp.*;
import gzz.modules.pp.vob.*;
import gzz.*;
+import gzz.vob.impl.DefaultVobMatcher;
import gzz.view.*;
import gzz.view.buoy.*;
import gzz.vob.*;
@@ -40,7 +41,7 @@
/** XXX
*/
public class PPCanvasCursor implements BuoyViewMainNode {
-private static final String rcsid = "$Id: PPCanvasCursor.java,v 1.7 2003/02/09
07:14:17 mudyc Exp $";
+private static final String rcsid = "$Id: PPCanvasCursor.java,v 1.8 2003/02/09
14:21:22 mudyc Exp $";
public static boolean dbg = false;
private static void pa(String s) {
System.out.println("PPCanvasCursor:"+s); }
@@ -130,21 +131,38 @@
public PPCanvasCursor(Cell c, Object content, CellPlacementHook hook,
AbstractViewContext avc, PPDims d, GraphicsAPI.Window
w) {
- super();
this.current = c;
this.content = content;
this.hook = hook;
- this.avc = avc;
+ this.avc = new AbstractViewContext();
+ this.avc.setAccursed(avc.getAccursed());
this.d = d;
this.window = w;
}
+ /** Cause the changes to the zooming and panning variables
+ * to be shown in the given vobscene.
+ * This changes the parameters of the coordinate systems created by
render().
+ */
+ private void setZoomPan(VobScene vs, int mainFrame) {
+ DefaultVobMatcher m = (DefaultVobMatcher)vs.matcher;
+ int cs = m.getCS(mainFrame, "C2F");
+ vs.coords.setOrthoParams(cs, 0, -panx*zoom, -pany*zoom, zoom, zoom);
+ }
+
public void renderMain(VobScene vs, int into) {
int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10);
vs.matcher.add(into, c2fCS, "C2F");
+ setZoomPan(vs, into);
SinglePaper.i(avc, d, window, current).render(vs, into, c2fCS);
- hook.placed(current, vs, into, (ViewContext)avc);
+
+ Cell paper = current.h(d.contains);
+ for (Cell c = paper.s(d.contains); c != null; c = c.s(d.contains) ) {
+ if (c == current) continue;
+ avc.setAccursed(c);
+ hook.placed(c, vs, into, (ViewContext)avc);
+ }
}
public void keystroke(String s) {
Index: gzz/gzz/modules/pp2/SinglePaper.java
diff -u gzz/gzz/modules/pp2/SinglePaper.java:1.2
gzz/gzz/modules/pp2/SinglePaper.java:1.3
--- gzz/gzz/modules/pp2/SinglePaper.java:1.2 Sat Feb 8 05:19:20 2003
+++ gzz/gzz/modules/pp2/SinglePaper.java Sun Feb 9 09:21:22 2003
@@ -16,7 +16,7 @@
* the background and the vobs inside the plane.
*/
public class SinglePaper {
-private static final String rcsid = "$Id: SinglePaper.java,v 1.2 2003/02/08
10:19:20 mudyc Exp $";
+private static final String rcsid = "$Id: SinglePaper.java,v 1.3 2003/02/09
14:21:22 mudyc Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.out.println("SinglePaper:"+s); }
@@ -154,7 +154,7 @@
bg.put(vs, frameUnit, bg2screen);
vs.map.put(black);
coordinatePlaneView.render(vs, paper2screen_shifted,
- context, frameCS, current);
+ context, frameCS);
}};
if(useStencil)
Index: gzz/gzz/modules/pp2/realppview.py
diff -u gzz/gzz/modules/pp2/realppview.py:1.6
gzz/gzz/modules/pp2/realppview.py:1.7
--- gzz/gzz/modules/pp2/realppview.py:1.6 Fri Feb 7 03:29:10 2003
+++ gzz/gzz/modules/pp2/realppview.py Sun Feb 9 09:21:22 2003
@@ -111,7 +111,7 @@
# Create the view..
self.adaptor = BuoyAdaptor()
self.adaptor.cellNodes = [PPCanvasNode(self.d, self.space, self.avc,
w)]
- self.adaptor.cellLinkers = [PPLinker(self.d.clone, self.d.association,
self.d.contains)]
+ self.adaptor.cellLinkers = [PPLinker(self.d.clone, self.d.association)]
self.b_mngr = gzz.view.buoy.buoymanager.RealBuoyManager.__init__(self,
self.adaptor, None, self.avc.getAccursed())
print 'bar'
Index: gzz/gzz/view/CoordinatePlaneView.java
diff -u gzz/gzz/view/CoordinatePlaneView.java:1.12
gzz/gzz/view/CoordinatePlaneView.java:1.13
--- gzz/gzz/view/CoordinatePlaneView.java:1.12 Sat Feb 8 05:19:20 2003
+++ gzz/gzz/view/CoordinatePlaneView.java Sun Feb 9 09:21:22 2003
@@ -36,7 +36,7 @@
*/
public class CoordinatePlaneView implements View {
-public static final String rcsid = "$Id: CoordinatePlaneView.java,v 1.12
2003/02/08 10:19:20 mudyc Exp $";
+public static final String rcsid = "$Id: CoordinatePlaneView.java,v 1.13
2003/02/09 14:21:22 mudyc Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
@@ -52,20 +52,6 @@
/** Get the box into which the cursor cell was placed.
*/
public int getCursorBox() { return cursorBox; }
-
- /** Next generation of PP doens't set accursed when drawing the paper
- */
- public void render(VobScene vs, int into, ViewContext context, int cullCS,
Cell accursed) {
- // push
- Cell temp = context.getAccursed();
- ((AbstractViewContext)context).setAccursed(accursed);
-
- // render
- render(vs, into, context, cullCS);
-
- // pop
- ((AbstractViewContext)context).setAccursed(temp);
- }
public void render(VobScene vs, int into, ViewContext context) {
render(vs, into, context, -1);
Index: gzz/gzz/view/buoy/PPLinker.java
diff -u gzz/gzz/view/buoy/PPLinker.java:1.4 gzz/gzz/view/buoy/PPLinker.java:1.5
--- gzz/gzz/view/buoy/PPLinker.java:1.4 Fri Feb 7 03:33:43 2003
+++ gzz/gzz/view/buoy/PPLinker.java Sun Feb 9 09:21:22 2003
@@ -13,22 +13,17 @@
* The real clone dimension may be used; however, currently,
* this only links between rootclones so it
* is not possible to clone the cell to another paper.
- *
- * mudyc> What's this for? PP has never in my time done links like this.
- * I fix this..
*/
public class PPLinker implements CellBuoyViewLinker {
-public static final String rcsid = "$Id: PPLinker.java,v 1.4 2003/02/07
08:33:43 mudyc Exp $";
- public static boolean dbg = true;
+public static final String rcsid = "$Id: PPLinker.java,v 1.5 2003/02/09
14:21:22 mudyc Exp $";
+ public static boolean dbg = false;
private static void pa(String s) { System.out.println("PPLinker:"+s); }
private Dim d_clone;
private Dim d_assoc;
- private Dim d_contains;
- public PPLinker(Dim d_clone, Dim d_assoc, Dim d_contains) {
+ public PPLinker(Dim d_clone, Dim d_assoc) {
this.d_clone = d_clone;
this.d_assoc = d_assoc;
- this.d_contains = d_contains;
}
public void doLinks(Cell c, VobScene vs, int cs,
@@ -36,23 +31,21 @@
BuoyLinkListener l) {
// XXX Right? Allow only main cell to link?
- // no, absolutely wrong. d.contains can link and the paper,root, can
not.
- // <sigh> if(c.s(d_clone, -1) != null) return;
+ // ahem? why?
+ //if(c.s(d_clone, -1) != null) return;
- Cell note = c.h(d_contains).s(d_contains);
- for (; note != null; note = note.s(d_contains)) {
- for(Cell assoc = note; assoc != null; assoc = assoc.s(d_clone)) {
- Cell left = assoc.s(d_assoc, -1);
- Cell right = assoc.s(d_assoc, 1);
- if(dbg) pa("LINKS "+c+" "+left+" "+right);
- if(right != null) {
- Cell rl = right.h(d_clone);
- l.link(1, cs, cellNodeType, new Pair(c, rl), rl);
- }
- if(left != null) {
- Cell ll = left.h(d_clone);
- l.link(-1, cs, cellNodeType, new Pair(ll, c), ll);
- }
+ Cell note = c.h(d_clone).s(d_clone);
+ for(Cell assoc = note; assoc != null; assoc = assoc.s(d_clone)) {
+ Cell left = assoc.s(d_assoc, -1);
+ Cell right = assoc.s(d_assoc, 1);
+ if(dbg) pa("LINKS "+c+" "+left+" "+right);
+ if(right != null) {
+ Cell rl = right.h(d_clone);
+ l.link(1, cs, cellNodeType, new Pair(c, rl), rl);
+ }
+ if(left != null) {
+ Cell ll = left.h(d_clone);
+ l.link(-1, cs, cellNodeType, new Pair(ll, c), ll);
}
}
}