@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); }
/** * 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); } }
/** * Maps {@code JLabel.getUI()} through queue */ public LabelUI getUI() { return (runMapping(new MapAction<LabelUI>("getUI") { @Override public LabelUI map() { return ((JLabel) getSource()).getUI(); } })); }
/** * 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); } }); }
/** 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)); }
private ColorCellRenderer getLabel() { if (label == null) { label = new ColorCellRenderer(); label.setUI((LabelUI) UIManager.getUI(label)); label.setOpaque(false); } return label; }
private FontCellRenderer getLabel() { if (label == null) { label = new FontCellRenderer(); label.setUI((LabelUI) UIManager.getUI(label)); label.setOpaque(false); } return label; }
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()); }
@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); } }
public void setUI(LabelUI ui) { super.setUI(UI); }
/** Return the LabelUI each crumb should use. */ protected LabelUI getLabelUI() { return null; //return new FadingLabelUI(); }
public LabelUI getUI() { AndroidClassUtil.callEmptyMethod(); return (LabelUI) null; }
public void setUI(LabelUI ui) { AndroidClassUtil.callEmptyMethod(); super.setUI(ui); }
/** * Resets the label's UI delegate to the default UI for the current look and * feel. */ public void updateUI() { setUI((LabelUI) UIManager.getUI(this)); }
public void setUI(final LabelUI ui) { super.setUI(ui); }
public LabelUI getUI() { return (LabelUI) ui; }
@Override public void updateUI() { setUI((LabelUI) UIManager.getUI(this)); }
public void testUpdateUI() throws Exception { ComponentUI ui = renderer.getUI(); assertTrue(ui instanceof LabelUI); renderer.updateUI(); assertSame(ui, renderer.getUI()); }
@SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"}) public static LabelUI createUI(JComponent c) { return new DarculaWelcomeScreenLabelUI(); }
/** * Sets the L&F object that renders this component. * * @param ui the LabelUI L&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); } }