// 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.*; import HtmlDocumentRegion; public class HtmlDocumentRegionPanel extends HtmlDocumentAreaPanel { HtmlDocumentRegionStream region_stream; boolean regions_changed= false; boolean size_changed= false; boolean posn_changed= false; /** the last size and position of this window */ int last_x, last_y, last_wide, last_tall; public HtmlDocumentRegionPanel() { super(); region_stream= null; regions_changed= false; } public void showRegions(HtmlDocumentRegionStream rs) { region_stream= rs; regions_changed= true; } public void reshape(int x, int y, int wide, int tall) { Jdb.trace("HTA.reshape(" + Integer.toString(x) + ", " + Integer.toString(y) + ", " + Integer.toString(wide) + ", " + Integer.toString(tall) + ")"); size_changed= ((last_wide != wide) || (last_tall != tall)); posn_changed= ((last_x != x) || (last_y != y)); super.reshape(x, y, wide, tall); } public void paint(Graphics g) { Jdb.enter("HDRP.paint()"); if (regions_changed || size_changed) { Jdb.trace("things changed"); if (null != region_stream) { Jdb.trace("rewind region_stream"); region_stream.rewind(); setAreas(region_stream); } } regions_changed= false; size_changed= false; Rectangle r= bounds(); last_x= r.x; last_y= r.y; last_wide= r.width; last_tall= r.height; super.paint(g); Jdb.exit("HDRP.paint()"); } }