home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Java / CFJava.cab / CFJavaRuntime.cab / netscape / application / HRTextAttachment.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-10-01  |  1.2 KB  |  31 lines

  1. package netscape.application;
  2.  
  3. public class HRTextAttachment extends TextAttachment {
  4.    private static int WIDTH_OFFSET = 10;
  5.    private static int HEIGHT = 12;
  6.  
  7.    public int width() {
  8.       return ((TextAttachment)this).owner().width();
  9.    }
  10.  
  11.    public int height() {
  12.       return HEIGHT;
  13.    }
  14.  
  15.    public void drawInRect(Graphics var1, Rect var2) {
  16.       Rect var3 = new Rect();
  17.       if (var1 != null && var2 != null) {
  18.          var3.x = var2.x + WIDTH_OFFSET;
  19.          var3.width = var2.width - 2 * WIDTH_OFFSET;
  20.          var3.height = 2;
  21.          var3.y = var2.y + (HEIGHT - 2) / 2;
  22.          var1.setColor(Color.darkGray);
  23.          var1.fillRect(var3);
  24.          ++var3.y;
  25.          var3.height = 1;
  26.          var1.setColor(Color.lightGray);
  27.          var1.fillRect(var3);
  28.       }
  29.    }
  30. }
  31.