当前位置: 首页>>代码示例>>Java>>正文


Java LabelUI类代码示例

本文整理汇总了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);
}
 
开发者ID:BrunoEberhard,项目名称:minimal-j,代码行数:20,代码来源:SwingCaption.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:JLabel.java

示例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();
        }
    }));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JLabelOperator.java

示例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);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JLabelOperator.java

示例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));
}
 
开发者ID:umple,项目名称:umple,代码行数:13,代码来源:PaletteFontChooserPreviewPanel.java

示例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;
}
 
开发者ID:jplot2d,项目名称:jplot2d,代码行数:9,代码来源:ColorPropertyEditor.java

示例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;
}
 
开发者ID:jplot2d,项目名称:jplot2d,代码行数:9,代码来源:FontPropertyEditor.java

示例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());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:JLabelTest.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:CleanComboUI.java

示例10: setUI

import javax.swing.plaf.LabelUI; //导入依赖的package包/类
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:LabelRenderer.java

示例11: getLabelUI

import javax.swing.plaf.LabelUI; //导入依赖的package包/类
/** Return the LabelUI each crumb should use. */
protected LabelUI getLabelUI() {
	return null; //return new FadingLabelUI();
}
 
开发者ID:mickleness,项目名称:pumpernickel,代码行数:5,代码来源:BreadCrumbUI.java

示例12: getUI

import javax.swing.plaf.LabelUI; //导入依赖的package包/类
public LabelUI getUI() {
	AndroidClassUtil.callEmptyMethod();
	return (LabelUI) null;
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:5,代码来源:JLabel.java

示例13: setUI

import javax.swing.plaf.LabelUI; //导入依赖的package包/类
public void setUI(LabelUI ui) {
	AndroidClassUtil.callEmptyMethod();
	super.setUI(ui);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:5,代码来源:JLabel.java

示例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));
}
 
开发者ID:vilie,项目名称:javify,代码行数:9,代码来源:JLabel.java

示例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));
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:9,代码来源:JLabel.java


注:本文中的javax.swing.plaf.LabelUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。