Java 类javax.swing.plaf.LabelUI 实例源码

项目:minimal-j    文件:SwingCaption.java   
@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);
}
项目:openjdk-jdk10    文件:JLabel.java   
/**
 * 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);
    }
}
项目:openjdk-jdk10    文件:JLabelOperator.java   
/**
 * Maps {@code JLabel.getUI()} through queue
 */
public LabelUI getUI() {
    return (runMapping(new MapAction<LabelUI>("getUI") {
        @Override
        public LabelUI map() {
            return ((JLabel) getSource()).getUI();
        }
    }));
}
项目:openjdk-jdk10    文件:JLabelOperator.java   
/**
 * 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);
        }
    });
}
项目:openjdk9    文件:JLabel.java   
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the LabelUI L&amp;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);
    }
}
项目:openjdk9    文件:JLabelOperator.java   
/**
 * Maps {@code JLabel.getUI()} through queue
 */
public LabelUI getUI() {
    return (runMapping(new MapAction<LabelUI>("getUI") {
        @Override
        public LabelUI map() {
            return ((JLabel) getSource()).getUI();
        }
    }));
}
项目:openjdk9    文件:JLabelOperator.java   
/**
 * 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);
        }
    });
}
项目:umple    文件:PaletteFontChooserPreviewPanel.java   
/** 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));
}
项目:jplot2d    文件:ColorPropertyEditor.java   
private ColorCellRenderer getLabel() {
    if (label == null) {
        label = new ColorCellRenderer();
        label.setUI((LabelUI) UIManager.getUI(label));
        label.setOpaque(false);
    }
    return label;
}
项目:jplot2d    文件:FontPropertyEditor.java   
private FontCellRenderer getLabel() {
    if (label == null) {
        label = new FontCellRenderer();
        label.setUI((LabelUI) UIManager.getUI(label));
        label.setOpaque(false);
    }
    return label;
}
项目:cn1    文件:JLabelTest.java   
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());
}
项目:freeVM    文件:JLabelTest.java   
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());
}
项目:freeVM    文件:JLabelTest.java   
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());
}
项目:incubator-netbeans    文件:CleanComboUI.java   
@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);
    }
}
项目:incubator-netbeans    文件:LabelRenderer.java   
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
项目:incubator-netbeans    文件:LabelRenderer.java   
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
项目:pumpernickel    文件:BreadCrumbUI.java   
/** Return the LabelUI each crumb should use. */
protected LabelUI getLabelUI() {
    return null; //return new FadingLabelUI();
}
项目:j2se_for_android    文件:JLabel.java   
public LabelUI getUI() {
    AndroidClassUtil.callEmptyMethod();
    return (LabelUI) null;
}
项目:j2se_for_android    文件:JLabel.java   
public void setUI(LabelUI ui) {
    AndroidClassUtil.callEmptyMethod();
    super.setUI(ui);
}
项目:javify    文件:JLabel.java   
/**
 * Resets the label's UI delegate to the default UI for the current look and
 * feel.
 */
public void updateUI()
{
  setUI((LabelUI) UIManager.getUI(this));
}
项目:jvm-stm    文件:JLabel.java   
/**
 * Resets the label's UI delegate to the default UI for the current look and 
 * feel.
 */
public void updateUI()
{
  setUI((LabelUI) UIManager.getUI(this));
}
项目:cn1    文件:JLabel.java   
public void setUI(final LabelUI ui) {
    super.setUI(ui);
}
项目:cn1    文件:JLabel.java   
public LabelUI getUI() {
    return (LabelUI) ui;
}
项目:cn1    文件:JLabel.java   
@Override
public void updateUI() {
    setUI((LabelUI) UIManager.getUI(this));
}
项目:cn1    文件:DefaultTableCellRendererTest.java   
public void testUpdateUI() throws Exception {
    ComponentUI ui = renderer.getUI();
    assertTrue(ui instanceof LabelUI);
    renderer.updateUI();
    assertSame(ui, renderer.getUI());
}
项目:JamVM-PH    文件:JLabel.java   
/**
 * Resets the label's UI delegate to the default UI for the current look and 
 * feel.
 */
public void updateUI()
{
  setUI((LabelUI) UIManager.getUI(this));
}
项目:tools-idea    文件:DarculaWelcomeScreenLabelUI.java   
@SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"})
public static LabelUI createUI(JComponent c) {
  return new DarculaWelcomeScreenLabelUI();
}
项目:classpath    文件:JLabel.java   
/**
 * Resets the label's UI delegate to the default UI for the current look and
 * feel.
 */
public void updateUI()
{
  setUI((LabelUI) UIManager.getUI(this));
}
项目:freeVM    文件:JLabel.java   
public void setUI(final LabelUI ui) {
    super.setUI(ui);
}
项目:freeVM    文件:JLabel.java   
public LabelUI getUI() {
    return (LabelUI) ui;
}
项目:freeVM    文件:JLabel.java   
@Override
public void updateUI() {
    setUI((LabelUI) UIManager.getUI(this));
}
项目:freeVM    文件:DefaultTableCellRendererTest.java   
public void testUpdateUI() throws Exception {
    ComponentUI ui = renderer.getUI();
    assertTrue(ui instanceof LabelUI);
    renderer.updateUI();
    assertSame(ui, renderer.getUI());
}
项目:freeVM    文件:JLabel.java   
public void setUI(final LabelUI ui) {
    super.setUI(ui);
}
项目:freeVM    文件:JLabel.java   
public LabelUI getUI() {
    return (LabelUI) ui;
}
项目:freeVM    文件:JLabel.java   
@Override
public void updateUI() {
    setUI((LabelUI) UIManager.getUI(this));
}
项目:freeVM    文件:DefaultTableCellRendererTest.java   
public void testUpdateUI() throws Exception {
    ComponentUI ui = renderer.getUI();
    assertTrue(ui instanceof LabelUI);
    renderer.updateUI();
    assertSame(ui, renderer.getUI());
}
项目:OpenJSharp    文件:JLabel.java   
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the LabelUI L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *    attribute: 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);
    }
}
项目:jdk8u-jdk    文件:JLabel.java   
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the LabelUI L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *    attribute: 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);
    }
}
项目:Java8CN    文件:JLabel.java   
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the LabelUI L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *    attribute: 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);
    }
}
项目:jdk8u_jdk    文件:JLabel.java   
/**
 * Sets the L&amp;F object that renders this component.
 *
 * @param ui  the LabelUI L&amp;F object
 * @see UIDefaults#getUI
 * @beaninfo
 *        bound: true
 *       hidden: true
 *    attribute: 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);
    }
}