package diagapplet; import java.applet.Applet; /* * * StandAloneApplet * */ public class StandAloneApplet extends Applet { // STANDALONE APPLICATION SUPPORT: // m_fStandAlone will be set to true if applet is run standalone //-------------------------------------------------------------------------- public boolean m_fStandAlone = false; // THREAD SUPPORT: // m_diagapplet is the Thread object for the applet //-------------------------------------------------------------------------- Thread main_applet_thread = null; public int old_width = 0; public int old_height = 0; public boolean initialized = false; public boolean inside_init = false; public boolean inside_resizeable_window = false; public int repaint_count = 0; public static boolean debug_on = false; public void manual_resize(int new_width, int new_height) { super.resize(new_width,new_height); if(true) { System.out.println("StandAloneApplet.manual_resize("+new_width+","+new_height+")"); Thread.dumpStack(); } try { if(inside_resizeable_window) { if(Math.abs(old_width - new_width) > 5 || Math.abs(old_height - new_height) > 5) { if(initialized && !inside_init) { removeAll(); init(); } old_width = new_width; old_height = new_height; } } } catch(Exception e) { e.printStackTrace(); } } public void cleanup() { } public boolean canShutdown() { try { cleanup(); } catch(Exception e) { e.printStackTrace(); } return true; } }