Package com.formdev.flatlaf.ui
Class FlatLabelUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.LabelUI
-
- javax.swing.plaf.basic.BasicLabelUI
-
- com.formdev.flatlaf.ui.FlatLabelUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableUI,PropertyChangeListener,EventListener
- Direct Known Subclasses:
FlatTitlePane.FlatTitleLabelUI
public class FlatLabelUI extends BasicLabelUI implements FlatStylingSupport.StyleableUI
Provides the Flat LaF UI delegate forJLabel.- UiDefault:
- Label.font Font, Label.background Color only used if opaque, Label.foreground Color , Label.disabledForeground Color
-
-
Field Summary
Fields Modifier and Type Field Description protected ColordisabledForeground-
Fields inherited from class javax.swing.plaf.basic.BasicLabelUI
labelUI
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFlatLabelUI(boolean shared)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyStyle(JLabel c, Object style)protected ObjectapplyStyleProperty(JLabel c, String key, Object value)static ComponentUIcreateUI(JComponent c)Map<String,Class<?>>getStyleableInfos(JComponent c)protected voidinstallComponents(JLabel c)protected voidinstallDefaults(JLabel c)protected voidinstallStyle(JLabel c)voidinstallUI(JComponent c)protected StringlayoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)Overridden to scale iconTextGap.voidpaint(Graphics g, JComponent c)protected voidpaintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)protected voidpaintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)voidpropertyChange(PropertyChangeEvent e)protected voiduninstallDefaults(JLabel c)-
Methods inherited from class javax.swing.plaf.basic.BasicLabelUI
getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installKeyboardActions, installListeners, uninstallComponents, uninstallKeyboardActions, uninstallListeners, uninstallUI
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
-
-
-
-
Field Detail
-
disabledForeground
protected Color disabledForeground
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUIin classBasicLabelUI
-
installDefaults
protected void installDefaults(JLabel c)
- Overrides:
installDefaultsin classBasicLabelUI
-
uninstallDefaults
protected void uninstallDefaults(JLabel c)
- Overrides:
uninstallDefaultsin classBasicLabelUI
-
installComponents
protected void installComponents(JLabel c)
- Overrides:
installComponentsin classBasicLabelUI
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBasicLabelUI
-
installStyle
protected void installStyle(JLabel c)
- Since:
- 2
-
applyStyleProperty
protected Object applyStyleProperty(JLabel c, String key, Object value)
- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Since:
- 2
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paintin classBasicLabelUI
-
paintEnabledText
protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)
- Overrides:
paintEnabledTextin classBasicLabelUI
-
paintDisabledText
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
- Overrides:
paintDisabledTextin classBasicLabelUI
-
layoutCL
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)
Overridden to scale iconTextGap.- Overrides:
layoutCLin classBasicLabelUI
-
-