KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > mdi > BasicInternalFrame


1 /*
2     This library is free software; you can redistribute it and/or
3     modify it under the terms of the GNU General Public
4     License as published by the Free Software Foundation; either
5     version 2 of the license, or (at your option) any later version.
6 */

7
8 package org.gjt.jclasslib.mdi;
9
10 import javax.swing.*;
11
12 /**
13     Child frame for MDI application.
14  
15     @author <a HREF="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
16     @version $Revision: 1.5 $ $Date: 2003/08/18 07:59:50 $
17 */

18 public abstract class BasicInternalFrame extends JInternalFrame {
19
20     /**
21         Constructor for creating a derived <tt>BasicInternalFrame</tt> with
22         an initialization parameter.
23      */

24     public static final Class JavaDoc[] CONSTRUCTOR_ARGUMENTS =
25         new Class JavaDoc[] {BasicDesktopManager.class, String JavaDoc.class};
26     
27     /** The parent <tt>DesktopManager</tt>. */
28     protected final BasicDesktopManager desktopManager;
29
30     /**
31         Constructor.
32         @param desktopManager the associated desktop manager.
33         @param title the frame title.
34      */

35     protected BasicInternalFrame(BasicDesktopManager desktopManager, String JavaDoc title) {
36         super(title, true, true, true, true);
37         this.desktopManager = desktopManager;
38     }
39     
40     /**
41         Get the initialization parameter used for storing the state of the frame.
42         This parameter will be supplied to the constructor when the state is restored.
43         @return the parameter
44      */

45     public Object JavaDoc getInitParam() {
46         return null;
47     }
48
49     /**
50         Setup the internal frame. Has to be called by derived classes.
51      */

52     protected void setupInternalFrame() {
53
54         setBounds(desktopManager.getNextInternalFrameBounds());
55
56         addVetoableChangeListener(desktopManager);
57         addInternalFrameListener(desktopManager);
58         desktopManager.addInternalFrame(this);
59
60
61         if (desktopManager.getParentFrame().isVisible()) {
62             setVisible(true);
63         }
64     }
65
66 }
67
Popular Tags