mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 05:50:53 +03:00
Compare commits
3 Commits
d7a5c353fe
...
4f1e5cdb05
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f1e5cdb05 | ||
|
|
070cf9c40d | ||
|
|
5b0f13110a |
@@ -8,6 +8,11 @@ FlatLaf Change Log
|
||||
- System File Chooser allows using **operating system file dialogs** in Java
|
||||
Swing applications. (PR #988)
|
||||
- Zooming API. (PR #1051)
|
||||
- Icons:
|
||||
- Support scaling Laf icons (checkbox, radiobutton, etc). (issue #1061)
|
||||
- Scale checkbox and radiobutton icons when using
|
||||
[text styles](https://www.formdev.com/flatlaf/typography/#text_styles)
|
||||
`large`, `medium`, `small` and `mini`.
|
||||
- TabbedPane: Added icon-only tab mode, which shows tab icons but hides tab
|
||||
titles. Tab titles are used in "Show Hidden Tabs" popup menu. (set client
|
||||
property `JTabbedPane.tabWidthMode` to `"iconOnly"`)
|
||||
@@ -27,6 +32,8 @@ FlatLaf Change Log
|
||||
modal dialogs. (issue #1048)
|
||||
- JideButton, JideToggleButton, JideSplitButton and JideToggleSplitButton: Paint
|
||||
border in button style `TOOLBAR_STYLE` if in selected state. (issue #1045)
|
||||
- IntelliJ Themes: Fixed problem when using theme instance more than once when
|
||||
switching to that theme. (issue #990)
|
||||
|
||||
|
||||
## 3.6.2
|
||||
|
||||
@@ -58,9 +58,9 @@ public class IntelliJTheme
|
||||
public final boolean dark;
|
||||
public final String author;
|
||||
|
||||
private Map<String, String> jsonColors;
|
||||
private Map<String, Object> jsonUI;
|
||||
private Map<String, Object> jsonIcons;
|
||||
private final Map<String, String> jsonColors;
|
||||
private final Map<String, Object> jsonUI;
|
||||
private final Map<String, Object> jsonIcons;
|
||||
|
||||
private Map<String, String> namedColors = Collections.emptyMap();
|
||||
|
||||
@@ -276,11 +276,6 @@ public class IntelliJTheme
|
||||
|
||||
put( properties, key, value );
|
||||
}
|
||||
|
||||
// let Java release memory
|
||||
jsonColors = null;
|
||||
jsonUI = null;
|
||||
jsonIcons = null;
|
||||
}
|
||||
|
||||
private String get( Properties properties, Map<String, String> themeSpecificProps, String key ) {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.formdev.flatlaf.icons;
|
||||
|
||||
import static com.formdev.flatlaf.util.UIScale.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
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
|
||||
* a scaled graphics context for icon painting.
|
||||
*
|
||||
* <p>
|
||||
* Subclasses do not need to scale icon painting.
|
||||
*
|
||||
* @author Karl Tauber
|
||||
@@ -37,10 +36,15 @@ import com.formdev.flatlaf.util.UIScale;
|
||||
public abstract class FlatAbstractIcon
|
||||
implements Icon, UIResource
|
||||
{
|
||||
/** Unscaled icon width. */
|
||||
protected final int width;
|
||||
/** Unscaled icon height. */
|
||||
protected final int height;
|
||||
protected Color color;
|
||||
|
||||
/** Additional icon scale factor. */
|
||||
private float scale = 1;
|
||||
|
||||
public FlatAbstractIcon( int width, int height, Color color ) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
@@ -61,6 +65,9 @@ public abstract class FlatAbstractIcon
|
||||
|
||||
g2.translate( x, y );
|
||||
UIScale.scaleGraphics( g2 );
|
||||
float scale = getScale();
|
||||
if( scale != 1 )
|
||||
g2.scale( scale, scale );
|
||||
|
||||
if( color != null )
|
||||
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 ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 );
|
||||
|
||||
/**
|
||||
* Returns the scaled icon width.
|
||||
*/
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return scale( width );
|
||||
return scale( UIScale.scale( width ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the scaled icon height.
|
||||
*/
|
||||
@Override
|
||||
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;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
@@ -25,11 +24,9 @@ import java.awt.geom.Area;
|
||||
import java.awt.geom.Path2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.UnknownStyleException;
|
||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
|
||||
/**
|
||||
@@ -39,6 +36,8 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="capsLockIconScale", fieldName="scale" )
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="capsLockIconColor", fieldName="color" )
|
||||
public class FlatCapsLockIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
@@ -49,31 +48,6 @@ public class FlatCapsLockIcon
|
||||
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
|
||||
protected void paintIcon( Component c, Graphics2D g ) {
|
||||
/*
|
||||
|
||||
@@ -29,6 +29,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.ui.FlatButtonUI;
|
||||
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.FlatUIUtils;
|
||||
|
||||
@@ -100,6 +101,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||
public class FlatCheckBoxIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
@@ -291,7 +293,7 @@ public class FlatCheckBoxIcon
|
||||
|
||||
/** @since 2 */
|
||||
public float getFocusWidth() {
|
||||
return focusWidth;
|
||||
return focusWidth * getScale();
|
||||
}
|
||||
|
||||
protected Color getFocusColor( Component c ) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.swing.AbstractButton;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||
|
||||
/**
|
||||
@@ -37,6 +38,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||
public class FlatCheckBoxMenuItemIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.swing.AbstractButton;
|
||||
import javax.swing.ButtonModel;
|
||||
import javax.swing.UIManager;
|
||||
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.FlatUIUtils;
|
||||
|
||||
@@ -38,6 +39,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
* @author Karl Tauber
|
||||
* @since 1.5
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="clearIconScale", fieldName="scale" )
|
||||
public class FlatClearIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.formdev.flatlaf.icons;
|
||||
|
||||
import static com.formdev.flatlaf.util.UIScale.*;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@@ -27,7 +26,9 @@ import java.awt.geom.Path2D;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.ui.FlatButtonUI;
|
||||
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.util.UIScale;
|
||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
|
||||
/**
|
||||
@@ -51,6 +52,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||
public class FlatHelpButtonIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
@@ -152,12 +154,12 @@ public class FlatHelpButtonIcon
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return scale( iconSize() );
|
||||
return scale( UIScale.scale( iconSize() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return scale( iconSize() );
|
||||
return scale( UIScale.scale( iconSize() ) );
|
||||
}
|
||||
|
||||
private int iconSize() {
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.swing.JMenu;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.Styleable;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableField;
|
||||
import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,7 @@ import com.formdev.flatlaf.ui.FlatStylingSupport.StyleableObject;
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="scale" )
|
||||
public class FlatMenuArrowIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.awt.geom.Ellipse2D;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.ui.FlatButtonUI;
|
||||
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.FlatUIUtils;
|
||||
|
||||
@@ -37,6 +38,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
* @author Karl Tauber
|
||||
* @since 1.5
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="searchIconScale", fieldName="scale" )
|
||||
public class FlatSearchIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.awt.geom.Path2D;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.ui.FlatButtonUI;
|
||||
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.FlatUIUtils;
|
||||
|
||||
@@ -45,6 +46,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
@StyleableField( cls=FlatAbstractIcon.class, key="closeScale", fieldName="scale" )
|
||||
public class FlatTabbedPaneCloseIcon
|
||||
extends FlatAbstractIcon
|
||||
implements StyleableObject
|
||||
|
||||
@@ -214,7 +214,7 @@ public class FlatPasswordFieldUI
|
||||
/** @since 2 */
|
||||
@Override
|
||||
protected Object applyStyleProperty( String key, Object value ) {
|
||||
if( key.equals( "capsLockIconColor" ) && capsLockIcon instanceof StyleableObject ) {
|
||||
if( key.startsWith( "capsLockIcon" ) && capsLockIcon instanceof StyleableObject ) {
|
||||
if( capsLockIconShared ) {
|
||||
capsLockIcon = FlatStylingSupport.cloneIcon( capsLockIcon );
|
||||
capsLockIconShared = false;
|
||||
@@ -236,7 +236,7 @@ public class FlatPasswordFieldUI
|
||||
|
||||
@Override
|
||||
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 super.getStyleableValue( c, key );
|
||||
|
||||
@@ -228,10 +228,8 @@ public class FlatRadioButtonUI
|
||||
public Map<String, Class<?>> getStyleableInfos( JComponent c ) {
|
||||
Map<String, Class<?>> infos = FlatStylingSupport.getAnnotatedStyleableInfos( this );
|
||||
Icon icon = getRealIcon( c );
|
||||
if( icon instanceof StyleableObject ) {
|
||||
for( Map.Entry<String, Class<?>> e : ((StyleableObject)icon).getStyleableInfos().entrySet() )
|
||||
infos.put( "icon.".concat( e.getKey() ), e.getValue() );
|
||||
}
|
||||
if( icon instanceof StyleableObject )
|
||||
FlatStylingSupport.putAllPrefixKey( infos, "icon.", ((StyleableObject)icon).getStyleableInfos() );
|
||||
return infos;
|
||||
}
|
||||
|
||||
|
||||
@@ -977,6 +977,24 @@ Tree.icon.openColor = @icon
|
||||
|
||||
#---- Styles ------------------------------------------------------------------
|
||||
|
||||
#---- scale icons ----
|
||||
|
||||
@largeScale = 1.125
|
||||
@mediumScale = 0.875
|
||||
@smallScale = 0.8125
|
||||
@miniScale = 0.75
|
||||
|
||||
[style]CheckBox.large = icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]CheckBox.medium = icon.scale: @mediumScale
|
||||
[style]CheckBox.small = icon.scale: @smallScale; iconTextGap: 3
|
||||
[style]CheckBox.mini = icon.scale: @miniScale; iconTextGap: 3
|
||||
|
||||
[style]RadioButton.large = icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]RadioButton.medium = icon.scale: @mediumScale
|
||||
[style]RadioButton.small = icon.scale: @smallScale; iconTextGap: 3
|
||||
[style]RadioButton.mini = icon.scale: @miniScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- inTextField ----
|
||||
# for leading/trailing components in text fields
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ public class TestFlatStyleableInfo
|
||||
//---- FlatHelpButtonIcon ----
|
||||
|
||||
expectedMap( expected,
|
||||
"help.scale", float.class,
|
||||
|
||||
"help.focusWidth", int.class,
|
||||
"help.focusColor", Color.class,
|
||||
"help.innerFocusWidth", float.class,
|
||||
@@ -413,6 +415,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
private void menuItem_checkIcon( Map<String, Class<?>> expected ) {
|
||||
expectedMap( expected,
|
||||
"icon.scale", float.class,
|
||||
|
||||
"icon.checkmarkColor", Color.class,
|
||||
"icon.disabledCheckmarkColor", Color.class,
|
||||
"selectionForeground", Color.class
|
||||
@@ -421,6 +425,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
private void menuItem_arrowIcon( Map<String, Class<?>> expected ) {
|
||||
expectedMap( expected,
|
||||
"icon.scale", float.class,
|
||||
|
||||
"icon.arrowType", String.class,
|
||||
"icon.arrowColor", Color.class,
|
||||
"icon.disabledArrowColor", Color.class,
|
||||
@@ -456,7 +462,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
expectedMap( expected,
|
||||
// capsLockIcon
|
||||
"capsLockIconColor", Color.class
|
||||
"capsLockIconColor", Color.class,
|
||||
"capsLockIconScale", float.class
|
||||
);
|
||||
|
||||
// border
|
||||
@@ -553,6 +560,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
//---- icon ----
|
||||
|
||||
"icon.scale", float.class,
|
||||
|
||||
"icon.focusWidth", float.class,
|
||||
"icon.focusColor", Color.class,
|
||||
"icon.borderWidth", float.class,
|
||||
@@ -831,6 +840,7 @@ public class TestFlatStyleableInfo
|
||||
"tabIconPlacement", int.class,
|
||||
|
||||
// FlatTabbedPaneCloseIcon
|
||||
"closeScale", float.class,
|
||||
"closeSize", Dimension.class,
|
||||
"closeArc", int.class,
|
||||
"closeCrossPlainSize", float.class,
|
||||
@@ -1269,6 +1279,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
private void flatCheckBoxIcon( Map<String, Class<?>> expected ) {
|
||||
expectedMap( expected,
|
||||
"scale", float.class,
|
||||
|
||||
"focusWidth", float.class,
|
||||
"focusColor", Color.class,
|
||||
"borderWidth", float.class,
|
||||
@@ -1353,6 +1365,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
private void flatCheckBoxMenuItemIcon( Map<String, Class<?>> expected ) {
|
||||
expectedMap( expected,
|
||||
"scale", float.class,
|
||||
|
||||
"checkmarkColor", Color.class,
|
||||
"disabledCheckmarkColor", Color.class,
|
||||
"selectionForeground", Color.class
|
||||
@@ -1371,6 +1385,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
private void flatMenuArrowIcon( Map<String, Class<?>> expected ) {
|
||||
expectedMap( expected,
|
||||
"scale", float.class,
|
||||
|
||||
"arrowType", String.class,
|
||||
"arrowColor", Color.class,
|
||||
"disabledArrowColor", Color.class,
|
||||
@@ -1383,6 +1399,8 @@ public class TestFlatStyleableInfo
|
||||
FlatHelpButtonIcon icon = new FlatHelpButtonIcon();
|
||||
|
||||
Map<String, Class<?>> expected = expectedMap(
|
||||
"scale", float.class,
|
||||
|
||||
"focusWidth", int.class,
|
||||
"focusColor", Color.class,
|
||||
"innerFocusWidth", float.class,
|
||||
@@ -1409,6 +1427,8 @@ public class TestFlatStyleableInfo
|
||||
FlatClearIcon icon = new FlatClearIcon();
|
||||
|
||||
Map<String, Class<?>> expected = expectedMap(
|
||||
"clearIconScale", float.class,
|
||||
|
||||
"clearIconColor", Color.class,
|
||||
"clearIconHoverColor", Color.class,
|
||||
"clearIconPressedColor", Color.class
|
||||
@@ -1439,6 +1459,8 @@ public class TestFlatStyleableInfo
|
||||
|
||||
private void flatSearchIcon( Map<String, Class<?>> expected ) {
|
||||
expectedMap( expected,
|
||||
"searchIconScale", float.class,
|
||||
|
||||
"searchIconColor", Color.class,
|
||||
"searchIconHoverColor", Color.class,
|
||||
"searchIconPressedColor", Color.class
|
||||
@@ -1450,6 +1472,8 @@ public class TestFlatStyleableInfo
|
||||
FlatCapsLockIcon icon = new FlatCapsLockIcon();
|
||||
|
||||
Map<String, Class<?>> expected = expectedMap(
|
||||
"capsLockIconScale", float.class,
|
||||
|
||||
"capsLockIconColor", Color.class
|
||||
);
|
||||
|
||||
@@ -1461,6 +1485,10 @@ public class TestFlatStyleableInfo
|
||||
FlatTabbedPaneCloseIcon icon = new FlatTabbedPaneCloseIcon();
|
||||
|
||||
Map<String, Class<?>> expected = expectedMap(
|
||||
//TODO closeScale ?
|
||||
// "scale", float.class,
|
||||
"closeScale", float.class,
|
||||
|
||||
"closeSize", Dimension.class,
|
||||
"closeArc", int.class,
|
||||
"closeCrossPlainSize", float.class,
|
||||
|
||||
@@ -273,6 +273,8 @@ public class TestFlatStyleableValue
|
||||
|
||||
//---- FlatHelpButtonIcon ----
|
||||
|
||||
testFloat( c, ui, "help.scale" );
|
||||
|
||||
testInteger( c, ui, "help.focusWidth" );
|
||||
testColor( c, ui, "help.focusColor" );
|
||||
testFloat( c, ui, "help.innerFocusWidth" );
|
||||
@@ -569,12 +571,16 @@ public class TestFlatStyleableValue
|
||||
}
|
||||
|
||||
private void menuItem_checkIcon( JComponent c, StyleableUI ui ) {
|
||||
testFloat( c, ui, "icon.scale" );
|
||||
|
||||
testColor( c, ui, "icon.checkmarkColor" );
|
||||
testColor( c, ui, "icon.disabledCheckmarkColor" );
|
||||
testColor( c, ui, "selectionForeground" );
|
||||
}
|
||||
|
||||
private void menuItem_arrowIcon( JComponent c, StyleableUI ui ) {
|
||||
testFloat( c, ui, "icon.scale" );
|
||||
|
||||
testString( c, ui, "icon.arrowType", "chevron" );
|
||||
testColor( c, ui, "icon.arrowColor" );
|
||||
testColor( c, ui, "icon.disabledArrowColor" );
|
||||
@@ -603,6 +609,7 @@ public class TestFlatStyleableValue
|
||||
testBoolean( c, ui, "showRevealButton" );
|
||||
|
||||
// capsLockIcon
|
||||
testFloat( c, ui, "capsLockIconScale" );
|
||||
testColor( c, ui, "capsLockIconColor" );
|
||||
|
||||
// border
|
||||
@@ -694,6 +701,8 @@ public class TestFlatStyleableValue
|
||||
return;
|
||||
}
|
||||
|
||||
testFloat( b, ui, "icon.scale" );
|
||||
|
||||
testFloat( b, ui, "icon.focusWidth" );
|
||||
testColor( b, ui, "icon.focusColor" );
|
||||
testFloat( b, ui, "icon.borderWidth" );
|
||||
@@ -952,6 +961,7 @@ public class TestFlatStyleableValue
|
||||
testString( c, ui, "tabIconPlacement", "top" );
|
||||
|
||||
// FlatTabbedPaneCloseIcon
|
||||
testFloat( c, ui, "closeScale" );
|
||||
testDimension( c, ui, "closeSize" );
|
||||
testInteger( c, ui, "closeArc" );
|
||||
testFloat( c, ui, "closeCrossPlainSize" );
|
||||
@@ -1383,6 +1393,8 @@ public class TestFlatStyleableValue
|
||||
}
|
||||
|
||||
private void flatCheckBoxIcon( FlatCheckBoxIcon icon ) {
|
||||
testValueFloat( icon, "scale" );
|
||||
|
||||
testValueFloat( icon, "focusWidth" );
|
||||
testValueColor( icon, "focusColor" );
|
||||
testValueFloat( icon, "borderWidth" );
|
||||
@@ -1461,6 +1473,8 @@ public class TestFlatStyleableValue
|
||||
}
|
||||
|
||||
private void flatCheckBoxMenuItemIcon( FlatCheckBoxMenuItemIcon icon ) {
|
||||
testValueFloat( icon, "scale" );
|
||||
|
||||
testValueColor( icon, "checkmarkColor" );
|
||||
testValueColor( icon, "disabledCheckmarkColor" );
|
||||
testValueColor( icon, "selectionForeground" );
|
||||
@@ -1471,6 +1485,8 @@ public class TestFlatStyleableValue
|
||||
FlatMenuArrowIcon icon = new FlatMenuArrowIcon();
|
||||
expectedStyleableInfos = icon.getStyleableInfos();
|
||||
|
||||
testValueFloat( icon, "scale" );
|
||||
|
||||
testValueString( icon, "arrowType", "chevron" );
|
||||
testValueColor( icon, "arrowColor" );
|
||||
testValueColor( icon, "disabledArrowColor" );
|
||||
@@ -1482,6 +1498,8 @@ public class TestFlatStyleableValue
|
||||
FlatHelpButtonIcon icon = new FlatHelpButtonIcon();
|
||||
expectedStyleableInfos = icon.getStyleableInfos();
|
||||
|
||||
testValueFloat( icon, "scale" );
|
||||
|
||||
testValueInteger( icon, "focusWidth" );
|
||||
testValueColor( icon, "focusColor" );
|
||||
testValueFloat( icon, "innerFocusWidth" );
|
||||
@@ -1505,6 +1523,8 @@ public class TestFlatStyleableValue
|
||||
FlatClearIcon icon = new FlatClearIcon();
|
||||
expectedStyleableInfos = icon.getStyleableInfos();
|
||||
|
||||
testValueFloat( icon, "clearIconScale" );
|
||||
|
||||
testValueColor( icon, "clearIconColor" );
|
||||
testValueColor( icon, "clearIconHoverColor" );
|
||||
testValueColor( icon, "clearIconPressedColor" );
|
||||
@@ -1527,6 +1547,8 @@ public class TestFlatStyleableValue
|
||||
}
|
||||
|
||||
private void flatSearchIcon( FlatSearchIcon icon ) {
|
||||
testValueFloat( icon, "searchIconScale" );
|
||||
|
||||
testValueColor( icon, "searchIconColor" );
|
||||
testValueColor( icon, "searchIconHoverColor" );
|
||||
testValueColor( icon, "searchIconPressedColor" );
|
||||
@@ -1537,6 +1559,7 @@ public class TestFlatStyleableValue
|
||||
FlatCapsLockIcon icon = new FlatCapsLockIcon();
|
||||
expectedStyleableInfos = icon.getStyleableInfos();
|
||||
|
||||
testValueFloat( icon, "capsLockIconScale" );
|
||||
testValueColor( icon, "capsLockIconColor" );
|
||||
}
|
||||
|
||||
@@ -1545,6 +1568,8 @@ public class TestFlatStyleableValue
|
||||
FlatTabbedPaneCloseIcon icon = new FlatTabbedPaneCloseIcon();
|
||||
expectedStyleableInfos = icon.getStyleableInfos();
|
||||
|
||||
testValueFloat( icon, "closeScale" );
|
||||
|
||||
testValueDimension( icon, "closeSize" );
|
||||
testValueInteger( icon, "closeArc" );
|
||||
testValueFloat( icon, "closeCrossPlainSize" );
|
||||
|
||||
@@ -50,6 +50,7 @@ help.hoverBorderColor java.awt.Color
|
||||
help.innerFocusWidth float
|
||||
help.pressedBackground java.awt.Color
|
||||
help.questionMarkColor java.awt.Color
|
||||
help.scale float
|
||||
hoverBackground java.awt.Color
|
||||
hoverBorderColor java.awt.Color
|
||||
hoverForeground java.awt.Color
|
||||
@@ -138,6 +139,7 @@ icon.pressedIndeterminateBorderColor java.awt.Color
|
||||
icon.pressedIndeterminateCheckmarkColor java.awt.Color
|
||||
icon.pressedSelectedBackground java.awt.Color
|
||||
icon.pressedSelectedBorderColor java.awt.Color
|
||||
icon.scale float
|
||||
icon.selectedBackground java.awt.Color
|
||||
icon.selectedBorderColor java.awt.Color
|
||||
icon.selectedBorderWidth float
|
||||
@@ -154,6 +156,7 @@ checkMargins java.awt.Insets
|
||||
disabledForeground java.awt.Color
|
||||
icon.checkmarkColor java.awt.Color
|
||||
icon.disabledCheckmarkColor java.awt.Color
|
||||
icon.scale float
|
||||
minimumIconSize java.awt.Dimension
|
||||
minimumWidth int
|
||||
selectionArc int
|
||||
@@ -304,6 +307,7 @@ disabledForeground java.awt.Color
|
||||
icon.arrowColor java.awt.Color
|
||||
icon.arrowType java.lang.String
|
||||
icon.disabledArrowColor java.awt.Color
|
||||
icon.scale float
|
||||
minimumIconSize java.awt.Dimension
|
||||
minimumWidth int
|
||||
selectionArc int
|
||||
@@ -369,6 +373,7 @@ arc int
|
||||
borderColor java.awt.Color
|
||||
borderWidth float
|
||||
capsLockIconColor java.awt.Color
|
||||
capsLockIconScale float
|
||||
custom.borderColor java.awt.Color
|
||||
disabledBackground java.awt.Color
|
||||
disabledBorderColor java.awt.Color
|
||||
@@ -473,6 +478,7 @@ icon.pressedIndeterminateBorderColor java.awt.Color
|
||||
icon.pressedIndeterminateCheckmarkColor java.awt.Color
|
||||
icon.pressedSelectedBackground java.awt.Color
|
||||
icon.pressedSelectedBorderColor java.awt.Color
|
||||
icon.scale float
|
||||
icon.selectedBackground java.awt.Color
|
||||
icon.selectedBorderColor java.awt.Color
|
||||
icon.selectedBorderWidth float
|
||||
@@ -489,6 +495,7 @@ checkMargins java.awt.Insets
|
||||
disabledForeground java.awt.Color
|
||||
icon.checkmarkColor java.awt.Color
|
||||
icon.disabledCheckmarkColor java.awt.Color
|
||||
icon.scale float
|
||||
minimumIconSize java.awt.Dimension
|
||||
minimumWidth int
|
||||
selectionArc int
|
||||
@@ -656,6 +663,7 @@ closeHoverBackground java.awt.Color
|
||||
closeHoverForeground java.awt.Color
|
||||
closePressedBackground java.awt.Color
|
||||
closePressedForeground java.awt.Color
|
||||
closeScale float
|
||||
closeSize java.awt.Dimension
|
||||
contentAreaColor java.awt.Color
|
||||
contentSeparatorHeight int
|
||||
@@ -1076,6 +1084,7 @@ inactiveDropShadowOpacity float
|
||||
#---- FlatCapsLockIcon ----
|
||||
|
||||
capsLockIconColor java.awt.Color
|
||||
capsLockIconScale float
|
||||
|
||||
|
||||
#---- FlatCheckBoxIcon ----
|
||||
@@ -1125,6 +1134,7 @@ pressedIndeterminateBorderColor java.awt.Color
|
||||
pressedIndeterminateCheckmarkColor java.awt.Color
|
||||
pressedSelectedBackground java.awt.Color
|
||||
pressedSelectedBorderColor java.awt.Color
|
||||
scale float
|
||||
selectedBackground java.awt.Color
|
||||
selectedBorderColor java.awt.Color
|
||||
selectedBorderWidth float
|
||||
@@ -1134,6 +1144,7 @@ selectedBorderWidth float
|
||||
|
||||
checkmarkColor java.awt.Color
|
||||
disabledCheckmarkColor java.awt.Color
|
||||
scale float
|
||||
selectionForeground java.awt.Color
|
||||
|
||||
|
||||
@@ -1142,6 +1153,7 @@ selectionForeground java.awt.Color
|
||||
clearIconColor java.awt.Color
|
||||
clearIconHoverColor java.awt.Color
|
||||
clearIconPressedColor java.awt.Color
|
||||
clearIconScale float
|
||||
|
||||
|
||||
#---- FlatHelpButtonIcon ----
|
||||
@@ -1161,6 +1173,7 @@ hoverBorderColor java.awt.Color
|
||||
innerFocusWidth float
|
||||
pressedBackground java.awt.Color
|
||||
questionMarkColor java.awt.Color
|
||||
scale float
|
||||
|
||||
|
||||
#---- FlatMenuArrowIcon ----
|
||||
@@ -1168,6 +1181,7 @@ questionMarkColor java.awt.Color
|
||||
arrowColor java.awt.Color
|
||||
arrowType java.lang.String
|
||||
disabledArrowColor java.awt.Color
|
||||
scale float
|
||||
selectionForeground java.awt.Color
|
||||
|
||||
|
||||
@@ -1219,6 +1233,7 @@ pressedIndeterminateBorderColor java.awt.Color
|
||||
pressedIndeterminateCheckmarkColor java.awt.Color
|
||||
pressedSelectedBackground java.awt.Color
|
||||
pressedSelectedBorderColor java.awt.Color
|
||||
scale float
|
||||
selectedBackground java.awt.Color
|
||||
selectedBorderColor java.awt.Color
|
||||
selectedBorderWidth float
|
||||
@@ -1228,6 +1243,7 @@ selectedBorderWidth float
|
||||
|
||||
checkmarkColor java.awt.Color
|
||||
disabledCheckmarkColor java.awt.Color
|
||||
scale float
|
||||
selectionForeground java.awt.Color
|
||||
|
||||
|
||||
@@ -1236,6 +1252,7 @@ selectionForeground java.awt.Color
|
||||
searchIconColor java.awt.Color
|
||||
searchIconHoverColor java.awt.Color
|
||||
searchIconPressedColor java.awt.Color
|
||||
searchIconScale float
|
||||
|
||||
|
||||
#---- FlatSearchWithHistoryIcon ----
|
||||
@@ -1243,6 +1260,7 @@ searchIconPressedColor java.awt.Color
|
||||
searchIconColor java.awt.Color
|
||||
searchIconHoverColor java.awt.Color
|
||||
searchIconPressedColor java.awt.Color
|
||||
searchIconScale float
|
||||
|
||||
|
||||
#---- FlatTabbedPaneCloseIcon ----
|
||||
@@ -1257,6 +1275,7 @@ closeHoverBackground java.awt.Color
|
||||
closeHoverForeground java.awt.Color
|
||||
closePressedBackground java.awt.Color
|
||||
closePressedForeground java.awt.Color
|
||||
closeScale float
|
||||
closeSize java.awt.Dimension
|
||||
|
||||
|
||||
|
||||
@@ -1503,6 +1503,22 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
|
||||
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: lighten($TextField.background,5%); toolbar.pressedBackground: lighten($TextField.background,10%); toolbar.selectedBackground: lighten($TextField.background,15%)
|
||||
|
||||
|
||||
#---- [style]CheckBox ----
|
||||
|
||||
[style]CheckBox.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]CheckBox.medium icon.scale: @mediumScale
|
||||
[style]CheckBox.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]CheckBox.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]RadioButton ----
|
||||
|
||||
[style]RadioButton.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]RadioButton.medium icon.scale: @mediumScale
|
||||
[style]RadioButton.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]RadioButton.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]ToggleButton ----
|
||||
|
||||
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: lighten($TextField.background,5%); toolbar.pressedBackground: lighten($TextField.background,10%); toolbar.selectedBackground: lighten($TextField.background,15%)
|
||||
|
||||
@@ -1508,6 +1508,22 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
|
||||
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: darken($TextField.background,4%); toolbar.pressedBackground: darken($TextField.background,8%); toolbar.selectedBackground: darken($TextField.background,12%)
|
||||
|
||||
|
||||
#---- [style]CheckBox ----
|
||||
|
||||
[style]CheckBox.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]CheckBox.medium icon.scale: @mediumScale
|
||||
[style]CheckBox.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]CheckBox.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]RadioButton ----
|
||||
|
||||
[style]RadioButton.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]RadioButton.medium icon.scale: @mediumScale
|
||||
[style]RadioButton.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]RadioButton.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]ToggleButton ----
|
||||
|
||||
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: darken($TextField.background,4%); toolbar.pressedBackground: darken($TextField.background,8%); toolbar.selectedBackground: darken($TextField.background,12%)
|
||||
|
||||
@@ -1513,6 +1513,22 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
|
||||
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: lighten($TextField.background,5%); toolbar.pressedBackground: lighten($TextField.background,10%); toolbar.selectedBackground: lighten($TextField.background,15%)
|
||||
|
||||
|
||||
#---- [style]CheckBox ----
|
||||
|
||||
[style]CheckBox.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]CheckBox.medium icon.scale: @mediumScale
|
||||
[style]CheckBox.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]CheckBox.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]RadioButton ----
|
||||
|
||||
[style]RadioButton.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]RadioButton.medium icon.scale: @mediumScale
|
||||
[style]RadioButton.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]RadioButton.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]ToggleButton ----
|
||||
|
||||
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: lighten($TextField.background,5%); toolbar.pressedBackground: lighten($TextField.background,10%); toolbar.selectedBackground: lighten($TextField.background,15%)
|
||||
|
||||
@@ -1517,6 +1517,22 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
|
||||
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: darken($TextField.background,4%); toolbar.pressedBackground: darken($TextField.background,8%); toolbar.selectedBackground: darken($TextField.background,12%)
|
||||
|
||||
|
||||
#---- [style]CheckBox ----
|
||||
|
||||
[style]CheckBox.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]CheckBox.medium icon.scale: @mediumScale
|
||||
[style]CheckBox.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]CheckBox.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]RadioButton ----
|
||||
|
||||
[style]RadioButton.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]RadioButton.medium icon.scale: @mediumScale
|
||||
[style]RadioButton.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]RadioButton.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]ToggleButton ----
|
||||
|
||||
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1; toolbar.hoverBackground: darken($TextField.background,4%); toolbar.pressedBackground: darken($TextField.background,8%); toolbar.selectedBackground: darken($TextField.background,12%)
|
||||
|
||||
@@ -1570,6 +1570,22 @@ ViewportUI com.formdev.flatlaf.ui.FlatViewportUI
|
||||
[style]Button.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1
|
||||
|
||||
|
||||
#---- [style]CheckBox ----
|
||||
|
||||
[style]CheckBox.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]CheckBox.medium icon.scale: @mediumScale
|
||||
[style]CheckBox.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]CheckBox.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]RadioButton ----
|
||||
|
||||
[style]RadioButton.large icon.scale: @largeScale; iconTextGap: 5
|
||||
[style]RadioButton.medium icon.scale: @mediumScale
|
||||
[style]RadioButton.mini icon.scale: @miniScale; iconTextGap: 3
|
||||
[style]RadioButton.small icon.scale: @smallScale; iconTextGap: 3
|
||||
|
||||
|
||||
#---- [style]ToggleButton ----
|
||||
|
||||
[style]ToggleButton.inTextField focusable: false; toolbar.margin: 1,1,1,1; toolbar.spacingInsets: 1,1,1,1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.5.0.382" Java: "16" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "8.3" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -146,8 +146,8 @@ new FormModel {
|
||||
"value": "cell 0 16"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 5, 0 )
|
||||
"size": new java.awt.Dimension( 335, 495 )
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 335, 675 )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "insets 0,hidemode 3"
|
||||
@@ -188,7 +188,7 @@ new FormModel {
|
||||
"value": "cell 1 0"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 5, 545 )
|
||||
"location": new java.awt.Point( 0, 715 )
|
||||
"size": new java.awt.Dimension( 235, 65 )
|
||||
} )
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.formdev.flatlaf.themeeditor;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.beans.Beans;
|
||||
import java.util.function.Predicate;
|
||||
import javax.swing.*;
|
||||
@@ -208,6 +206,24 @@ class FlatThemePreviewSwitches
|
||||
JLabel label32 = new JLabel();
|
||||
FlatThemePreviewSwitches.ZoomRadioButton radioButton1 = new FlatThemePreviewSwitches.ZoomRadioButton();
|
||||
FlatThemePreviewSwitches.ZoomRadioButton radioButton2 = new FlatThemePreviewSwitches.ZoomRadioButton();
|
||||
JLabel label39 = new JLabel();
|
||||
JLabel label5 = new JLabel();
|
||||
JLabel label6 = new JLabel();
|
||||
JLabel largeLabel = new JLabel();
|
||||
JCheckBox largeCheckBox = new JCheckBox();
|
||||
JRadioButton largeRadioButton = new JRadioButton();
|
||||
JLabel defaultLabel = new JLabel();
|
||||
JCheckBox defaultCheckBox = new JCheckBox();
|
||||
JRadioButton defaultRadioButton = new JRadioButton();
|
||||
JLabel mediumLabel = new JLabel();
|
||||
JCheckBox mediumCheckBox = new JCheckBox();
|
||||
JRadioButton mediumRadioButton = new JRadioButton();
|
||||
JLabel smallLabel = new JLabel();
|
||||
JCheckBox smallCheckBox = new JCheckBox();
|
||||
JRadioButton smallRadioButton = new JRadioButton();
|
||||
JLabel miniLabel = new JLabel();
|
||||
JCheckBox miniCheckBox = new JCheckBox();
|
||||
JRadioButton miniRadioButton = new JRadioButton();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new MigLayout(
|
||||
@@ -238,6 +254,13 @@ class FlatThemePreviewSwitches
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]unrel" +
|
||||
"[]para" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[]"));
|
||||
|
||||
//======== panel1 ========
|
||||
@@ -585,6 +608,91 @@ class FlatThemePreviewSwitches
|
||||
radioButton2.setSelected(true);
|
||||
add(radioButton2, "cell 2 16");
|
||||
|
||||
//---- label39 ----
|
||||
label39.setText("Sizes");
|
||||
label39.putClientProperty(FlatClientProperties.STYLE_CLASS, "h3");
|
||||
add(label39, "cell 0 17 3 1");
|
||||
|
||||
//---- label5 ----
|
||||
label5.setText("JCheckBox");
|
||||
add(label5, "cell 1 18 3 1,alignx left,growx 0");
|
||||
|
||||
//---- label6 ----
|
||||
label6.setText("JRadioButton");
|
||||
add(label6, "cell 4 18 3 1,alignx left,growx 0");
|
||||
|
||||
//---- largeLabel ----
|
||||
largeLabel.setText("large");
|
||||
largeLabel.putClientProperty(FlatClientProperties.STYLE_CLASS, "large");
|
||||
add(largeLabel, "cell 0 19");
|
||||
|
||||
//---- largeCheckBox ----
|
||||
largeCheckBox.setText("Text");
|
||||
largeCheckBox.putClientProperty(FlatClientProperties.STYLE_CLASS, "large");
|
||||
add(largeCheckBox, "cell 1 19 3 1,alignx left,growx 0");
|
||||
|
||||
//---- largeRadioButton ----
|
||||
largeRadioButton.setText("Text");
|
||||
largeRadioButton.putClientProperty(FlatClientProperties.STYLE_CLASS, "large");
|
||||
add(largeRadioButton, "cell 4 19 3 1,alignx left,growx 0");
|
||||
|
||||
//---- defaultLabel ----
|
||||
defaultLabel.setText("default");
|
||||
add(defaultLabel, "cell 0 20");
|
||||
|
||||
//---- defaultCheckBox ----
|
||||
defaultCheckBox.setText("Text");
|
||||
add(defaultCheckBox, "cell 1 20 3 1,alignx left,growx 0");
|
||||
|
||||
//---- defaultRadioButton ----
|
||||
defaultRadioButton.setText("Text");
|
||||
add(defaultRadioButton, "cell 4 20 3 1,alignx left,growx 0");
|
||||
|
||||
//---- mediumLabel ----
|
||||
mediumLabel.setText("medium");
|
||||
mediumLabel.putClientProperty(FlatClientProperties.STYLE_CLASS, "medium");
|
||||
add(mediumLabel, "cell 0 21");
|
||||
|
||||
//---- mediumCheckBox ----
|
||||
mediumCheckBox.setText("Text");
|
||||
mediumCheckBox.putClientProperty(FlatClientProperties.STYLE_CLASS, "medium");
|
||||
add(mediumCheckBox, "cell 1 21 3 1,alignx left,growx 0");
|
||||
|
||||
//---- mediumRadioButton ----
|
||||
mediumRadioButton.setText("Text");
|
||||
mediumRadioButton.putClientProperty(FlatClientProperties.STYLE_CLASS, "medium");
|
||||
add(mediumRadioButton, "cell 4 21 3 1,alignx left,growx 0");
|
||||
|
||||
//---- smallLabel ----
|
||||
smallLabel.setText("small");
|
||||
smallLabel.putClientProperty(FlatClientProperties.STYLE_CLASS, "small");
|
||||
add(smallLabel, "cell 0 22");
|
||||
|
||||
//---- smallCheckBox ----
|
||||
smallCheckBox.setText("Text");
|
||||
smallCheckBox.putClientProperty(FlatClientProperties.STYLE_CLASS, "small");
|
||||
add(smallCheckBox, "cell 1 22 3 1,alignx left,growx 0");
|
||||
|
||||
//---- smallRadioButton ----
|
||||
smallRadioButton.setText("Text");
|
||||
smallRadioButton.putClientProperty(FlatClientProperties.STYLE_CLASS, "small");
|
||||
add(smallRadioButton, "cell 4 22 3 1,alignx left,growx 0");
|
||||
|
||||
//---- miniLabel ----
|
||||
miniLabel.setText("mini");
|
||||
miniLabel.putClientProperty(FlatClientProperties.STYLE_CLASS, "mini");
|
||||
add(miniLabel, "cell 0 23");
|
||||
|
||||
//---- miniCheckBox ----
|
||||
miniCheckBox.setText("Text");
|
||||
miniCheckBox.putClientProperty(FlatClientProperties.STYLE_CLASS, "mini");
|
||||
add(miniCheckBox, "cell 1 23 3 1,alignx left,growx 0");
|
||||
|
||||
//---- miniRadioButton ----
|
||||
miniRadioButton.setText("Text");
|
||||
miniRadioButton.putClientProperty(FlatClientProperties.STYLE_CLASS, "mini");
|
||||
add(miniRadioButton, "cell 4 23 3 1,alignx left,growx 0");
|
||||
|
||||
//---- buttonGroup1 ----
|
||||
ButtonGroup buttonGroup1 = new ButtonGroup();
|
||||
buttonGroup1.add(zoom1xButton);
|
||||
@@ -797,31 +905,8 @@ class FlatThemePreviewSwitches
|
||||
extends FlatCheckBoxIcon
|
||||
{
|
||||
@Override
|
||||
public void paintIcon( Component c, Graphics g, int x, int y ) {
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
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;
|
||||
public float getScale() {
|
||||
return zoom;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -831,31 +916,8 @@ class FlatThemePreviewSwitches
|
||||
extends FlatRadioButtonIcon
|
||||
{
|
||||
@Override
|
||||
public void paintIcon( Component c, Graphics g, int x, int y ) {
|
||||
Graphics2D g2 = (Graphics2D) g.create();
|
||||
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;
|
||||
public float getScale() {
|
||||
return zoom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.5.0.382" Java: "16" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "8.3" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -9,7 +9,7 @@ new FormModel {
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "insets dialog,hidemode 3"
|
||||
"$columnConstraints": "[fill][sizegroup 1,center][sizegroup 1,center][sizegroup 1,center]para[sizegroup 2,center][sizegroup 2,center][sizegroup 2,center]0[grow,fill]"
|
||||
"$rowConstraints": "[]para[][]3[][][][][]unrel[]para[][]3[][][][][]unrel[]"
|
||||
"$rowConstraints": "[]para[][]3[][][][][]unrel[]para[][]3[][][][][]unrel[]para[][][][][][][]"
|
||||
} ) {
|
||||
name: "this"
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
@@ -521,19 +521,140 @@ new FormModel {
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 16"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label39"
|
||||
"text": "Sizes"
|
||||
"$client.FlatLaf.styleClass": "h3"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 17 3 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label5"
|
||||
"text": "JCheckBox"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 18 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "label6"
|
||||
"text": "JRadioButton"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 18 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "largeLabel"
|
||||
"text": "large"
|
||||
"$client.FlatLaf.styleClass": "large"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 19"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "largeCheckBox"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "large"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 19 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "largeRadioButton"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "large"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 19 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "defaultLabel"
|
||||
"text": "default"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 20"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "defaultCheckBox"
|
||||
"text": "Text"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 20 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "defaultRadioButton"
|
||||
"text": "Text"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 20 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "mediumLabel"
|
||||
"text": "medium"
|
||||
"$client.FlatLaf.styleClass": "medium"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 21"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "mediumCheckBox"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "medium"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 21 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "mediumRadioButton"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "medium"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 21 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "smallLabel"
|
||||
"text": "small"
|
||||
"$client.FlatLaf.styleClass": "small"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 22"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "smallCheckBox"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "small"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 22 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "smallRadioButton"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "small"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 22 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "miniLabel"
|
||||
"text": "mini"
|
||||
"$client.FlatLaf.styleClass": "mini"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 23"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "miniCheckBox"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "mini"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 23 3 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JRadioButton" ) {
|
||||
name: "miniRadioButton"
|
||||
"text": "Text"
|
||||
"$client.FlatLaf.styleClass": "mini"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 4 23 3 1,alignx left,growx 0"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 325, 515 )
|
||||
"size": new java.awt.Dimension( 325, 685 )
|
||||
} )
|
||||
add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
|
||||
name: "buttonGroup1"
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 580 )
|
||||
"location": new java.awt.Point( 0, 735 )
|
||||
} )
|
||||
add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
|
||||
name: "buttonGroup2"
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 634 )
|
||||
"location": new java.awt.Point( 0, 790 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1319,6 +1319,14 @@ ViewportUI
|
||||
[style].small
|
||||
[style]Button.clearButton
|
||||
[style]Button.inTextField
|
||||
[style]CheckBox.large
|
||||
[style]CheckBox.medium
|
||||
[style]CheckBox.mini
|
||||
[style]CheckBox.small
|
||||
[style]RadioButton.large
|
||||
[style]RadioButton.medium
|
||||
[style]RadioButton.mini
|
||||
[style]RadioButton.small
|
||||
[style]ToggleButton.inTextField
|
||||
[style]ToolBar.inTextField
|
||||
[style]ToolBarSeparator.inTextField
|
||||
|
||||
Reference in New Issue
Block a user