< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java

Print this page




 147             }
 148         } else {
 149             if (e.getChild() instanceof JMenuBar) {
 150                 final JMenuBar jmb = (JMenuBar)e.getChild();
 151                 final MenuBarUI mbui = jmb.getUI();
 152 
 153                 if (mbui instanceof AquaMenuBarUI) {
 154                     final Window owningWindow = SwingUtilities.getWindowAncestor(jmb);
 155 
 156                     // Could be a JDialog, and may have been added to a JRootPane not yet in a window.
 157                     if (owningWindow != null && owningWindow instanceof JFrame) {
 158                         ((AquaMenuBarUI)mbui).clearScreenMenuBar((JFrame)owningWindow);
 159                     }
 160                 }
 161             }
 162         }
 163     }
 164 
 165     /**
 166      * Invoked when a property changes on the root pane. If the event
 167      * indicates the <code>defaultButton</code> has changed, this will
 168      * update the animation.
 169      * If the enabled state changed, it will start or stop the animation
 170      */
 171     public void propertyChange(final PropertyChangeEvent e) {
 172         super.propertyChange(e);
 173 
 174         final String prop = e.getPropertyName();
 175         if ("defaultButton".equals(prop) || "temporaryDefaultButton".equals(prop)) {
 176             // Change the animating button if this root is showing and enabled
 177             // otherwise do nothing - someone else may be active
 178             final JRootPane root = (JRootPane)e.getSource();
 179 
 180             if (root.isShowing() && root.isEnabled()) {
 181                 updateDefaultButton(root);
 182             }
 183         } else if ("enabled".equals(prop) || AquaFocusHandler.FRAME_ACTIVE_PROPERTY.equals(prop)) {
 184             final JRootPane root = (JRootPane)e.getSource();
 185             if (root.isShowing()) {
 186                 if (((Boolean)e.getNewValue()).booleanValue()) {
 187                     updateDefaultButton((JRootPane)e.getSource());




 147             }
 148         } else {
 149             if (e.getChild() instanceof JMenuBar) {
 150                 final JMenuBar jmb = (JMenuBar)e.getChild();
 151                 final MenuBarUI mbui = jmb.getUI();
 152 
 153                 if (mbui instanceof AquaMenuBarUI) {
 154                     final Window owningWindow = SwingUtilities.getWindowAncestor(jmb);
 155 
 156                     // Could be a JDialog, and may have been added to a JRootPane not yet in a window.
 157                     if (owningWindow != null && owningWindow instanceof JFrame) {
 158                         ((AquaMenuBarUI)mbui).clearScreenMenuBar((JFrame)owningWindow);
 159                     }
 160                 }
 161             }
 162         }
 163     }
 164 
 165     /**
 166      * Invoked when a property changes on the root pane. If the event
 167      * indicates the {@code defaultButton} has changed, this will
 168      * update the animation.
 169      * If the enabled state changed, it will start or stop the animation
 170      */
 171     public void propertyChange(final PropertyChangeEvent e) {
 172         super.propertyChange(e);
 173 
 174         final String prop = e.getPropertyName();
 175         if ("defaultButton".equals(prop) || "temporaryDefaultButton".equals(prop)) {
 176             // Change the animating button if this root is showing and enabled
 177             // otherwise do nothing - someone else may be active
 178             final JRootPane root = (JRootPane)e.getSource();
 179 
 180             if (root.isShowing() && root.isEnabled()) {
 181                 updateDefaultButton(root);
 182             }
 183         } else if ("enabled".equals(prop) || AquaFocusHandler.FRAME_ACTIVE_PROPERTY.equals(prop)) {
 184             final JRootPane root = (JRootPane)e.getSource();
 185             if (root.isShowing()) {
 186                 if (((Boolean)e.getNewValue()).booleanValue()) {
 187                     updateDefaultButton((JRootPane)e.getSource());


< prev index next >