// Job: Jay's Own Browser, a web browser written in Java by Jay Skeer // Copyright (C) 1996 Jay Skeer, Jay Prime Positive // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // import java.awt.*; public class HtmlRuleArea extends HtmlDocumentArea { public HtmlRuleArea(HotText ht, int x1, int y1, int x2, int y2, int bly) { text= ht.getText(); hot_item= ht.getHotItem(); area= new Rectangle(); if (null != hot_item) { color= Color.blue; } else { color= Color.black; } base_line= bly; area= new Rectangle(Math.min(x1,x2), Math.min(y1,y2), Math.abs(x2 - x1), Math.abs(y2 - y1)); } public HtmlRuleArea(HotItem hi, int x1, int y1, int x2, int y2, int bly) { text= new String(); hot_item= hi; area= new Rectangle(); if (null != hot_item) { color= Color.blue; } else { color= Color.black; } base_line= bly; area= new Rectangle(Math.min(x1,x2), Math.min(y1,y2), Math.abs(x2 - x1), Math.abs(y2 - y1)); } public void paint(Graphics g, int xoff, int yoff) { Jdb.enter("HRA.paint(g"+g+", "+xoff+","+yoff); if (null != area) { int left= area.x - xoff; int right= left + area.width; int midy= base_line - yoff; g.drawLine(left, midy, right, midy); } Jdb.exit("HRA.paint(g"+g+", "+xoff+","+yoff); } }