[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] fenfire/org/fenfire/view/buoy TransclusionConne...
From: |
Tuomas J. Lukka |
Subject: |
[ff-cvs] fenfire/org/fenfire/view/buoy TransclusionConne... |
Date: |
Fri, 15 Aug 2003 05:35:10 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/08/15 05:35:10
Modified files:
org/fenfire/view/buoy: TransclusionConnector.java
Log message:
Make the transclusion link id first-class citizen
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/buoy/TransclusionConnector.java.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/view/buoy/TransclusionConnector.java
diff -u fenfire/org/fenfire/view/buoy/TransclusionConnector.java:1.21
fenfire/org/fenfire/view/buoy/TransclusionConnector.java:1.22
--- fenfire/org/fenfire/view/buoy/TransclusionConnector.java:1.21 Mon Aug
4 02:02:48 2003
+++ fenfire/org/fenfire/view/buoy/TransclusionConnector.java Fri Aug 15
05:35:07 2003
@@ -44,7 +44,7 @@
/** Hang transclusion buoys.
*/
public class TransclusionConnector implements BuoyViewConnector {
-public static final String rcsid = "$Id: TransclusionConnector.java,v 1.21
2003/08/04 06:02:48 mudyc Exp $";
+public static final String rcsid = "$Id: TransclusionConnector.java,v 1.22
2003/08/15 09:35:07 tjl Exp $";
public static boolean dbg = false;
private static void p(String s) {
System.out.println("TransclusionConnector:: "+s); }
@@ -83,6 +83,35 @@
}
}
+ /** A link id, for reaching the node from the buoy.
+ */
+ public class LinkId {
+ public LinkId(Object node, PageScrollBlock scrollBlock) {
+ this.node = node;
+ this.scrollBlock = scrollBlock;
+ }
+ /** The Fen node that contains the transclusion.
+ */
+ public final Object node;
+ /** The scrollblock from which the transclusion comes.
+ */
+ public final PageScrollBlock scrollBlock;
+
+ public int hashCode() {
+ return
+ (node.hashCode()*317501) ^
+ (scrollBlock.hashCode()*1941);
+ }
+
+ public boolean equals(Object o) {
+ if(!(o instanceof LinkId)) return false;
+ LinkId p = (LinkId)o;
+ // Nodes can be compared with ==
+ return node == p.node && scrollBlock.equals(p.scrollBlock);
+ }
+
+ }
+
NodeFunction scrollBlockForNode ;
@@ -118,7 +147,8 @@
if(culledCS > 0) cs = culledCS;
l.link(1, cs, pageImageScrollNodeType,
- new Pair(node, ((View2D.Anchor)anchor).plane),
+ new LinkId(node,
+ ((PageScrollBlock)((View2D.Anchor)anchor).plane)),
anchor);
}
@@ -146,7 +176,8 @@
}
Object anchor = getAnchor(plane, node);
l.link(-1, cs, normalNodeNodeType,
- new Pair(node, span.getScrollBlock()),
+ new LinkId(node,
+ (PageScrollBlock)span.getScrollBlock()),
anchor);
}
- [ff-cvs] fenfire/org/fenfire/view/buoy TransclusionConne...,
Tuomas J. Lukka <=