本文整理汇总了Java中javax.swing.plaf.LabelUI类的典型用法代码示例。如果您正苦于以下问题:Java LabelUI类的具体用法?Java LabelUI怎么用?Java LabelUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LabelUI类属于javax.swing.plaf包,在下文中一共展示了LabelUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
@Override
public void setUI(LabelUI ui) {
if (getFont() != null) {
// set the Font to "unchanged", otherwise the font gets smaller and smaller
// with every setUI
setFont(null);
}
super.setUI(ui);
Font font = getFont();
Font boldFont = boldFonts.get(font);
if (boldFont == null) {
float fontSize = font.getSize();
fontSize = ((int)(fontSize * 4.0F / 5.0F + 1.0F));
boldFont = font.deriveFont(fontSize).deriveFont(Font.BOLD);
boldFonts.put(font, boldFont);
}
setFont(boldFont);
}
示例2: setUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/**
* Sets the L&F object that renders this component.
*
* @param ui the LabelUI L&F object
* @see UIDefaults#getUI
*/
@BeanProperty(hidden = true, visualUpdate = true, description
= "The UI object that implements the Component's LookAndFeel.")
public void setUI(LabelUI ui) {
super.setUI(ui);
// disabled icon is generated by LF so it should be unset here
if (!disabledIconSet && disabledIcon != null) {
setDisabledIcon(null);
}
}
示例3: getUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/**
* Maps {@code JLabel.getUI()} through queue
*/
public LabelUI getUI() {
return (runMapping(new MapAction<LabelUI>("getUI") {
@Override
public LabelUI map() {
return ((JLabel) getSource()).getUI();
}
}));
}
示例4: setUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/**
* Maps {@code JLabel.setUI(LabelUI)} through queue
*/
public void setUI(final LabelUI labelUI) {
runMapping(new MapVoidAction("setUI") {
@Override
public void map() {
((JLabel) getSource()).setUI(labelUI);
}
});
}
示例5: PaletteFontChooserPreviewPanel
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/** Creates new form PaletteFontChooserPreviewPanel */
public PaletteFontChooserPreviewPanel() {
initComponents();
previewLabel.setUI((LabelUI) PaletteLabelUI.createUI(previewLabel));
previewLabel.setBackground(Color.WHITE);
previewLabel.setForeground(Color.BLACK);
previewLabel.setOpaque(true);
setPreferredSize(new Dimension(100,50));
setMinimumSize(new Dimension(100,50));
}
示例6: getLabel
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
private ColorCellRenderer getLabel() {
if (label == null) {
label = new ColorCellRenderer();
label.setUI((LabelUI) UIManager.getUI(label));
label.setOpaque(false);
}
return label;
}
示例7: getLabel
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
private FontCellRenderer getLabel() {
if (label == null) {
label = new FontCellRenderer();
label.setUI((LabelUI) UIManager.getUI(label));
label.setOpaque(false);
}
return label;
}
示例8: testGetSetUpdateUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
public void testGetSetUpdateUI() throws Exception {
LabelUI defaultUI = label.getUI();
assertNotNull(defaultUI);
LabelUI ui = new LabelUI() {
};
label.setUI(ui);
assertEquals(ui, label.getUI());
label.updateUI();
assertEquals(defaultUI, label.getUI());
}
示例9: paintCurrentValue
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
@Override
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) {
ListCellRenderer renderer = comboBox.getRenderer();
//Fix for an obscure condition when renderer may be null -
//can't figure how this can happen unless the combo box is
//painted before installUI() has completed (which is called
//by the superclass constructor calling updateUI(). Only
//happens when opening an individual Properties window. Maybe
//the window is constructed off the AWT thread?
if ((listBox == null) || (renderer == null)) {
return;
}
Component c;
c = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, hasFocus && !isPopupVisible(comboBox), false);
c.setFont(comboBox.getFont());
c.setForeground(comboBox.isEnabled() ? comboBox.getForeground() : PropUtils.getDisabledForeground());
c.setBackground(comboBox.getBackground());
boolean shouldValidate = false;
if (c instanceof JPanel) {
shouldValidate = true;
}
LabelUI origUI = null;
if (c instanceof JLabel && isGtk) {
// Override L&F's strange background painting
origUI = ((JLabel) c).getUI();
((JLabel) c).setUI(new SolidBackgroundLabelUI());
}
currentValuePane.paintComponent(
g, c, comboBox, bounds.x, bounds.y, bounds.width, bounds.height, shouldValidate
);
if (origUI != null) {
((JLabel) c).setUI(origUI);
}
}
示例10: setUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
public void setUI(LabelUI ui) {
super.setUI(UI);
}
示例11: getLabelUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/** Return the LabelUI each crumb should use. */
protected LabelUI getLabelUI() {
return null; //return new FadingLabelUI();
}
示例12: getUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
public LabelUI getUI() {
AndroidClassUtil.callEmptyMethod();
return (LabelUI) null;
}
示例13: setUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
public void setUI(LabelUI ui) {
AndroidClassUtil.callEmptyMethod();
super.setUI(ui);
}
示例14: updateUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/**
* Resets the label's UI delegate to the default UI for the current look and
* feel.
*/
public void updateUI()
{
setUI((LabelUI) UIManager.getUI(this));
}
示例15: updateUI
import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/**
* Resets the label's UI delegate to the default UI for the current look and
* feel.
*/
public void updateUI()
{
setUI((LabelUI) UIManager.getUI(this));
}