/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A Windows L&F implementation of LabelUI. This implementation
* is completely static, i.e. there's only one UIView implementation
* that's shared by all JLabel objects.
*
* @author Hans Muller
*/
{
/**
* The default <code>BasicLabelUI</code> instance. This field might
* not be used. To change the default instance use a subclass which
* overrides the <code>createUI</code> method, and place that class
* name in defaults table under the key "LabelUI".
*/
}
/**
* Forwards the call to SwingUtilities.layoutCompoundLabel().
* This method is here so that a subclass could do Label specific
* layout and to shorten the method name a little.
*
* @see SwingUtilities#layoutCompoundLabel
*/
{
return SwingUtilities.layoutCompoundLabel(
(JComponent) label,
text,
icon,
label.getIconTextGap());
}
/**
* Paint clippedText at textX, textY with the labels foreground color.
*
* @see #paint
* @see #paintDisabledText
*/
{
int mnemIndex = l.getDisplayedMnemonicIndex();
g.setColor(l.getForeground());
}
/**
* Paint clippedText at textX, textY with background.lighter() and then
* shifted down and to the right by one pixel with background.darker().
*
* @see #paint
* @see #paintEnabledText
*/
{
int accChar = l.getDisplayedMnemonicIndex();
}
/**
* Paints the label text with the foreground color, if the label is opaque
* then paints the entire background with the background color. The Label
* text is drawn by {@link #paintEnabledText} or {@link #paintDisabledText}.
* The locations of the label parts are computed by {@link #layoutCL}.
*
* @see #paintEnabledText
* @see #paintDisabledText
* @see #layoutCL
*/
{
return;
}
}
if (v != null) {
v.paint(g, paintTextR);
} else {
int textX = paintTextR.x;
}
else {
}
}
}
}
}
{
}
}
else {
return rv;
}
}
/**
* @return getPreferredSize(c)
*/
Dimension d = getPreferredSize(c);
if (v != null) {
}
return d;
}
/**
* @return getPreferredSize(c)
*/
Dimension d = getPreferredSize(c);
if (v != null) {
}
return d;
}
/**
* Returns the baseline.
*
* @throws NullPointerException {@inheritDoc}
* @throws IllegalArgumentException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
return -1;
}
}
/**
* Returns an enum indicating how the baseline of the component
* changes as the size changes.
*
* @throws NullPointerException {@inheritDoc}
* @see javax.swing.JComponent#getBaseline(int, int)
* @since 1.6
*/
JComponent c) {
super.getBaselineResizeBehavior(c);
}
switch(((JLabel)c).getVerticalAlignment()) {
}
}
installDefaults((JLabel)c);
installComponents((JLabel)c);
installListeners((JLabel)c);
}
uninstallDefaults((JLabel)c);
uninstallListeners((JLabel)c);
}
}
c.addPropertyChangeListener(this);
}
c.setInheritsPopupMenu(true);
}
int dka = l.getDisplayedMnemonic();
"Label.actionMap");
inputMap = new ComponentInputMapUIResource(l);
}
inputMap.put(KeyStroke.getKeyStroke(dka, BasicLookAndFeel.getFocusAcceleratorKeyMask(), false), "press");
}
else {
}
}
}
}
c.removePropertyChangeListener(this);
}
}
null);
}
if (safeBasicLabelUI == null) {
safeBasicLabelUI = new BasicLabelUI();
}
return safeBasicLabelUI;
}
return labelUI;
}
// remove the old html view client property if one
// existed, and install a new one if the text installed
// into the JLabel is html source.
}
}
}
// When the accelerator is pressed, temporarily make the JLabel
// focusTraversable by registering a WHEN_FOCUSED action for the
// release of the accelerator. Then give it focus so it can
// prevent unwanted keyTyped events from getting to other components.
super(key);
}
}
}
}
inputMap = new InputMapUIResource();
}
inputMap.put(KeyStroke.getKeyStroke(dka, BasicLookAndFeel.getFocusAcceleratorKeyMask(), true), RELEASE);
// Need this when the sticky keys are enabled
// Need this if ALT is released before the accelerator
}
}
// inputMap should never be null.
}
} else {
}
}
}
}
}