[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] fenfire/org/fenfire/view TextNodeView.java
From: |
Asko Soukka |
Subject: |
[ff-cvs] fenfire/org/fenfire/view TextNodeView.java |
Date: |
Mon, 18 Aug 2003 09:05:11 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Asko Soukka <address@hidden> 03/08/18 09:05:11
Modified files:
org/fenfire/view: TextNodeView.java
Log message:
TextNodeView f() return TextPlaceable
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/TextNodeView.java.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/view/TextNodeView.java
diff -u fenfire/org/fenfire/view/TextNodeView.java:1.20
fenfire/org/fenfire/view/TextNodeView.java:1.21
--- fenfire/org/fenfire/view/TextNodeView.java:1.20 Mon Aug 18 03:49:48 2003
+++ fenfire/org/fenfire/view/TextNodeView.java Mon Aug 18 09:05:11 2003
@@ -40,7 +40,7 @@
* The maximum size of a single line is determined by <pre>width</pre>.
*/
public class TextNodeView implements PureNodeFunction {
- public static final String rcsid = "$Id: TextNodeView.java,v 1.20
2003/08/18 07:49:48 tjl Exp $";
+ public static final String rcsid = "$Id: TextNodeView.java,v 1.21
2003/08/18 13:05:11 humppake Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.out.println("TextNodeView::"+s);
}
@@ -87,13 +87,13 @@
final Enfilade1D enf = (Enfilade1D)nodeContent.f(g, node);
final String s = enf.makeString();
if (s.length() == 0)
- return new org.nongnu.libvob.lava.placeable.Placeable() {
- public void place(VobScene vs, int into) {
- }
- public float getWidth() { return 10; }
- public float getHeight() { return 10; }
- };
-
+ return new org.nongnu.libvob.lava.placeable.TextPlaceable() {
+ public void place(VobScene vs, int into) {}
+ public float getWidth() { return 10; }
+ public float getHeight() { return 10; }
+ public void getCursorXY(int position, float[] xyOut) {
getXY(s, position, xyOut); }
+ public int getCursorPos(float x, float y) { return
getPos(s, x, y); }
+ };
final HChain ch = getChain(s);
final HBroken br = breaker.breakLines(ch, width, scale);
final float height = br.getHeight();
@@ -116,18 +116,20 @@
pa(" "+s+"' "+width+" "+height+" "+scale+" "+br);
}
- return new org.nongnu.libvob.lava.placeable.Placeable() {
+ return new org.nongnu.libvob.lava.placeable.TextPlaceable() {
public void place(VobScene vs, int into) {
br.put(vs, into);
}
-
public float getWidth() { return width; }
public float getHeight() { return height; }
+ public void getCursorXY(int position, float[] xyOut) { getXY(s,
position, xyOut); }
+ public int getCursorPos(float x, float y) { return getPos(s, x,
y); }
};
}
/**
- * Get the position of the first character placed after given coordinates.
+ * Get the position of the first character placed the most
+ * closest to the given coordinates.
*/
public int getPos(ConstGraph g, Object node, float x, float y) {
Enfilade1D enf = (Enfilade1D)nodeContent.f(g, node);