mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Icons: support scaling Laf icons (checkbox, radiobutton, etc) (issue #1061)
This commit is contained in:
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf.icons;
|
package com.formdev.flatlaf.icons;
|
||||||
|
|
||||||
import static com.formdev.flatlaf.util.UIScale.*;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
@@ -29,7 +28,7 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
/**
|
/**
|
||||||
* Base class for icons that scales width and height, creates and initializes
|
* Base class for icons that scales width and height, creates and initializes
|
||||||
* a scaled graphics context for icon painting.
|
* a scaled graphics context for icon painting.
|
||||||
*
|
* <p>
|
||||||
* Subclasses do not need to scale icon painting.
|
* Subclasses do not need to scale icon painting.
|
||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
@@ -37,10 +36,15 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
public abstract class FlatAbstractIcon
|
public abstract class FlatAbstractIcon
|
||||||
implements Icon, UIResource
|
implements Icon, UIResource
|
||||||
{
|
{
|
||||||
|
/** Unscaled icon width. */
|
||||||
protected final int width;
|
protected final int width;
|
||||||
|
/** Unscaled icon height. */
|
||||||
protected final int height;
|
protected final int height;
|
||||||
protected Color color;
|
protected Color color;
|
||||||
|
|
||||||
|
/** Additional icon scale factor. */
|
||||||
|
private float scale = 1;
|
||||||
|
|
||||||
public FlatAbstractIcon( int width, int height, Color color ) {
|
public FlatAbstractIcon( int width, int height, Color color ) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
@@ -61,6 +65,9 @@ public abstract class FlatAbstractIcon
|
|||||||
|
|
||||||
g2.translate( x, y );
|
g2.translate( x, y );
|
||||||
UIScale.scaleGraphics( g2 );
|
UIScale.scaleGraphics( g2 );
|
||||||
|
float scale = getScale();
|
||||||
|
if( scale != 1 )
|
||||||
|
g2.scale( scale, scale );
|
||||||
|
|
||||||
if( color != null )
|
if( color != null )
|
||||||
g2.setColor( color );
|
g2.setColor( color );
|
||||||
@@ -71,19 +78,71 @@ public abstract class FlatAbstractIcon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since 3.5.2 */
|
/**
|
||||||
|
* Paints icon background. Default implementation does nothing.
|
||||||
|
* Can be overridden to paint specific icon background.
|
||||||
|
* <p>
|
||||||
|
* The bounds of the area to be filled are:
|
||||||
|
* x, y, {@link #getIconWidth()}, {@link #getIconHeight()}.
|
||||||
|
* <p>
|
||||||
|
* In contrast to {@link #paintIcon(Component, Graphics2D)},
|
||||||
|
* the graphics context {@code g} is not translated and not scaled.
|
||||||
|
*
|
||||||
|
* @since 3.5.2
|
||||||
|
*/
|
||||||
protected void paintBackground( Component c, Graphics2D g, int x, int y ) {
|
protected void paintBackground( Component c, Graphics2D g, int x, int y ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paints icon.
|
||||||
|
* <p>
|
||||||
|
* The graphics context is translated and scaled.
|
||||||
|
* This means that icon x,y coordinates are {@code 0,0}
|
||||||
|
* and it is not necessary to scale coordinates within this method.
|
||||||
|
* <p>
|
||||||
|
* The bounds to be used for icon painting are:
|
||||||
|
* 0, 0, {@link #width}, {@link #height}.
|
||||||
|
*/
|
||||||
protected abstract void paintIcon( Component c, Graphics2D g );
|
protected abstract void paintIcon( Component c, Graphics2D g );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the scaled icon width.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getIconWidth() {
|
public int getIconWidth() {
|
||||||
return scale( width );
|
return scale( UIScale.scale( width ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the scaled icon height.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getIconHeight() {
|
public int getIconHeight() {
|
||||||
return scale( height );
|
return scale( UIScale.scale( height ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @since 3.7 */
|
||||||
|
public float getScale() {
|
||||||
|
return scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @since 3.7 */
|
||||||
|
public void setScale( float scale ) {
|
||||||
|
this.scale = scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multiplies the given value by the icon scale factor {@link #getScale()} and rounds the result.
|
||||||
|
* <p>
|
||||||
|
* If you want scale a {@code float} or {@code double} value,
|
||||||
|
* simply use: {@code myFloatValue * }{@link #getScale()}.
|
||||||
|
* <p>
|
||||||
|
* Do not use this method when painting icon in {@link #paintIcon(Component, Graphics2D)}.
|
||||||
|
*
|
||||||
|
* @since 3.7
|
||||||
|
*/
|
||||||
|
protected int scale( int size ) {
|
||||||
|
float scale = getScale();
|
||||||
|
return (scale == 1) ? size : Math.round( size * scale );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package com.formdev.flatlaf.icons;
|
package com.formdev.flatlaf.icons;
|
||||||
|
|
||||||
import java.awt.BasicStroke;
|
import java.awt.BasicStroke;
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.RenderingHints;
|
import java.awt.RenderingHints;
|
||||||
@@ -25,11 +24,9 @@ import java.awt.geom.Area;
|
|||||||
import java.awt.geom.Path2D;
|
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 java.util.Collections;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
|
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,6 +36,8 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
|||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="capsLockIconScale", fieldName="scale" )
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="capsLockIconColor", fieldName="color" )
|
||||||
public class FlatCapsLockIcon
|
public class FlatCapsLockIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
@@ -49,31 +48,6 @@ public class FlatCapsLockIcon
|
|||||||
super( 16, 16, UIManager.getColor( "PasswordField.capsLockIconColor" ) );
|
super( 16, 16, UIManager.getColor( "PasswordField.capsLockIconColor" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @since 2 */
|
|
||||||
@Override
|
|
||||||
public Object applyStyleProperty( String key, Object value ) {
|
|
||||||
Object oldValue;
|
|
||||||
switch( key ) {
|
|
||||||
case "capsLockIconColor": oldValue = color; color = (Color) value; return oldValue;
|
|
||||||
default: throw new UnknownStyleException( key );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @since 3.7 */
|
|
||||||
@Override
|
|
||||||
public Map<String, Class<?>> getStyleableInfos() throws IllegalArgumentException {
|
|
||||||
return Collections.singletonMap( "capsLockIconColor", Color.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @since 2.5 */
|
|
||||||
@Override
|
|
||||||
public Object getStyleableValue( String key ) {
|
|
||||||
switch( key ) {
|
|
||||||
case "capsLockIconColor": return color;
|
|
||||||
default: return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void paintIcon( Component c, Graphics2D g ) {
|
protected void paintIcon( Component c, Graphics2D g ) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ 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.FlatStylingSupport.Styleable;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
@@ -100,6 +101,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
|||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||||
public class FlatCheckBoxIcon
|
public class FlatCheckBoxIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
@@ -291,7 +293,7 @@ public class FlatCheckBoxIcon
|
|||||||
|
|
||||||
/** @since 2 */
|
/** @since 2 */
|
||||||
public float getFocusWidth() {
|
public float getFocusWidth() {
|
||||||
return focusWidth;
|
return focusWidth * getScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Color getFocusColor( Component c ) {
|
protected Color getFocusColor( Component c ) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ 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.FlatStylingSupport.Styleable;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,6 +38,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
|||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||||
public class FlatCheckBoxMenuItemIcon
|
public class FlatCheckBoxMenuItemIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ 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.FlatStylingSupport.Styleable;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="clearIconScale", fieldName="scale" )
|
||||||
public class FlatClearIcon
|
public class FlatClearIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf.icons;
|
package com.formdev.flatlaf.icons;
|
||||||
|
|
||||||
import static com.formdev.flatlaf.util.UIScale.*;
|
|
||||||
import java.awt.BasicStroke;
|
import java.awt.BasicStroke;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
@@ -27,7 +26,9 @@ import java.awt.geom.Path2D;
|
|||||||
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.FlatStylingSupport.Styleable;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,6 +52,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
|||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||||
public class FlatHelpButtonIcon
|
public class FlatHelpButtonIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
@@ -152,12 +154,12 @@ public class FlatHelpButtonIcon
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconWidth() {
|
public int getIconWidth() {
|
||||||
return scale( iconSize() );
|
return scale( UIScale.scale( iconSize() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getIconHeight() {
|
public int getIconHeight() {
|
||||||
return scale( iconSize() );
|
return scale( UIScale.scale( iconSize() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private int iconSize() {
|
private int iconSize() {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import javax.swing.JMenu;
|
|||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,6 +39,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
|||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||||
public class FlatMenuArrowIcon
|
public class FlatMenuArrowIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import java.awt.geom.Ellipse2D;
|
|||||||
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.FlatStylingSupport.Styleable;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="searchIconScale", fieldName="scale" )
|
||||||
public class FlatSearchIcon
|
public class FlatSearchIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.awt.geom.Path2D;
|
|||||||
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.FlatStylingSupport.Styleable;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||||
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
|||||||
*
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
|
@StyleableField( cls=FlatAbstractIcon.class, key="closeScale", fieldName="scale" )
|
||||||
public class FlatTabbedPaneCloseIcon
|
public class FlatTabbedPaneCloseIcon
|
||||||
extends FlatAbstractIcon
|
extends FlatAbstractIcon
|
||||||
implements StyleableObject
|
implements StyleableObject
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ public class FlatPasswordFieldUI
|
|||||||
/** @since 2 */
|
/** @since 2 */
|
||||||
@Override
|
@Override
|
||||||
protected Object applyStyleProperty( String key, Object value ) {
|
protected Object applyStyleProperty( String key, Object value ) {
|
||||||
if( key.equals( "capsLockIconColor" ) && capsLockIcon instanceof StyleableObject ) {
|
if( key.startsWith( "capsLockIcon" ) && capsLockIcon instanceof StyleableObject ) {
|
||||||
if( capsLockIconShared ) {
|
if( capsLockIconShared ) {
|
||||||
capsLockIcon = FlatStylingSupport.cloneIcon( capsLockIcon );
|
capsLockIcon = FlatStylingSupport.cloneIcon( capsLockIcon );
|
||||||
capsLockIconShared = false;
|
capsLockIconShared = false;
|
||||||
@@ -236,7 +236,7 @@ public class FlatPasswordFieldUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getStyleableValue( JComponent c, String key ) {
|
public Object getStyleableValue( JComponent c, String key ) {
|
||||||
if( key.equals( "capsLockIconColor" ) && capsLockIcon instanceof StyleableObject )
|
if( key.startsWith( "capsLockIcon" ) && capsLockIcon instanceof StyleableObject )
|
||||||
return ((StyleableObject)capsLockIcon).getStyleableValue( key );
|
return ((StyleableObject)capsLockIcon).getStyleableValue( key );
|
||||||
|
|
||||||
return super.getStyleableValue( c, key );
|
return super.getStyleableValue( c, key );
|
||||||
|
|||||||
@@ -228,10 +228,8 @@ public class FlatRadioButtonUI
|
|||||||
public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
|
public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
|
||||||
Map<String, Class<?>> infos = FlatStylingSupport.getAnnotatedStyleableInfos( this );
|
Map<String, Class<?>> infos = FlatStylingSupport.getAnnotatedStyleableInfos( this );
|
||||||
Icon icon = getRealIcon( c );
|
Icon icon = getRealIcon( c );
|
||||||
if( icon instanceof StyleableObject ) {
|
if( icon instanceof StyleableObject )
|
||||||
for( Map.Entry<String, Class<?>> e : ((StyleableObject)icon).getStyleableInfos().entrySet() )
|
FlatStylingSupport.putAllPrefixKey( infos, "icon.", ((StyleableObject)icon).getStyleableInfos() );
|
||||||
infos.put( "icon.".concat( e.getKey() ), e.getValue() );
|
|
||||||
}
|
|
||||||
return infos;
|
return infos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ public class TestFlatStyleableInfo
|
|||||||
//---- FlatHelpButtonIcon ----
|
//---- FlatHelpButtonIcon ----
|
||||||
|
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
|
"help.scale", float.class,
|
||||||
|
|
||||||
"help.focusWidth", int.class,
|
"help.focusWidth", int.class,
|
||||||
"help.focusColor", Color.class,
|
"help.focusColor", Color.class,
|
||||||
"help.innerFocusWidth", float.class,
|
"help.innerFocusWidth", float.class,
|
||||||
@@ -413,6 +415,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
private void menuItem_checkIcon( Map<String, Class<?>> expected ) {
|
private void menuItem_checkIcon( Map<String, Class<?>> expected ) {
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
|
"icon.scale", float.class,
|
||||||
|
|
||||||
"icon.checkmarkColor", Color.class,
|
"icon.checkmarkColor", Color.class,
|
||||||
"icon.disabledCheckmarkColor", Color.class,
|
"icon.disabledCheckmarkColor", Color.class,
|
||||||
"selectionForeground", Color.class
|
"selectionForeground", Color.class
|
||||||
@@ -421,6 +425,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
private void menuItem_arrowIcon( Map<String, Class<?>> expected ) {
|
private void menuItem_arrowIcon( Map<String, Class<?>> expected ) {
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
|
"icon.scale", float.class,
|
||||||
|
|
||||||
"icon.arrowType", String.class,
|
"icon.arrowType", String.class,
|
||||||
"icon.arrowColor", Color.class,
|
"icon.arrowColor", Color.class,
|
||||||
"icon.disabledArrowColor", Color.class,
|
"icon.disabledArrowColor", Color.class,
|
||||||
@@ -456,7 +462,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
// capsLockIcon
|
// capsLockIcon
|
||||||
"capsLockIconColor", Color.class
|
"capsLockIconColor", Color.class,
|
||||||
|
"capsLockIconScale", float.class
|
||||||
);
|
);
|
||||||
|
|
||||||
// border
|
// border
|
||||||
@@ -553,6 +560,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
//---- icon ----
|
//---- icon ----
|
||||||
|
|
||||||
|
"icon.scale", float.class,
|
||||||
|
|
||||||
"icon.focusWidth", float.class,
|
"icon.focusWidth", float.class,
|
||||||
"icon.focusColor", Color.class,
|
"icon.focusColor", Color.class,
|
||||||
"icon.borderWidth", float.class,
|
"icon.borderWidth", float.class,
|
||||||
@@ -831,6 +840,7 @@ public class TestFlatStyleableInfo
|
|||||||
"tabIconPlacement", int.class,
|
"tabIconPlacement", int.class,
|
||||||
|
|
||||||
// FlatTabbedPaneCloseIcon
|
// FlatTabbedPaneCloseIcon
|
||||||
|
"closeScale", float.class,
|
||||||
"closeSize", Dimension.class,
|
"closeSize", Dimension.class,
|
||||||
"closeArc", int.class,
|
"closeArc", int.class,
|
||||||
"closeCrossPlainSize", float.class,
|
"closeCrossPlainSize", float.class,
|
||||||
@@ -1269,6 +1279,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
private void flatCheckBoxIcon( Map<String, Class<?>> expected ) {
|
private void flatCheckBoxIcon( Map<String, Class<?>> expected ) {
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
|
"scale", float.class,
|
||||||
|
|
||||||
"focusWidth", float.class,
|
"focusWidth", float.class,
|
||||||
"focusColor", Color.class,
|
"focusColor", Color.class,
|
||||||
"borderWidth", float.class,
|
"borderWidth", float.class,
|
||||||
@@ -1353,6 +1365,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
private void flatCheckBoxMenuItemIcon( Map<String, Class<?>> expected ) {
|
private void flatCheckBoxMenuItemIcon( Map<String, Class<?>> expected ) {
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
|
"scale", float.class,
|
||||||
|
|
||||||
"checkmarkColor", Color.class,
|
"checkmarkColor", Color.class,
|
||||||
"disabledCheckmarkColor", Color.class,
|
"disabledCheckmarkColor", Color.class,
|
||||||
"selectionForeground", Color.class
|
"selectionForeground", Color.class
|
||||||
@@ -1371,6 +1385,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
private void flatMenuArrowIcon( Map<String, Class<?>> expected ) {
|
private void flatMenuArrowIcon( Map<String, Class<?>> expected ) {
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
|
"scale", float.class,
|
||||||
|
|
||||||
"arrowType", String.class,
|
"arrowType", String.class,
|
||||||
"arrowColor", Color.class,
|
"arrowColor", Color.class,
|
||||||
"disabledArrowColor", Color.class,
|
"disabledArrowColor", Color.class,
|
||||||
@@ -1383,6 +1399,8 @@ public class TestFlatStyleableInfo
|
|||||||
FlatHelpButtonIcon icon = new FlatHelpButtonIcon();
|
FlatHelpButtonIcon icon = new FlatHelpButtonIcon();
|
||||||
|
|
||||||
Map<String, Class<?>> expected = expectedMap(
|
Map<String, Class<?>> expected = expectedMap(
|
||||||
|
"scale", float.class,
|
||||||
|
|
||||||
"focusWidth", int.class,
|
"focusWidth", int.class,
|
||||||
"focusColor", Color.class,
|
"focusColor", Color.class,
|
||||||
"innerFocusWidth", float.class,
|
"innerFocusWidth", float.class,
|
||||||
@@ -1409,6 +1427,8 @@ public class TestFlatStyleableInfo
|
|||||||
FlatClearIcon icon = new FlatClearIcon();
|
FlatClearIcon icon = new FlatClearIcon();
|
||||||
|
|
||||||
Map<String, Class<?>> expected = expectedMap(
|
Map<String, Class<?>> expected = expectedMap(
|
||||||
|
"clearIconScale", float.class,
|
||||||
|
|
||||||
"clearIconColor", Color.class,
|
"clearIconColor", Color.class,
|
||||||
"clearIconHoverColor", Color.class,
|
"clearIconHoverColor", Color.class,
|
||||||
"clearIconPressedColor", Color.class
|
"clearIconPressedColor", Color.class
|
||||||
@@ -1439,6 +1459,8 @@ public class TestFlatStyleableInfo
|
|||||||
|
|
||||||
private void flatSearchIcon( Map<String, Class<?>> expected ) {
|
private void flatSearchIcon( Map<String, Class<?>> expected ) {
|
||||||
expectedMap( expected,
|
expectedMap( expected,
|
||||||
|
"searchIconScale", float.class,
|
||||||
|
|
||||||
"searchIconColor", Color.class,
|
"searchIconColor", Color.class,
|
||||||
"searchIconHoverColor", Color.class,
|
"searchIconHoverColor", Color.class,
|
||||||
"searchIconPressedColor", Color.class
|
"searchIconPressedColor", Color.class
|
||||||
@@ -1450,6 +1472,8 @@ public class TestFlatStyleableInfo
|
|||||||
FlatCapsLockIcon icon = new FlatCapsLockIcon();
|
FlatCapsLockIcon icon = new FlatCapsLockIcon();
|
||||||
|
|
||||||
Map<String, Class<?>> expected = expectedMap(
|
Map<String, Class<?>> expected = expectedMap(
|
||||||
|
"capsLockIconScale", float.class,
|
||||||
|
|
||||||
"capsLockIconColor", Color.class
|
"capsLockIconColor", Color.class
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1461,6 +1485,10 @@ public class TestFlatStyleableInfo
|
|||||||
FlatTabbedPaneCloseIcon icon = new FlatTabbedPaneCloseIcon();
|
FlatTabbedPaneCloseIcon icon = new FlatTabbedPaneCloseIcon();
|
||||||
|
|
||||||
Map<String, Class<?>> expected = expectedMap(
|
Map<String, Class<?>> expected = expectedMap(
|
||||||
|
//TODO closeScale ?
|
||||||
|
// "scale", float.class,
|
||||||
|
"closeScale", float.class,
|
||||||
|
|
||||||
"closeSize", Dimension.class,
|
"closeSize", Dimension.class,
|
||||||
"closeArc", int.class,
|
"closeArc", int.class,
|
||||||
"closeCrossPlainSize", float.class,
|
"closeCrossPlainSize", float.class,
|
||||||
|
|||||||
@@ -273,6 +273,8 @@ public class TestFlatStyleableValue
|
|||||||
|
|
||||||
//---- FlatHelpButtonIcon ----
|
//---- FlatHelpButtonIcon ----
|
||||||
|
|
||||||
|
testFloat( c, ui, "help.scale" );
|
||||||
|
|
||||||
testInteger( c, ui, "help.focusWidth" );
|
testInteger( c, ui, "help.focusWidth" );
|
||||||
testColor( c, ui, "help.focusColor" );
|
testColor( c, ui, "help.focusColor" );
|
||||||
testFloat( c, ui, "help.innerFocusWidth" );
|
testFloat( c, ui, "help.innerFocusWidth" );
|
||||||
@@ -569,12 +571,16 @@ public class TestFlatStyleableValue
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void menuItem_checkIcon( JComponent c, StyleableUI ui ) {
|
private void menuItem_checkIcon( JComponent c, StyleableUI ui ) {
|
||||||
|
testFloat( c, ui, "icon.scale" );
|
||||||
|
|
||||||
testColor( c, ui, "icon.checkmarkColor" );
|
testColor( c, ui, "icon.checkmarkColor" );
|
||||||
testColor( c, ui, "icon.disabledCheckmarkColor" );
|
testColor( c, ui, "icon.disabledCheckmarkColor" );
|
||||||
testColor( c, ui, "selectionForeground" );
|
testColor( c, ui, "selectionForeground" );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void menuItem_arrowIcon( JComponent c, StyleableUI ui ) {
|
private void menuItem_arrowIcon( JComponent c, StyleableUI ui ) {
|
||||||
|
testFloat( c, ui, "icon.scale" );
|
||||||
|
|
||||||
testString( c, ui, "icon.arrowType", "chevron" );
|
testString( c, ui, "icon.arrowType", "chevron" );
|
||||||
testColor( c, ui, "icon.arrowColor" );
|
testColor( c, ui, "icon.arrowColor" );
|
||||||
testColor( c, ui, "icon.disabledArrowColor" );
|
testColor( c, ui, "icon.disabledArrowColor" );
|
||||||
@@ -603,6 +609,7 @@ public class TestFlatStyleableValue
|
|||||||
testBoolean( c, ui, "showRevealButton" );
|
testBoolean( c, ui, "showRevealButton" );
|
||||||
|
|
||||||
// capsLockIcon
|
// capsLockIcon
|
||||||
|
testFloat( c, ui, "capsLockIconScale" );
|
||||||
testColor( c, ui, "capsLockIconColor" );
|
testColor( c, ui, "capsLockIconColor" );
|
||||||
|
|
||||||
// border
|
// border
|
||||||
@@ -694,6 +701,8 @@ public class TestFlatStyleableValue
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testFloat( b, ui, "icon.scale" );
|
||||||
|
|
||||||
testFloat( b, ui, "icon.focusWidth" );
|
testFloat( b, ui, "icon.focusWidth" );
|
||||||
testColor( b, ui, "icon.focusColor" );
|
testColor( b, ui, "icon.focusColor" );
|
||||||
testFloat( b, ui, "icon.borderWidth" );
|
testFloat( b, ui, "icon.borderWidth" );
|
||||||
@@ -952,6 +961,7 @@ public class TestFlatStyleableValue
|
|||||||
testString( c, ui, "tabIconPlacement", "top" );
|
testString( c, ui, "tabIconPlacement", "top" );
|
||||||
|
|
||||||
// FlatTabbedPaneCloseIcon
|
// FlatTabbedPaneCloseIcon
|
||||||
|
testFloat( c, ui, "closeScale" );
|
||||||
testDimension( c, ui, "closeSize" );
|
testDimension( c, ui, "closeSize" );
|
||||||
testInteger( c, ui, "closeArc" );
|
testInteger( c, ui, "closeArc" );
|
||||||
testFloat( c, ui, "closeCrossPlainSize" );
|
testFloat( c, ui, "closeCrossPlainSize" );
|
||||||
@@ -1383,6 +1393,8 @@ public class TestFlatStyleableValue
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void flatCheckBoxIcon( FlatCheckBoxIcon icon ) {
|
private void flatCheckBoxIcon( FlatCheckBoxIcon icon ) {
|
||||||
|
testValueFloat( icon, "scale" );
|
||||||
|
|
||||||
testValueFloat( icon, "focusWidth" );
|
testValueFloat( icon, "focusWidth" );
|
||||||
testValueColor( icon, "focusColor" );
|
testValueColor( icon, "focusColor" );
|
||||||
testValueFloat( icon, "borderWidth" );
|
testValueFloat( icon, "borderWidth" );
|
||||||
@@ -1461,6 +1473,8 @@ public class TestFlatStyleableValue
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void flatCheckBoxMenuItemIcon( FlatCheckBoxMenuItemIcon icon ) {
|
private void flatCheckBoxMenuItemIcon( FlatCheckBoxMenuItemIcon icon ) {
|
||||||
|
testValueFloat( icon, "scale" );
|
||||||
|
|
||||||
testValueColor( icon, "checkmarkColor" );
|
testValueColor( icon, "checkmarkColor" );
|
||||||
testValueColor( icon, "disabledCheckmarkColor" );
|
testValueColor( icon, "disabledCheckmarkColor" );
|
||||||
testValueColor( icon, "selectionForeground" );
|
testValueColor( icon, "selectionForeground" );
|
||||||
@@ -1471,6 +1485,8 @@ public class TestFlatStyleableValue
|
|||||||
FlatMenuArrowIcon icon = new FlatMenuArrowIcon();
|
FlatMenuArrowIcon icon = new FlatMenuArrowIcon();
|
||||||
expectedStyleableInfos = icon.getStyleableInfos();
|
expectedStyleableInfos = icon.getStyleableInfos();
|
||||||
|
|
||||||
|
testValueFloat( icon, "scale" );
|
||||||
|
|
||||||
testValueString( icon, "arrowType", "chevron" );
|
testValueString( icon, "arrowType", "chevron" );
|
||||||
testValueColor( icon, "arrowColor" );
|
testValueColor( icon, "arrowColor" );
|
||||||
testValueColor( icon, "disabledArrowColor" );
|
testValueColor( icon, "disabledArrowColor" );
|
||||||
@@ -1482,6 +1498,8 @@ public class TestFlatStyleableValue
|
|||||||
FlatHelpButtonIcon icon = new FlatHelpButtonIcon();
|
FlatHelpButtonIcon icon = new FlatHelpButtonIcon();
|
||||||
expectedStyleableInfos = icon.getStyleableInfos();
|
expectedStyleableInfos = icon.getStyleableInfos();
|
||||||
|
|
||||||
|
testValueFloat( icon, "scale" );
|
||||||
|
|
||||||
testValueInteger( icon, "focusWidth" );
|
testValueInteger( icon, "focusWidth" );
|
||||||
testValueColor( icon, "focusColor" );
|
testValueColor( icon, "focusColor" );
|
||||||
testValueFloat( icon, "innerFocusWidth" );
|
testValueFloat( icon, "innerFocusWidth" );
|
||||||
@@ -1505,6 +1523,8 @@ public class TestFlatStyleableValue
|
|||||||
FlatClearIcon icon = new FlatClearIcon();
|
FlatClearIcon icon = new FlatClearIcon();
|
||||||
expectedStyleableInfos = icon.getStyleableInfos();
|
expectedStyleableInfos = icon.getStyleableInfos();
|
||||||
|
|
||||||
|
testValueFloat( icon, "clearIconScale" );
|
||||||
|
|
||||||
testValueColor( icon, "clearIconColor" );
|
testValueColor( icon, "clearIconColor" );
|
||||||
testValueColor( icon, "clearIconHoverColor" );
|
testValueColor( icon, "clearIconHoverColor" );
|
||||||
testValueColor( icon, "clearIconPressedColor" );
|
testValueColor( icon, "clearIconPressedColor" );
|
||||||
@@ -1527,6 +1547,8 @@ public class TestFlatStyleableValue
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void flatSearchIcon( FlatSearchIcon icon ) {
|
private void flatSearchIcon( FlatSearchIcon icon ) {
|
||||||
|
testValueFloat( icon, "searchIconScale" );
|
||||||
|
|
||||||
testValueColor( icon, "searchIconColor" );
|
testValueColor( icon, "searchIconColor" );
|
||||||
testValueColor( icon, "searchIconHoverColor" );
|
testValueColor( icon, "searchIconHoverColor" );
|
||||||
testValueColor( icon, "searchIconPressedColor" );
|
testValueColor( icon, "searchIconPressedColor" );
|
||||||
@@ -1537,6 +1559,7 @@ public class TestFlatStyleableValue
|
|||||||
FlatCapsLockIcon icon = new FlatCapsLockIcon();
|
FlatCapsLockIcon icon = new FlatCapsLockIcon();
|
||||||
expectedStyleableInfos = icon.getStyleableInfos();
|
expectedStyleableInfos = icon.getStyleableInfos();
|
||||||
|
|
||||||
|
testValueFloat( icon, "capsLockIconScale" );
|
||||||
testValueColor( icon, "capsLockIconColor" );
|
testValueColor( icon, "capsLockIconColor" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1545,6 +1568,8 @@ public class TestFlatStyleableValue
|
|||||||
FlatTabbedPaneCloseIcon icon = new FlatTabbedPaneCloseIcon();
|
FlatTabbedPaneCloseIcon icon = new FlatTabbedPaneCloseIcon();
|
||||||
expectedStyleableInfos = icon.getStyleableInfos();
|
expectedStyleableInfos = icon.getStyleableInfos();
|
||||||
|
|
||||||
|
testValueFloat( icon, "closeScale" );
|
||||||
|
|
||||||
testValueDimension( icon, "closeSize" );
|
testValueDimension( icon, "closeSize" );
|
||||||
testValueInteger( icon, "closeArc" );
|
testValueInteger( icon, "closeArc" );
|
||||||
testValueFloat( icon, "closeCrossPlainSize" );
|
testValueFloat( icon, "closeCrossPlainSize" );
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ help.hoverBorderColor java.awt.Color
|
|||||||
help.innerFocusWidth float
|
help.innerFocusWidth float
|
||||||
help.pressedBackground java.awt.Color
|
help.pressedBackground java.awt.Color
|
||||||
help.questionMarkColor java.awt.Color
|
help.questionMarkColor java.awt.Color
|
||||||
|
help.scale float
|
||||||
hoverBackground java.awt.Color
|
hoverBackground java.awt.Color
|
||||||
hoverBorderColor java.awt.Color
|
hoverBorderColor java.awt.Color
|
||||||
hoverForeground java.awt.Color
|
hoverForeground java.awt.Color
|
||||||
@@ -138,6 +139,7 @@ icon.pressedIndeterminateBorderColor java.awt.Color
|
|||||||
icon.pressedIndeterminateCheckmarkColor java.awt.Color
|
icon.pressedIndeterminateCheckmarkColor java.awt.Color
|
||||||
icon.pressedSelectedBackground java.awt.Color
|
icon.pressedSelectedBackground java.awt.Color
|
||||||
icon.pressedSelectedBorderColor java.awt.Color
|
icon.pressedSelectedBorderColor java.awt.Color
|
||||||
|
icon.scale float
|
||||||
icon.selectedBackground java.awt.Color
|
icon.selectedBackground java.awt.Color
|
||||||
icon.selectedBorderColor java.awt.Color
|
icon.selectedBorderColor java.awt.Color
|
||||||
icon.selectedBorderWidth float
|
icon.selectedBorderWidth float
|
||||||
@@ -154,6 +156,7 @@ checkMargins java.awt.Insets
|
|||||||
disabledForeground java.awt.Color
|
disabledForeground java.awt.Color
|
||||||
icon.checkmarkColor java.awt.Color
|
icon.checkmarkColor java.awt.Color
|
||||||
icon.disabledCheckmarkColor java.awt.Color
|
icon.disabledCheckmarkColor java.awt.Color
|
||||||
|
icon.scale float
|
||||||
minimumIconSize java.awt.Dimension
|
minimumIconSize java.awt.Dimension
|
||||||
minimumWidth int
|
minimumWidth int
|
||||||
selectionArc int
|
selectionArc int
|
||||||
@@ -304,6 +307,7 @@ disabledForeground java.awt.Color
|
|||||||
icon.arrowColor java.awt.Color
|
icon.arrowColor java.awt.Color
|
||||||
icon.arrowType java.lang.String
|
icon.arrowType java.lang.String
|
||||||
icon.disabledArrowColor java.awt.Color
|
icon.disabledArrowColor java.awt.Color
|
||||||
|
icon.scale float
|
||||||
minimumIconSize java.awt.Dimension
|
minimumIconSize java.awt.Dimension
|
||||||
minimumWidth int
|
minimumWidth int
|
||||||
selectionArc int
|
selectionArc int
|
||||||
@@ -369,6 +373,7 @@ arc int
|
|||||||
borderColor java.awt.Color
|
borderColor java.awt.Color
|
||||||
borderWidth float
|
borderWidth float
|
||||||
capsLockIconColor java.awt.Color
|
capsLockIconColor java.awt.Color
|
||||||
|
capsLockIconScale float
|
||||||
custom.borderColor java.awt.Color
|
custom.borderColor java.awt.Color
|
||||||
disabledBackground java.awt.Color
|
disabledBackground java.awt.Color
|
||||||
disabledBorderColor java.awt.Color
|
disabledBorderColor java.awt.Color
|
||||||
@@ -473,6 +478,7 @@ icon.pressedIndeterminateBorderColor java.awt.Color
|
|||||||
icon.pressedIndeterminateCheckmarkColor java.awt.Color
|
icon.pressedIndeterminateCheckmarkColor java.awt.Color
|
||||||
icon.pressedSelectedBackground java.awt.Color
|
icon.pressedSelectedBackground java.awt.Color
|
||||||
icon.pressedSelectedBorderColor java.awt.Color
|
icon.pressedSelectedBorderColor java.awt.Color
|
||||||
|
icon.scale float
|
||||||
icon.selectedBackground java.awt.Color
|
icon.selectedBackground java.awt.Color
|
||||||
icon.selectedBorderColor java.awt.Color
|
icon.selectedBorderColor java.awt.Color
|
||||||
icon.selectedBorderWidth float
|
icon.selectedBorderWidth float
|
||||||
@@ -489,6 +495,7 @@ checkMargins java.awt.Insets
|
|||||||
disabledForeground java.awt.Color
|
disabledForeground java.awt.Color
|
||||||
icon.checkmarkColor java.awt.Color
|
icon.checkmarkColor java.awt.Color
|
||||||
icon.disabledCheckmarkColor java.awt.Color
|
icon.disabledCheckmarkColor java.awt.Color
|
||||||
|
icon.scale float
|
||||||
minimumIconSize java.awt.Dimension
|
minimumIconSize java.awt.Dimension
|
||||||
minimumWidth int
|
minimumWidth int
|
||||||
selectionArc int
|
selectionArc int
|
||||||
@@ -656,6 +663,7 @@ closeHoverBackground java.awt.Color
|
|||||||
closeHoverForeground java.awt.Color
|
closeHoverForeground java.awt.Color
|
||||||
closePressedBackground java.awt.Color
|
closePressedBackground java.awt.Color
|
||||||
closePressedForeground java.awt.Color
|
closePressedForeground java.awt.Color
|
||||||
|
closeScale float
|
||||||
closeSize java.awt.Dimension
|
closeSize java.awt.Dimension
|
||||||
contentAreaColor java.awt.Color
|
contentAreaColor java.awt.Color
|
||||||
contentSeparatorHeight int
|
contentSeparatorHeight int
|
||||||
@@ -1076,6 +1084,7 @@ inactiveDropShadowOpacity float
|
|||||||
#---- FlatCapsLockIcon ----
|
#---- FlatCapsLockIcon ----
|
||||||
|
|
||||||
capsLockIconColor java.awt.Color
|
capsLockIconColor java.awt.Color
|
||||||
|
capsLockIconScale float
|
||||||
|
|
||||||
|
|
||||||
#---- FlatCheckBoxIcon ----
|
#---- FlatCheckBoxIcon ----
|
||||||
@@ -1125,6 +1134,7 @@ pressedIndeterminateBorderColor java.awt.Color
|
|||||||
pressedIndeterminateCheckmarkColor java.awt.Color
|
pressedIndeterminateCheckmarkColor java.awt.Color
|
||||||
pressedSelectedBackground java.awt.Color
|
pressedSelectedBackground java.awt.Color
|
||||||
pressedSelectedBorderColor java.awt.Color
|
pressedSelectedBorderColor java.awt.Color
|
||||||
|
scale float
|
||||||
selectedBackground java.awt.Color
|
selectedBackground java.awt.Color
|
||||||
selectedBorderColor java.awt.Color
|
selectedBorderColor java.awt.Color
|
||||||
selectedBorderWidth float
|
selectedBorderWidth float
|
||||||
@@ -1134,6 +1144,7 @@ selectedBorderWidth float
|
|||||||
|
|
||||||
checkmarkColor java.awt.Color
|
checkmarkColor java.awt.Color
|
||||||
disabledCheckmarkColor java.awt.Color
|
disabledCheckmarkColor java.awt.Color
|
||||||
|
scale float
|
||||||
selectionForeground java.awt.Color
|
selectionForeground java.awt.Color
|
||||||
|
|
||||||
|
|
||||||
@@ -1142,6 +1153,7 @@ selectionForeground java.awt.Color
|
|||||||
clearIconColor java.awt.Color
|
clearIconColor java.awt.Color
|
||||||
clearIconHoverColor java.awt.Color
|
clearIconHoverColor java.awt.Color
|
||||||
clearIconPressedColor java.awt.Color
|
clearIconPressedColor java.awt.Color
|
||||||
|
clearIconScale float
|
||||||
|
|
||||||
|
|
||||||
#---- FlatHelpButtonIcon ----
|
#---- FlatHelpButtonIcon ----
|
||||||
@@ -1161,6 +1173,7 @@ hoverBorderColor java.awt.Color
|
|||||||
innerFocusWidth float
|
innerFocusWidth float
|
||||||
pressedBackground java.awt.Color
|
pressedBackground java.awt.Color
|
||||||
questionMarkColor java.awt.Color
|
questionMarkColor java.awt.Color
|
||||||
|
scale float
|
||||||
|
|
||||||
|
|
||||||
#---- FlatMenuArrowIcon ----
|
#---- FlatMenuArrowIcon ----
|
||||||
@@ -1168,6 +1181,7 @@ questionMarkColor java.awt.Color
|
|||||||
arrowColor java.awt.Color
|
arrowColor java.awt.Color
|
||||||
arrowType java.lang.String
|
arrowType java.lang.String
|
||||||
disabledArrowColor java.awt.Color
|
disabledArrowColor java.awt.Color
|
||||||
|
scale float
|
||||||
selectionForeground java.awt.Color
|
selectionForeground java.awt.Color
|
||||||
|
|
||||||
|
|
||||||
@@ -1219,6 +1233,7 @@ pressedIndeterminateBorderColor java.awt.Color
|
|||||||
pressedIndeterminateCheckmarkColor java.awt.Color
|
pressedIndeterminateCheckmarkColor java.awt.Color
|
||||||
pressedSelectedBackground java.awt.Color
|
pressedSelectedBackground java.awt.Color
|
||||||
pressedSelectedBorderColor java.awt.Color
|
pressedSelectedBorderColor java.awt.Color
|
||||||
|
scale float
|
||||||
selectedBackground java.awt.Color
|
selectedBackground java.awt.Color
|
||||||
selectedBorderColor java.awt.Color
|
selectedBorderColor java.awt.Color
|
||||||
selectedBorderWidth float
|
selectedBorderWidth float
|
||||||
@@ -1228,6 +1243,7 @@ selectedBorderWidth float
|
|||||||
|
|
||||||
checkmarkColor java.awt.Color
|
checkmarkColor java.awt.Color
|
||||||
disabledCheckmarkColor java.awt.Color
|
disabledCheckmarkColor java.awt.Color
|
||||||
|
scale float
|
||||||
selectionForeground java.awt.Color
|
selectionForeground java.awt.Color
|
||||||
|
|
||||||
|
|
||||||
@@ -1236,6 +1252,7 @@ selectionForeground java.awt.Color
|
|||||||
searchIconColor java.awt.Color
|
searchIconColor java.awt.Color
|
||||||
searchIconHoverColor java.awt.Color
|
searchIconHoverColor java.awt.Color
|
||||||
searchIconPressedColor java.awt.Color
|
searchIconPressedColor java.awt.Color
|
||||||
|
searchIconScale float
|
||||||
|
|
||||||
|
|
||||||
#---- FlatSearchWithHistoryIcon ----
|
#---- FlatSearchWithHistoryIcon ----
|
||||||
@@ -1243,6 +1260,7 @@ searchIconPressedColor java.awt.Color
|
|||||||
searchIconColor java.awt.Color
|
searchIconColor java.awt.Color
|
||||||
searchIconHoverColor java.awt.Color
|
searchIconHoverColor java.awt.Color
|
||||||
searchIconPressedColor java.awt.Color
|
searchIconPressedColor java.awt.Color
|
||||||
|
searchIconScale float
|
||||||
|
|
||||||
|
|
||||||
#---- FlatTabbedPaneCloseIcon ----
|
#---- FlatTabbedPaneCloseIcon ----
|
||||||
@@ -1257,6 +1275,7 @@ closeHoverBackground java.awt.Color
|
|||||||
closeHoverForeground java.awt.Color
|
closeHoverForeground java.awt.Color
|
||||||
closePressedBackground java.awt.Color
|
closePressedBackground java.awt.Color
|
||||||
closePressedForeground java.awt.Color
|
closePressedForeground java.awt.Color
|
||||||
|
closeScale float
|
||||||
closeSize java.awt.Dimension
|
closeSize java.awt.Dimension
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
package com.formdev.flatlaf.themeeditor;
|
package com.formdev.flatlaf.themeeditor;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Graphics;
|
|
||||||
import java.awt.Graphics2D;
|
|
||||||
import java.beans.Beans;
|
import java.beans.Beans;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
@@ -797,31 +795,8 @@ class FlatThemePreviewSwitches
|
|||||||
extends FlatCheckBoxIcon
|
extends FlatCheckBoxIcon
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void paintIcon( Component c, Graphics g, int x, int y ) {
|
public float getScale() {
|
||||||
Graphics2D g2 = (Graphics2D) g.create();
|
return zoom;
|
||||||
try {
|
|
||||||
g2.translate( x, y );
|
|
||||||
g2.scale( zoom, zoom );
|
|
||||||
|
|
||||||
super.paintIcon( c, g2, 0, 0 );
|
|
||||||
} finally {
|
|
||||||
g2.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getIconWidth() {
|
|
||||||
return Math.round( super.getIconWidth() * zoom );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getIconHeight() {
|
|
||||||
return Math.round( super.getIconHeight() * zoom );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getFocusWidth() {
|
|
||||||
return super.getFocusWidth() * zoom;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -831,31 +806,8 @@ class FlatThemePreviewSwitches
|
|||||||
extends FlatRadioButtonIcon
|
extends FlatRadioButtonIcon
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void paintIcon( Component c, Graphics g, int x, int y ) {
|
public float getScale() {
|
||||||
Graphics2D g2 = (Graphics2D) g.create();
|
return zoom;
|
||||||
try {
|
|
||||||
g2.translate( x, y );
|
|
||||||
g2.scale( zoom, zoom );
|
|
||||||
|
|
||||||
super.paintIcon( c, g2, 0, 0 );
|
|
||||||
} finally {
|
|
||||||
g2.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getIconWidth() {
|
|
||||||
return Math.round( super.getIconWidth() * zoom );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getIconHeight() {
|
|
||||||
return Math.round( super.getIconHeight() * zoom );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getFocusWidth() {
|
|
||||||
return super.getFocusWidth() * zoom;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user