src/java.desktop/share/classes/javax/swing/JInternalFrame.java

Print this page

        

*** 25,46 **** package javax.swing; import java.awt.*; ! import java.beans.PropertyVetoException; ! import java.beans.PropertyChangeEvent; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; import javax.swing.plaf.*; import javax.accessibility.*; import java.io.ObjectOutputStream; import java.io.IOException; ! import java.beans.PropertyChangeListener; import sun.awt.AppContext; import sun.swing.SwingUtilities2; /** --- 25,45 ---- package javax.swing; import java.awt.*; ! import java.beans.*; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; import javax.swing.plaf.*; import javax.accessibility.*; import java.io.ObjectOutputStream; import java.io.IOException; ! import sun.awt.AppContext; import sun.swing.SwingUtilities2; /**
*** 102,117 **** * @see javax.swing.RootPaneContainer * * @author David Kloba * @author Rich Schiavi * @since 1.2 - * @beaninfo - * attribute: isContainer true - * attribute: containerDelegate getContentPane - * description: A frame container which is contained within - * another window. */ @SuppressWarnings("serial") // Same-version serialization only public class JInternalFrame extends JComponent implements Accessible, WindowConstants, RootPaneContainer { --- 101,113 ---- * @see javax.swing.RootPaneContainer * * @author David Kloba * @author Rich Schiavi * @since 1.2 */ + @JavaBean(defaultProperty = "JMenuBar", description = "A frame container which is contained within another window.") + @SwingContainer(delegate = "getContentPane") @SuppressWarnings("serial") // Same-version serialization only public class JInternalFrame extends JComponent implements Accessible, WindowConstants, RootPaneContainer {
*** 375,390 **** } /** * Sets the UI delegate for this <code>JInternalFrame</code>. * @param ui the UI delegate - * @beaninfo - * bound: true - * hidden: true - * attribute: visualUpdate true - * description: The UI object that implements the Component's LookAndFeel. */ public void setUI(InternalFrameUI ui) { boolean checkingEnabled = isRootPaneCheckingEnabled(); try { setRootPaneCheckingEnabled(false); super.setUI(ui); --- 371,383 ---- } /** * Sets the UI delegate for this <code>JInternalFrame</code>. * @param ui the UI delegate */ + @BeanProperty(hidden = true, visualUpdate = true, description + = "The UI object that implements the Component's LookAndFeel.") public void setUI(InternalFrameUI ui) { boolean checkingEnabled = isRootPaneCheckingEnabled(); try { setRootPaneCheckingEnabled(false); super.setUI(ui);
*** 432,445 **** * * @return the string "InternalFrameUI" * * @see JComponent#getUIClassID * @see UIDefaults#getUI - * - * @beaninfo - * description: UIClassID */ public String getUIClassID() { return uiClassID; } /** --- 425,437 ---- * * @return the string "InternalFrameUI" * * @see JComponent#getUIClassID * @see UIDefaults#getUI */ + @BeanProperty(bound = false, description + = "UIClassID") public String getUIClassID() { return uiClassID; } /**
*** 468,481 **** * * @see #addImpl * @see #setLayout * @see #isRootPaneCheckingEnabled * @see javax.swing.RootPaneContainer - * @beaninfo - * hidden: true - * description: Whether the add and setLayout methods are forwarded */ protected void setRootPaneCheckingEnabled(boolean enabled) { rootPaneCheckingEnabled = enabled; } /** --- 460,472 ---- * * @see #addImpl * @see #setLayout * @see #isRootPaneCheckingEnabled * @see javax.swing.RootPaneContainer */ + @BeanProperty(hidden = true, description + = "Whether the add and setLayout methods are forwarded") protected void setRootPaneCheckingEnabled(boolean enabled) { rootPaneCheckingEnabled = enabled; } /**
*** 593,608 **** /** * Sets the <code>menuBar</code> property for this <code>JInternalFrame</code>. * * @param m the <code>JMenuBar</code> to use in this internal frame * @see #getJMenuBar - * @beaninfo - * bound: true - * preferred: true - * description: The menu bar for accessing pulldown menus - * from this internal frame. */ public void setJMenuBar(JMenuBar m){ JMenuBar oldValue = getMenuBar(); getRootPane().setJMenuBar(m); firePropertyChange(MENU_BAR_PROPERTY, oldValue, m); } --- 584,596 ---- /** * Sets the <code>menuBar</code> property for this <code>JInternalFrame</code>. * * @param m the <code>JMenuBar</code> to use in this internal frame * @see #getJMenuBar */ + @BeanProperty(preferred = true, description + = "The menu bar for accessing pulldown menus from this internal frame.") public void setJMenuBar(JMenuBar m){ JMenuBar oldValue = getMenuBar(); getRootPane().setJMenuBar(m); firePropertyChange(MENU_BAR_PROPERTY, oldValue, m); }
*** 624,639 **** * @param c the content pane for this internal frame * * @exception java.awt.IllegalComponentStateException (a runtime * exception) if the content pane parameter is <code>null</code> * @see RootPaneContainer#getContentPane - * @beaninfo - * bound: true - * hidden: true - * description: The client area of the internal frame where child - * components are normally inserted. */ public void setContentPane(Container c) { Container oldValue = getContentPane(); getRootPane().setContentPane(c); firePropertyChange(CONTENT_PANE_PROPERTY, oldValue, c); } --- 612,624 ---- * @param c the content pane for this internal frame * * @exception java.awt.IllegalComponentStateException (a runtime * exception) if the content pane parameter is <code>null</code> * @see RootPaneContainer#getContentPane */ + @BeanProperty(hidden = true, description + = "The client area of the internal frame where child components are normally inserted.") public void setContentPane(Container c) { Container oldValue = getContentPane(); getRootPane().setContentPane(c); firePropertyChange(CONTENT_PANE_PROPERTY, oldValue, c); }
*** 656,670 **** * @param layered the <code>JLayeredPane</code> for this internal frame * * @exception java.awt.IllegalComponentStateException (a runtime * exception) if the layered pane parameter is <code>null</code> * @see RootPaneContainer#setLayeredPane - * @beaninfo - * hidden: true - * bound: true - * description: The pane which holds the various desktop layers. */ public void setLayeredPane(JLayeredPane layered) { JLayeredPane oldValue = getLayeredPane(); getRootPane().setLayeredPane(layered); firePropertyChange(LAYERED_PANE_PROPERTY, oldValue, layered); } --- 641,653 ---- * @param layered the <code>JLayeredPane</code> for this internal frame * * @exception java.awt.IllegalComponentStateException (a runtime * exception) if the layered pane parameter is <code>null</code> * @see RootPaneContainer#setLayeredPane */ + @BeanProperty(hidden = true, description + = "The pane which holds the various desktop layers.") public void setLayeredPane(JLayeredPane layered) { JLayeredPane oldValue = getLayeredPane(); getRootPane().setLayeredPane(layered); firePropertyChange(LAYERED_PANE_PROPERTY, oldValue, layered); }
*** 683,697 **** * Sets this <code>JInternalFrame</code>'s * <code>glassPane</code> property. * * @param glass the glass pane for this internal frame * @see RootPaneContainer#getGlassPane - * @beaninfo - * bound: true - * hidden: true - * description: A transparent pane used for menu rendering. */ public void setGlassPane(Component glass) { Component oldValue = getGlassPane(); getRootPane().setGlassPane(glass); firePropertyChange(GLASS_PANE_PROPERTY, oldValue, glass); } --- 666,678 ---- * Sets this <code>JInternalFrame</code>'s * <code>glassPane</code> property. * * @param glass the glass pane for this internal frame * @see RootPaneContainer#getGlassPane */ + @BeanProperty(hidden = true, description + = "A transparent pane used for menu rendering.") public void setGlassPane(Component glass) { Component oldValue = getGlassPane(); getRootPane().setGlassPane(glass); firePropertyChange(GLASS_PANE_PROPERTY, oldValue, glass); }
*** 700,709 **** --- 681,692 ---- * Returns the <code>rootPane</code> object for this internal frame. * * @return the <code>rootPane</code> property * @see RootPaneContainer#getRootPane */ + @BeanProperty(hidden = true, description + = "The root pane used by this internal frame.") public JRootPane getRootPane() { return rootPane; }
*** 711,724 **** * Sets the <code>rootPane</code> property * for this <code>JInternalFrame</code>. * This method is called by the constructor. * * @param root the new <code>JRootPane</code> object - * @beaninfo - * bound: true - * hidden: true - * description: The root pane used by this internal frame. */ protected void setRootPane(JRootPane root) { if(rootPane != null) { remove(rootPane); } --- 694,703 ----
*** 739,753 **** /** * Sets whether this <code>JInternalFrame</code> can be closed by * some user action. * @param b a boolean value, where <code>true</code> means this internal frame can be closed - * @beaninfo - * preferred: true - * bound: true - * description: Indicates whether this internal frame can be closed. */ public void setClosable(boolean b) { Boolean oldValue = closable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; closable = b; firePropertyChange("closable", oldValue, newValue); --- 718,730 ---- /** * Sets whether this <code>JInternalFrame</code> can be closed by * some user action. * @param b a boolean value, where <code>true</code> means this internal frame can be closed */ + @BeanProperty(preferred = true, description + = "Indicates whether this internal frame can be closed.") public void setClosable(boolean b) { Boolean oldValue = closable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; closable = b; firePropertyChange("closable", oldValue, newValue);
*** 805,820 **** * * @see #isClosed() * @see #setDefaultCloseOperation * @see #dispose * @see javax.swing.event.InternalFrameEvent#INTERNAL_FRAME_CLOSING - * - * @beaninfo - * bound: true - * constrained: true - * description: Indicates whether this internal frame has been closed. */ public void setClosed(boolean b) throws PropertyVetoException { if (isClosed == b) { return; } --- 782,794 ---- * * @see #isClosed() * @see #setDefaultCloseOperation * @see #dispose * @see javax.swing.event.InternalFrameEvent#INTERNAL_FRAME_CLOSING */ + @BeanProperty(description + = "Indicates whether this internal frame has been closed.") public void setClosed(boolean b) throws PropertyVetoException { if (isClosed == b) { return; }
*** 842,857 **** /** * Sets whether the <code>JInternalFrame</code> can be resized by some * user action. * * @param b a boolean, where <code>true</code> means this internal frame can be resized - * @beaninfo - * preferred: true - * bound: true - * description: Determines whether this internal frame can be resized - * by the user. */ public void setResizable(boolean b) { Boolean oldValue = resizable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; resizable = b; firePropertyChange("resizable", oldValue, newValue); --- 816,828 ---- /** * Sets whether the <code>JInternalFrame</code> can be resized by some * user action. * * @param b a boolean, where <code>true</code> means this internal frame can be resized */ + @BeanProperty(preferred = true, description + = "Determines whether this internal frame can be resized by the user.") public void setResizable(boolean b) { Boolean oldValue = resizable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; resizable = b; firePropertyChange("resizable", oldValue, newValue);
*** 875,889 **** * make the <code>JInternalFrame</code> an icon. * Some look and feels might not implement iconification; * they will ignore this property. * * @param b a boolean, where <code>true</code> means this internal frame can be iconified - * @beaninfo - * preferred: true - bound: true - * description: Determines whether this internal frame can be iconified. */ public void setIconifiable(boolean b) { Boolean oldValue = iconable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; iconable = b; firePropertyChange("iconable", oldValue, newValue); --- 846,858 ---- * make the <code>JInternalFrame</code> an icon. * Some look and feels might not implement iconification; * they will ignore this property. * * @param b a boolean, where <code>true</code> means this internal frame can be iconified */ + @BeanProperty(preferred = true, description + = "Determines whether this internal frame can be iconified.") public void setIconifiable(boolean b) { Boolean oldValue = iconable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; iconable = b; firePropertyChange("iconable", oldValue, newValue);
*** 923,938 **** * @exception PropertyVetoException when the attempt to set the * property is vetoed by the <code>JInternalFrame</code> * * @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED * @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED - * - * @beaninfo - * bound: true - * constrained: true - * description: The image displayed when this internal frame is minimized. */ public void setIcon(boolean b) throws PropertyVetoException { if (isIcon == b) { return; } --- 892,904 ---- * @exception PropertyVetoException when the attempt to set the * property is vetoed by the <code>JInternalFrame</code> * * @see InternalFrameEvent#INTERNAL_FRAME_ICONIFIED * @see InternalFrameEvent#INTERNAL_FRAME_DEICONIFIED */ + @BeanProperty(description + = "The image displayed when this internal frame is minimized.") public void setIcon(boolean b) throws PropertyVetoException { if (isIcon == b) { return; }
*** 962,976 **** * some user action. * Some look and feels might not support maximizing internal frames; * they will ignore this property. * * @param b <code>true</code> to specify that this internal frame should be maximizable; <code>false</code> to specify that it should not be - * @beaninfo - * bound: true - * preferred: true - * description: Determines whether this internal frame can be maximized. */ public void setMaximizable(boolean b) { Boolean oldValue = maximizable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; maximizable = b; firePropertyChange("maximizable", oldValue, newValue); --- 928,940 ---- * some user action. * Some look and feels might not support maximizing internal frames; * they will ignore this property. * * @param b <code>true</code> to specify that this internal frame should be maximizable; <code>false</code> to specify that it should not be */ + @BeanProperty(preferred = true, description + = "Determines whether this internal frame can be maximized.") public void setMaximizable(boolean b) { Boolean oldValue = maximizable ? Boolean.TRUE : Boolean.FALSE; Boolean newValue = b ? Boolean.TRUE : Boolean.FALSE; maximizable = b; firePropertyChange("maximizable", oldValue, newValue);
*** 1004,1018 **** * * @param b a boolean, where <code>true</code> maximizes this internal frame and <code>false</code> * restores it * @exception PropertyVetoException when the attempt to set the * property is vetoed by the <code>JInternalFrame</code> - * @beaninfo - * bound: true - * constrained: true - * description: Indicates whether this internal frame is maximized. */ public void setMaximum(boolean b) throws PropertyVetoException { if (isMaximum == b) { return; } --- 968,980 ---- * * @param b a boolean, where <code>true</code> maximizes this internal frame and <code>false</code> * restores it * @exception PropertyVetoException when the attempt to set the * property is vetoed by the <code>JInternalFrame</code> */ + @BeanProperty(description + = "Indicates whether this internal frame is maximized.") public void setMaximum(boolean b) throws PropertyVetoException { if (isMaximum == b) { return; }
*** 1040,1054 **** * Sets the <code>JInternalFrame</code> title. <code>title</code> * may have a <code>null</code> value. * @see #getTitle * * @param title the <code>String</code> to display in the title bar - * @beaninfo - * preferred: true - * bound: true - * description: The text displayed in the title bar. */ public void setTitle(String title) { String oldValue = this.title; this.title = title; firePropertyChange(TITLE_PROPERTY, oldValue, title); } --- 1002,1014 ---- * Sets the <code>JInternalFrame</code> title. <code>title</code> * may have a <code>null</code> value. * @see #getTitle * * @param title the <code>String</code> to display in the title bar */ + @BeanProperty(preferred = true, description + = "The text displayed in the title bar.") public void setTitle(String title) { String oldValue = this.title; this.title = title; firePropertyChange(TITLE_PROPERTY, oldValue, title); }
*** 1074,1090 **** * property is vetoed by the <code>JInternalFrame</code> * * @see #isShowing * @see InternalFrameEvent#INTERNAL_FRAME_ACTIVATED * @see InternalFrameEvent#INTERNAL_FRAME_DEACTIVATED - * - * @beaninfo - * constrained: true - * bound: true - * description: Indicates whether this internal frame is currently - * the active frame. */ public void setSelected(boolean selected) throws PropertyVetoException { // The InternalFrame may already be selected, but the focus // may be outside it, so restore the focus to the subcomponent // which previously had it. See Bug 4302764. if (selected && isSelected) { --- 1034,1046 ---- * property is vetoed by the <code>JInternalFrame</code> * * @see #isShowing * @see InternalFrameEvent#INTERNAL_FRAME_ACTIVATED * @see InternalFrameEvent#INTERNAL_FRAME_DEACTIVATED */ + @BeanProperty(description + = "Indicates whether this internal frame is currently the active frame.") public void setSelected(boolean selected) throws PropertyVetoException { // The InternalFrame may already be selected, but the focus // may be outside it, so restore the focus to the subcomponent // which previously had it. See Bug 4302764. if (selected && isSelected) {
*** 1151,1164 **** * for that situation, such as displaying no icon * or a default icon for the look and feel. * * @param icon the <code>Icon</code> to display in the title bar * @see #getFrameIcon - * @beaninfo - * bound: true - * description: The icon shown in the top-left corner of this internal frame. */ public void setFrameIcon(Icon icon) { Icon oldIcon = frameIcon; frameIcon = icon; firePropertyChange(FRAME_ICON_PROPERTY, oldIcon, icon); } --- 1107,1119 ---- * for that situation, such as displaying no icon * or a default icon for the look and feel. * * @param icon the <code>Icon</code> to display in the title bar * @see #getFrameIcon */ + @BeanProperty(description + = "The icon shown in the top-left corner of this internal frame.") public void setFrameIcon(Icon icon) { Icon oldIcon = frameIcon; frameIcon = icon; firePropertyChange(FRAME_ICON_PROPERTY, oldIcon, icon); }
*** 1212,1221 **** --- 1167,1177 ---- * <code>Cursor</code>. * * @return the last non-resizable <code>Cursor</code> * @since 1.6 */ + @BeanProperty(bound = false) public Cursor getLastCursor() { return lastCursor; } /**
*** 1247,1260 **** * * @param layer an <code>Integer</code> object specifying this * frame's desktop layer * @throws NullPointerException if {@code layer} is {@code null} * @see JLayeredPane - * @beaninfo - * expert: true - * description: Specifies what desktop layer is used. */ public void setLayer(Integer layer) { if(getParent() != null && getParent() instanceof JLayeredPane) { // Normally we want to do this, as it causes the LayeredPane // to draw properly. JLayeredPane p = (JLayeredPane)getParent(); --- 1203,1215 ---- * * @param layer an <code>Integer</code> object specifying this * frame's desktop layer * @throws NullPointerException if {@code layer} is {@code null} * @see JLayeredPane */ + @BeanProperty(bound = false, expert = true, description + = "Specifies what desktop layer is used.") public void setLayer(Integer layer) { if(getParent() != null && getParent() instanceof JLayeredPane) { // Normally we want to do this, as it causes the LayeredPane // to draw properly. JLayeredPane p = (JLayeredPane)getParent();
*** 1278,1291 **** * * @since 1.3 * * @see #setLayer(Integer) * @see JLayeredPane - * @beaninfo - * expert: true - * description: Specifies what desktop layer is used. */ public void setLayer(int layer) { this.setLayer(Integer.valueOf(layer)); } /** --- 1233,1245 ---- * * @since 1.3 * * @see #setLayer(Integer) * @see JLayeredPane */ + @BeanProperty(bound = false, expert = true, description + = "Specifies what desktop layer is used.") public void setLayer(int layer) { this.setLayer(Integer.valueOf(layer)); } /**
*** 1305,1314 **** --- 1259,1269 ---- * finds none, the <code>desktopIcon</code> tree is searched. * * @return the <code>JDesktopPane</code> this internal frame belongs to, * or <code>null</code> if none is found */ + @BeanProperty(bound = false) public JDesktopPane getDesktopPane() { Container p; // Search upward for desktop p = getParent();
*** 1329,1342 **** * Sets the <code>JDesktopIcon</code> associated with this * <code>JInternalFrame</code>. * * @param d the <code>JDesktopIcon</code> to display on the desktop * @see #getDesktopIcon - * @beaninfo - * bound: true - * description: The icon shown when this internal frame is minimized. */ public void setDesktopIcon(JDesktopIcon d) { JDesktopIcon oldValue = getDesktopIcon(); desktopIcon = d; firePropertyChange("desktopIcon", oldValue, d); } --- 1284,1296 ---- * Sets the <code>JDesktopIcon</code> associated with this * <code>JInternalFrame</code>. * * @param d the <code>JDesktopIcon</code> to display on the desktop * @see #getDesktopIcon */ + @BeanProperty(description + = "The icon shown when this internal frame is minimized.") public void setDesktopIcon(JDesktopIcon d) { JDesktopIcon oldValue = getDesktopIcon(); desktopIcon = d; firePropertyChange("desktopIcon", oldValue, d); }
*** 1422,1431 **** --- 1376,1386 ---- * <code>JInternalFrame</code> is selected * @see #getFocusOwner * @see #isSelected * @since 1.4 */ + @BeanProperty(bound = false) public Component getMostRecentFocusOwner() { if (isSelected()) { return getFocusOwner(); }
*** 1536,1545 **** --- 1491,1501 ---- * array if no listeners have been added * @since 1.4 * * @see #addInternalFrameListener */ + @BeanProperty(bound = false) public InternalFrameListener[] getInternalFrameListeners() { return listenerList.getListeners(InternalFrameListener.class); } // remind: name ok? all one method ok? need to be synchronized?
*** 1869,1878 **** --- 1825,1835 ---- * * @return <code>null</code> * @see java.awt.Container#isFocusCycleRoot() * @since 1.4 */ + @BeanProperty(bound = false) public final Container getFocusCycleRootAncestor() { return null; } /**
*** 1881,1890 **** --- 1838,1848 ---- * contained within a window that might need a warning string) * this method always returns <code>null</code>. * @return <code>null</code> * @see java.awt.Window#getWarningString */ + @BeanProperty(bound = false) public final String getWarningString() { return null; } /**
*** 2016,2025 **** --- 1974,1984 ---- * @return an <code>AccessibleJInternalFrame</code> that serves as the * <code>AccessibleContext</code> of this * <code>JInternalFrame</code> * @see AccessibleJInternalFrame */ + @BeanProperty(bound = false) public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJInternalFrame(); } return accessibleContext;