Styling: renamed class FlatStyleSupport to FlatStylingSupport

This commit is contained in:
Karl Tauber
2021-09-01 00:21:47 +02:00
parent 6f9bbb184a
commit 397c369114
51 changed files with 262 additions and 262 deletions

View File

@@ -23,7 +23,7 @@ import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D; import java.awt.geom.RoundRectangle2D;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**

View File

@@ -28,8 +28,8 @@ import javax.swing.AbstractButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatStyleSupport; import com.formdev.flatlaf.ui.FlatStylingSupport;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**
@@ -136,14 +136,14 @@ public class FlatCheckBoxIcon
* @since TODO * @since TODO
*/ */
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -25,8 +25,8 @@ import java.util.Map;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.JMenuItem; import javax.swing.JMenuItem;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport; import com.formdev.flatlaf.ui.FlatStylingSupport;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
/** /**
* Icon for {@link javax.swing.JCheckBoxMenuItem}. * Icon for {@link javax.swing.JCheckBoxMenuItem}.
@@ -53,14 +53,14 @@ public class FlatCheckBoxMenuItemIcon
* @since TODO * @since TODO
*/ */
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -26,9 +26,9 @@ import java.util.Map;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.ButtonModel; import javax.swing.ButtonModel;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport; import com.formdev.flatlaf.ui.FlatStylingSupport;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable;
/** /**
* "clear" icon for search fields. * "clear" icon for search fields.
@@ -55,14 +55,14 @@ public class FlatClearIcon
* @since TODO * @since TODO
*/ */
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -25,9 +25,9 @@ import java.awt.geom.Path2D;
import java.util.Map; import java.util.Map;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatStyleSupport; import com.formdev.flatlaf.ui.FlatStylingSupport;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable;
/** /**
* Help button icon for {@link javax.swing.JButton}. * Help button icon for {@link javax.swing.JButton}.
@@ -78,14 +78,14 @@ public class FlatHelpButtonIcon
* @since TODO * @since TODO
*/ */
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -24,9 +24,9 @@ import java.awt.geom.Path2D;
import java.util.Map; import java.util.Map;
import javax.swing.JMenu; import javax.swing.JMenu;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport; import com.formdev.flatlaf.ui.FlatStylingSupport;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
/** /**
* "arrow" icon for {@link javax.swing.JMenu}. * "arrow" icon for {@link javax.swing.JMenu}.
@@ -55,14 +55,14 @@ public class FlatMenuArrowIcon
* @since TODO * @since TODO
*/ */
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -19,7 +19,7 @@ package com.formdev.flatlaf.icons;
import java.awt.Component; import java.awt.Component;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D; import java.awt.geom.Ellipse2D;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
/** /**
* Icon for {@link javax.swing.JRadioButton}. * Icon for {@link javax.swing.JRadioButton}.

View File

@@ -24,9 +24,9 @@ import java.awt.geom.Ellipse2D;
import java.util.Map; import java.util.Map;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatStyleSupport; import com.formdev.flatlaf.ui.FlatStylingSupport;
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable;
/** /**
* "search" icon for search fields. * "search" icon for search fields.
@@ -53,14 +53,14 @@ public class FlatSearchIcon
* @since TODO * @since TODO
*/ */
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -26,8 +26,8 @@ import java.awt.geom.Path2D;
import java.util.Map; import java.util.Map;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatButtonUI; import com.formdev.flatlaf.ui.FlatButtonUI;
import com.formdev.flatlaf.ui.FlatStyleSupport; import com.formdev.flatlaf.ui.FlatStylingSupport;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
/** /**
@@ -70,14 +70,14 @@ public class FlatTabbedPaneCloseIcon
* @since TODO * @since TODO
*/ */
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -32,8 +32,8 @@ import javax.swing.JViewport;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicBorders; import javax.swing.plaf.basic.BasicBorders;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableBorder; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableBorder;
import com.formdev.flatlaf.util.DerivedColor; import com.formdev.flatlaf.util.DerivedColor;
/** /**
@@ -84,7 +84,7 @@ public class FlatBorder
*/ */
@Override @Override
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -92,7 +92,7 @@ public class FlatBorder
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -26,7 +26,7 @@ import java.awt.Paint;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.UIResource; import javax.swing.plaf.UIResource;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**

View File

@@ -48,9 +48,9 @@ import javax.swing.plaf.basic.BasicButtonListener;
import javax.swing.plaf.basic.BasicButtonUI; import javax.swing.plaf.basic.BasicButtonUI;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.icons.FlatHelpButtonIcon; import com.formdev.flatlaf.icons.FlatHelpButtonIcon;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -160,7 +160,7 @@ public class FlatButtonUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( (AbstractButton) c, FlatStyleSupport.getStyle( c ) ); applyStyle( (AbstractButton) c, FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -275,7 +275,7 @@ public class FlatButtonUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( AbstractButton b, Object style ) { protected void applyStyle( AbstractButton b, Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style,
(key, value) -> applyStyleProperty( b, key, value ) ); (key, value) -> applyStyleProperty( b, key, value ) );
} }
@@ -288,7 +288,7 @@ public class FlatButtonUI
return new UnknownStyleException( key ); return new UnknownStyleException( key );
if( helpButtonIconShared ) { if( helpButtonIconShared ) {
helpButtonIcon = FlatStyleSupport.cloneIcon( helpButtonIcon ); helpButtonIcon = FlatStylingSupport.cloneIcon( helpButtonIcon );
helpButtonIconShared = false; helpButtonIconShared = false;
} }
@@ -298,7 +298,7 @@ public class FlatButtonUI
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, b, borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, b, borderShared );
} }
/** /**
@@ -306,9 +306,9 @@ public class FlatButtonUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
Map<String, Class<?>> infos = FlatStyleSupport.getAnnotatedStyleableInfos( this, c.getBorder() ); Map<String, Class<?>> infos = FlatStylingSupport.getAnnotatedStyleableInfos( this, c.getBorder() );
if( helpButtonIcon instanceof FlatHelpButtonIcon ) if( helpButtonIcon instanceof FlatHelpButtonIcon )
FlatStyleSupport.putAllPrefixKey( infos, "help.", ((FlatHelpButtonIcon)helpButtonIcon).getStyleableInfos() ); FlatStylingSupport.putAllPrefixKey( infos, "help.", ((FlatHelpButtonIcon)helpButtonIcon).getStyleableInfos() );
return infos; return infos;
} }

View File

@@ -25,8 +25,8 @@ import javax.swing.JComponent;
import javax.swing.LookAndFeel; import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI; import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JCheckBoxMenuItem}. * Provides the Flat LaF UI delegate for {@link javax.swing.JCheckBoxMenuItem}.
@@ -71,7 +71,7 @@ public class FlatCheckBoxMenuItemUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( menuItem ) ); applyStyle( FlatStylingSupport.getStyle( menuItem ) );
} }
@Override @Override
@@ -97,14 +97,14 @@ public class FlatCheckBoxMenuItemUI
@Override @Override
protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { protected PropertyChangeListener createPropertyChangeListener( JComponent c ) {
return FlatStyleSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) ); return FlatStylingSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**

View File

@@ -71,8 +71,8 @@ import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.basic.ComboPopup; import javax.swing.plaf.basic.ComboPopup;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.SystemInfo; import com.formdev.flatlaf.util.SystemInfo;
/** /**
@@ -156,7 +156,7 @@ public class FlatComboBoxUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( comboBox ) ); applyStyle( FlatStylingSupport.getStyle( comboBox ) );
} }
@Override @Override
@@ -454,7 +454,7 @@ public class FlatComboBoxUI
Insets oldPadding = padding; Insets oldPadding = padding;
int oldEditorColumns = editorColumns; int oldEditorColumns = editorColumns;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
if( !padding.equals( oldPadding ) ) { if( !padding.equals( oldPadding ) ) {
paddingBorder.padding = padding; paddingBorder.padding = padding;
@@ -481,7 +481,7 @@ public class FlatComboBoxUI
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, comboBox, borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, comboBox, borderShared );
} }
/** /**
@@ -491,8 +491,8 @@ public class FlatComboBoxUI
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
Map<String, Class<?>> infos = new LinkedHashMap<>(); Map<String, Class<?>> infos = new LinkedHashMap<>();
infos.put( "padding", Insets.class ); infos.put( "padding", Insets.class );
FlatStyleSupport.collectAnnotatedStyleableInfos( this, infos ); FlatStylingSupport.collectAnnotatedStyleableInfos( this, infos );
FlatStyleSupport.collectStyleableInfos( comboBox.getBorder(), infos ); FlatStylingSupport.collectStyleableInfos( comboBox.getBorder(), infos );
return infos; return infos;
} }

View File

@@ -25,8 +25,8 @@ import java.awt.Insets;
import java.awt.RadialGradientPaint; import java.awt.RadialGradientPaint;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.Map; import java.util.Map;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableBorder; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableBorder;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -95,7 +95,7 @@ public class FlatDropShadowBorder
*/ */
@Override @Override
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
Object oldValue = FlatStyleSupport.applyToAnnotatedObject( this, key, value ); Object oldValue = FlatStylingSupport.applyToAnnotatedObject( this, key, value );
if( key.equals( "shadowInsets" ) ) { if( key.equals( "shadowInsets" ) ) {
applyStyleProperty( nonNegativeInsets( shadowInsets ) ); applyStyleProperty( nonNegativeInsets( shadowInsets ) );
shadowSize = maxInset( shadowInsets ); shadowSize = maxInset( shadowInsets );
@@ -108,7 +108,7 @@ public class FlatDropShadowBorder
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -33,8 +33,8 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicEditorPaneUI; import javax.swing.plaf.basic.BasicEditorPaneUI;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
/** /**
@@ -91,7 +91,7 @@ public class FlatEditorPaneUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -179,7 +179,7 @@ public class FlatEditorPaneUI
oldDisabledBackground = disabledBackground; oldDisabledBackground = disabledBackground;
oldInactiveBackground = inactiveBackground; oldInactiveBackground = inactiveBackground;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
updateBackground(); updateBackground();
} }
@@ -188,7 +188,7 @@ public class FlatEditorPaneUI
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -196,7 +196,7 @@ public class FlatEditorPaneUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
private void updateBackground() { private void updateBackground() {

View File

@@ -35,9 +35,9 @@ import javax.swing.UIManager;
import javax.swing.event.MouseInputAdapter; import javax.swing.event.MouseInputAdapter;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicInternalFrameUI; import javax.swing.plaf.basic.BasicInternalFrameUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableBorder; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableBorder;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JInternalFrame}. * Provides the Flat LaF UI delegate for {@link javax.swing.JInternalFrame}.
@@ -116,7 +116,7 @@ public class FlatInternalFrameUI
windowResizer = createWindowResizer(); windowResizer = createWindowResizer();
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -148,7 +148,7 @@ public class FlatInternalFrameUI
@Override @Override
protected PropertyChangeListener createPropertyChangeListener() { protected PropertyChangeListener createPropertyChangeListener() {
return FlatStyleSupport.createPropertyChangeListener( frame, this::applyStyle, return FlatStylingSupport.createPropertyChangeListener( frame, this::applyStyle,
super.createPropertyChangeListener() ); super.createPropertyChangeListener() );
} }
@@ -156,7 +156,7 @@ public class FlatInternalFrameUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
@@ -165,7 +165,7 @@ public class FlatInternalFrameUI
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, frame, borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, frame, borderShared );
} }
/** /**
@@ -173,7 +173,7 @@ public class FlatInternalFrameUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this, frame.getBorder() ); return FlatStylingSupport.getAnnotatedStyleableInfos( this, frame.getBorder() );
} }
//---- class FlatInternalFrameBorder -------------------------------------- //---- class FlatInternalFrameBorder --------------------------------------
@@ -213,13 +213,13 @@ public class FlatInternalFrameUI
case "inactiveDropShadowOpacity": return inactiveDropShadowBorder.applyStyleProperty( "shadowOpacity", value ); case "inactiveDropShadowOpacity": return inactiveDropShadowBorder.applyStyleProperty( "shadowOpacity", value );
} }
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
@Override @Override
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
Map<String, Class<?>> infos = new LinkedHashMap<>(); Map<String, Class<?>> infos = new LinkedHashMap<>();
FlatStyleSupport.collectAnnotatedStyleableInfos( this, infos ); FlatStylingSupport.collectAnnotatedStyleableInfos( this, infos );
infos.put( "borderMargins", Insets.class ); infos.put( "borderMargins", Insets.class );
infos.put( "activeDropShadowColor", Color.class ); infos.put( "activeDropShadowColor", Color.class );
infos.put( "activeDropShadowInsets", Insets.class ); infos.put( "activeDropShadowInsets", Insets.class );

View File

@@ -36,8 +36,8 @@ import javax.swing.plaf.basic.BasicHTML;
import javax.swing.plaf.basic.BasicLabelUI; import javax.swing.plaf.basic.BasicLabelUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -83,7 +83,7 @@ public class FlatLabelUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -141,14 +141,14 @@ public class FlatLabelUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -156,7 +156,7 @@ public class FlatLabelUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
/** /**

View File

@@ -27,8 +27,8 @@ import javax.swing.JComponent;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicListUI; import javax.swing.plaf.basic.BasicListUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JList}. * Provides the Flat LaF UI delegate for {@link javax.swing.JList}.
@@ -90,7 +90,7 @@ public class FlatListUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -140,7 +140,7 @@ public class FlatListUI
@Override @Override
protected PropertyChangeListener createPropertyChangeListener() { protected PropertyChangeListener createPropertyChangeListener() {
return FlatStyleSupport.createPropertyChangeListener( list, this::applyStyle, return FlatStylingSupport.createPropertyChangeListener( list, this::applyStyle,
super.createPropertyChangeListener() ); super.createPropertyChangeListener() );
} }
@@ -153,7 +153,7 @@ public class FlatListUI
Color oldSelectionInactiveBackground = selectionInactiveBackground; Color oldSelectionInactiveBackground = selectionInactiveBackground;
Color oldSelectionInactiveForeground = selectionInactiveForeground; Color oldSelectionInactiveForeground = selectionInactiveForeground;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
// update selection background // update selection background
if( selectionBackground != oldSelectionBackground ) { if( selectionBackground != oldSelectionBackground ) {
@@ -178,7 +178,7 @@ public class FlatListUI
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -186,7 +186,7 @@ public class FlatListUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
/** /**

View File

@@ -24,8 +24,8 @@ import java.awt.Insets;
import java.util.Map; import java.util.Map;
import javax.swing.JMenuBar; import javax.swing.JMenuBar;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableBorder; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableBorder;
/** /**
* Border for {@link javax.swing.JMenuBar}. * Border for {@link javax.swing.JMenuBar}.
@@ -45,12 +45,12 @@ public class FlatMenuBarBorder
*/ */
@Override @Override
public Object applyStyleProperty( String key, Object value ) { public Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
@Override @Override
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -40,7 +40,7 @@ import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicMenuBarUI; import javax.swing.plaf.basic.BasicMenuBarUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.SystemInfo; import com.formdev.flatlaf.util.SystemInfo;
/** /**
@@ -80,7 +80,7 @@ public class FlatMenuBarUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -102,7 +102,7 @@ public class FlatMenuBarUI
protected void installListeners() { protected void installListeners() {
super.installListeners(); super.installListeners();
propertyChangeListener = FlatStyleSupport.createPropertyChangeListener( propertyChangeListener = FlatStylingSupport.createPropertyChangeListener(
menuBar, this::applyStyle, null ); menuBar, this::applyStyle, null );
menuBar.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener ); menuBar.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener );
} }
@@ -131,7 +131,7 @@ public class FlatMenuBarUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
@@ -140,7 +140,7 @@ public class FlatMenuBarUI
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, menuBar, borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, menuBar, borderShared );
} }
/** /**
@@ -148,7 +148,7 @@ public class FlatMenuBarUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this, menuBar.getBorder() ); return FlatStylingSupport.getAnnotatedStyleableInfos( this, menuBar.getBorder() );
} }
@Override @Override

View File

@@ -42,8 +42,8 @@ import javax.swing.text.View;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon; import com.formdev.flatlaf.icons.FlatCheckBoxMenuItemIcon;
import com.formdev.flatlaf.icons.FlatMenuArrowIcon; import com.formdev.flatlaf.icons.FlatMenuArrowIcon;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.DerivedColor; import com.formdev.flatlaf.util.DerivedColor;
import com.formdev.flatlaf.util.Graphics2DProxy; import com.formdev.flatlaf.util.Graphics2DProxy;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
@@ -110,9 +110,9 @@ public class FlatMenuItemRenderer
if( key.startsWith( "icon." ) || key.equals( "selectionForeground" ) ) { if( key.startsWith( "icon." ) || key.equals( "selectionForeground" ) ) {
if( iconsShared ) { if( iconsShared ) {
if( checkIcon instanceof FlatCheckBoxMenuItemIcon ) if( checkIcon instanceof FlatCheckBoxMenuItemIcon )
checkIcon = FlatStyleSupport.cloneIcon( checkIcon ); checkIcon = FlatStylingSupport.cloneIcon( checkIcon );
if( arrowIcon instanceof FlatMenuArrowIcon ) if( arrowIcon instanceof FlatMenuArrowIcon )
arrowIcon = FlatStyleSupport.cloneIcon( arrowIcon ); arrowIcon = FlatStylingSupport.cloneIcon( arrowIcon );
iconsShared = false; iconsShared = false;
} }
@@ -147,18 +147,18 @@ public class FlatMenuItemRenderer
} }
} }
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
Map<String, Class<?>> infos = FlatStyleSupport.getAnnotatedStyleableInfos( this ); Map<String, Class<?>> infos = FlatStylingSupport.getAnnotatedStyleableInfos( this );
if( checkIcon instanceof FlatCheckBoxMenuItemIcon ) if( checkIcon instanceof FlatCheckBoxMenuItemIcon )
FlatStyleSupport.putAllPrefixKey( infos, "icon.", ((FlatCheckBoxMenuItemIcon)checkIcon).getStyleableInfos() ); FlatStylingSupport.putAllPrefixKey( infos, "icon.", ((FlatCheckBoxMenuItemIcon)checkIcon).getStyleableInfos() );
if( arrowIcon instanceof FlatMenuArrowIcon ) if( arrowIcon instanceof FlatMenuArrowIcon )
FlatStyleSupport.putAllPrefixKey( infos, "icon.", ((FlatMenuArrowIcon)arrowIcon).getStyleableInfos() ); FlatStylingSupport.putAllPrefixKey( infos, "icon.", ((FlatMenuArrowIcon)arrowIcon).getStyleableInfos() );
infos.remove( "icon.selectionForeground" ); infos.remove( "icon.selectionForeground" );
return infos; return infos;
} }

View File

@@ -27,8 +27,8 @@ import javax.swing.JComponent;
import javax.swing.LookAndFeel; import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicMenuItemUI; import javax.swing.plaf.basic.BasicMenuItemUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JMenuItem}. * Provides the Flat LaF UI delegate for {@link javax.swing.JMenuItem}.
@@ -73,7 +73,7 @@ public class FlatMenuItemUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( menuItem ) ); applyStyle( FlatStylingSupport.getStyle( menuItem ) );
} }
@Override @Override
@@ -99,14 +99,14 @@ public class FlatMenuItemUI
@Override @Override
protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { protected PropertyChangeListener createPropertyChangeListener( JComponent c ) {
return FlatStyleSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) ); return FlatStylingSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
@@ -130,7 +130,7 @@ public class FlatMenuItemUI
case "disabledForeground": case "disabledForeground":
case "acceleratorForeground": case "acceleratorForeground":
case "acceleratorSelectionForeground": case "acceleratorSelectionForeground":
return FlatStyleSupport.applyToField( ui, key, key, value ); return FlatStylingSupport.applyToField( ui, key, key, value );
default: throw new UnknownStyleException( key ); default: throw new UnknownStyleException( key );
} }

View File

@@ -33,8 +33,8 @@ import javax.swing.UIManager;
import javax.swing.event.MouseInputListener; import javax.swing.event.MouseInputListener;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicMenuUI; import javax.swing.plaf.basic.BasicMenuUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JMenu}. * Provides the Flat LaF UI delegate for {@link javax.swing.JMenu}.
@@ -90,7 +90,7 @@ public class FlatMenuUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( menuItem ) ); applyStyle( FlatStylingSupport.getStyle( menuItem ) );
} }
@Override @Override
@@ -145,14 +145,14 @@ public class FlatMenuUI
@Override @Override
protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { protected PropertyChangeListener createPropertyChangeListener( JComponent c ) {
return FlatStyleSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) ); return FlatStylingSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**

View File

@@ -39,7 +39,7 @@ import javax.swing.text.JTextComponent;
import javax.swing.text.PasswordView; import javax.swing.text.PasswordView;
import javax.swing.text.View; import javax.swing.text.View;
import com.formdev.flatlaf.icons.FlatCapsLockIcon; import com.formdev.flatlaf.icons.FlatCapsLockIcon;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JPasswordField}. * Provides the Flat LaF UI delegate for {@link javax.swing.JPasswordField}.
@@ -168,7 +168,7 @@ public class FlatPasswordFieldUI
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
if( key.equals( "capsLockIconColor" ) && capsLockIcon instanceof FlatCapsLockIcon ) { if( key.equals( "capsLockIconColor" ) && capsLockIcon instanceof FlatCapsLockIcon ) {
if( capsLockIconShared ) { if( capsLockIconShared ) {
capsLockIcon = FlatStyleSupport.cloneIcon( capsLockIcon ); capsLockIcon = FlatStylingSupport.cloneIcon( capsLockIcon );
capsLockIconShared = false; capsLockIconShared = false;
} }
return ((FlatCapsLockIcon)capsLockIcon).applyStyleProperty( key, value ); return ((FlatCapsLockIcon)capsLockIcon).applyStyleProperty( key, value );

View File

@@ -24,8 +24,8 @@ import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableBorder; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableBorder;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**

View File

@@ -23,7 +23,7 @@ import javax.swing.JComponent;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicPopupMenuUI; import javax.swing.plaf.basic.BasicPopupMenuUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JPopupMenu}. * Provides the Flat LaF UI delegate for {@link javax.swing.JPopupMenu}.
@@ -53,7 +53,7 @@ public class FlatPopupMenuUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -68,7 +68,7 @@ public class FlatPopupMenuUI
protected void installListeners() { protected void installListeners() {
super.installListeners(); super.installListeners();
propertyChangeListener = FlatStyleSupport.createPropertyChangeListener( popupMenu, this::applyStyle, null ); propertyChangeListener = FlatStylingSupport.createPropertyChangeListener( popupMenu, this::applyStyle, null );
popupMenu.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener ); popupMenu.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener );
} }
@@ -84,7 +84,7 @@ public class FlatPopupMenuUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
@@ -93,7 +93,7 @@ public class FlatPopupMenuUI
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, popupMenu, borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, popupMenu, borderShared );
} }
/** /**
@@ -101,6 +101,6 @@ public class FlatPopupMenuUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this, popupMenu.getBorder() ); return FlatStylingSupport.getAnnotatedStyleableInfos( this, popupMenu.getBorder() );
} }
} }

View File

@@ -32,8 +32,8 @@ import javax.swing.LookAndFeel;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicProgressBarUI; import javax.swing.plaf.basic.BasicProgressBarUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -78,7 +78,7 @@ public class FlatProgressBarUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( progressBar ) ); applyStyle( FlatStylingSupport.getStyle( progressBar ) );
} }
@Override @Override
@@ -133,14 +133,14 @@ public class FlatProgressBarUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -148,7 +148,7 @@ public class FlatProgressBarUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -25,8 +25,8 @@ import javax.swing.JComponent;
import javax.swing.LookAndFeel; import javax.swing.LookAndFeel;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicRadioButtonMenuItemUI; import javax.swing.plaf.basic.BasicRadioButtonMenuItemUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JRadioButtonMenuItem}. * Provides the Flat LaF UI delegate for {@link javax.swing.JRadioButtonMenuItem}.
@@ -71,7 +71,7 @@ public class FlatRadioButtonMenuItemUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( menuItem ) ); applyStyle( FlatStylingSupport.getStyle( menuItem ) );
} }
@Override @Override
@@ -97,14 +97,14 @@ public class FlatRadioButtonMenuItemUI
@Override @Override
protected PropertyChangeListener createPropertyChangeListener( JComponent c ) { protected PropertyChangeListener createPropertyChangeListener( JComponent c ) {
return FlatStyleSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) ); return FlatStylingSupport.createPropertyChangeListener( c, this::applyStyle, super.createPropertyChangeListener( c ) );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**

View File

@@ -36,9 +36,9 @@ import javax.swing.plaf.basic.BasicButtonListener;
import javax.swing.plaf.basic.BasicRadioButtonUI; import javax.swing.plaf.basic.BasicRadioButtonUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.icons.FlatCheckBoxIcon; import com.formdev.flatlaf.icons.FlatCheckBoxIcon;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -92,7 +92,7 @@ public class FlatRadioButtonUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -159,7 +159,7 @@ public class FlatRadioButtonUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
@@ -172,7 +172,7 @@ public class FlatRadioButtonUI
return new UnknownStyleException( key ); return new UnknownStyleException( key );
if( iconShared ) { if( iconShared ) {
icon = FlatStyleSupport.cloneIcon( icon ); icon = FlatStylingSupport.cloneIcon( icon );
iconShared = false; iconShared = false;
} }
@@ -180,7 +180,7 @@ public class FlatRadioButtonUI
return ((FlatCheckBoxIcon)icon).applyStyleProperty( key, value ); return ((FlatCheckBoxIcon)icon).applyStyleProperty( key, value );
} }
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -188,7 +188,7 @@ public class FlatRadioButtonUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
Map<String, Class<?>> infos = FlatStyleSupport.getAnnotatedStyleableInfos( this ); Map<String, Class<?>> infos = FlatStylingSupport.getAnnotatedStyleableInfos( this );
if( icon instanceof FlatCheckBoxIcon ) { if( icon instanceof FlatCheckBoxIcon ) {
for( Map.Entry<String, Class<?>> e : ((FlatCheckBoxIcon)icon).getStyleableInfos().entrySet() ) for( Map.Entry<String, Class<?>> e : ((FlatCheckBoxIcon)icon).getStyleableInfos().entrySet() )
infos.put( "icon.".concat( e.getKey() ), e.getValue() ); infos.put( "icon.".concat( e.getKey() ), e.getValue() );

View File

@@ -18,7 +18,7 @@ package com.formdev.flatlaf.ui;
import java.awt.Component; import java.awt.Component;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
/** /**
* Border for various components (e.g. {@link javax.swing.JComboBox}). * Border for various components (e.g. {@link javax.swing.JComboBox}).

View File

@@ -37,8 +37,8 @@ import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicScrollBarUI; import javax.swing.plaf.basic.BasicScrollBarUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -115,7 +115,7 @@ public class FlatScrollBarUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -224,7 +224,7 @@ public class FlatScrollBarUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
if( incrButton instanceof FlatScrollBarButton ) if( incrButton instanceof FlatScrollBarButton )
((FlatScrollBarButton)incrButton).updateStyle(); ((FlatScrollBarButton)incrButton).updateStyle();
@@ -246,7 +246,7 @@ public class FlatScrollBarUI
case "maximumThumbSize": oldValue = maximumThumbSize; maximumThumbSize = (Dimension) value; return oldValue; case "maximumThumbSize": oldValue = maximumThumbSize; maximumThumbSize = (Dimension) value; return oldValue;
} }
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -260,7 +260,7 @@ public class FlatScrollBarUI
infos.put( "width", int.class ); infos.put( "width", int.class );
infos.put( "minimumThumbSize", Dimension.class ); infos.put( "minimumThumbSize", Dimension.class );
infos.put( "maximumThumbSize", Dimension.class ); infos.put( "maximumThumbSize", Dimension.class );
FlatStyleSupport.collectAnnotatedStyleableInfos( this, infos ); FlatStylingSupport.collectAnnotatedStyleableInfos( this, infos );
return infos; return infos;
} }

View File

@@ -48,7 +48,7 @@ import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicScrollPaneUI; import javax.swing.plaf.basic.BasicScrollPaneUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JScrollPane}. * Provides the Flat LaF UI delegate for {@link javax.swing.JScrollPane}.
@@ -87,7 +87,7 @@ public class FlatScrollPaneUI
int focusWidth = UIManager.getInt( "Component.focusWidth" ); int focusWidth = UIManager.getInt( "Component.focusWidth" );
LookAndFeel.installProperty( c, "opaque", focusWidth == 0 ); LookAndFeel.installProperty( c, "opaque", focusWidth == 0 );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
MigLayoutVisualPadding.install( scrollpane ); MigLayoutVisualPadding.install( scrollpane );
} }
@@ -305,7 +305,7 @@ public class FlatScrollPaneUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
@@ -319,7 +319,7 @@ public class FlatScrollPaneUI
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, scrollpane, borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, scrollpane, borderShared );
} }
/** /**
@@ -327,7 +327,7 @@ public class FlatScrollPaneUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this, scrollpane.getBorder() ); return FlatStylingSupport.getAnnotatedStyleableInfos( this, scrollpane.getBorder() );
} }
@Override @Override

View File

@@ -29,8 +29,8 @@ import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSeparatorUI; import javax.swing.plaf.basic.BasicSeparatorUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JSeparator}. * Provides the Flat LaF UI delegate for {@link javax.swing.JSeparator}.
@@ -82,7 +82,7 @@ public class FlatSeparatorUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -111,7 +111,7 @@ public class FlatSeparatorUI
protected void installListeners( JSeparator s ) { protected void installListeners( JSeparator s ) {
super.installListeners( s ); super.installListeners( s );
propertyChangeListener = FlatStyleSupport.createPropertyChangeListener( propertyChangeListener = FlatStylingSupport.createPropertyChangeListener(
s, style -> applyStyle( s, this, style ), null ); s, style -> applyStyle( s, this, style ), null );
s.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener ); s.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener );
} }
@@ -140,14 +140,14 @@ public class FlatSeparatorUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -155,7 +155,7 @@ public class FlatSeparatorUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -36,8 +36,8 @@ import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSliderUI; import javax.swing.plaf.basic.BasicSliderUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.Graphics2DProxy; import com.formdev.flatlaf.util.Graphics2DProxy;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -119,7 +119,7 @@ public class FlatSliderUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( slider ) ); applyStyle( FlatStylingSupport.getStyle( slider ) );
} }
@Override @Override
@@ -186,7 +186,7 @@ public class FlatSliderUI
@Override @Override
protected PropertyChangeListener createPropertyChangeListener( JSlider slider ) { protected PropertyChangeListener createPropertyChangeListener( JSlider slider ) {
return FlatStyleSupport.createPropertyChangeListener( slider, this::applyStyle, return FlatStylingSupport.createPropertyChangeListener( slider, this::applyStyle,
super.createPropertyChangeListener( slider ) ); super.createPropertyChangeListener( slider ) );
} }
@@ -194,14 +194,14 @@ public class FlatSliderUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -209,7 +209,7 @@ public class FlatSliderUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -45,8 +45,8 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource; import javax.swing.plaf.UIResource;
import javax.swing.plaf.basic.BasicSpinnerUI; import javax.swing.plaf.basic.BasicSpinnerUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JSpinner}. * Provides the Flat LaF UI delegate for {@link javax.swing.JSpinner}.
@@ -114,7 +114,7 @@ public class FlatSpinnerUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( spinner ) ); applyStyle( FlatStylingSupport.getStyle( spinner ) );
} }
@Override @Override
@@ -194,7 +194,7 @@ public class FlatSpinnerUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
updateEditorPadding(); updateEditorPadding();
updateArrowButtonsStyle(); updateArrowButtonsStyle();
} }
@@ -205,7 +205,7 @@ public class FlatSpinnerUI
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, spinner, borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, spinner, borderShared );
} }
/** /**
@@ -213,7 +213,7 @@ public class FlatSpinnerUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this, spinner.getBorder() ); return FlatStylingSupport.getAnnotatedStyleableInfos( this, spinner.getBorder() );
} }
@Override @Override

View File

@@ -35,9 +35,9 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicSplitPaneDivider; import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI; import javax.swing.plaf.basic.BasicSplitPaneUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -90,7 +90,7 @@ public class FlatSplitPaneUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( splitPane ) ); applyStyle( FlatStylingSupport.getStyle( splitPane ) );
} }
@Override @Override
@@ -121,7 +121,7 @@ public class FlatSplitPaneUI
protected void installListeners() { protected void installListeners() {
super.installListeners(); super.installListeners();
propertyChangeListener = FlatStyleSupport.createPropertyChangeListener( splitPane, this::applyStyle, null ); propertyChangeListener = FlatStylingSupport.createPropertyChangeListener( splitPane, this::applyStyle, null );
splitPane.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener ); splitPane.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener );
} }
@@ -142,7 +142,7 @@ public class FlatSplitPaneUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
if( divider instanceof FlatSplitPaneDivider ) if( divider instanceof FlatSplitPaneDivider )
((FlatSplitPaneDivider)divider).updateStyle(); ((FlatSplitPaneDivider)divider).updateStyle();
@@ -158,7 +158,7 @@ public class FlatSplitPaneUI
} catch( UnknownStyleException ex ) { } catch( UnknownStyleException ex ) {
// ignore // ignore
} }
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -166,7 +166,7 @@ public class FlatSplitPaneUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
Map<String, Class<?>> infos = FlatStyleSupport.getAnnotatedStyleableInfos( this ); Map<String, Class<?>> infos = FlatStylingSupport.getAnnotatedStyleableInfos( this );
if( divider instanceof FlatSplitPaneDivider ) if( divider instanceof FlatSplitPaneDivider )
infos.putAll( ((FlatSplitPaneDivider)divider).getStyleableInfos() ); infos.putAll( ((FlatSplitPaneDivider)divider).getStyleableInfos() );
return infos; return infos;
@@ -193,14 +193,14 @@ public class FlatSplitPaneUI
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
* @since TODO * @since TODO
*/ */
public Map<String, Class<?>> getStyleableInfos() { public Map<String, Class<?>> getStyleableInfos() {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
void updateStyle() { void updateStyle() {

View File

@@ -45,7 +45,7 @@ import com.formdev.flatlaf.util.SystemInfo;
* @author Karl Tauber * @author Karl Tauber
* @since TODO * @since TODO
*/ */
public class FlatStyleSupport public class FlatStylingSupport
{ {
/** /**
* Indicates that a field is intended to be used by FlatLaf styling support. * Indicates that a field is intended to be used by FlatLaf styling support.

View File

@@ -87,9 +87,9 @@ import javax.swing.text.JTextComponent;
import javax.swing.text.View; import javax.swing.text.View;
import com.formdev.flatlaf.FlatLaf; import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon; import com.formdev.flatlaf.icons.FlatTabbedPaneCloseIcon;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.Animator; import com.formdev.flatlaf.util.Animator;
import com.formdev.flatlaf.util.CubicBezierEasing; import com.formdev.flatlaf.util.CubicBezierEasing;
import com.formdev.flatlaf.util.JavaCompatibility; import com.formdev.flatlaf.util.JavaCompatibility;
@@ -269,7 +269,7 @@ public class FlatTabbedPaneUI
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -576,7 +576,7 @@ public class FlatTabbedPaneUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
// update buttons // update buttons
for( Component c : tabPane.getComponents() ) { for( Component c : tabPane.getComponents() ) {
@@ -595,7 +595,7 @@ public class FlatTabbedPaneUI
return new UnknownStyleException( key ); return new UnknownStyleException( key );
if( closeIconShared ) { if( closeIconShared ) {
closeIcon = FlatStyleSupport.cloneIcon( closeIcon ); closeIcon = FlatStylingSupport.cloneIcon( closeIcon );
closeIconShared = false; closeIconShared = false;
} }
@@ -626,7 +626,7 @@ public class FlatTabbedPaneUI
} }
} }
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -638,7 +638,7 @@ public class FlatTabbedPaneUI
infos.put( "tabInsets", Insets.class ); infos.put( "tabInsets", Insets.class );
infos.put( "tabAreaInsets", Insets.class ); infos.put( "tabAreaInsets", Insets.class );
infos.put( "textIconGap", int.class ); infos.put( "textIconGap", int.class );
FlatStyleSupport.collectAnnotatedStyleableInfos( this, infos ); FlatStylingSupport.collectAnnotatedStyleableInfos( this, infos );
if( closeIcon instanceof FlatTabbedPaneCloseIcon ) if( closeIcon instanceof FlatTabbedPaneCloseIcon )
infos.putAll( ((FlatTabbedPaneCloseIcon)closeIcon).getStyleableInfos() ); infos.putAll( ((FlatTabbedPaneCloseIcon)closeIcon).getStyleableInfos() );
return infos; return infos;

View File

@@ -38,8 +38,8 @@ import javax.swing.plaf.basic.BasicTableHeaderUI;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import javax.swing.table.TableColumnModel; import javax.swing.table.TableColumnModel;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -98,7 +98,7 @@ public class FlatTableHeaderUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -123,7 +123,7 @@ public class FlatTableHeaderUI
protected void installListeners() { protected void installListeners() {
super.installListeners(); super.installListeners();
propertyChangeListener = FlatStyleSupport.createPropertyChangeListener( header, this::applyStyle, null ); propertyChangeListener = FlatStylingSupport.createPropertyChangeListener( header, this::applyStyle, null );
header.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener ); header.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener );
} }
@@ -139,7 +139,7 @@ public class FlatTableHeaderUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
@@ -149,7 +149,7 @@ public class FlatTableHeaderUI
if( key.equals( "sortIconPosition" ) && value instanceof String ) if( key.equals( "sortIconPosition" ) && value instanceof String )
value = parseSortIconPosition( (String) value ); value = parseSortIconPosition( (String) value );
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -157,7 +157,7 @@ public class FlatTableHeaderUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
private static int parseSortIconPosition( String str ) { private static int parseSortIconPosition( String str ) {

View File

@@ -38,8 +38,8 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTableUI; import javax.swing.plaf.basic.BasicTableUI;
import javax.swing.table.JTableHeader; import javax.swing.table.JTableHeader;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.Graphics2DProxy; import com.formdev.flatlaf.util.Graphics2DProxy;
import com.formdev.flatlaf.util.SystemInfo; import com.formdev.flatlaf.util.SystemInfo;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -124,7 +124,7 @@ public class FlatTableUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -187,7 +187,7 @@ public class FlatTableUI
protected void installListeners() { protected void installListeners() {
super.installListeners(); super.installListeners();
propertyChangeListener = FlatStyleSupport.createPropertyChangeListener( table, this::applyStyle, null ); propertyChangeListener = FlatStylingSupport.createPropertyChangeListener( table, this::applyStyle, null );
table.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener ); table.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener );
} }
@@ -229,7 +229,7 @@ public class FlatTableUI
Color oldSelectionInactiveBackground = selectionInactiveBackground; Color oldSelectionInactiveBackground = selectionInactiveBackground;
Color oldSelectionInactiveForeground = selectionInactiveForeground; Color oldSelectionInactiveForeground = selectionInactiveForeground;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
// update selection background // update selection background
if( selectionBackground != oldSelectionBackground ) { if( selectionBackground != oldSelectionBackground ) {
@@ -254,7 +254,7 @@ public class FlatTableUI
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -262,7 +262,7 @@ public class FlatTableUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
/** /**

View File

@@ -29,8 +29,8 @@ import javax.swing.JTextArea;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTextAreaUI; import javax.swing.plaf.basic.BasicTextAreaUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
/** /**
@@ -86,7 +86,7 @@ public class FlatTextAreaUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -153,7 +153,7 @@ public class FlatTextAreaUI
oldDisabledBackground = disabledBackground; oldDisabledBackground = disabledBackground;
oldInactiveBackground = inactiveBackground; oldInactiveBackground = inactiveBackground;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
updateBackground(); updateBackground();
} }
@@ -162,7 +162,7 @@ public class FlatTextAreaUI
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -170,7 +170,7 @@ public class FlatTextAreaUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
private void updateBackground() { private void updateBackground() {

View File

@@ -18,7 +18,7 @@ package com.formdev.flatlaf.ui;
import java.awt.Component; import java.awt.Component;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
/** /**
* Border for various text components (e.g. {@link javax.swing.JTextField}). * Border for various text components (e.g. {@link javax.swing.JTextField}).

View File

@@ -43,8 +43,8 @@ import javax.swing.plaf.basic.BasicTextFieldUI;
import javax.swing.text.Caret; import javax.swing.text.Caret;
import javax.swing.text.JTextComponent; import javax.swing.text.JTextComponent;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
import com.formdev.flatlaf.util.JavaCompatibility; import com.formdev.flatlaf.util.JavaCompatibility;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -107,7 +107,7 @@ public class FlatTextFieldUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -209,7 +209,7 @@ public class FlatTextFieldUI
oldDisabledBackground = disabledBackground; oldDisabledBackground = disabledBackground;
oldInactiveBackground = inactiveBackground; oldInactiveBackground = inactiveBackground;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
updateBackground(); updateBackground();
} }
@@ -220,7 +220,7 @@ public class FlatTextFieldUI
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
if( borderShared == null ) if( borderShared == null )
borderShared = new AtomicBoolean( true ); borderShared = new AtomicBoolean( true );
return FlatStyleSupport.applyToAnnotatedObjectOrBorder( this, key, value, getComponent(), borderShared ); return FlatStylingSupport.applyToAnnotatedObjectOrBorder( this, key, value, getComponent(), borderShared );
} }
/** /**
@@ -228,7 +228,7 @@ public class FlatTextFieldUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this, getComponent().getBorder() ); return FlatStylingSupport.getAnnotatedStyleableInfos( this, getComponent().getBorder() );
} }
private void updateBackground() { private void updateBackground() {

View File

@@ -29,8 +29,8 @@ import javax.swing.JEditorPane;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTextPaneUI; import javax.swing.plaf.basic.BasicTextPaneUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.HiDPIUtils; import com.formdev.flatlaf.util.HiDPIUtils;
/** /**
@@ -87,7 +87,7 @@ public class FlatTextPaneUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -161,7 +161,7 @@ public class FlatTextPaneUI
oldDisabledBackground = disabledBackground; oldDisabledBackground = disabledBackground;
oldInactiveBackground = inactiveBackground; oldInactiveBackground = inactiveBackground;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
updateBackground(); updateBackground();
} }
@@ -170,7 +170,7 @@ public class FlatTextPaneUI
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -178,7 +178,7 @@ public class FlatTextPaneUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
private void updateBackground() { private void updateBackground() {

View File

@@ -28,8 +28,8 @@ import javax.swing.JComponent;
import javax.swing.JToggleButton; import javax.swing.JToggleButton;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.UnknownStyleException; import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**

View File

@@ -32,8 +32,8 @@ import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolBarSeparatorUI; import javax.swing.plaf.basic.BasicToolBarSeparatorUI;
import com.formdev.flatlaf.FlatClientProperties; import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JToolBar.Separator}. * Provides the Flat LaF UI delegate for {@link javax.swing.JToolBar.Separator}.
@@ -76,7 +76,7 @@ public class FlatToolBarSeparatorUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -107,7 +107,7 @@ public class FlatToolBarSeparatorUI
protected void installListeners( JSeparator s ) { protected void installListeners( JSeparator s ) {
super.installListeners( s ); super.installListeners( s );
propertyChangeListener = FlatStyleSupport.createPropertyChangeListener( propertyChangeListener = FlatStylingSupport.createPropertyChangeListener(
s, style -> applyStyle( s, this, style ), null ); s, style -> applyStyle( s, this, style ), null );
s.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener ); s.addPropertyChangeListener( FlatClientProperties.STYLE, propertyChangeListener );
} }
@@ -136,14 +136,14 @@ public class FlatToolBarSeparatorUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -151,7 +151,7 @@ public class FlatToolBarSeparatorUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
@Override @Override

View File

@@ -29,8 +29,8 @@ import javax.swing.UIManager;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToolBarUI; import javax.swing.plaf.basic.BasicToolBarUI;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
/** /**
* Provides the Flat LaF UI delegate for {@link javax.swing.JToolBar}. * Provides the Flat LaF UI delegate for {@link javax.swing.JToolBar}.
@@ -83,7 +83,7 @@ public class FlatToolBarUI
if( !focusableButtons ) if( !focusableButtons )
setButtonsFocusable( false ); setButtonsFocusable( false );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -133,7 +133,7 @@ public class FlatToolBarUI
@Override @Override
protected PropertyChangeListener createPropertyListener() { protected PropertyChangeListener createPropertyListener() {
return FlatStyleSupport.createPropertyChangeListener( toolBar, this::applyStyle, super.createPropertyListener() ); return FlatStylingSupport.createPropertyChangeListener( toolBar, this::applyStyle, super.createPropertyListener() );
} }
/** /**
@@ -142,7 +142,7 @@ public class FlatToolBarUI
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
boolean oldFocusableButtons = focusableButtons; boolean oldFocusableButtons = focusableButtons;
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
if( focusableButtons != oldFocusableButtons ) if( focusableButtons != oldFocusableButtons )
setButtonsFocusable( focusableButtons ); setButtonsFocusable( focusableButtons );
@@ -152,7 +152,7 @@ public class FlatToolBarUI
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -160,7 +160,7 @@ public class FlatToolBarUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
/** /**

View File

@@ -40,8 +40,8 @@ import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicTreeUI; import javax.swing.plaf.basic.BasicTreeUI;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import com.formdev.flatlaf.ui.FlatStyleSupport.Styleable; import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
import com.formdev.flatlaf.ui.FlatStyleSupport.StyleableUI; import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableUI;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
/** /**
@@ -156,7 +156,7 @@ public class FlatTreeUI
public void installUI( JComponent c ) { public void installUI( JComponent c ) {
super.installUI( c ); super.installUI( c );
applyStyle( FlatStyleSupport.getStyle( c ) ); applyStyle( FlatStylingSupport.getStyle( c ) );
} }
@Override @Override
@@ -313,14 +313,14 @@ public class FlatTreeUI
* @since TODO * @since TODO
*/ */
protected void applyStyle( Object style ) { protected void applyStyle( Object style ) {
oldStyleValues = FlatStyleSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty ); oldStyleValues = FlatStylingSupport.parseAndApply( oldStyleValues, style, this::applyStyleProperty );
} }
/** /**
* @since TODO * @since TODO
*/ */
protected Object applyStyleProperty( String key, Object value ) { protected Object applyStyleProperty( String key, Object value ) {
return FlatStyleSupport.applyToAnnotatedObject( this, key, value ); return FlatStylingSupport.applyToAnnotatedObject( this, key, value );
} }
/** /**
@@ -328,7 +328,7 @@ public class FlatTreeUI
*/ */
@Override @Override
public Map<String, Class<?>> getStyleableInfos( JComponent c ) { public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
return FlatStyleSupport.getAnnotatedStyleableInfos( this ); return FlatStylingSupport.getAnnotatedStyleableInfos( this );
} }
/** /**

View File

@@ -868,7 +868,7 @@ debug*/
* with other components. This is only possible if it does not have styles. * with other components. This is only possible if it does not have styles.
*/ */
public static boolean canUseSharedUI( JComponent c ) { public static boolean canUseSharedUI( JComponent c ) {
return FlatStyleSupport.getStyle( c ) == null; return FlatStylingSupport.getStyle( c ) == null;
} }
//---- class RepaintFocusListener ----------------------------------------- //---- class RepaintFocusListener -----------------------------------------

View File

@@ -47,21 +47,21 @@ public class TestFlatStyling
@Test @Test
void parse() { void parse() {
assertEquals( null, FlatStyleSupport.parse( null ) ); assertEquals( null, FlatStylingSupport.parse( null ) );
assertEquals( null, FlatStyleSupport.parse( "" ) ); assertEquals( null, FlatStylingSupport.parse( "" ) );
assertEquals( null, FlatStyleSupport.parse( " " ) ); assertEquals( null, FlatStylingSupport.parse( " " ) );
assertEquals( null, FlatStyleSupport.parse( ";" ) ); assertEquals( null, FlatStylingSupport.parse( ";" ) );
assertEquals( null, FlatStyleSupport.parse( " ; ; " ) ); assertEquals( null, FlatStylingSupport.parse( " ; ; " ) );
assertEquals( assertEquals(
expectedMap( "background", Color.WHITE ), expectedMap( "background", Color.WHITE ),
FlatStyleSupport.parse( "background: #fff" ) ); FlatStylingSupport.parse( "background: #fff" ) );
assertEquals( assertEquals(
expectedMap( "background", Color.WHITE, "foreground", Color.BLACK ), expectedMap( "background", Color.WHITE, "foreground", Color.BLACK ),
FlatStyleSupport.parse( "background: #fff; foreground: #000" ) ); FlatStylingSupport.parse( "background: #fff; foreground: #000" ) );
assertEquals( assertEquals(
expectedMap( "background", Color.WHITE, "foreground", Color.BLACK, "someWidth", 20 ), expectedMap( "background", Color.WHITE, "foreground", Color.BLACK, "someWidth", 20 ),
FlatStyleSupport.parse( "background: #fff; foreground: #000; someWidth: 20" ) ); FlatStylingSupport.parse( "background: #fff; foreground: #000; someWidth: 20" ) );
} }
private Map<Object, Object> expectedMap( Object... keyValuePairs ) { private Map<Object, Object> expectedMap( Object... keyValuePairs ) {