jdk/src/share/classes/javax/swing/JComponent.java

Print this page

        

*** 22,50 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing; - import java.util.HashSet; import java.util.Hashtable; - import java.util.Dictionary; import java.util.Enumeration; import java.util.Locale; import java.util.Vector; import java.util.EventListener; import java.util.Set; - import java.util.Map; - import java.util.HashMap; import java.awt.*; import java.awt.event.*; - import java.awt.image.VolatileImage; - import java.awt.Graphics2D; import java.awt.peer.LightweightPeer; ! import java.awt.dnd.DropTarget; ! import java.awt.font.FontRenderContext; import java.beans.PropertyChangeListener; import java.beans.VetoableChangeListener; import java.beans.VetoableChangeSupport; import java.beans.Transient; --- 22,44 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing; import java.util.HashSet; import java.util.Hashtable; import java.util.Enumeration; import java.util.Locale; import java.util.Vector; import java.util.EventListener; import java.util.Set; import java.awt.*; import java.awt.event.*; import java.awt.peer.LightweightPeer; ! import java.beans.JavaBean; ! import java.beans.BeanProperty; import java.beans.PropertyChangeListener; import java.beans.VetoableChangeListener; import java.beans.VetoableChangeSupport; import java.beans.Transient;
*** 179,188 **** --- 173,183 ---- * * @author Hans Muller * @author Arnaud Weber * @since 1.2 */ + @JavaBean(defaultProperty = "UIClassID") @SuppressWarnings("serial") // Same-version serialization only public abstract class JComponent extends Container implements Serializable, TransferHandler.HasGetTransferHandler { /**
*** 480,494 **** * <p> * This is a bound property. * * @param value whether or not the JPopupMenu is inherited * @see #setComponentPopupMenu - * @beaninfo - * bound: true - * description: Whether or not the JPopupMenu is inherited * @since 1.5 */ public void setInheritsPopupMenu(boolean value) { boolean oldValue = getFlag(INHERITS_POPUP_MENU); setFlag(INHERITS_POPUP_MENU, value); firePropertyChange("inheritsPopupMenu", oldValue, value); } --- 475,488 ---- * <p> * This is a bound property. * * @param value whether or not the JPopupMenu is inherited * @see #setComponentPopupMenu * @since 1.5 */ + @BeanProperty(description + = "Whether or not the JPopupMenu is inherited") public void setInheritsPopupMenu(boolean value) { boolean oldValue = getFlag(INHERITS_POPUP_MENU); setFlag(INHERITS_POPUP_MENU, value); firePropertyChange("inheritsPopupMenu", oldValue, value); }
*** 520,535 **** * This is a bound property. * * @param popup - the popup that will be assigned to this component * may be null * @see #getComponentPopupMenu - * @beaninfo - * bound: true - * preferred: true - * description: Popup to show * @since 1.5 */ public void setComponentPopupMenu(JPopupMenu popup) { if(popup != null) { enableEvents(AWTEvent.MOUSE_EVENT_MASK); } JPopupMenu oldPopup = this.popupMenu; --- 514,527 ---- * This is a bound property. * * @param popup - the popup that will be assigned to this component * may be null * @see #getComponentPopupMenu * @since 1.5 */ + @BeanProperty(preferred = true, description + = "Popup to show") public void setComponentPopupMenu(JPopupMenu popup) { if(popup != null) { enableEvents(AWTEvent.MOUSE_EVENT_MASK); } JPopupMenu oldPopup = this.popupMenu;
*** 641,656 **** * * @param newUI the new UI delegate * @see #updateUI * @see UIManager#getLookAndFeel * @see UIManager#getUI - * @beaninfo - * bound: true - * hidden: true - * attribute: visualUpdate true - * description: The component's look and feel delegate. */ protected void setUI(ComponentUI newUI) { /* We do not check that the UI instance is different * before allowing the switch in order to enable the * same UI instance *with different default settings* * to be installed. --- 633,645 ---- * * @param newUI the new UI delegate * @see #updateUI * @see UIManager#getLookAndFeel * @see UIManager#getUI */ + @BeanProperty(hidden = true, visualUpdate = true, description + = "The component's look and feel delegate.") protected void setUI(ComponentUI newUI) { /* We do not check that the UI instance is different * before allowing the switch in order to enable the * same UI instance *with different default settings* * to be installed.
*** 708,721 **** * <code>ComponentUI</code> subclass that defines their look and feel. * * @return the <code>UIDefaults</code> key for a * <code>ComponentUI</code> subclass * @see UIDefaults#getUI - * @beaninfo - * expert: true - * description: UIClassID */ public String getUIClassID() { return uiClassID; } --- 697,709 ---- * <code>ComponentUI</code> subclass that defines their look and feel. * * @return the <code>UIDefaults</code> key for a * <code>ComponentUI</code> subclass * @see UIDefaults#getUI */ + @BeanProperty(bound = false, expert = true, description + = "UIClassID") public String getUIClassID() { return uiClassID; }
*** 1255,1264 **** --- 1243,1253 ---- * Use this method to keep some state you might need between tiles. * * @return true if the component is currently painting a tile, * false otherwise */ + @BeanProperty(bound = false) public boolean isPaintingTile() { return getFlag(IS_PAINTING_TILE); } /**
*** 1285,1294 **** --- 1274,1284 ---- * @return true if the current painting operation on this component * is part of a print operation * @see #print * @since 1.6 */ + @BeanProperty(bound = false) public final boolean isPaintingForPrint() { return getFlag(IS_PRINTING); } /**
*** 1309,1318 **** --- 1299,1309 ---- * @deprecated As of 1.4, replaced by * <code>Component.setFocusTraversalKeys(int, Set)</code> and * <code>Container.setFocusCycleRoot(boolean)</code>. */ @Deprecated + @BeanProperty(bound = false) public boolean isManagingFocus() { return false; } private void registerNextFocusableComponent() {
*** 1579,1593 **** * @see #setInputVerifier * @see #getInputVerifier * @see #getVerifyInputWhenFocusTarget * * @since 1.3 - * @beaninfo - * bound: true - * description: Whether the Component verifies input before accepting - * focus. */ public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget) { boolean oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget; this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget; --- 1570,1582 ---- * @see #setInputVerifier * @see #getInputVerifier * @see #getVerifyInputWhenFocusTarget * * @since 1.3 */ + @BeanProperty(description + = "Whether the Component verifies input before accepting focus.") public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget) { boolean oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget; this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget;
*** 1631,1645 **** /** * Sets the preferred size of this component. * If <code>preferredSize</code> is <code>null</code>, the UI will * be asked for the preferred size. - * @beaninfo - * preferred: true - * bound: true - * description: The preferred size of the component. */ public void setPreferredSize(Dimension preferredSize) { super.setPreferredSize(preferredSize); } --- 1620,1632 ---- /** * Sets the preferred size of this component. * If <code>preferredSize</code> is <code>null</code>, the UI will * be asked for the preferred size. */ + @BeanProperty(preferred = true, description + = "The preferred size of the component.") public void setPreferredSize(Dimension preferredSize) { super.setPreferredSize(preferredSize); }
*** 1675,1688 **** * restores the default behavior. * * @param maximumSize a <code>Dimension</code> containing the * desired maximum allowable size * @see #getMaximumSize - * @beaninfo - * bound: true - * description: The maximum size of the component. */ public void setMaximumSize(Dimension maximumSize) { super.setMaximumSize(maximumSize); } --- 1662,1674 ---- * restores the default behavior. * * @param maximumSize a <code>Dimension</code> containing the * desired maximum allowable size * @see #getMaximumSize */ + @BeanProperty(description + = "The maximum size of the component.") public void setMaximumSize(Dimension maximumSize) { super.setMaximumSize(maximumSize); }
*** 1716,1729 **** * to compute it. Setting the minimum size to <code>null</code> * restores the default behavior. * * @param minimumSize the new minimum size of this component * @see #getMinimumSize - * @beaninfo - * bound: true - * description: The minimum size of the component. */ public void setMinimumSize(Dimension minimumSize) { super.setMinimumSize(minimumSize); } /** --- 1702,1714 ---- * to compute it. Setting the minimum size to <code>null</code> * restores the default behavior. * * @param minimumSize the new minimum size of this component * @see #getMinimumSize */ + @BeanProperty(description + = "The minimum size of the component.") public void setMinimumSize(Dimension minimumSize) { super.setMinimumSize(minimumSize); } /**
*** 1783,1798 **** * This is a bound property. * * @param border the border to be rendered for this component * @see Border * @see CompoundBorder - * @beaninfo - * bound: true - * preferred: true - * attribute: visualUpdate true - * description: The component's border. */ public void setBorder(Border border) { Border oldBorder = this.border; this.border = border; firePropertyChange("border", oldBorder, border); --- 1768,1780 ---- * This is a bound property. * * @param border the border to be rendered for this component * @see Border * @see CompoundBorder */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The component's border.") public void setBorder(Border border) { Border oldBorder = this.border; this.border = border; firePropertyChange("border", oldBorder, border);
*** 1821,1830 **** --- 1803,1813 ---- * border's insets; otherwise calls <code>super.getInsets</code>. * * @return the value of the insets property * @see #setBorder */ + @BeanProperty(expert = true) public Insets getInsets() { if (border != null) { return border.getBorderInsets(this); } return super.getInsets();
*** 1839,1850 **** * If <code>insets</code> is null, this will allocate a new one. * * @param insets the <code>Insets</code> object, which can be reused * @return the <code>Insets</code> object * @see #getInsets - * @beaninfo - * expert: true */ public Insets getInsets(Insets insets) { if (insets == null) { insets = new Insets(0, 0, 0, 0); } --- 1822,1831 ----
*** 1882,1894 **** /** * Sets the the horizontal alignment. * * @param alignmentY the new horizontal alignment * @see #getAlignmentY - * @beaninfo - * description: The preferred vertical alignment of the component. */ public void setAlignmentY(float alignmentY) { this.alignmentY = validateAlignment(alignmentY); isAlignmentYSet = true; } --- 1863,1875 ---- /** * Sets the the horizontal alignment. * * @param alignmentY the new horizontal alignment * @see #getAlignmentY */ + @BeanProperty(description + = "The preferred vertical alignment of the component.") public void setAlignmentY(float alignmentY) { this.alignmentY = validateAlignment(alignmentY); isAlignmentYSet = true; }
*** 1911,1923 **** /** * Sets the the vertical alignment. * * @param alignmentX the new vertical alignment * @see #getAlignmentX - * @beaninfo - * description: The preferred horizontal alignment of the component. */ public void setAlignmentX(float alignmentX) { this.alignmentX = validateAlignment(alignmentX); isAlignmentXSet = true; } --- 1892,1904 ---- /** * Sets the the vertical alignment. * * @param alignmentX the new vertical alignment * @see #getAlignmentX */ + @BeanProperty(description + = "The preferred horizontal alignment of the component.") public void setAlignmentX(float alignmentX) { this.alignmentX = validateAlignment(alignmentX); isAlignmentXSet = true; }
*** 1929,1942 **** * Sets the input verifier for this component. * * @param inputVerifier the new input verifier * @since 1.3 * @see InputVerifier - * @beaninfo - * bound: true - * description: The component's input verifier. */ public void setInputVerifier(InputVerifier inputVerifier) { InputVerifier oldInputVerifier = (InputVerifier)getClientProperty( JComponent_INPUT_VERIFIER); putClientProperty(JComponent_INPUT_VERIFIER, inputVerifier); firePropertyChange("inputVerifier", oldInputVerifier, inputVerifier); --- 1910,1922 ---- * Sets the input verifier for this component. * * @param inputVerifier the new input verifier * @since 1.3 * @see InputVerifier */ + @BeanProperty(description + = "The component's input verifier.") public void setInputVerifier(InputVerifier inputVerifier) { InputVerifier oldInputVerifier = (InputVerifier)getClientProperty( JComponent_INPUT_VERIFIER); putClientProperty(JComponent_INPUT_VERIFIER, inputVerifier); firePropertyChange("inputVerifier", oldInputVerifier, inputVerifier);
*** 1957,1966 **** --- 1937,1947 ---- * Returns this component's graphics context, which lets you draw * on a component. Use this method to get a <code>Graphics</code> object and * then invoke operations on that object to draw on the component. * @return this components graphics context */ + @BeanProperty(bound = false) public Graphics getGraphics() { if (DEBUG_GRAPHICS_LOADED && shouldDebugGraphics() != 0) { DebugGraphics graphics = new DebugGraphics(super.getGraphics(), this); return graphics;
*** 1983,2001 **** * performed on the View's offscreen buffer. * <li>DebugGraphics.NONE_OPTION disables debugging. * <li>A value of 0 causes no changes to the debugging options. * </ul> * <code>debugOptions</code> is bitwise OR'd into the current value - * - * @beaninfo - * preferred: true - * enum: NONE_OPTION DebugGraphics.NONE_OPTION - * LOG_OPTION DebugGraphics.LOG_OPTION - * FLASH_OPTION DebugGraphics.FLASH_OPTION - * BUFFERED_OPTION DebugGraphics.BUFFERED_OPTION - * description: Diagnostic options for graphics operations. */ public void setDebugGraphicsOptions(int debugOptions) { DebugGraphics.setDebugOptions(this, debugOptions); } /** Returns the state of graphics debugging. --- 1964,1980 ---- * performed on the View's offscreen buffer. * <li>DebugGraphics.NONE_OPTION disables debugging. * <li>A value of 0 causes no changes to the debugging options. * </ul> * <code>debugOptions</code> is bitwise OR'd into the current value */ + @BeanProperty(bound = false, preferred = true, enumerationValues = { + "DebugGraphics.NONE_OPTION", + "DebugGraphics.LOG_OPTION", + "DebugGraphics.FLASH_OPTION", + "DebugGraphics.BUFFERED_OPTION"}, description + = "Diagnostic options for graphics operations.") public void setDebugGraphicsOptions(int debugOptions) { DebugGraphics.setDebugOptions(this, debugOptions); } /** Returns the state of graphics debugging.
*** 2268,2277 **** --- 2247,2257 ---- * registered actions. * * @return an array of <code>KeyStroke</code> objects * @see #registerKeyboardAction */ + @BeanProperty(bound = false) public KeyStroke[] getRegisteredKeyStrokes() { int[] counts = new int[3]; KeyStroke[][] strokes = new KeyStroke[3][]; for (int counter = 0; counter < 3; counter++) {
*** 2606,2615 **** --- 2586,2596 ---- * <code>getBaseline</code> returns a value less than 0. * * @see #getBaseline(int, int) * @since 1.6 */ + @BeanProperty(bound = false) public BaselineResizeBehavior getBaselineResizeBehavior() { if (ui != null) { return ui.getBaselineResizeBehavior(this); } return BaselineResizeBehavior.OTHER;
*** 2656,2669 **** * Makes the component visible or invisible. * Overrides <code>Component.setVisible</code>. * * @param aFlag true to make the component visible; false to * make it invisible - * - * @beaninfo - * attribute: visualUpdate true */ public void setVisible(boolean aFlag) { if (aFlag != isVisible()) { super.setVisible(aFlag); if (aFlag) { Container parent = getParent(); --- 2637,2648 ---- * Makes the component visible or invisible. * Overrides <code>Component.setVisible</code>. * * @param aFlag true to make the component visible; false to * make it invisible */ + @BeanProperty(hidden = true, visualUpdate = true) public void setVisible(boolean aFlag) { if (aFlag != isVisible()) { super.setVisible(aFlag); if (aFlag) { Container parent = getParent();
*** 2689,2705 **** * receiving MouseEvents. * * @param enabled true if this component should be enabled, false otherwise * @see java.awt.Component#isEnabled * @see java.awt.Component#isLightweight - * - * @beaninfo - * preferred: true - * bound: true - * attribute: visualUpdate true - * description: The enabled state of the component. */ public void setEnabled(boolean enabled) { boolean oldEnabled = isEnabled(); super.setEnabled(enabled); firePropertyChange("enabled", oldEnabled, enabled); if (enabled != oldEnabled) { --- 2668,2680 ---- * receiving MouseEvents. * * @param enabled true if this component should be enabled, false otherwise * @see java.awt.Component#isEnabled * @see java.awt.Component#isLightweight */ + @BeanProperty(expert = true, preferred = true, visualUpdate = true, description + = "The enabled state of the component.") public void setEnabled(boolean enabled) { boolean oldEnabled = isEnabled(); super.setEnabled(enabled); firePropertyChange("enabled", oldEnabled, enabled); if (enabled != oldEnabled) {
*** 2712,2728 **** * look and feel to honor this property, some may choose to ignore * it. * * @param fg the desired foreground <code>Color</code> * @see java.awt.Component#getForeground - * - * @beaninfo - * preferred: true - * bound: true - * attribute: visualUpdate true - * description: The foreground color of the component. */ public void setForeground(Color fg) { Color oldFg = getForeground(); super.setForeground(fg); if ((oldFg != null) ? !oldFg.equals(fg) : ((fg != null) && !fg.equals(oldFg))) { // foreground already bound in AWT1.2 --- 2687,2699 ---- * look and feel to honor this property, some may choose to ignore * it. * * @param fg the desired foreground <code>Color</code> * @see java.awt.Component#getForeground */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The foreground color of the component.") public void setForeground(Color fg) { Color oldFg = getForeground(); super.setForeground(fg); if ((oldFg != null) ? !oldFg.equals(fg) : ((fg != null) && !fg.equals(oldFg))) { // foreground already bound in AWT1.2
*** 2742,2758 **** * choose to ignore it. * * @param bg the desired background <code>Color</code> * @see java.awt.Component#getBackground * @see #setOpaque - * - * @beaninfo - * preferred: true - * bound: true - * attribute: visualUpdate true - * description: The background color of the component. */ public void setBackground(Color bg) { Color oldBg = getBackground(); super.setBackground(bg); if ((oldBg != null) ? !oldBg.equals(bg) : ((bg != null) && !bg.equals(oldBg))) { // background already bound in AWT1.2 --- 2713,2725 ---- * choose to ignore it. * * @param bg the desired background <code>Color</code> * @see java.awt.Component#getBackground * @see #setOpaque */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The background color of the component.") public void setBackground(Color bg) { Color oldBg = getBackground(); super.setBackground(bg); if ((oldBg != null) ? !oldBg.equals(bg) : ((bg != null) && !bg.equals(oldBg))) { // background already bound in AWT1.2
*** 2763,2779 **** /** * Sets the font for this component. * * @param font the desired <code>Font</code> for this component * @see java.awt.Component#getFont - * - * @beaninfo - * preferred: true - * bound: true - * attribute: visualUpdate true - * description: The font for the component. */ public void setFont(Font font) { Font oldFont = getFont(); super.setFont(font); // font already bound in AWT1.2 if (font != oldFont) { --- 2730,2742 ---- /** * Sets the font for this component. * * @param font the desired <code>Font</code> for this component * @see java.awt.Component#getFont */ + @BeanProperty(preferred = true, visualUpdate = true, description + = "The font for the component.") public void setFont(Font font) { Font oldFont = getFont(); super.setFont(font); // font already bound in AWT1.2 if (font != oldFont) {
*** 3018,3031 **** * for further documentation. * * @param text the string to display; if the text is <code>null</code>, * the tool tip is turned off for this component * @see #TOOL_TIP_TEXT_KEY - * @beaninfo - * preferred: true - * description: The text to display in a tool tip. */ public void setToolTipText(String text) { String oldText = getToolTipText(); putClientProperty(TOOL_TIP_TEXT_KEY, text); ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); if (text != null) { --- 2981,2993 ---- * for further documentation. * * @param text the string to display; if the text is <code>null</code>, * the tool tip is turned off for this component * @see #TOOL_TIP_TEXT_KEY */ + @BeanProperty(bound = false, preferred = true, description + = "The text to display in a tool tip.") public void setToolTipText(String text) { String oldText = getToolTipText(); putClientProperty(TOOL_TIP_TEXT_KEY, text); ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); if (text != null) {
*** 3180,3194 **** * bounds and the mouse button continues to be held down; otherwise * false * @see #getAutoscrolls * @see JViewport * @see JScrollPane - * - * @beaninfo - * expert: true - * description: Determines if this component automatically scrolls its contents when dragged. */ public void setAutoscrolls(boolean autoscrolls) { setFlag(AUTOSCROLLS_SET, true); if (this.autoscrolls != autoscrolls) { this.autoscrolls = autoscrolls; if (autoscrolls) { --- 3142,3154 ---- * bounds and the mouse button continues to be held down; otherwise * false * @see #getAutoscrolls * @see JViewport * @see JScrollPane */ + @BeanProperty(bound = false, expert = true, description + = "Determines if this component automatically scrolls its contents when dragged.") public void setAutoscrolls(boolean autoscrolls) { setFlag(AUTOSCROLLS_SET, true); if (this.autoscrolls != autoscrolls) { this.autoscrolls = autoscrolls; if (autoscrolls) {
*** 3244,3258 **** * @param newHandler the new {@code TransferHandler} * * @see TransferHandler * @see #getTransferHandler * @since 1.4 - * @beaninfo - * bound: true - * hidden: true - * description: Mechanism for transfer of data to and from the component */ public void setTransferHandler(TransferHandler newHandler) { TransferHandler oldHandler = (TransferHandler)getClientProperty( JComponent_TRANSFER_HANDLER); putClientProperty(JComponent_TRANSFER_HANDLER, newHandler); --- 3204,3216 ---- * @param newHandler the new {@code TransferHandler} * * @see TransferHandler * @see #getTransferHandler * @since 1.4 */ + @BeanProperty(hidden = true, description + = "Mechanism for transfer of data to and from the component") public void setTransferHandler(TransferHandler newHandler) { TransferHandler oldHandler = (TransferHandler)getClientProperty( JComponent_TRANSFER_HANDLER); putClientProperty(JComponent_TRANSFER_HANDLER, newHandler);
*** 4204,4215 **** * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or if keystrokes * contains null, or if any keystroke represents a KEY_TYPED event, * or if any keystroke already maps to another focus traversal * operation for this Component * @since 1.5 - * @beaninfo - * bound: true */ public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes) { if (id == KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS) { --- 4162,4171 ----
*** 4331,4340 **** --- 4287,4297 ---- * <code>component.getLocation().x</code> because it doesn't cause any * heap allocations. * * @return the current x coordinate of the component's origin */ + @BeanProperty(bound = false) public int getX() { return super.getX(); } /** * Returns the current y coordinate of the component's origin.
*** 4343,4352 **** --- 4300,4310 ---- * <code>component.getLocation().y</code> because it doesn't cause any * heap allocations. * * @return the current y coordinate of the component's origin */ + @BeanProperty(bound = false) public int getY() { return super.getY(); } /** * Returns the current width of this component.
*** 4355,4364 **** --- 4313,4323 ---- * <code>component.getSize().width</code> because it doesn't cause any * heap allocations. * * @return the current width of this component */ + @BeanProperty(bound = false) public int getWidth() { return super.getWidth(); } /** * Returns the current height of this component.
*** 4367,4376 **** --- 4326,4336 ---- * <code>component.getSize().height</code> because it doesn't cause any * heap allocations. * * @return the current height of this component */ + @BeanProperty(bound = false) public int getHeight() { return super.getHeight(); } /** * Returns true if this component is completely opaque. * <p>
*** 4400,4414 **** * <code>JComponent</code> subclasses (such as <code>JButton</code> and * <code>JTree</code>) is look-and-feel dependent. * * @param isOpaque true if this component should be opaque * @see #isOpaque - * @beaninfo - * bound: true - * expert: true - * description: The component's opacity */ public void setOpaque(boolean isOpaque) { boolean oldValue = getFlag(IS_OPAQUE); setFlag(IS_OPAQUE, isOpaque); setFlag(OPAQUE_SET, true); firePropertyChange("opaque", oldValue, isOpaque); --- 4360,4372 ---- * <code>JComponent</code> subclasses (such as <code>JButton</code> and * <code>JTree</code>) is look-and-feel dependent. * * @param isOpaque true if this component should be opaque * @see #isOpaque */ + @BeanProperty(expert = true, description + = "The component's opacity") public void setOpaque(boolean isOpaque) { boolean oldValue = getFlag(IS_OPAQUE); setFlag(IS_OPAQUE, isOpaque); setFlag(OPAQUE_SET, true); firePropertyChange("opaque", oldValue, isOpaque);
*** 4515,4524 **** --- 4473,4483 ---- * <code>new Rectangle(0, 0, getWidth(), getHeight())</code>, * and all of its ancestors' visible rectangles. * * @return the visible rectangle */ + @BeanProperty(bound = false) public Rectangle getVisibleRect() { Rectangle visibleRect = new Rectangle(); computeVisibleRect(visibleRect); return visibleRect;
*** 4623,4632 **** --- 4582,4592 ---- * @see #addVetoableChangeListener * @see #removeVetoableChangeListener * * @since 1.4 */ + @BeanProperty(bound = false) public synchronized VetoableChangeListener[] getVetoableChangeListeners() { if (vetoableChangeSupport == null) { return new VetoableChangeListener[0]; } return vetoableChangeSupport.getVetoableChangeListeners();
*** 4640,4649 **** --- 4600,4610 ---- * been added to any container. * * @return the top-level <code>Container</code> that this component is in, * or <code>null</code> if not in any container */ + @BeanProperty(bound = false) public Container getTopLevelAncestor() { for(Container p = this; p != null; p = p.getParent()) { if(p instanceof Window || p instanceof Applet) { return p; }
*** 4706,4715 **** --- 4667,4677 ---- * @see #addAncestorListener * @see #removeAncestorListener * * @since 1.4 */ + @BeanProperty(bound = false) public AncestorListener[] getAncestorListeners() { AncestorNotifier ancestorNotifier = getAncestorNotifier(); if (ancestorNotifier == null) { return new AncestorListener[0]; }
*** 4943,4952 **** --- 4905,4915 ---- * guarantee, such as <code>JLayeredPane</code>, * should override this method to return false. * * @return always returns true */ + @BeanProperty(bound = false) public boolean isOptimizedDrawingEnabled() { return true; } /**
*** 5392,5401 **** --- 5355,5365 ---- * Returns the <code>JRootPane</code> ancestor for this component. * * @return the <code>JRootPane</code> that contains this component, * or <code>null</code> if no <code>JRootPane</code> is found */ + @BeanProperty(bound = false) public JRootPane getRootPane() { return SwingUtilities.getRootPane(this); }