/[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.33 by benja, Fri Dec 6 01:03:51 2002 UTC revision 1.34 by benja, Sun Dec 8 01:35:06 2002 UTC
# Line 24  BoxCellView.java Line 24  BoxCellView.java
24  package gzz.view;  package gzz.view;
25  import gzz.client.*;  import gzz.client.*;
26  import gzz.*;  import gzz.*;
27    import gzz.zzutil.Containment;
28  import gzz.errors.*;  import gzz.errors.*;
29  import gzz.vob.*;  import gzz.vob.*;
30  import gzz.vob.impl.*;  import gzz.vob.impl.*;
# Line 62  public static final String rcsid = "$Id$ Line 63  public static final String rcsid = "$Id$
63                          float[] out) {                          float[] out) {
64          String s;          String s;
65          if(c != null)          if(c != null)
66              s = c.t();              s = Containment.getContainedText(c);
67          else          else
68              s = widthString;              s = widthString;
69          out[0] = style.getWidth(s, scale) / scale;          out[0] = style.getWidth(s, scale) / scale;
# Line 73  public static final String rcsid = "$Id$ Line 74  public static final String rcsid = "$Id$
74      java.awt.Point point;      java.awt.Point point;
75      public void place(Cell c, VobScene vs, int box,      public void place(Cell c, VobScene vs, int box,
76                        ViewContext context) {                        ViewContext context) {
77          String s = c.t();          String s = Containment.getContainedText(c);
78          if (s == null) s = "";          if (s == null) s = "";
79          int offs = context.getCursorOffset(c);          int offs = context.getCursorOffset(c);
80          if(dbg) pa("TextCellContentview: '"+s+"' "+offs);          if(dbg) pa("TextCellContentview: '"+s+"' "+offs);
# Line 137  public static final String rcsid = "$Id$ Line 138  public static final String rcsid = "$Id$
138      protected void placeVob(Cell c, VobScene vs, int cs, int start, int end,      protected void placeVob(Cell c, VobScene vs, int cs, int start, int end,
139                              int offs, ViewContext context, float h, float scaled_h, float scale) {                              int offs, ViewContext context, float h, float scaled_h, float scale) {
140              // XXX should optimize for common case: no substring()              // XXX should optimize for common case: no substring()
141          TextVob vob = new TextVob(style, c.t().substring(start, end));          TextVob vob = new TextVob(style, Containment.getContainedText(c).substring(start, end));
142          int cs_scaled = vs.orthoCS(cs, WH_KEY, 0, 0, 0, h, h);          int cs_scaled = vs.orthoCS(cs, WH_KEY, 0, 0, 0, h, h);
143          vs.map.put(vob, cs_scaled);          vs.map.put(vob, cs_scaled);
144    
145          if(offs >= 0 && offs >= start && offs <= end) {          if(offs >= 0 && offs >= start && offs <= end) {
146              float x = style.getWidth(c.t().substring(start, offs), scale);              float x = style.getWidth(Containment.getContainedText(c).substring(start, offs), scale);
147              x *= h/scaled_h;              x *= h/scaled_h;
148              int cs_cursor = vs.orthoCS(cs, CURS_KEY, -1, x+1, 0, 0, h);              int cs_cursor = vs.orthoCS(cs, CURS_KEY, -1, x+1, 0, 0, h);
149              // v.map.put(new TextCursorVob(vob, offs), cs);              // v.map.put(new TextCursorVob(vob, offs), cs);

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

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