Java Code Examples for javax.swing.plaf.LabelUI

The following examples show how to use javax.swing.plaf.LabelUI. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Bytecoder   Source File: JLabel.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 2
Source Project: openjdk-jdk9   Source File: JLabel.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example 3
Source Project: openjdk-jdk9   Source File: JLabelOperator.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Maps {@code JLabel.getUI()} through queue
 */
public LabelUI getUI() {
    return (runMapping(new MapAction<LabelUI>("getUI") {
        @Override
        public LabelUI map() {
            return ((JLabel) getSource()).getUI();
        }
    }));
}
 
Example 4
Source Project: openjdk-jdk9   Source File: JLabelOperator.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
        }
    });
}
 
Example 5
Source Project: netbeans   Source File: CleanComboUI.java    License: Apache License 2.0 4 votes vote down vote up
@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);
    }
}
 
Example 6
Source Project: netbeans   Source File: LabelRenderer.java    License: Apache License 2.0 4 votes vote down vote up
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
 
Example 7
Source Project: netbeans   Source File: LabelRenderer.java    License: Apache License 2.0 4 votes vote down vote up
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
 
Example 8
Source Project: visualvm   Source File: SimpleXYChartUtils.java    License: GNU General Public License v2.0 4 votes vote down vote up
private static JLabel createRotatedLabel(String text, final LabelUI labelUI) {
    return new JLabel(text, SwingConstants.CENTER) {
        public void updateUI() { if (getUI() != labelUI) setUI(labelUI); }
    };
}
 
Example 9
Source Project: visualvm   Source File: LabelRenderer.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
 
Example 10
Source Project: visualvm   Source File: LabelRenderer.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
 
Example 11
Source Project: visualvm   Source File: LabelRenderer.java    License: GNU General Public License v2.0 4 votes vote down vote up
public void setUI(LabelUI ui) {
    super.setUI(UI);
}
 
Example 12
Source Project: jdk1.8-source-analysis   Source File: JLabel.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 13
Source Project: dragonwell8_jdk   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 14
Source Project: TencentKona-8   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 15
Source Project: jdk8u60   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 16
Source Project: JDKSourceCode1.8   Source File: JLabel.java    License: MIT License 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 17
Source Project: openjdk-jdk8u   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 18
Source Project: openjdk-jdk8u-backup   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 19
Source Project: jdk8u-jdk   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 20
Source Project: Java8CN   Source File: JLabel.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 21
Source Project: hottub   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 22
Source Project: openjdk-8-source   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 23
Source Project: openjdk-8   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 24
Source Project: jdk8u_jdk   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 25
Source Project: jdk8u-jdk   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 26
Source Project: jdk8u-dev-jdk   Source File: JLabel.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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);
    }
}
 
Example 27
Source Project: jdk1.8-source-analysis   Source File: JLabel.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return LabelUI object
 */
public LabelUI getUI() {
    return (LabelUI)ui;
}
 
Example 28
Source Project: jdk1.8-source-analysis   Source File: JLabel.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((LabelUI)UIManager.getUI(this));
}
 
Example 29
Source Project: dragonwell8_jdk   Source File: JLabel.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Returns the L&amp;F object that renders this component.
 *
 * @return LabelUI object
 */
public LabelUI getUI() {
    return (LabelUI)ui;
}
 
Example 30
Source Project: dragonwell8_jdk   Source File: JLabel.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Resets the UI property to a value from the current look and feel.
 *
 * @see JComponent#updateUI
 */
public void updateUI() {
    setUI((LabelUI)UIManager.getUI(this));
}