/[classpath]/classpath/javax/swing/text/GlyphView.java
ViewVC logotype

Diff of /classpath/javax/swing/text/GlyphView.java

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

revision 1.2.2.4 by gnu_andrew, Tue Sep 20 18:46:35 2005 UTC revision 1.2.2.5 by gnu_andrew, Wed Nov 2 00:44:03 2005 UTC
# Line 44  import java.awt.FontMetrics; Line 44  import java.awt.FontMetrics;
44  import java.awt.Graphics;  import java.awt.Graphics;
45  import java.awt.Rectangle;  import java.awt.Rectangle;
46  import java.awt.Shape;  import java.awt.Shape;
47    import java.awt.Toolkit;
48  import java.text.BreakIterator;  import java.text.BreakIterator;
49    
50  import javax.swing.SwingConstants;  import javax.swing.SwingConstants;
# Line 71  public class GlyphView extends View impl Line 72  public class GlyphView extends View impl
72       */       */
73      public GlyphPainter()      public GlyphPainter()
74      {      {
75          // Nothing to do here.
76      }      }
77    
78      /**      /**
# Line 258  public class GlyphView extends View impl Line 260  public class GlyphView extends View impl
260      public float getHeight(GlyphView view)      public float getHeight(GlyphView view)
261      {      {
262        Font font = view.getFont();        Font font = view.getFont();
263        FontMetrics metrics = view.getContainer().getFontMetrics(font);        FontMetrics metrics = Toolkit.getDefaultToolkit().getFontMetrics(font);
264        float height = metrics.getHeight();        float height = metrics.getHeight();
265        return height;        return height;
266      }      }
# Line 377  public class GlyphView extends View impl Line 379  public class GlyphView extends View impl
379      {      {
380        Element el = view.getElement();        Element el = view.getElement();
381        Font font = view.getFont();        Font font = view.getFont();
382        FontMetrics fm = view.getContainer().getFontMetrics(font);        FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font);
383        Segment txt = view.getText(p0, p1);        Segment txt = view.getText(p0, p1);
384        int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, te, p0);        int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, te, p0);
385        return span;        return span;
# Line 664  public class GlyphView extends View impl Line 666  public class GlyphView extends View impl
666        }        }
667      catch (BadLocationException ex)      catch (BadLocationException ex)
668        {        {
669          throw new AssertionError("BadLocationException must not be thrown "          AssertionError ae;
670                                   + "here");          ae = new AssertionError("BadLocationException must not be thrown "
671                                    + "here");
672            ae.initCause(ex);
673            throw ae;
674        }        }
675      FontMetrics fm = null; // Fetch font metrics somewhere.      FontMetrics fm = null; // Fetch font metrics somewhere.
676      return Utilities.getTabbedTextWidth(seg, fm, 0, null, p0);      return Utilities.getTabbedTextWidth(seg, fm, 0, null, p0);
# Line 712  public class GlyphView extends View impl Line 717  public class GlyphView extends View impl
717        }        }
718      catch (BadLocationException ex)      catch (BadLocationException ex)
719        {        {
720          throw new AssertionError("BadLocationException should not be "          AssertionError ae;
721                                   + "thrown here. p0 = " + p0 + ", p1 = " + p1);          ae = new AssertionError("BadLocationException should not be "
722                                    + "thrown here. p0 = " + p0 + ", p1 = " + p1);
723            ae.initCause(ex);
724            throw ae;
725        }        }
726    
727      return txt;      return txt;

Legend:
Removed from v.1.2.2.4  
changed lines
  Added in v.1.2.2.5

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