[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] fenfire/org/fenfire/view/buoy AbstractNodeType2...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] fenfire/org/fenfire/view/buoy AbstractNodeType2... |
Date: |
Fri, 27 Jun 2003 18:18:41 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Benja Fallenstein <address@hidden> 03/06/27 18:18:41
Modified files:
org/fenfire/view/buoy: AbstractNodeType2D.java NodeType2D.java
NodeType2DFull.java PPConnector.java
TransclusionConnector.java
Log message:
Fix buoy anchor cs and therefore the bug
where the connection wasn't centered on the
buoy during buoy interpolation.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/AbstractNodeType2D.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/NodeType2D.java.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/NodeType2DFull.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/PPConnector.java.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/TransclusionConnector.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/view/buoy/AbstractNodeType2D.java
diff -u fenfire/org/fenfire/view/buoy/AbstractNodeType2D.java:1.3
fenfire/org/fenfire/view/buoy/AbstractNodeType2D.java:1.4
--- fenfire/org/fenfire/view/buoy/AbstractNodeType2D.java:1.3 Wed Jun 11
13:00:24 2003
+++ fenfire/org/fenfire/view/buoy/AbstractNodeType2D.java Fri Jun 27
18:18:41 2003
@@ -51,7 +51,8 @@
Object anchor) {
Pair p = (Pair)anchor;
Object plane = p.first;
- Rectangle rect = (Rectangle)p.second;
+ Pair q = (Pair)p.second;
+ Rectangle rect = (Rectangle)q.first;
return mainNodeFactory.create(plane, view2d,
rect.x+rect.width/2f,
Index: fenfire/org/fenfire/view/buoy/NodeType2D.java
diff -u fenfire/org/fenfire/view/buoy/NodeType2D.java:1.10
fenfire/org/fenfire/view/buoy/NodeType2D.java:1.11
--- fenfire/org/fenfire/view/buoy/NodeType2D.java:1.10 Wed Jun 11 12:10:04 2003
+++ fenfire/org/fenfire/view/buoy/NodeType2D.java Fri Jun 27 18:18:41 2003
@@ -26,6 +26,7 @@
*/
package org.fenfire.view.buoy;
import org.fenfire.view.View2D;
+import org.fenfire.view.NodedView2D;
import org.fenfire.util.Pair;
import org.nongnu.libvob.*;
import org.nongnu.libvob.impl.DefaultVobMatcher;
@@ -52,7 +53,8 @@
public Object getSize(Object linkId, Object anchor,
float wh[]) {
Pair p = (Pair)anchor;
- Rectangle rect = (Rectangle)p.second;
+ Pair q = (Pair)p.second;
+ Rectangle rect = (Rectangle)q.first;
wh[0] = rect.width;
wh[1] = rect.height;
return null;
@@ -68,8 +70,12 @@
}
Pair p = (Pair)anchor;
Object plane = p.first;
- Rectangle rect = (Rectangle)p.second;
+ Pair q = (Pair)p.second;
+ Rectangle rect = (Rectangle)q.first;
+ Object node = q.second; // may be null if this
+ // is not a noded View2D
+
float[] tmp = new float[2];
vs.coords.getSqSize(into, tmp);
float w = tmp[0], h = tmp[1];
@@ -89,6 +95,8 @@
view2d.render(vs, plane, into, into, box2paper);
if (dbg) pa("start renderBuoy..DONE");
- return vs.coords.unitSq(into);
+
+ int box = node==null ? into : vs.matcher.getCS(into, new Pair(plane,
node));
+ return vs.coords.unitSq(box);
}
}
Index: fenfire/org/fenfire/view/buoy/NodeType2DFull.java
diff -u fenfire/org/fenfire/view/buoy/NodeType2DFull.java:1.6
fenfire/org/fenfire/view/buoy/NodeType2DFull.java:1.7
--- fenfire/org/fenfire/view/buoy/NodeType2DFull.java:1.6 Wed Jun 11
13:00:24 2003
+++ fenfire/org/fenfire/view/buoy/NodeType2DFull.java Fri Jun 27 18:18:41 2003
@@ -68,7 +68,8 @@
}
Pair p = (Pair)anchor;
Object plane = p.first;
- Rectangle rect = (Rectangle)p.second;
+ Pair q = (Pair)p.second;
+ Rectangle rect = (Rectangle)q.first;
view2d.getSize(plane, tmpSize);
vs.coords.getSqSize(into, tmpSqSize);
Index: fenfire/org/fenfire/view/buoy/PPConnector.java
diff -u fenfire/org/fenfire/view/buoy/PPConnector.java:1.14
fenfire/org/fenfire/view/buoy/PPConnector.java:1.15
--- fenfire/org/fenfire/view/buoy/PPConnector.java:1.14 Wed Jun 11 13:00:24 2003
+++ fenfire/org/fenfire/view/buoy/PPConnector.java Fri Jun 27 18:18:41 2003
@@ -41,7 +41,7 @@
/** Make the kinds of links familiar from PP structure.
*/
public class PPConnector implements BuoyViewConnector {
-public static final String rcsid = "$Id: PPConnector.java,v 1.14 2003/06/11
17:00:24 tjl Exp $";
+public static final String rcsid = "$Id: PPConnector.java,v 1.15 2003/06/27
22:18:41 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.out.println("PPConnector::"+s); }
@@ -95,7 +95,7 @@
Object obj = iter.next();
Object plane = fen.constgraph.find1_X11(CANVAS2D.contains, obj);
if (container == plane) continue;
- Pair anchor = new Pair(plane, getRect(obj));
+ Pair anchor = new Pair(plane, new Pair(getRect(obj), obj));
if (dbg) pa("rect:"+getRect(obj));
l.link(1, cs, nodeType, new Pair(node, obj), anchor, shift);
shift++;
@@ -108,7 +108,7 @@
Object obj = iter.next();
Object plane = fen.constgraph.find1_X11(CANVAS2D.contains, obj);
if (container == plane) continue;
- Pair anchor = new Pair(plane, getRect(obj));
+ Pair anchor = new Pair(plane, new Pair(getRect(obj), obj));
if (dbg) pa("rect:"+getRect(obj));
l.link(-1, cs, nodeType, new Pair(obj, node), anchor, shift);
shift++;
Index: fenfire/org/fenfire/view/buoy/TransclusionConnector.java
diff -u fenfire/org/fenfire/view/buoy/TransclusionConnector.java:1.12
fenfire/org/fenfire/view/buoy/TransclusionConnector.java:1.13
--- fenfire/org/fenfire/view/buoy/TransclusionConnector.java:1.12 Wed Jun
11 13:00:24 2003
+++ fenfire/org/fenfire/view/buoy/TransclusionConnector.java Fri Jun 27
18:18:41 2003
@@ -45,7 +45,7 @@
/** Hang transclusion buoys.
*/
public class TransclusionConnector implements BuoyViewConnector {
-public static final String rcsid = "$Id: TransclusionConnector.java,v 1.12
2003/06/11 17:00:24 tjl Exp $";
+public static final String rcsid = "$Id: TransclusionConnector.java,v 1.13
2003/06/27 22:18:41 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) {
System.out.println("TransclusionConnector:: "+s); }
@@ -80,7 +80,7 @@
for(int i=0; i<sp.getPageIndex(); i++)
x += b.getPage(i).getSize().width;
- return new Pair(b, new Rectangle(x,y,w,h));
+ return new Pair(b, new Pair(new Rectangle(x,y,w,h), null));
}
}
@@ -149,7 +149,7 @@
if(dbg) pa("No plane!");
continue;
}
- Object anchor = new Pair(plane, getRect(node));
+ Object anchor = new Pair(plane, new Pair(getRect(node),
null));
l.link(-1, cs, normalNodeNodeType,
new Pair(node, span.getScrollBlock()),
anchor);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] fenfire/org/fenfire/view/buoy AbstractNodeType2...,
Benja Fallenstein <=