MotifLabelUI.java revision 1859
5595N/A/*
5595N/A * Copyright 1997-1998 Sun Microsystems, Inc. All Rights Reserved.
5595N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5597N/A *
5597N/A * This code is free software; you can redistribute it and/or modify it
5597N/A * under the terms of the GNU General Public License version 2 only, as
5597N/A * published by the Free Software Foundation. Sun designates this
5597N/A * particular file as subject to the "Classpath" exception as provided
5597N/A * by Sun in the LICENSE file that accompanied this code.
5597N/A *
5597N/A * This code is distributed in the hope that it will be useful, but WITHOUT
5597N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5597N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5597N/A * version 2 for more details (a copy is included in the LICENSE file that
5597N/A * accompanied this code).
5597N/A *
5597N/A * You should have received a copy of the GNU General Public License version
5597N/A * 2 along with this work; if not, write to the Free Software Foundation,
5595N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5595N/A *
5595N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
5595N/A * CA 95054 USA or visit www.sun.com if you need additional information or
5595N/A * have any questions.
5595N/A */
5595N/A
5595N/Apackage com.sun.java.swing.plaf.motif;
5595N/A
5595N/Aimport sun.awt.AppContext;
5595N/A
5595N/Aimport javax.swing.*;
5597N/Aimport javax.swing.plaf.basic.BasicLabelUI;
5597N/Aimport javax.swing.plaf.ComponentUI;
5597N/A
5597N/A/**
5597N/A * A Motif L&F implementation of LabelUI.
5597N/A * This merely sets up new default values in MotifLookAndFeel.
5597N/A * <p>
5597N/A * <strong>Warning:</strong>
5597N/A * Serialized objects of this class will not be compatible with
5597N/A * future Swing releases. The current serialization support is appropriate
5597N/A * for short term storage or RMI between applications running the same
5597N/A * version of Swing. A future release of Swing will provide support for
5597N/A * long term persistence.
5597N/A *
5597N/A * @author Amy Fowler
5597N/A */
5597N/Apublic class MotifLabelUI extends BasicLabelUI
5597N/A{
5597N/A private static final Object MOTIF_LABEL_UI_KEY = new Object();
5597N/A
5597N/A public static ComponentUI createUI(JComponent c) {
5597N/A AppContext appContext = AppContext.getAppContext();
5597N/A MotifLabelUI motifLabelUI =
5597N/A (MotifLabelUI) appContext.get(MOTIF_LABEL_UI_KEY);
5597N/A if (motifLabelUI == null) {
5597N/A motifLabelUI = new MotifLabelUI();
5597N/A appContext.put(MOTIF_LABEL_UI_KEY, motifLabelUI);
5597N/A }
5597N/A return motifLabelUI;
5597N/A }
5597N/A}
5597N/A