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

Diff of /gzz/gzz/view/LinebrokenCellContentView.java

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

revision 1.15 by humppake, Mon Nov 18 10:28:16 2002 UTC revision 1.16 by benja, Sun Nov 24 20:09:18 2002 UTC
# Line 50  public static final String rcsid = "$Id$ Line 50  public static final String rcsid = "$Id$
50      TextStyle style;      TextStyle style;
51      SimpleLinebreaker breaker = new SimpleLinebreaker();      SimpleLinebreaker breaker = new SimpleLinebreaker();
52    
53    
54        String widthString;
55    
56      public LinebrokenCellContentView(TextStyle style) {      public LinebrokenCellContentView(TextStyle style) {
57            this(style, "XXXXXXXXXX");
58        }
59    
60        public LinebrokenCellContentView(TextStyle style, String widthString) {
61          this.style = style;          this.style = style;
62            this.widthString = widthString;
63      }      }
64    
65      /** Get the height necessary to layout *all* text in a cell,      /** Get the height necessary to layout *all* text in a cell,
# Line 63  public static final String rcsid = "$Id$ Line 71  public static final String rcsid = "$Id$
71          return br.getHeight();          return br.getHeight();
72      }      }
73    
74        public void getSize(Cell c, float scale, ViewContext context,
75                            float[] out) {
76            String s;
77            if(c != null)
78                s = c.t();
79            else
80                s = widthString;
81    
82            float w = style.getWidth(s, scale);
83            float h;
84            if(c != null)
85                h = getHeight(c, w, scale);
86            else
87                h = style.getHeight(scale);
88            
89            out[0] = w/scale;
90            out[1] = h/scale;
91        }
92    
93      static Rectangle box = new Rectangle();      static Rectangle box = new Rectangle();
94      float[] boxwh = new float[2];      float[] boxwh = new float[2];
95      public void place(Cell c, VobScene vs, int box,      public void place(Cell c, VobScene vs, int box,

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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