/[gzz]/gzz/gzz/view/TextCellContentView.java
ViewVC logotype

Diff of /gzz/gzz/view/TextCellContentView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by tjl, Tue Oct 15 13:29:18 2002 UTC revision 1.19 by tjl, Tue Oct 29 07:30:58 2002 UTC
# Line 36  import java.util.*; Line 36  import java.util.*;
36  /** A cell content view showing a cell's text.  /** A cell content view showing a cell's text.
37   */   */
38    
39  public class TextCellContentView implements CellContentView {  public class TextCellContentView extends CellContentView {
40  public static final String rcsid = "$Id$";  public static final String rcsid = "$Id$";
41      public static boolean dbg = false;      public static boolean dbg = false;
42      private static void p(String s) { if(dbg) pa(s); }      private static void p(String s) { if(dbg) pa(s); }
# Line 52  public static final String rcsid = "$Id$ Line 52  public static final String rcsid = "$Id$
52      }      }
53    
54      public void place(Cell c, VobScene v, Box box,      public void place(Cell c, VobScene v, Box box,
55                        ViewContext context, float scale) {                        ViewContext context) {
56          String s = c.t();          String s = c.t();
57          if (s == null) s = "";          if (s == null) s = "";
58          int offs = context.getCursorOffset(c);          int offs = context.getCursorOffset(c);
# Line 73  public static final String rcsid = "$Id$ Line 73  public static final String rcsid = "$Id$
73          offs -= brBefore;          offs -= brBefore;
74          center -= brBefore;          center -= brBefore;
75    
76            float scale = 1; // XXX use getFontSize
77    
78          float width = style.getWidth(s, scale);          float width = style.getWidth(s, scale);
79          float left = style.getWidth(s.substring(0, center), scale);          float left = style.getWidth(s.substring(0, center), scale);
80          float right = width - left;          float right = width - left;

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26