< prev index next >

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

Print this page




  65      * well known look and feel implementations.  Presently
  66      * the well known names are "Motif", "Windows", "Mac", "Metal".  Note
  67      * that a LookAndFeel derived from a well known superclass
  68      * that doesn't make any fundamental changes to the look or feel
  69      * shouldn't override this method.
  70      */
  71     public String getID() {
  72         return "Aqua";
  73     }
  74 
  75     /**
  76      * Return a one line description of this look and feel implementation,
  77      * e.g. "The CDE/Motif Look and Feel".   This string is intended for
  78      * the user, e.g. in the title of a window or in a ToolTip message.
  79      */
  80     public String getDescription() {
  81         return "Aqua Look and Feel for Mac OS X";
  82     }
  83 
  84     /**
  85      * Returns true if the <code>LookAndFeel</code> returned
  86      * <code>RootPaneUI</code> instances support providing Window decorations
  87      * in a <code>JRootPane</code>.
  88      * <p>
  89      * The default implementation returns false, subclasses that support
  90      * Window decorations should override this and return true.
  91      *
  92      * @return True if the RootPaneUI instances created support client side
  93      *             decorations
  94      * @see JDialog#setDefaultLookAndFeelDecorated
  95      * @see JFrame#setDefaultLookAndFeelDecorated
  96      * @see JRootPane#setWindowDecorationStyle
  97      * @since 1.4
  98      */
  99     public boolean getSupportsWindowDecorations() {
 100         return false;
 101     }
 102 
 103     /**
 104      * If the underlying platform has a "native" look and feel, and this
 105      * is an implementation of it, return true.
 106      */
 107     public boolean isNativeLookAndFeel() {


 157 
 158     /**
 159      * UIManager.setLookAndFeel calls this method just before we're
 160      * replaced by a new default look and feel.   Subclasses may
 161      * choose to free up some resources here.
 162      *
 163      * @see #initialize
 164      */
 165     public void uninitialize() {
 166         KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
 167 
 168         final PopupFactory popupFactory = PopupFactory.getSharedInstance();
 169         if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) {
 170             ((ScreenPopupFactory)popupFactory).setActive(false);
 171         }
 172 
 173         super.uninitialize();
 174     }
 175 
 176     /**
 177      * Returns an <code>ActionMap</code>.
 178      * <P>
 179      * This <code>ActionMap</code> contains <code>Actions</code> that
 180      * embody the ability to render an auditory cue. These auditory
 181      * cues map onto user and system activities that may be useful
 182      * for an end user to know about (such as a dialog box appearing).
 183      * <P>
 184      * At the appropriate time in a <code>JComponent</code> UI's lifecycle,
 185      * the ComponentUI is responsible for getting the appropriate
 186      * <code>Action</code> out of the <code>ActionMap</code> and passing
 187      * it on to <code>playSound</code>.
 188      * <P>
 189      * The <code>Actions</code> in this <code>ActionMap</code> are
 190      * created by the <code>createAudioAction</code> method.
 191      *
 192      * @return      an ActionMap containing Actions
 193      *              responsible for rendering auditory cues
 194      * @see #createAudioAction
 195      * @see #playSound(Action)
 196      * @since 1.4
 197      */
 198     protected ActionMap getAudioActionMap() {
 199         ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap");
 200         if (audioActionMap != null) return audioActionMap;
 201 
 202         final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");
 203         if (acList != null) {
 204             audioActionMap = new ActionMapUIResource();
 205             for (int counter = acList.length - 1; counter >= 0; counter--) {
 206                 audioActionMap.put(acList[counter], createAudioAction(acList[counter]));
 207             }
 208         }
 209         UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap);
 210 




  65      * well known look and feel implementations.  Presently
  66      * the well known names are "Motif", "Windows", "Mac", "Metal".  Note
  67      * that a LookAndFeel derived from a well known superclass
  68      * that doesn't make any fundamental changes to the look or feel
  69      * shouldn't override this method.
  70      */
  71     public String getID() {
  72         return "Aqua";
  73     }
  74 
  75     /**
  76      * Return a one line description of this look and feel implementation,
  77      * e.g. "The CDE/Motif Look and Feel".   This string is intended for
  78      * the user, e.g. in the title of a window or in a ToolTip message.
  79      */
  80     public String getDescription() {
  81         return "Aqua Look and Feel for Mac OS X";
  82     }
  83 
  84     /**
  85      * Returns true if the {@code LookAndFeel} returned
  86      * {@code RootPaneUI} instances support providing Window decorations
  87      * in a {@code JRootPane}.
  88      * <p>
  89      * The default implementation returns false, subclasses that support
  90      * Window decorations should override this and return true.
  91      *
  92      * @return True if the RootPaneUI instances created support client side
  93      *             decorations
  94      * @see JDialog#setDefaultLookAndFeelDecorated
  95      * @see JFrame#setDefaultLookAndFeelDecorated
  96      * @see JRootPane#setWindowDecorationStyle
  97      * @since 1.4
  98      */
  99     public boolean getSupportsWindowDecorations() {
 100         return false;
 101     }
 102 
 103     /**
 104      * If the underlying platform has a "native" look and feel, and this
 105      * is an implementation of it, return true.
 106      */
 107     public boolean isNativeLookAndFeel() {


 157 
 158     /**
 159      * UIManager.setLookAndFeel calls this method just before we're
 160      * replaced by a new default look and feel.   Subclasses may
 161      * choose to free up some resources here.
 162      *
 163      * @see #initialize
 164      */
 165     public void uninitialize() {
 166         KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventPostProcessor(AquaMnemonicHandler.getInstance());
 167 
 168         final PopupFactory popupFactory = PopupFactory.getSharedInstance();
 169         if (popupFactory != null && popupFactory instanceof ScreenPopupFactory) {
 170             ((ScreenPopupFactory)popupFactory).setActive(false);
 171         }
 172 
 173         super.uninitialize();
 174     }
 175 
 176     /**
 177      * Returns an {@code ActionMap}.
 178      * <P>
 179      * This {@code ActionMap} contains {@code Actions} that
 180      * embody the ability to render an auditory cue. These auditory
 181      * cues map onto user and system activities that may be useful
 182      * for an end user to know about (such as a dialog box appearing).
 183      * <P>
 184      * At the appropriate time in a {@code JComponent} UI's lifecycle,
 185      * the ComponentUI is responsible for getting the appropriate
 186      * {@code Action} out of the {@code ActionMap} and passing
 187      * it on to {@code playSound}.
 188      * <P>
 189      * The {@code Actions} in this {@code ActionMap} are
 190      * created by the {@code createAudioAction} method.
 191      *
 192      * @return      an ActionMap containing Actions
 193      *              responsible for rendering auditory cues
 194      * @see #createAudioAction
 195      * @see #playSound(Action)
 196      * @since 1.4
 197      */
 198     protected ActionMap getAudioActionMap() {
 199         ActionMap audioActionMap = (ActionMap)UIManager.get("AuditoryCues.actionMap");
 200         if (audioActionMap != null) return audioActionMap;
 201 
 202         final Object[] acList = (Object[])UIManager.get("AuditoryCues.cueList");
 203         if (acList != null) {
 204             audioActionMap = new ActionMapUIResource();
 205             for (int counter = acList.length - 1; counter >= 0; counter--) {
 206                 audioActionMap.put(acList[counter], createAudioAction(acList[counter]));
 207             }
 208         }
 209         UIManager.getLookAndFeelDefaults().put("AuditoryCues.actionMap", audioActionMap);
 210 


< prev index next >