< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java

Print this page


   1 /*
   2  * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 846             if (laf == null || laf != UIManager.getLookAndFeel()) {
 847                 dispose();
 848                 return;
 849             }
 850 
 851             SwingUtilities2.putAATextInfo(useLAFConditions(), defaults);
 852 
 853             updateUI();
 854         }
 855 
 856         void dispose() {
 857             Toolkit tk = Toolkit.getDefaultToolkit();
 858             tk.removePropertyChangeListener(key, this);
 859         }
 860 
 861         /**
 862          * Updates the UI of the passed in window and all its children.
 863          */
 864         private static void updateWindowUI(Window window) {
 865             updateStyles(window);
 866             Window ownedWins[] = window.getOwnedWindows();
 867             for (Window w : ownedWins) {
 868                 updateWindowUI(w);
 869             }
 870         }
 871 
 872         /**
 873          * Updates the UIs of all the known Frames.
 874          */
 875         private static void updateAllUIs() {
 876             Frame appFrames[] = Frame.getFrames();
 877             for (Frame frame : appFrames) {
 878                 updateWindowUI(frame);
 879             }
 880         }
 881 
 882         /**
 883          * Indicates if an updateUI call is pending.
 884          */
 885         private static boolean updatePending;
 886 
 887         /**
 888          * Sets whether or not an updateUI call is pending.
 889          */
 890         private static synchronized void setUpdatePending(boolean update) {
 891             updatePending = update;
 892         }
 893 
 894         /**
 895          * Returns true if a UI update is pending.
 896          */


   1 /*
   2  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 846             if (laf == null || laf != UIManager.getLookAndFeel()) {
 847                 dispose();
 848                 return;
 849             }
 850 
 851             SwingUtilities2.putAATextInfo(useLAFConditions(), defaults);
 852 
 853             updateUI();
 854         }
 855 
 856         void dispose() {
 857             Toolkit tk = Toolkit.getDefaultToolkit();
 858             tk.removePropertyChangeListener(key, this);
 859         }
 860 
 861         /**
 862          * Updates the UI of the passed in window and all its children.
 863          */
 864         private static void updateWindowUI(Window window) {
 865             updateStyles(window);
 866             Window[] ownedWins = window.getOwnedWindows();
 867             for (Window w : ownedWins) {
 868                 updateWindowUI(w);
 869             }
 870         }
 871 
 872         /**
 873          * Updates the UIs of all the known Frames.
 874          */
 875         private static void updateAllUIs() {
 876             Frame[] appFrames = Frame.getFrames();
 877             for (Frame frame : appFrames) {
 878                 updateWindowUI(frame);
 879             }
 880         }
 881 
 882         /**
 883          * Indicates if an updateUI call is pending.
 884          */
 885         private static boolean updatePending;
 886 
 887         /**
 888          * Sets whether or not an updateUI call is pending.
 889          */
 890         private static synchronized void setUpdatePending(boolean update) {
 891             updatePending = update;
 892         }
 893 
 894         /**
 895          * Returns true if a UI update is pending.
 896          */


< prev index next >