mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-17 00:37:39 -06:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27f9614633 | ||
|
|
2211cc5596 | ||
|
|
46f0393648 | ||
|
|
b4c1a97687 | ||
|
|
adcef385b0 | ||
|
|
48e38b2855 | ||
|
|
2cc8327a08 | ||
|
|
404e80082c | ||
|
|
3fbc21347a | ||
|
|
d76f0e2241 | ||
|
|
e5fcc59805 | ||
|
|
de82dac873 | ||
|
|
a14ef72177 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,6 +1,21 @@
|
|||||||
FlatLaf Change Log
|
FlatLaf Change Log
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
## 0.21
|
||||||
|
|
||||||
|
- ScrollBar: Show decrease/increase arrow buttons if client property
|
||||||
|
"JScrollBar.showButtons" is set to `true` on `JScrollPane` or `JScrollBar`.
|
||||||
|
(issue #25)
|
||||||
|
- `FlatLaf.isNativeLookAndFeel()` now returns `false`.
|
||||||
|
- Button: Optionally support gradient borders, gradient backgrounds and shadows
|
||||||
|
for improved compatibility with IntelliJ platform themes (e.g. for Vuesion,
|
||||||
|
Spacegray and Material Design Dark themes).
|
||||||
|
- Button: Fixed help button styling in IntelliJ platform themes.
|
||||||
|
- ScrollPane: Paint disabled border if view component (e.g. JTextPane) is
|
||||||
|
disabled.
|
||||||
|
- Fixed Swing system colors in dark themes.
|
||||||
|
|
||||||
|
|
||||||
## 0.20
|
## 0.20
|
||||||
|
|
||||||
- Support using IntelliJ platform themes (.theme.json files).
|
- Support using IntelliJ platform themes (.theme.json files).
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ build script:
|
|||||||
|
|
||||||
groupId: com.formdev
|
groupId: com.formdev
|
||||||
artifactId: flatlaf
|
artifactId: flatlaf
|
||||||
version: 0.20
|
version: 0.21
|
||||||
|
|
||||||
Otherwise download `flatlaf-<version>.jar` here:
|
Otherwise download `flatlaf-<version>.jar` here:
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
version = "0.20"
|
version = "0.21"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -24,12 +24,52 @@ import javax.swing.JComponent;
|
|||||||
*/
|
*/
|
||||||
public interface FlatClientProperties
|
public interface FlatClientProperties
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Specifies type of a button.
|
||||||
|
* <p>
|
||||||
|
* <strong>Component</strong> {@link javax.swing.JButton}<br>
|
||||||
|
* <strong>Value type</strong> {@link java.lang.String}<br>
|
||||||
|
* <strong>Allowed Values</strong> {@link BUTTON_TYPE_HELP}
|
||||||
|
*/
|
||||||
String BUTTON_TYPE = "JButton.buttonType";
|
String BUTTON_TYPE = "JButton.buttonType";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paint a help button (circle with question mark).
|
||||||
|
*
|
||||||
|
* @see #BUTTON_TYPE
|
||||||
|
*/
|
||||||
String BUTTON_TYPE_HELP = "help";
|
String BUTTON_TYPE_HELP = "help";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies selected state of a checkbox.
|
||||||
|
* <p>
|
||||||
|
* <strong>Component</strong> {@link javax.swing.JCheckBox}<br>
|
||||||
|
* <strong>Value type</strong> {@link java.lang.String}<br>
|
||||||
|
* <strong>Allowed Values</strong> {@link SELECTED_STATE_INDETERMINATE}
|
||||||
|
*/
|
||||||
String SELECTED_STATE = "JButton.selectedState";
|
String SELECTED_STATE = "JButton.selectedState";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paint an indeterminate state on a checkbox.
|
||||||
|
*
|
||||||
|
* @see #SELECTED_STATE
|
||||||
|
*/
|
||||||
String SELECTED_STATE_INDETERMINATE = "indeterminate";
|
String SELECTED_STATE_INDETERMINATE = "indeterminate";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies whether the decrease/increase arrow buttons of a scrollbar are shown.
|
||||||
|
* <p>
|
||||||
|
* <strong>Component</strong> {@link javax.swing.JScrollBar} or {@link javax.swing.JScrollPane}<br>
|
||||||
|
* <strong>Value type</strong> {@link java.lang.Boolean}
|
||||||
|
*/
|
||||||
|
String SCROLL_BAR_SHOW_BUTTONS = "JScrollBar.showButtons";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies whether a full border is painted around a tabbed pane.
|
||||||
|
* <p>
|
||||||
|
* <strong>Component</strong> {@link javax.swing.JTabbedPane}<br>
|
||||||
|
* <strong>Value type</strong> {@link java.lang.Boolean}
|
||||||
|
*/
|
||||||
String TABBED_PANE_HAS_FULL_BORDER = "JTabbedPane.hasFullBorder";
|
String TABBED_PANE_HAS_FULL_BORDER = "JTabbedPane.hasFullBorder";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.awt.event.KeyEvent;
|
|||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import javax.swing.AbstractButton;
|
import javax.swing.AbstractButton;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JTabbedPane;
|
import javax.swing.JTabbedPane;
|
||||||
@@ -62,6 +63,8 @@ public abstract class FlatLaf
|
|||||||
private KeyEventPostProcessor mnemonicListener;
|
private KeyEventPostProcessor mnemonicListener;
|
||||||
private static boolean altKeyPressed;
|
private static boolean altKeyPressed;
|
||||||
|
|
||||||
|
private Consumer<UIDefaults> postInitialization;
|
||||||
|
|
||||||
public static boolean install( LookAndFeel newLookAndFeel ) {
|
public static boolean install( LookAndFeel newLookAndFeel ) {
|
||||||
try {
|
try {
|
||||||
UIManager.setLookAndFeel( newLookAndFeel );
|
UIManager.setLookAndFeel( newLookAndFeel );
|
||||||
@@ -89,7 +92,7 @@ public abstract class FlatLaf
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isNativeLookAndFeel() {
|
public boolean isNativeLookAndFeel() {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -133,6 +136,18 @@ public abstract class FlatLaf
|
|||||||
};
|
};
|
||||||
Toolkit.getDefaultToolkit().addPropertyChangeListener( desktopPropertyName, desktopPropertyListener );
|
Toolkit.getDefaultToolkit().addPropertyChangeListener( desktopPropertyName, desktopPropertyListener );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Following code should be ideally in initialize(), but needs color from UI defaults.
|
||||||
|
// Do not move this code to getDefaults() to avoid side effects in the case that
|
||||||
|
// getDefaults() is directly invoked from 3rd party code. E.g. `new FlatLightLaf().getDefaults()`.
|
||||||
|
postInitialization = defaults -> {
|
||||||
|
// update link color in HTML text
|
||||||
|
Color linkColor = defaults.getColor( "Component.linkColor" );
|
||||||
|
if( linkColor != null ) {
|
||||||
|
new HTMLEditorKit().getStyleSheet().addRule(
|
||||||
|
String.format( "a { color: #%06x; }", linkColor.getRGB() & 0xffffff ) );
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -152,6 +167,7 @@ public abstract class FlatLaf
|
|||||||
|
|
||||||
// restore default link color
|
// restore default link color
|
||||||
new HTMLEditorKit().getStyleSheet().addRule( "a { color: blue; }" );
|
new HTMLEditorKit().getStyleSheet().addRule( "a { color: blue; }" );
|
||||||
|
postInitialization = null;
|
||||||
|
|
||||||
if( base != null )
|
if( base != null )
|
||||||
base.uninitialize();
|
base.uninitialize();
|
||||||
@@ -221,11 +237,9 @@ public abstract class FlatLaf
|
|||||||
if( useScreenMenuBar )
|
if( useScreenMenuBar )
|
||||||
defaults.put( "MenuBarUI", aquaMenuBarUI );
|
defaults.put( "MenuBarUI", aquaMenuBarUI );
|
||||||
|
|
||||||
// update link color in HTML text
|
if( postInitialization != null ) {
|
||||||
Color linkColor = defaults.getColor( "Component.linkColor" );
|
postInitialization.accept( defaults );
|
||||||
if( linkColor != null ) {
|
postInitialization = null;
|
||||||
new HTMLEditorKit().getStyleSheet().addRule(
|
|
||||||
String.format( "a { color: #%06x; }", linkColor.getRGB() & 0xffffff ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaults;
|
return defaults;
|
||||||
|
|||||||
@@ -128,6 +128,10 @@ public class IntelliJTheme
|
|||||||
|
|
||||||
defaults.put( "Component.isIntelliJTheme", true );
|
defaults.put( "Component.isIntelliJTheme", true );
|
||||||
|
|
||||||
|
// enable button shadows
|
||||||
|
defaults.put( "Button.paintShadow", true );
|
||||||
|
defaults.put( "Button.shadowWidth", dark ? 2 : 1 );
|
||||||
|
|
||||||
loadNamedColors( defaults );
|
loadNamedColors( defaults );
|
||||||
|
|
||||||
// convert Json "ui" structure to UI defaults
|
// convert Json "ui" structure to UI defaults
|
||||||
@@ -139,6 +143,20 @@ public class IntelliJTheme
|
|||||||
applyColorPalette( defaults );
|
applyColorPalette( defaults );
|
||||||
applyCheckBoxColors( defaults );
|
applyCheckBoxColors( defaults );
|
||||||
|
|
||||||
|
// IDEA uses a SVG icon for the help button, but paints the background with Button.startBackground and Button.endBackground
|
||||||
|
Object helpButtonBackground = defaults.get( "Button.startBackground" );
|
||||||
|
Object helpButtonBorderColor = defaults.get( "Button.startBorderColor" );
|
||||||
|
if( helpButtonBackground == null )
|
||||||
|
helpButtonBackground = defaults.get( "Button.background" );
|
||||||
|
if( helpButtonBorderColor == null )
|
||||||
|
helpButtonBorderColor = defaults.get( "Button.borderColor" );
|
||||||
|
defaults.put( "HelpButton.background", helpButtonBackground );
|
||||||
|
defaults.put( "HelpButton.borderColor", helpButtonBorderColor );
|
||||||
|
defaults.put( "HelpButton.disabledBackground", defaults.get( "Panel.background" ) );
|
||||||
|
defaults.put( "HelpButton.disabledBorderColor", defaults.get( "Button.disabledBorderColor" ) );
|
||||||
|
defaults.put( "HelpButton.focusedBorderColor", defaults.get( "Button.focusedBorderColor" ) );
|
||||||
|
defaults.put( "HelpButton.focusedBackground", defaults.get( "Button.focusedBackground" ) );
|
||||||
|
|
||||||
// IDEA uses TextField.background for editable ComboBox and Spinner
|
// IDEA uses TextField.background for editable ComboBox and Spinner
|
||||||
defaults.put( "ComboBox.editableBackground", defaults.get( "TextField.background" ) );
|
defaults.put( "ComboBox.editableBackground", defaults.get( "TextField.background" ) );
|
||||||
defaults.put( "Spinner.background", defaults.get( "TextField.background" ) );
|
defaults.put( "Spinner.background", defaults.get( "TextField.background" ) );
|
||||||
@@ -212,7 +230,9 @@ public class IntelliJTheme
|
|||||||
if( uiValue == null ) {
|
if( uiValue == null ) {
|
||||||
// fix errors (missing '#' for colors)
|
// fix errors (missing '#' for colors)
|
||||||
if( !valueStr.startsWith( "#" ) && (key.endsWith( "ground" ) || key.endsWith( "Color" )) )
|
if( !valueStr.startsWith( "#" ) && (key.endsWith( "ground" ) || key.endsWith( "Color" )) )
|
||||||
valueStr = "#" + valueStr;
|
valueStr = fixColorIfValid( "#" + valueStr, valueStr );
|
||||||
|
else if( valueStr.startsWith( "##" ) )
|
||||||
|
valueStr = fixColorIfValid( valueStr.substring( 1 ), valueStr );
|
||||||
else if( key.endsWith( ".border" ) || key.endsWith( "Border" ) ) {
|
else if( key.endsWith( ".border" ) || key.endsWith( "Border" ) ) {
|
||||||
List<String> parts = StringUtils.split( valueStr, ',' );
|
List<String> parts = StringUtils.split( valueStr, ',' );
|
||||||
if( parts.size() == 5 && !parts.get( 4 ).startsWith( "#" ) ) {
|
if( parts.size() == 5 && !parts.get( 4 ).startsWith( "#" ) ) {
|
||||||
@@ -259,6 +279,17 @@ public class IntelliJTheme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String fixColorIfValid( String newColorStr, String colorStr ) {
|
||||||
|
try {
|
||||||
|
// check whether it is valid
|
||||||
|
UIDefaultsLoader.parseColorRGBA( newColorStr );
|
||||||
|
|
||||||
|
return newColorStr;
|
||||||
|
} catch( IllegalArgumentException ex ) {
|
||||||
|
return colorStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void applyColorPalette( UIDefaults defaults ) {
|
private void applyColorPalette( UIDefaults defaults ) {
|
||||||
if( icons == null )
|
if( icons == null )
|
||||||
return;
|
return;
|
||||||
@@ -380,17 +411,6 @@ public class IntelliJTheme
|
|||||||
private static Set<String> noWildcardReplace = new HashSet<>();
|
private static Set<String> noWildcardReplace = new HashSet<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Button
|
|
||||||
// IDEA buttons support gradient for background and border, but FlatLaf does not
|
|
||||||
uiKeyMapping.put( "Button.startBackground", "Button.background" );
|
|
||||||
uiKeyMapping.put( "Button.startBorderColor", "Button.borderColor" );
|
|
||||||
uiKeyMapping.put( "Button.default.startBackground", "Button.default.background" );
|
|
||||||
uiKeyMapping.put( "Button.default.startBorderColor", "Button.default.borderColor" );
|
|
||||||
uiKeyMapping.put( "Button.endBackground", "" ); // ignore
|
|
||||||
uiKeyMapping.put( "Button.endBorderColor", "" ); // ignore
|
|
||||||
uiKeyMapping.put( "Button.default.endBackground", "" ); // ignore
|
|
||||||
uiKeyMapping.put( "Button.default.endBorderColor", "" ); // ignore
|
|
||||||
|
|
||||||
// ComboBox
|
// ComboBox
|
||||||
uiKeyMapping.put( "ComboBox.background", "" ); // ignore
|
uiKeyMapping.put( "ComboBox.background", "" ); // ignore
|
||||||
uiKeyMapping.put( "ComboBox.nonEditableBackground", "ComboBox.background" );
|
uiKeyMapping.put( "ComboBox.nonEditableBackground", "ComboBox.background" );
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import java.awt.Insets;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@@ -77,6 +78,8 @@ class UIDefaultsLoader
|
|||||||
|
|
||||||
static void loadDefaultsFromProperties( List<Class<?>> lafClasses, UIDefaults defaults ) {
|
static void loadDefaultsFromProperties( List<Class<?>> lafClasses, UIDefaults defaults ) {
|
||||||
try {
|
try {
|
||||||
|
List<ClassLoader> addonClassLoaders = new ArrayList<>();
|
||||||
|
|
||||||
// load properties files
|
// load properties files
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
ServiceLoader<FlatDefaultsAddon> addonLoader = ServiceLoader.load( FlatDefaultsAddon.class );
|
ServiceLoader<FlatDefaultsAddon> addonLoader = ServiceLoader.load( FlatDefaultsAddon.class );
|
||||||
@@ -94,6 +97,10 @@ class UIDefaultsLoader
|
|||||||
if( in != null )
|
if( in != null )
|
||||||
properties.load( in );
|
properties.load( in );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClassLoader addonClassLoader = addon.getClass().getClassLoader();
|
||||||
|
if( !addonClassLoaders.contains( addonClassLoader ) )
|
||||||
|
addonClassLoaders.add( addonClassLoader );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +138,7 @@ class UIDefaultsLoader
|
|||||||
|
|
||||||
String value = resolveValue( properties, (String) e.getValue() );
|
String value = resolveValue( properties, (String) e.getValue() );
|
||||||
try {
|
try {
|
||||||
globals.put( key.substring( GLOBAL_PREFIX.length() ), parseValue( key, value, resolver ) );
|
globals.put( key.substring( GLOBAL_PREFIX.length() ), parseValue( key, value, resolver, addonClassLoaders ) );
|
||||||
} catch( RuntimeException ex ) {
|
} catch( RuntimeException ex ) {
|
||||||
logParseError( key, value, ex );
|
logParseError( key, value, ex );
|
||||||
}
|
}
|
||||||
@@ -156,7 +163,7 @@ class UIDefaultsLoader
|
|||||||
|
|
||||||
String value = resolveValue( properties, (String) e.getValue() );
|
String value = resolveValue( properties, (String) e.getValue() );
|
||||||
try {
|
try {
|
||||||
defaults.put( key, parseValue( key, value, resolver ) );
|
defaults.put( key, parseValue( key, value, resolver, addonClassLoaders ) );
|
||||||
} catch( RuntimeException ex ) {
|
} catch( RuntimeException ex ) {
|
||||||
logParseError( key, value, ex );
|
logParseError( key, value, ex );
|
||||||
}
|
}
|
||||||
@@ -195,13 +202,13 @@ class UIDefaultsLoader
|
|||||||
return resolveValue( properties, newValue );
|
return resolveValue( properties, newValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum ValueType { UNKNOWN, STRING, INTEGER, BORDER, ICON, INSETS, SIZE, COLOR, SCALEDNUMBER }
|
private enum ValueType { UNKNOWN, STRING, INTEGER, BORDER, ICON, INSETS, SIZE, COLOR, SCALEDNUMBER, INSTANCE, CLASS }
|
||||||
|
|
||||||
static Object parseValue( String key, String value ) {
|
static Object parseValue( String key, String value ) {
|
||||||
return parseValue( key, value, v -> v );
|
return parseValue( key, value, v -> v, Collections.emptyList() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Object parseValue( String key, String value, Function<String, String> resolver ) {
|
private static Object parseValue( String key, String value, Function<String, String> resolver, List<ClassLoader> addonClassLoaders ) {
|
||||||
value = value.trim();
|
value = value.trim();
|
||||||
|
|
||||||
// null, false, true
|
// null, false, true
|
||||||
@@ -254,12 +261,14 @@ class UIDefaultsLoader
|
|||||||
switch( valueType ) {
|
switch( valueType ) {
|
||||||
case STRING: return value;
|
case STRING: return value;
|
||||||
case INTEGER: return parseInteger( value, true );
|
case INTEGER: return parseInteger( value, true );
|
||||||
case BORDER: return parseBorder( value, resolver );
|
case BORDER: return parseBorder( value, resolver, addonClassLoaders );
|
||||||
case ICON: return parseInstance( value );
|
case ICON: return parseInstance( value, addonClassLoaders );
|
||||||
case INSETS: return parseInsets( value );
|
case INSETS: return parseInsets( value );
|
||||||
case SIZE: return parseSize( value );
|
case SIZE: return parseSize( value );
|
||||||
case COLOR: return parseColorOrFunction( value, true );
|
case COLOR: return parseColorOrFunction( value, true );
|
||||||
case SCALEDNUMBER: return parseScaledNumber( value );
|
case SCALEDNUMBER: return parseScaledNumber( value );
|
||||||
|
case INSTANCE: return parseInstance( value, addonClassLoaders );
|
||||||
|
case CLASS: return parseClass( value, addonClassLoaders );
|
||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
default:
|
default:
|
||||||
// colors
|
// colors
|
||||||
@@ -277,7 +286,7 @@ class UIDefaultsLoader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Object parseBorder( String value, Function<String, String> resolver ) {
|
private static Object parseBorder( String value, Function<String, String> resolver, List<ClassLoader> addonClassLoaders ) {
|
||||||
if( value.indexOf( ',' ) >= 0 ) {
|
if( value.indexOf( ',' ) >= 0 ) {
|
||||||
// top,left,bottom,right[,lineColor]
|
// top,left,bottom,right[,lineColor]
|
||||||
List<String> parts = StringUtils.split( value, ',' );
|
List<String> parts = StringUtils.split( value, ',' );
|
||||||
@@ -292,13 +301,13 @@ class UIDefaultsLoader
|
|||||||
: new FlatEmptyBorder( insets );
|
: new FlatEmptyBorder( insets );
|
||||||
};
|
};
|
||||||
} else
|
} else
|
||||||
return parseInstance( value );
|
return parseInstance( value, addonClassLoaders );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Object parseInstance( String value ) {
|
private static Object parseInstance( String value, List<ClassLoader> addonClassLoaders ) {
|
||||||
return (LazyValue) t -> {
|
return (LazyValue) t -> {
|
||||||
try {
|
try {
|
||||||
return Class.forName( value ).newInstance();
|
return findClass( value, addonClassLoaders ).newInstance();
|
||||||
} catch( InstantiationException | IllegalAccessException | ClassNotFoundException ex ) {
|
} catch( InstantiationException | IllegalAccessException | ClassNotFoundException ex ) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
@@ -306,6 +315,35 @@ class UIDefaultsLoader
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Object parseClass( String value, List<ClassLoader> addonClassLoaders ) {
|
||||||
|
return (LazyValue) t -> {
|
||||||
|
try {
|
||||||
|
return findClass( value, addonClassLoaders );
|
||||||
|
} catch( ClassNotFoundException ex ) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Class<?> findClass( String className, List<ClassLoader> addonClassLoaders )
|
||||||
|
throws ClassNotFoundException
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return Class.forName( className );
|
||||||
|
} catch( ClassNotFoundException ex ) {
|
||||||
|
// search in addons class loaders
|
||||||
|
for( ClassLoader addonClassLoader : addonClassLoaders ) {
|
||||||
|
try {
|
||||||
|
return addonClassLoader.loadClass( className );
|
||||||
|
} catch( ClassNotFoundException ex2 ) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static Insets parseInsets( String value ) {
|
private static Insets parseInsets( String value ) {
|
||||||
List<String> numbers = StringUtils.split( value, ',' );
|
List<String> numbers = StringUtils.split( value, ',' );
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -38,12 +38,15 @@ public class FlatArrowButton
|
|||||||
extends BasicArrowButton
|
extends BasicArrowButton
|
||||||
implements UIResource
|
implements UIResource
|
||||||
{
|
{
|
||||||
|
public static final int DEFAULT_ARROW_WIDTH = 8;
|
||||||
|
|
||||||
private final boolean chevron;
|
private final boolean chevron;
|
||||||
private final Color foreground;
|
private final Color foreground;
|
||||||
private final Color disabledForeground;
|
private final Color disabledForeground;
|
||||||
private final Color hoverForeground;
|
private final Color hoverForeground;
|
||||||
private final Color hoverBackground;
|
private final Color hoverBackground;
|
||||||
|
|
||||||
|
private int arrowWidth = DEFAULT_ARROW_WIDTH;
|
||||||
private int xOffset = 0;
|
private int xOffset = 0;
|
||||||
private int yOffset = 0;
|
private int yOffset = 0;
|
||||||
|
|
||||||
@@ -80,6 +83,14 @@ public class FlatArrowButton
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getArrowWidth() {
|
||||||
|
return arrowWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArrowWidth( int arrowWidth ) {
|
||||||
|
this.arrowWidth = arrowWidth;
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean isHover() {
|
protected boolean isHover() {
|
||||||
return hover;
|
return hover;
|
||||||
}
|
}
|
||||||
@@ -128,8 +139,8 @@ public class FlatArrowButton
|
|||||||
int direction = getDirection();
|
int direction = getDirection();
|
||||||
boolean vert = (direction == NORTH || direction == SOUTH);
|
boolean vert = (direction == NORTH || direction == SOUTH);
|
||||||
|
|
||||||
int w = scale( chevron ? 8 : 9 );
|
int w = scale( arrowWidth + (chevron ? 0 : 1) );
|
||||||
int h = scale( chevron ? 4 : 5 );
|
int h = scale( (arrowWidth / 2) + (chevron ? 0 : 1) );
|
||||||
int rw = vert ? w : h;
|
int rw = vert ? w : h;
|
||||||
int rh = vert ? h : w;
|
int rh = vert ? h : w;
|
||||||
int x = Math.round( (width - rw) / 2f + scale( (float) xOffset ) );
|
int x = Math.round( (width - rw) / 2f + scale( (float) xOffset ) );
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import java.awt.Graphics;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
import java.awt.KeyboardFocusManager;
|
import java.awt.KeyboardFocusManager;
|
||||||
|
import java.awt.Paint;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
@@ -82,7 +83,7 @@ public class FlatBorder
|
|||||||
getLineWidth() + scale( (float) innerFocusWidth ), arc );
|
getLineWidth() + scale( (float) innerFocusWidth ), arc );
|
||||||
}
|
}
|
||||||
|
|
||||||
g2.setColor( getBorderColor( c ) );
|
g2.setPaint( getBorderColor( c ) );
|
||||||
FlatUIUtils.drawRoundRectangle( g2, x, y, width, height, focusWidth, borderWidth, arc );
|
FlatUIUtils.drawRoundRectangle( g2, x, y, width, height, focusWidth, borderWidth, arc );
|
||||||
} finally {
|
} finally {
|
||||||
g2.dispose();
|
g2.dispose();
|
||||||
@@ -93,13 +94,24 @@ public class FlatBorder
|
|||||||
return focusColor;
|
return focusColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Color getBorderColor( Component c ) {
|
protected Paint getBorderColor( Component c ) {
|
||||||
boolean enabled = c.isEnabled() && (!(c instanceof JTextComponent) || ((JTextComponent)c).isEditable());
|
return isEnabled( c )
|
||||||
return enabled
|
|
||||||
? (isFocused( c ) ? focusedBorderColor : borderColor)
|
? (isFocused( c ) ? focusedBorderColor : borderColor)
|
||||||
: disabledBorderColor;
|
: disabledBorderColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isEnabled( Component c ) {
|
||||||
|
if( c instanceof JScrollPane ) {
|
||||||
|
// check whether view component is disabled
|
||||||
|
JViewport viewport = ((JScrollPane)c).getViewport();
|
||||||
|
Component view = (viewport != null) ? viewport.getView() : null;
|
||||||
|
if( view != null && !isEnabled( view ) )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.isEnabled() && (!(c instanceof JTextComponent) || ((JTextComponent)c).isEditable());
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean isFocused( Component c ) {
|
protected boolean isFocused( Component c ) {
|
||||||
if( c instanceof JScrollPane ) {
|
if( c instanceof JScrollPane ) {
|
||||||
JViewport viewport = ((JScrollPane)c).getViewport();
|
JViewport viewport = ((JScrollPane)c).getViewport();
|
||||||
|
|||||||
@@ -19,8 +19,10 @@ package com.formdev.flatlaf.ui;
|
|||||||
import static com.formdev.flatlaf.util.UIScale.scale;
|
import static com.formdev.flatlaf.util.UIScale.scale;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
|
import java.awt.GradientPaint;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Insets;
|
import java.awt.Insets;
|
||||||
|
import java.awt.Paint;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.UIResource;
|
import javax.swing.plaf.UIResource;
|
||||||
@@ -29,10 +31,14 @@ import javax.swing.plaf.UIResource;
|
|||||||
* Border for {@link javax.swing.JButton}.
|
* Border for {@link javax.swing.JButton}.
|
||||||
*
|
*
|
||||||
* @uiDefault Button.borderColor Color
|
* @uiDefault Button.borderColor Color
|
||||||
|
* @uiDefault Button.startBorderColor Color optional; if set, a gradient paint is used and Button.borderColor is ignored
|
||||||
|
* @uiDefault Button.endBorderColor Color optional; if set, a gradient paint is used
|
||||||
* @uiDefault Button.disabledBorderColor Color
|
* @uiDefault Button.disabledBorderColor Color
|
||||||
* @uiDefault Button.focusedBorderColor Color
|
* @uiDefault Button.focusedBorderColor Color
|
||||||
* @uiDefault Button.hoverBorderColor Color optional
|
* @uiDefault Button.hoverBorderColor Color optional
|
||||||
* @uiDefault Button.default.borderColor Color
|
* @uiDefault Button.default.borderColor Color
|
||||||
|
* @uiDefault Button.default.startBorderColor Color optional; if set, a gradient paint is used and Button.default.borderColor is ignored
|
||||||
|
* @uiDefault Button.default.endBorderColor Color optional; if set, a gradient paint is used
|
||||||
* @uiDefault Button.default.hoverBorderColor Color optional
|
* @uiDefault Button.default.hoverBorderColor Color optional
|
||||||
* @uiDefault Button.default.focusedBorderColor Color
|
* @uiDefault Button.default.focusedBorderColor Color
|
||||||
* @uiDefault Button.default.focusColor Color
|
* @uiDefault Button.default.focusColor Color
|
||||||
@@ -44,11 +50,13 @@ import javax.swing.plaf.UIResource;
|
|||||||
public class FlatButtonBorder
|
public class FlatButtonBorder
|
||||||
extends FlatBorder
|
extends FlatBorder
|
||||||
{
|
{
|
||||||
protected final Color borderColor = UIManager.getColor( "Button.borderColor" );
|
protected final Color borderColor = FlatUIUtils.getUIColor( "Button.startBorderColor", "Button.borderColor" );
|
||||||
|
protected final Color endBorderColor = UIManager.getColor( "Button.endBorderColor" );
|
||||||
protected final Color disabledBorderColor = UIManager.getColor( "Button.disabledBorderColor" );
|
protected final Color disabledBorderColor = UIManager.getColor( "Button.disabledBorderColor" );
|
||||||
protected final Color focusedBorderColor = UIManager.getColor( "Button.focusedBorderColor" );
|
protected final Color focusedBorderColor = UIManager.getColor( "Button.focusedBorderColor" );
|
||||||
protected final Color hoverBorderColor = UIManager.getColor( "Button.hoverBorderColor" );
|
protected final Color hoverBorderColor = UIManager.getColor( "Button.hoverBorderColor" );
|
||||||
protected final Color defaultBorderColor = UIManager.getColor( "Button.default.borderColor" );
|
protected final Color defaultBorderColor = FlatUIUtils.getUIColor( "Button.default.startBorderColor", "Button.default.borderColor" );
|
||||||
|
protected final Color defaultEndBorderColor = UIManager.getColor( "Button.default.endBorderColor" );
|
||||||
protected final Color defaultHoverBorderColor = UIManager.getColor( "Button.default.hoverBorderColor" );
|
protected final Color defaultHoverBorderColor = UIManager.getColor( "Button.default.hoverBorderColor" );
|
||||||
protected final Color defaultFocusedBorderColor = UIManager.getColor( "Button.default.focusedBorderColor" );
|
protected final Color defaultFocusedBorderColor = UIManager.getColor( "Button.default.focusedBorderColor" );
|
||||||
protected final Color defaultFocusColor = UIManager.getColor( "Button.default.focusColor" );
|
protected final Color defaultFocusColor = UIManager.getColor( "Button.default.focusColor" );
|
||||||
@@ -67,14 +75,22 @@ public class FlatButtonBorder
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Color getBorderColor( Component c ) {
|
protected Paint getBorderColor( Component c ) {
|
||||||
boolean def = FlatButtonUI.isDefaultButton( c );
|
boolean def = FlatButtonUI.isDefaultButton( c );
|
||||||
return FlatButtonUI.buttonStateColor( c,
|
Paint color = FlatButtonUI.buttonStateColor( c,
|
||||||
def ? defaultBorderColor : borderColor,
|
def ? defaultBorderColor : borderColor,
|
||||||
disabledBorderColor,
|
disabledBorderColor,
|
||||||
def ? defaultFocusedBorderColor : focusedBorderColor,
|
def ? defaultFocusedBorderColor : focusedBorderColor,
|
||||||
def ? defaultHoverBorderColor : hoverBorderColor,
|
def ? defaultHoverBorderColor : hoverBorderColor,
|
||||||
null );
|
null );
|
||||||
|
|
||||||
|
// change to gradient paint if start/end colors are specified
|
||||||
|
Color startBg = def ? defaultBorderColor : borderColor;
|
||||||
|
Color endBg = def ? defaultEndBorderColor : endBorderColor;
|
||||||
|
if( color == startBg && endBg != null && !startBg.equals( endBg ) )
|
||||||
|
color = new GradientPaint( 0, 0, startBg, 0, c.getHeight(), endBg );
|
||||||
|
|
||||||
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,9 +23,11 @@ import java.awt.Component;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.FontMetrics;
|
import java.awt.FontMetrics;
|
||||||
|
import java.awt.GradientPaint;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.geom.RoundRectangle2D;
|
||||||
import javax.swing.AbstractButton;
|
import javax.swing.AbstractButton;
|
||||||
import javax.swing.ButtonModel;
|
import javax.swing.ButtonModel;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
@@ -39,6 +41,7 @@ import javax.swing.plaf.ComponentUI;
|
|||||||
import javax.swing.plaf.UIResource;
|
import javax.swing.plaf.UIResource;
|
||||||
import javax.swing.plaf.basic.BasicButtonUI;
|
import javax.swing.plaf.basic.BasicButtonUI;
|
||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the Flat LaF UI delegate for {@link javax.swing.JButton}.
|
* Provides the Flat LaF UI delegate for {@link javax.swing.JButton}.
|
||||||
@@ -58,16 +61,24 @@ import com.formdev.flatlaf.FlatLaf;
|
|||||||
* @uiDefault Button.arc int
|
* @uiDefault Button.arc int
|
||||||
* @uiDefault Button.minimumWidth int
|
* @uiDefault Button.minimumWidth int
|
||||||
* @uiDefault Button.iconTextGap int
|
* @uiDefault Button.iconTextGap int
|
||||||
|
* @uiDefault Button.startBackground Color optional; if set, a gradient paint is used and Button.background is ignored
|
||||||
|
* @uiDefault Button.endBackground Color optional; if set, a gradient paint is used
|
||||||
* @uiDefault Button.focusedBackground Color optional
|
* @uiDefault Button.focusedBackground Color optional
|
||||||
* @uiDefault Button.hoverBackground Color optional
|
* @uiDefault Button.hoverBackground Color optional
|
||||||
* @uiDefault Button.pressedBackground Color optional
|
* @uiDefault Button.pressedBackground Color optional
|
||||||
* @uiDefault Button.disabledText Color
|
* @uiDefault Button.disabledText Color
|
||||||
* @uiDefault Button.default.background Color
|
* @uiDefault Button.default.background Color
|
||||||
|
* @uiDefault Button.default.startBackground Color optional; if set, a gradient paint is used and Button.default.background is ignored
|
||||||
|
* @uiDefault Button.default.endBackground Color optional; if set, a gradient paint is used
|
||||||
* @uiDefault Button.default.foreground Color
|
* @uiDefault Button.default.foreground Color
|
||||||
* @uiDefault Button.default.focusedBackground Color optional
|
* @uiDefault Button.default.focusedBackground Color optional
|
||||||
* @uiDefault Button.default.hoverBackground Color optional
|
* @uiDefault Button.default.hoverBackground Color optional
|
||||||
* @uiDefault Button.default.pressedBackground Color optional
|
* @uiDefault Button.default.pressedBackground Color optional
|
||||||
* @uiDefault Button.default.boldText boolean
|
* @uiDefault Button.default.boldText boolean
|
||||||
|
* @uiDefault Button.paintShadow boolean default is false
|
||||||
|
* @uiDefault Button.shadowWidth int default is 2
|
||||||
|
* @uiDefault Button.shadowColor Color optional
|
||||||
|
* @uiDefault Button.default.shadowColor Color optional
|
||||||
* @uiDefault Button.toolbar.hoverBackground Color
|
* @uiDefault Button.toolbar.hoverBackground Color
|
||||||
* @uiDefault Button.toolbar.pressedBackground Color
|
* @uiDefault Button.toolbar.pressedBackground Color
|
||||||
*
|
*
|
||||||
@@ -81,18 +92,25 @@ public class FlatButtonUI
|
|||||||
protected int minimumWidth;
|
protected int minimumWidth;
|
||||||
protected int iconTextGap;
|
protected int iconTextGap;
|
||||||
|
|
||||||
|
protected Color startBackground;
|
||||||
|
protected Color endBackground;
|
||||||
protected Color focusedBackground;
|
protected Color focusedBackground;
|
||||||
protected Color hoverBackground;
|
protected Color hoverBackground;
|
||||||
protected Color pressedBackground;
|
protected Color pressedBackground;
|
||||||
protected Color disabledText;
|
protected Color disabledText;
|
||||||
|
|
||||||
protected Color defaultBackground;
|
protected Color defaultBackground;
|
||||||
|
protected Color defaultEndBackground;
|
||||||
protected Color defaultForeground;
|
protected Color defaultForeground;
|
||||||
protected Color defaultFocusedBackground;
|
protected Color defaultFocusedBackground;
|
||||||
protected Color defaultHoverBackground;
|
protected Color defaultHoverBackground;
|
||||||
protected Color defaultPressedBackground;
|
protected Color defaultPressedBackground;
|
||||||
protected boolean defaultBoldText;
|
protected boolean defaultBoldText;
|
||||||
|
|
||||||
|
protected int shadowWidth;
|
||||||
|
protected Color shadowColor;
|
||||||
|
protected Color defaultShadowColor;
|
||||||
|
|
||||||
protected Color toolbarHoverBackground;
|
protected Color toolbarHoverBackground;
|
||||||
protected Color toolbarPressedBackground;
|
protected Color toolbarPressedBackground;
|
||||||
|
|
||||||
@@ -120,12 +138,21 @@ public class FlatButtonUI
|
|||||||
minimumWidth = UIManager.getInt( prefix + "minimumWidth" );
|
minimumWidth = UIManager.getInt( prefix + "minimumWidth" );
|
||||||
iconTextGap = FlatUIUtils.getUIInt( prefix + "iconTextGap", 4 );
|
iconTextGap = FlatUIUtils.getUIInt( prefix + "iconTextGap", 4 );
|
||||||
|
|
||||||
|
startBackground = UIManager.getColor( prefix + "startBackground" );
|
||||||
|
endBackground = UIManager.getColor( prefix + "endBackground" );
|
||||||
focusedBackground = UIManager.getColor( prefix + "focusedBackground" );
|
focusedBackground = UIManager.getColor( prefix + "focusedBackground" );
|
||||||
hoverBackground = UIManager.getColor( prefix + "hoverBackground" );
|
hoverBackground = UIManager.getColor( prefix + "hoverBackground" );
|
||||||
pressedBackground = UIManager.getColor( prefix + "pressedBackground" );
|
pressedBackground = UIManager.getColor( prefix + "pressedBackground" );
|
||||||
disabledText = UIManager.getColor( prefix + "disabledText" );
|
disabledText = UIManager.getColor( prefix + "disabledText" );
|
||||||
|
|
||||||
defaultBackground = UIManager.getColor( "Button.default.background" );
|
if( UIManager.getBoolean( "Button.paintShadow" ) ) {
|
||||||
|
shadowWidth = FlatUIUtils.getUIInt( "Button.shadowWidth", 2 );
|
||||||
|
shadowColor = UIManager.getColor( "Button.shadowColor" );
|
||||||
|
defaultShadowColor = UIManager.getColor( "Button.default.shadowColor" );
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultBackground = FlatUIUtils.getUIColor( "Button.default.startBackground", "Button.default.background" );
|
||||||
|
defaultEndBackground = UIManager.getColor( "Button.default.endBackground" );
|
||||||
defaultForeground = UIManager.getColor( "Button.default.foreground" );
|
defaultForeground = UIManager.getColor( "Button.default.foreground" );
|
||||||
defaultFocusedBackground = UIManager.getColor( "Button.default.focusedBackground" );
|
defaultFocusedBackground = UIManager.getColor( "Button.default.focusedBackground" );
|
||||||
defaultHoverBackground = UIManager.getColor( "Button.default.hoverBackground" );
|
defaultHoverBackground = UIManager.getColor( "Button.default.hoverBackground" );
|
||||||
@@ -140,6 +167,12 @@ public class FlatButtonUI
|
|||||||
defaults_initialized = true;
|
defaults_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( startBackground != null ) {
|
||||||
|
Color bg = b.getBackground();
|
||||||
|
if( bg == null || bg instanceof UIResource )
|
||||||
|
b.setBackground( startBackground );
|
||||||
|
}
|
||||||
|
|
||||||
LookAndFeel.installProperty( b, "opaque", false );
|
LookAndFeel.installProperty( b, "opaque", false );
|
||||||
LookAndFeel.installProperty( b, "iconTextGap", scale( iconTextGap ) );
|
LookAndFeel.installProperty( b, "iconTextGap", scale( iconTextGap ) );
|
||||||
|
|
||||||
@@ -201,8 +234,23 @@ public class FlatButtonUI
|
|||||||
Border border = c.getBorder();
|
Border border = c.getBorder();
|
||||||
float focusWidth = (border instanceof FlatBorder) ? scale( (float) this.focusWidth ) : 0;
|
float focusWidth = (border instanceof FlatBorder) ? scale( (float) this.focusWidth ) : 0;
|
||||||
float arc = (border instanceof FlatButtonBorder || isToolBarButton( c )) ? scale( (float) this.arc ) : 0;
|
float arc = (border instanceof FlatButtonBorder || isToolBarButton( c )) ? scale( (float) this.arc ) : 0;
|
||||||
|
boolean def = isDefaultButton( c );
|
||||||
|
|
||||||
FlatUIUtils.setColor( g2, background, isDefaultButton(c) ? defaultBackground : c.getBackground() );
|
// paint shadow
|
||||||
|
Color shadowColor = def ? defaultShadowColor : this.shadowColor;
|
||||||
|
if( shadowColor != null && shadowWidth > 0 && focusWidth > 0 && !c.hasFocus() && c.isEnabled() ) {
|
||||||
|
g2.setColor( shadowColor );
|
||||||
|
g2.fill( new RoundRectangle2D.Float( focusWidth, focusWidth + UIScale.scale( (float) shadowWidth ),
|
||||||
|
c.getWidth() - focusWidth * 2, c.getHeight() - focusWidth * 2, arc, arc ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// paint background
|
||||||
|
Color startBg = def ? defaultBackground : startBackground;
|
||||||
|
Color endBg = def ? defaultEndBackground : endBackground;
|
||||||
|
if( background == startBg && endBg != null && !startBg.equals( endBg ) )
|
||||||
|
g2.setPaint( new GradientPaint( 0, 0, startBg, 0, c.getHeight(), endBg ) );
|
||||||
|
else
|
||||||
|
FlatUIUtils.setColor( g2, background, def ? defaultBackground : c.getBackground() );
|
||||||
FlatUIUtils.fillRoundRectangle( g2, 0, 0, c.getWidth(), c.getHeight(), focusWidth, arc );
|
FlatUIUtils.fillRoundRectangle( g2, 0, 0, c.getWidth(), c.getHeight(), focusWidth, arc );
|
||||||
} finally {
|
} finally {
|
||||||
g2.dispose();
|
g2.dispose();
|
||||||
|
|||||||
@@ -22,11 +22,16 @@ import java.awt.Graphics;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.beans.PropertyChangeEvent;
|
||||||
|
import java.beans.PropertyChangeListener;
|
||||||
|
import java.util.Objects;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.basic.BasicScrollBarUI;
|
import javax.swing.plaf.basic.BasicScrollBarUI;
|
||||||
|
import com.formdev.flatlaf.FlatClientProperties;
|
||||||
import com.formdev.flatlaf.util.UIScale;
|
import com.formdev.flatlaf.util.UIScale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,13 +43,20 @@ import com.formdev.flatlaf.util.UIScale;
|
|||||||
* @uiDefault ScrollBar.foreground Color
|
* @uiDefault ScrollBar.foreground Color
|
||||||
* @uiDefault ScrollBar.track Color
|
* @uiDefault ScrollBar.track Color
|
||||||
* @uiDefault ScrollBar.thumb Color
|
* @uiDefault ScrollBar.thumb Color
|
||||||
* @uiDefault ScrollBar.hoverTrackColor Color
|
|
||||||
* @uiDefault ScrollBar.hoverThumbColor Color
|
|
||||||
* @uiDefault ScrollBar.width int
|
* @uiDefault ScrollBar.width int
|
||||||
* @uiDefault ScrollBar.minimumThumbSize Dimension
|
* @uiDefault ScrollBar.minimumThumbSize Dimension
|
||||||
* @uiDefault ScrollBar.maximumThumbSize Dimension
|
* @uiDefault ScrollBar.maximumThumbSize Dimension
|
||||||
* @uiDefault ScrollBar.allowsAbsolutePositioning boolean
|
* @uiDefault ScrollBar.allowsAbsolutePositioning boolean
|
||||||
*
|
*
|
||||||
|
* <!-- FlatScrollBarUI -->
|
||||||
|
*
|
||||||
|
* @uiDefault ScrollBar.hoverTrackColor Color
|
||||||
|
* @uiDefault ScrollBar.hoverThumbColor Color
|
||||||
|
* @uiDefault Component.arrowType String triangle (default) or chevron
|
||||||
|
* @uiDefault ScrollBar.showButtons boolean
|
||||||
|
* @uiDefault ScrollBar.buttonArrowColor Color
|
||||||
|
* @uiDefault ScrollBar.buttonDisabledArrowColor Color
|
||||||
|
*
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatScrollBarUI
|
public class FlatScrollBarUI
|
||||||
@@ -53,6 +65,11 @@ public class FlatScrollBarUI
|
|||||||
protected Color hoverTrackColor;
|
protected Color hoverTrackColor;
|
||||||
protected Color hoverThumbColor;
|
protected Color hoverThumbColor;
|
||||||
|
|
||||||
|
protected boolean showButtons;
|
||||||
|
protected String arrowType;
|
||||||
|
protected Color buttonArrowColor;
|
||||||
|
protected Color buttonDisabledArrowColor;
|
||||||
|
|
||||||
private MouseAdapter hoverListener;
|
private MouseAdapter hoverListener;
|
||||||
private boolean hoverTrack;
|
private boolean hoverTrack;
|
||||||
private boolean hoverThumb;
|
private boolean hoverThumb;
|
||||||
@@ -85,6 +102,11 @@ public class FlatScrollBarUI
|
|||||||
|
|
||||||
hoverTrackColor = UIManager.getColor( "ScrollBar.hoverTrackColor" );
|
hoverTrackColor = UIManager.getColor( "ScrollBar.hoverTrackColor" );
|
||||||
hoverThumbColor = UIManager.getColor( "ScrollBar.hoverThumbColor" );
|
hoverThumbColor = UIManager.getColor( "ScrollBar.hoverThumbColor" );
|
||||||
|
|
||||||
|
showButtons = UIManager.getBoolean( "ScrollBar.showButtons" );
|
||||||
|
arrowType = UIManager.getString( "Component.arrowType" );
|
||||||
|
buttonArrowColor = UIManager.getColor( "ScrollBar.buttonArrowColor" );
|
||||||
|
buttonDisabledArrowColor = UIManager.getColor( "ScrollBar.buttonDisabledArrowColor" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -93,6 +115,24 @@ public class FlatScrollBarUI
|
|||||||
|
|
||||||
hoverTrackColor = null;
|
hoverTrackColor = null;
|
||||||
hoverThumbColor = null;
|
hoverThumbColor = null;
|
||||||
|
|
||||||
|
buttonArrowColor = null;
|
||||||
|
buttonDisabledArrowColor = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
|
return new BasicScrollBarUI.PropertyChangeHandler() {
|
||||||
|
@Override
|
||||||
|
public void propertyChange( PropertyChangeEvent e ) {
|
||||||
|
super.propertyChange( e );
|
||||||
|
|
||||||
|
if( FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS.equals( e.getPropertyName() ) ) {
|
||||||
|
scrollbar.revalidate();
|
||||||
|
scrollbar.repaint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -102,24 +142,50 @@ public class FlatScrollBarUI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JButton createDecreaseButton( int orientation ) {
|
protected JButton createDecreaseButton( int orientation ) {
|
||||||
return createInvisibleButton();
|
return createArrowButton( orientation );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected JButton createIncreaseButton( int orientation ) {
|
protected JButton createIncreaseButton( int orientation ) {
|
||||||
return createInvisibleButton();
|
return createArrowButton( orientation );
|
||||||
}
|
}
|
||||||
|
|
||||||
private JButton createInvisibleButton() {
|
private JButton createArrowButton( int orientation ) {
|
||||||
JButton button = new JButton();
|
FlatArrowButton button = new FlatArrowButton( orientation,
|
||||||
button.setMinimumSize( new Dimension() );
|
arrowType, buttonArrowColor, buttonDisabledArrowColor, null, hoverTrackColor )
|
||||||
button.setMaximumSize( new Dimension() );
|
{
|
||||||
button.setPreferredSize( new Dimension() );
|
@Override
|
||||||
|
public Dimension getPreferredSize() {
|
||||||
|
if( isShowButtons() ) {
|
||||||
|
int w = UIScale.scale( scrollBarWidth );
|
||||||
|
return new Dimension( w, w );
|
||||||
|
} else
|
||||||
|
return new Dimension();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Dimension getMinimumSize() {
|
||||||
|
return isShowButtons() ? super.getMinimumSize() : new Dimension();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Dimension getMaximumSize() {
|
||||||
|
return isShowButtons() ? super.getMaximumSize() : new Dimension();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
button.setArrowWidth( FlatArrowButton.DEFAULT_ARROW_WIDTH - 2 );
|
||||||
button.setFocusable( false );
|
button.setFocusable( false );
|
||||||
button.setRequestFocusEnabled( false );
|
button.setRequestFocusEnabled( false );
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isShowButtons() {
|
||||||
|
Object showButtons = scrollbar.getClientProperty( FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS );
|
||||||
|
if( showButtons == null && scrollbar.getParent() instanceof JScrollPane )
|
||||||
|
showButtons = ((JScrollPane)scrollbar.getParent()).getClientProperty( FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS );
|
||||||
|
return (showButtons != null) ? Objects.equals( showButtons, true ) : this.showButtons;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void paintDecreaseHighlight( Graphics g ) {
|
protected void paintDecreaseHighlight( Graphics g ) {
|
||||||
// do not paint
|
// do not paint
|
||||||
|
|||||||
@@ -24,13 +24,16 @@ import java.awt.event.ContainerListener;
|
|||||||
import java.awt.event.FocusEvent;
|
import java.awt.event.FocusEvent;
|
||||||
import java.awt.event.FocusListener;
|
import java.awt.event.FocusListener;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
|
import java.beans.PropertyChangeListener;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JScrollBar;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JViewport;
|
import javax.swing.JViewport;
|
||||||
import javax.swing.LookAndFeel;
|
import javax.swing.LookAndFeel;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.basic.BasicScrollPaneUI;
|
import javax.swing.plaf.basic.BasicScrollPaneUI;
|
||||||
|
import com.formdev.flatlaf.FlatClientProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides the Flat LaF UI delegate for {@link javax.swing.JScrollPane}.
|
* Provides the Flat LaF UI delegate for {@link javax.swing.JScrollPane}.
|
||||||
@@ -87,6 +90,29 @@ public class FlatScrollPaneUI
|
|||||||
handler = null;
|
handler = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected PropertyChangeListener createPropertyChangeListener() {
|
||||||
|
return new BasicScrollPaneUI.PropertyChangeHandler() {
|
||||||
|
@Override
|
||||||
|
public void propertyChange( PropertyChangeEvent e ) {
|
||||||
|
super.propertyChange( e );
|
||||||
|
|
||||||
|
if( FlatClientProperties.SCROLL_BAR_SHOW_BUTTONS.equals( e.getPropertyName() ) ) {
|
||||||
|
JScrollBar vsb = scrollpane.getVerticalScrollBar();
|
||||||
|
JScrollBar hsb = scrollpane.getHorizontalScrollBar();
|
||||||
|
if( vsb != null ) {
|
||||||
|
vsb.revalidate();
|
||||||
|
vsb.repaint();
|
||||||
|
}
|
||||||
|
if( hsb != null ) {
|
||||||
|
hsb.revalidate();
|
||||||
|
hsb.repaint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public Handler getHandler() {
|
public Handler getHandler() {
|
||||||
if( handler == null )
|
if( handler == null )
|
||||||
handler = new Handler();
|
handler = new Handler();
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ import javax.swing.plaf.ComponentUI;
|
|||||||
* @uiDefault ToggleButton.arc int
|
* @uiDefault ToggleButton.arc int
|
||||||
* @uiDefault ToggleButton.minimumWidth int
|
* @uiDefault ToggleButton.minimumWidth int
|
||||||
* @uiDefault ToggleButton.iconTextGap int
|
* @uiDefault ToggleButton.iconTextGap int
|
||||||
|
* @uiDefault ToggleButton.startBackground Color optional; if set, a gradient paint is used and ToggleButton.background is ignored
|
||||||
|
* @uiDefault ToggleButton.endBackground Color optional; if set, a gradient paint is used
|
||||||
* @uiDefault ToggleButton.pressedBackground Color
|
* @uiDefault ToggleButton.pressedBackground Color
|
||||||
* @uiDefault ToggleButton.disabledText Color
|
* @uiDefault ToggleButton.disabledText Color
|
||||||
* @uiDefault ToggleButton.toolbar.hoverBackground Color
|
* @uiDefault ToggleButton.toolbar.hoverBackground Color
|
||||||
|
|||||||
@@ -54,14 +54,14 @@
|
|||||||
*.acceleratorSelectionForeground=@selectionForeground
|
*.acceleratorSelectionForeground=@selectionForeground
|
||||||
|
|
||||||
|
|
||||||
#---- system ----
|
#---- system colors ----
|
||||||
|
|
||||||
control=@background
|
activeCaption=#434E60
|
||||||
controlText=@foreground
|
inactiveCaption=#393C3D
|
||||||
infoText=@foreground
|
controlHighlight=#616669
|
||||||
text=@foreground
|
controlLtHighlight=#303234
|
||||||
textText=@foreground
|
controlShadow=#afb3b5
|
||||||
window=@background
|
controlDkShadow=#d7d9da
|
||||||
|
|
||||||
|
|
||||||
#---- Button ----
|
#---- Button ----
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ Button.focusedBackground=null
|
|||||||
Button.default.background=#4A86C7
|
Button.default.background=#4A86C7
|
||||||
Button.default.foreground=#f0f0f0
|
Button.default.foreground=#f0f0f0
|
||||||
Button.default.focusedBackground=null
|
Button.default.focusedBackground=null
|
||||||
Button.default.hoverBackground=#5B91CC
|
|
||||||
Button.default.pressedBackground=#6E9ED2
|
|
||||||
Button.default.borderColor=#3167ad
|
Button.default.borderColor=#3167ad
|
||||||
Button.default.hoverBorderColor=#a8cef6
|
Button.default.hoverBorderColor=#a8cef6
|
||||||
Button.default.focusedBorderColor=#a8cef6
|
Button.default.focusedBorderColor=#a8cef6
|
||||||
|
|||||||
@@ -61,6 +61,30 @@ ViewportUI=com.formdev.flatlaf.ui.FlatViewportUI
|
|||||||
@textComponentMargin=2,6,2,6
|
@textComponentMargin=2,6,2,6
|
||||||
|
|
||||||
|
|
||||||
|
#---- system colors ----
|
||||||
|
|
||||||
|
desktop=@textComponentBackground
|
||||||
|
activeCaptionText=@foreground
|
||||||
|
activeCaptionBorder=@@activeCaption
|
||||||
|
inactiveCaptionText=@foreground
|
||||||
|
inactiveCaptionBorder=@@inactiveCaption
|
||||||
|
window=@background
|
||||||
|
windowBorder=@foreground
|
||||||
|
windowText=@foreground
|
||||||
|
menu=@background
|
||||||
|
menuText=@foreground
|
||||||
|
text=@textComponentBackground
|
||||||
|
textText=@foreground
|
||||||
|
textHighlight=@selectionBackground
|
||||||
|
textHighlightText=@selectionForeground
|
||||||
|
textInactiveText=@disabledText
|
||||||
|
control=@background
|
||||||
|
controlText=@foreground
|
||||||
|
scrollbar=@@ScrollBar.track
|
||||||
|
info=@@ToolTip.background
|
||||||
|
infoText=@foreground
|
||||||
|
|
||||||
|
|
||||||
#---- Button ----
|
#---- Button ----
|
||||||
|
|
||||||
Button.border=com.formdev.flatlaf.ui.FlatButtonBorder
|
Button.border=com.formdev.flatlaf.ui.FlatButtonBorder
|
||||||
@@ -262,6 +286,10 @@ RadioButtonMenuItem.margin=2,2,2,2
|
|||||||
#---- ScrollBar ----
|
#---- ScrollBar ----
|
||||||
|
|
||||||
ScrollBar.width=10
|
ScrollBar.width=10
|
||||||
|
ScrollBar.showButtons=false
|
||||||
|
ScrollBar.squareButtons=false
|
||||||
|
ScrollBar.buttonArrowColor=@@ComboBox.buttonArrowColor
|
||||||
|
ScrollBar.buttonDisabledArrowColor=@@ComboBox.buttonDisabledArrowColor
|
||||||
|
|
||||||
|
|
||||||
#---- ScrollPane ----
|
#---- ScrollPane ----
|
||||||
|
|||||||
@@ -54,14 +54,14 @@
|
|||||||
*.acceleratorSelectionForeground=@selectionForeground
|
*.acceleratorSelectionForeground=@selectionForeground
|
||||||
|
|
||||||
|
|
||||||
#---- system ----
|
#---- system colors ----
|
||||||
|
|
||||||
control=#e0e0e0
|
activeCaption=#99b4d1
|
||||||
controlText=@foreground
|
inactiveCaption=#bfcddb
|
||||||
infoText=@foreground
|
controlHighlight=#e3e3e3
|
||||||
text=@foreground
|
controlLtHighlight=#fff
|
||||||
textText=@foreground
|
controlShadow=#a0a0a0
|
||||||
window=@background
|
controlDkShadow=#696969
|
||||||
|
|
||||||
|
|
||||||
#---- Button ----
|
#---- Button ----
|
||||||
|
|||||||
@@ -19,5 +19,7 @@
|
|||||||
Button.hoverBorderColor=null
|
Button.hoverBorderColor=null
|
||||||
Button.default.hoverBorderColor=null
|
Button.default.hoverBorderColor=null
|
||||||
|
|
||||||
Button.default.hoverBackground=@buttonHoverBackground
|
|
||||||
Button.default.pressedBackground=@buttonPressedBackground
|
#---- HelpButton ----
|
||||||
|
|
||||||
|
HelpButton.hoverBorderColor=null
|
||||||
|
|||||||
@@ -164,8 +164,6 @@ class ControlBar
|
|||||||
if( lafClassName.equals( UIManager.getLookAndFeel().getClass().getName() ) )
|
if( lafClassName.equals( UIManager.getLookAndFeel().getClass().getName() ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FlatLafDemo.prefs.put( FlatLafDemo.KEY_LAF, lafClassName );
|
|
||||||
|
|
||||||
EventQueue.invokeLater( () -> {
|
EventQueue.invokeLater( () -> {
|
||||||
try {
|
try {
|
||||||
// change look and feel
|
// change look and feel
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class DemoFrame
|
|||||||
extends JFrame
|
extends JFrame
|
||||||
{
|
{
|
||||||
DemoFrame() {
|
DemoFrame() {
|
||||||
int tabIndex = FlatLafDemo.prefs.getInt( FlatLafDemo.KEY_TAB, 0 );
|
int tabIndex = DemoPrefs.getState().getInt( FlatLafDemo.KEY_TAB, 0 );
|
||||||
|
|
||||||
initComponents();
|
initComponents();
|
||||||
controlBar.initialize( this, tabbedPane );
|
controlBar.initialize( this, tabbedPane );
|
||||||
@@ -48,7 +48,7 @@ class DemoFrame
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void selectedTabChanged() {
|
private void selectedTabChanged() {
|
||||||
FlatLafDemo.prefs.putInt( FlatLafDemo.KEY_TAB, tabbedPane.getSelectedIndex() );
|
DemoPrefs.getState().putInt( FlatLafDemo.KEY_TAB, tabbedPane.getSelectedIndex() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 FormDev Software GmbH
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.formdev.flatlaf.demo;
|
||||||
|
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.util.prefs.Preferences;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
|
import com.formdev.flatlaf.FlatLightLaf;
|
||||||
|
import com.formdev.flatlaf.IntelliJTheme;
|
||||||
|
import com.formdev.flatlaf.demo.intellijthemes.IJThemesPanel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class DemoPrefs
|
||||||
|
{
|
||||||
|
public static final String KEY_LAF = "laf";
|
||||||
|
public static final String KEY_LAF_INTELLIJ_THEME = "lafIntelliJTheme";
|
||||||
|
|
||||||
|
public static final String RESOURCE_PREFIX = "res:";
|
||||||
|
public static final String FILE_PREFIX = "file:";
|
||||||
|
|
||||||
|
public static final String INTELLIJ_THEME_UI_KEY = "__FlatLaf.demo.intelliJTheme";
|
||||||
|
|
||||||
|
private static Preferences state;
|
||||||
|
|
||||||
|
public static Preferences getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init( String rootPath ) {
|
||||||
|
state = Preferences.userRoot().node( rootPath );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initLaf( String[] args ) {
|
||||||
|
// set look and feel
|
||||||
|
try {
|
||||||
|
if( args.length > 0 )
|
||||||
|
UIManager.setLookAndFeel( args[0] );
|
||||||
|
else {
|
||||||
|
String lafClassName = state.get( KEY_LAF, FlatLightLaf.class.getName() );
|
||||||
|
if( IntelliJTheme.ThemeLaf.class.getName().equals( lafClassName ) ) {
|
||||||
|
String intelliJTheme = state.get( KEY_LAF_INTELLIJ_THEME, "" );
|
||||||
|
if( intelliJTheme.startsWith( RESOURCE_PREFIX ) )
|
||||||
|
IntelliJTheme.install( IJThemesPanel.class.getResourceAsStream( intelliJTheme.substring( RESOURCE_PREFIX.length() ) ) );
|
||||||
|
else if( intelliJTheme.startsWith( FILE_PREFIX ) )
|
||||||
|
FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( intelliJTheme.substring( FILE_PREFIX.length() ) ) ) );
|
||||||
|
else
|
||||||
|
FlatLightLaf.install();
|
||||||
|
|
||||||
|
if( !intelliJTheme.isEmpty() )
|
||||||
|
UIManager.getLookAndFeelDefaults().put( INTELLIJ_THEME_UI_KEY, intelliJTheme );
|
||||||
|
} else
|
||||||
|
UIManager.setLookAndFeel( lafClassName );
|
||||||
|
}
|
||||||
|
} catch( Exception ex ) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
|
||||||
|
// fallback
|
||||||
|
FlatLightLaf.install();
|
||||||
|
}
|
||||||
|
|
||||||
|
// remember active look and feel
|
||||||
|
UIManager.addPropertyChangeListener( e -> {
|
||||||
|
if( "lookAndFeel".equals( e.getPropertyName() ) )
|
||||||
|
state.put( KEY_LAF, UIManager.getLookAndFeel().getClass().getName() );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,10 +16,7 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf.demo;
|
package com.formdev.flatlaf.demo;
|
||||||
|
|
||||||
import java.util.prefs.Preferences;
|
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.UIManager;
|
|
||||||
import com.formdev.flatlaf.FlatLightLaf;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
@@ -27,29 +24,14 @@ import com.formdev.flatlaf.FlatLightLaf;
|
|||||||
public class FlatLafDemo
|
public class FlatLafDemo
|
||||||
{
|
{
|
||||||
static final String PREFS_ROOT_PATH = "/flatlaf-demo";
|
static final String PREFS_ROOT_PATH = "/flatlaf-demo";
|
||||||
static final String KEY_LAF = "laf";
|
|
||||||
static final String KEY_TAB = "tab";
|
static final String KEY_TAB = "tab";
|
||||||
|
|
||||||
static Preferences prefs;
|
|
||||||
|
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
prefs = Preferences.userRoot().node( PREFS_ROOT_PATH );
|
DemoPrefs.init( PREFS_ROOT_PATH );
|
||||||
|
|
||||||
// set look and feel
|
// set look and feel
|
||||||
try {
|
DemoPrefs.initLaf( args );
|
||||||
if( args.length > 0 )
|
|
||||||
UIManager.setLookAndFeel( args[0] );
|
|
||||||
else {
|
|
||||||
String lafClassName = prefs.get( KEY_LAF, FlatLightLaf.class.getName() );
|
|
||||||
UIManager.setLookAndFeel( lafClassName );
|
|
||||||
}
|
|
||||||
} catch( Exception ex ) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
|
|
||||||
// fallback
|
|
||||||
FlatLightLaf.install();
|
|
||||||
}
|
|
||||||
|
|
||||||
// create frame
|
// create frame
|
||||||
DemoFrame frame = new DemoFrame();
|
DemoFrame frame = new DemoFrame();
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ class MoreComponentsPanel
|
|||||||
JPanel panel1 = new JPanel();
|
JPanel panel1 = new JPanel();
|
||||||
JScrollBar scrollBar2 = new JScrollBar();
|
JScrollBar scrollBar2 = new JScrollBar();
|
||||||
JScrollBar scrollBar3 = new JScrollBar();
|
JScrollBar scrollBar3 = new JScrollBar();
|
||||||
|
JScrollBar scrollBar7 = new JScrollBar();
|
||||||
|
JScrollBar scrollBar8 = new JScrollBar();
|
||||||
JSeparator separator2 = new JSeparator();
|
JSeparator separator2 = new JSeparator();
|
||||||
JSlider slider2 = new JSlider();
|
JSlider slider2 = new JSlider();
|
||||||
JSlider slider4 = new JSlider();
|
JSlider slider4 = new JSlider();
|
||||||
@@ -60,6 +62,8 @@ class MoreComponentsPanel
|
|||||||
JLabel scrollBarLabel = new JLabel();
|
JLabel scrollBarLabel = new JLabel();
|
||||||
JScrollBar scrollBar1 = new JScrollBar();
|
JScrollBar scrollBar1 = new JScrollBar();
|
||||||
JScrollBar scrollBar4 = new JScrollBar();
|
JScrollBar scrollBar4 = new JScrollBar();
|
||||||
|
JScrollBar scrollBar5 = new JScrollBar();
|
||||||
|
JScrollBar scrollBar6 = new JScrollBar();
|
||||||
JLabel separatorLabel = new JLabel();
|
JLabel separatorLabel = new JLabel();
|
||||||
JSeparator separator1 = new JSeparator();
|
JSeparator separator1 = new JSeparator();
|
||||||
JPanel panel2 = new JPanel();
|
JPanel panel2 = new JPanel();
|
||||||
@@ -102,6 +106,8 @@ class MoreComponentsPanel
|
|||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
"[]"));
|
"[]"));
|
||||||
|
|
||||||
//---- scrollPaneLabel ----
|
//---- scrollPaneLabel ----
|
||||||
@@ -121,20 +127,29 @@ class MoreComponentsPanel
|
|||||||
scrollPane13.setViewportView(panel1);
|
scrollPane13.setViewportView(panel1);
|
||||||
}
|
}
|
||||||
add(scrollPane13, "cell 1 0,grow,width 70,height 70");
|
add(scrollPane13, "cell 1 0,grow,width 70,height 70");
|
||||||
add(scrollBar2, "cell 2 0 1 4,growy");
|
add(scrollBar2, "cell 2 0 1 6,growy");
|
||||||
|
|
||||||
//---- scrollBar3 ----
|
//---- scrollBar3 ----
|
||||||
scrollBar3.setEnabled(false);
|
scrollBar3.setEnabled(false);
|
||||||
add(scrollBar3, "cell 2 0 1 4,growy");
|
add(scrollBar3, "cell 2 0 1 6,growy");
|
||||||
|
|
||||||
|
//---- scrollBar7 ----
|
||||||
|
scrollBar7.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar7, "cell 2 0 1 6,growy");
|
||||||
|
|
||||||
|
//---- scrollBar8 ----
|
||||||
|
scrollBar8.setEnabled(false);
|
||||||
|
scrollBar8.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar8, "cell 2 0 1 6,growy");
|
||||||
|
|
||||||
//---- separator2 ----
|
//---- separator2 ----
|
||||||
separator2.setOrientation(SwingConstants.VERTICAL);
|
separator2.setOrientation(SwingConstants.VERTICAL);
|
||||||
add(separator2, "cell 2 0 1 4,growy");
|
add(separator2, "cell 2 0 1 6,growy");
|
||||||
|
|
||||||
//---- slider2 ----
|
//---- slider2 ----
|
||||||
slider2.setOrientation(SwingConstants.VERTICAL);
|
slider2.setOrientation(SwingConstants.VERTICAL);
|
||||||
slider2.setValue(30);
|
slider2.setValue(30);
|
||||||
add(slider2, "cell 2 0 1 4,growy");
|
add(slider2, "cell 2 0 1 6,growy");
|
||||||
|
|
||||||
//---- slider4 ----
|
//---- slider4 ----
|
||||||
slider4.setMinorTickSpacing(10);
|
slider4.setMinorTickSpacing(10);
|
||||||
@@ -143,19 +158,19 @@ class MoreComponentsPanel
|
|||||||
slider4.setPaintLabels(true);
|
slider4.setPaintLabels(true);
|
||||||
slider4.setOrientation(SwingConstants.VERTICAL);
|
slider4.setOrientation(SwingConstants.VERTICAL);
|
||||||
slider4.setValue(30);
|
slider4.setValue(30);
|
||||||
add(slider4, "cell 2 0 1 4,growy");
|
add(slider4, "cell 2 0 1 6,growy");
|
||||||
add(scrollPane14, "cell 3 0,grow");
|
add(scrollPane14, "cell 3 0,grow");
|
||||||
|
|
||||||
//---- progressBar3 ----
|
//---- progressBar3 ----
|
||||||
progressBar3.setOrientation(SwingConstants.VERTICAL);
|
progressBar3.setOrientation(SwingConstants.VERTICAL);
|
||||||
progressBar3.setValue(50);
|
progressBar3.setValue(50);
|
||||||
add(progressBar3, "cell 4 0 1 4,growy");
|
add(progressBar3, "cell 4 0 1 6,growy");
|
||||||
|
|
||||||
//---- progressBar4 ----
|
//---- progressBar4 ----
|
||||||
progressBar4.setOrientation(SwingConstants.VERTICAL);
|
progressBar4.setOrientation(SwingConstants.VERTICAL);
|
||||||
progressBar4.setValue(55);
|
progressBar4.setValue(55);
|
||||||
progressBar4.setStringPainted(true);
|
progressBar4.setStringPainted(true);
|
||||||
add(progressBar4, "cell 4 0 1 4,growy");
|
add(progressBar4, "cell 4 0 1 6,growy");
|
||||||
|
|
||||||
//======== toolBar2 ========
|
//======== toolBar2 ========
|
||||||
{
|
{
|
||||||
@@ -178,7 +193,7 @@ class MoreComponentsPanel
|
|||||||
toggleButton7.setIcon(UIManager.getIcon("Tree.closedIcon"));
|
toggleButton7.setIcon(UIManager.getIcon("Tree.closedIcon"));
|
||||||
toolBar2.add(toggleButton7);
|
toolBar2.add(toggleButton7);
|
||||||
}
|
}
|
||||||
add(toolBar2, "cell 4 0 1 4,growy");
|
add(toolBar2, "cell 4 0 1 6,growy");
|
||||||
|
|
||||||
//---- scrollBarLabel ----
|
//---- scrollBarLabel ----
|
||||||
scrollBarLabel.setText("JScrollBar:");
|
scrollBarLabel.setText("JScrollBar:");
|
||||||
@@ -193,30 +208,41 @@ class MoreComponentsPanel
|
|||||||
scrollBar4.setEnabled(false);
|
scrollBar4.setEnabled(false);
|
||||||
add(scrollBar4, "cell 1 2,growx");
|
add(scrollBar4, "cell 1 2,growx");
|
||||||
|
|
||||||
|
//---- scrollBar5 ----
|
||||||
|
scrollBar5.setOrientation(Adjustable.HORIZONTAL);
|
||||||
|
scrollBar5.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar5, "cell 1 3,growx");
|
||||||
|
|
||||||
|
//---- scrollBar6 ----
|
||||||
|
scrollBar6.setOrientation(Adjustable.HORIZONTAL);
|
||||||
|
scrollBar6.setEnabled(false);
|
||||||
|
scrollBar6.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar6, "cell 1 4,growx");
|
||||||
|
|
||||||
//---- separatorLabel ----
|
//---- separatorLabel ----
|
||||||
separatorLabel.setText("JSeparator:");
|
separatorLabel.setText("JSeparator:");
|
||||||
add(separatorLabel, "cell 0 3");
|
add(separatorLabel, "cell 0 5");
|
||||||
add(separator1, "cell 1 3,growx");
|
add(separator1, "cell 1 5,growx");
|
||||||
|
|
||||||
//======== panel2 ========
|
//======== panel2 ========
|
||||||
{
|
{
|
||||||
panel2.setBorder(new TitledBorder("TitledBorder"));
|
panel2.setBorder(new TitledBorder("TitledBorder"));
|
||||||
panel2.setLayout(new FlowLayout());
|
panel2.setLayout(new FlowLayout());
|
||||||
}
|
}
|
||||||
add(panel2, "cell 3 3,grow");
|
add(panel2, "cell 3 5,grow");
|
||||||
|
|
||||||
//---- sliderLabel ----
|
//---- sliderLabel ----
|
||||||
sliderLabel.setText("JSlider:");
|
sliderLabel.setText("JSlider:");
|
||||||
add(sliderLabel, "cell 0 4");
|
add(sliderLabel, "cell 0 6");
|
||||||
|
|
||||||
//---- slider1 ----
|
//---- slider1 ----
|
||||||
slider1.setValue(30);
|
slider1.setValue(30);
|
||||||
add(slider1, "cell 1 4 3 1,aligny top,grow 100 0");
|
add(slider1, "cell 1 6 3 1,aligny top,grow 100 0");
|
||||||
|
|
||||||
//---- slider6 ----
|
//---- slider6 ----
|
||||||
slider6.setEnabled(false);
|
slider6.setEnabled(false);
|
||||||
slider6.setValue(30);
|
slider6.setValue(30);
|
||||||
add(slider6, "cell 1 4 3 1,aligny top,growy 0");
|
add(slider6, "cell 1 6 3 1,aligny top,growy 0");
|
||||||
|
|
||||||
//---- slider3 ----
|
//---- slider3 ----
|
||||||
slider3.setMinorTickSpacing(10);
|
slider3.setMinorTickSpacing(10);
|
||||||
@@ -224,7 +250,7 @@ class MoreComponentsPanel
|
|||||||
slider3.setMajorTickSpacing(50);
|
slider3.setMajorTickSpacing(50);
|
||||||
slider3.setPaintLabels(true);
|
slider3.setPaintLabels(true);
|
||||||
slider3.setValue(30);
|
slider3.setValue(30);
|
||||||
add(slider3, "cell 1 5 3 1,aligny top,grow 100 0");
|
add(slider3, "cell 1 7 3 1,aligny top,grow 100 0");
|
||||||
|
|
||||||
//---- slider5 ----
|
//---- slider5 ----
|
||||||
slider5.setMinorTickSpacing(10);
|
slider5.setMinorTickSpacing(10);
|
||||||
@@ -233,41 +259,41 @@ class MoreComponentsPanel
|
|||||||
slider5.setPaintLabels(true);
|
slider5.setPaintLabels(true);
|
||||||
slider5.setEnabled(false);
|
slider5.setEnabled(false);
|
||||||
slider5.setValue(30);
|
slider5.setValue(30);
|
||||||
add(slider5, "cell 1 5 3 1,aligny top,growy 0");
|
add(slider5, "cell 1 7 3 1,aligny top,growy 0");
|
||||||
|
|
||||||
//---- progressBarLabel ----
|
//---- progressBarLabel ----
|
||||||
progressBarLabel.setText("JProgressBar:");
|
progressBarLabel.setText("JProgressBar:");
|
||||||
add(progressBarLabel, "cell 0 6");
|
add(progressBarLabel, "cell 0 8");
|
||||||
|
|
||||||
//---- progressBar1 ----
|
//---- progressBar1 ----
|
||||||
progressBar1.setValue(50);
|
progressBar1.setValue(50);
|
||||||
add(progressBar1, "cell 1 6 3 1,growx");
|
add(progressBar1, "cell 1 8 3 1,growx");
|
||||||
|
|
||||||
//---- progressBar2 ----
|
//---- progressBar2 ----
|
||||||
progressBar2.setStringPainted(true);
|
progressBar2.setStringPainted(true);
|
||||||
progressBar2.setValue(55);
|
progressBar2.setValue(55);
|
||||||
add(progressBar2, "cell 1 6 3 1,growx");
|
add(progressBar2, "cell 1 8 3 1,growx");
|
||||||
|
|
||||||
//---- indeterminateCheckBox ----
|
//---- indeterminateCheckBox ----
|
||||||
indeterminateCheckBox.setText("indeterminate");
|
indeterminateCheckBox.setText("indeterminate");
|
||||||
indeterminateCheckBox.addActionListener(e -> indeterminateCheckBoxActionPerformed());
|
indeterminateCheckBox.addActionListener(e -> indeterminateCheckBoxActionPerformed());
|
||||||
add(indeterminateCheckBox, "cell 4 6");
|
add(indeterminateCheckBox, "cell 4 8");
|
||||||
|
|
||||||
//---- toolTipLabel ----
|
//---- toolTipLabel ----
|
||||||
toolTipLabel.setText("JToolTip:");
|
toolTipLabel.setText("JToolTip:");
|
||||||
add(toolTipLabel, "cell 0 7");
|
add(toolTipLabel, "cell 0 9");
|
||||||
|
|
||||||
//---- toolTip1 ----
|
//---- toolTip1 ----
|
||||||
toolTip1.setTipText("Some text in tool tip.");
|
toolTip1.setTipText("Some text in tool tip.");
|
||||||
add(toolTip1, "cell 1 7 3 1");
|
add(toolTip1, "cell 1 9 3 1");
|
||||||
|
|
||||||
//---- toolTip2 ----
|
//---- toolTip2 ----
|
||||||
toolTip2.setTipText("Tool tip with\nmultiple\nlines.");
|
toolTip2.setTipText("Tool tip with\nmultiple\nlines.");
|
||||||
add(toolTip2, "cell 1 7 3 1");
|
add(toolTip2, "cell 1 9 3 1");
|
||||||
|
|
||||||
//---- toolBarLabel ----
|
//---- toolBarLabel ----
|
||||||
toolBarLabel.setText("JToolBar:");
|
toolBarLabel.setText("JToolBar:");
|
||||||
add(toolBarLabel, "cell 0 8");
|
add(toolBarLabel, "cell 0 10");
|
||||||
|
|
||||||
//======== toolBar1 ========
|
//======== toolBar1 ========
|
||||||
{
|
{
|
||||||
@@ -297,7 +323,7 @@ class MoreComponentsPanel
|
|||||||
toggleButton6.setSelected(true);
|
toggleButton6.setSelected(true);
|
||||||
toolBar1.add(toggleButton6);
|
toolBar1.add(toggleButton6);
|
||||||
}
|
}
|
||||||
add(toolBar1, "cell 1 8 3 1,growx");
|
add(toolBar1, "cell 1 10 3 1,growx");
|
||||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ new FormModel {
|
|||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "hidemode 3"
|
"$layoutConstraints": "hidemode 3"
|
||||||
"$columnConstraints": "[][][][][][]"
|
"$columnConstraints": "[][][][][][]"
|
||||||
"$rowConstraints": "[][][][][][][][][]"
|
"$rowConstraints": "[][][][][][][][][][][]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "this"
|
name: "this"
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
@@ -32,26 +32,39 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
name: "scrollBar2"
|
name: "scrollBar2"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 0 1 4,growy"
|
"value": "cell 2 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
name: "scrollBar3"
|
name: "scrollBar3"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 0 1 4,growy"
|
"value": "cell 2 0 1 6,growy"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar7"
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 0 1 6,growy"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar8"
|
||||||
|
"enabled": false
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSeparator" ) {
|
add( new FormComponent( "javax.swing.JSeparator" ) {
|
||||||
name: "separator2"
|
name: "separator2"
|
||||||
"orientation": 1
|
"orientation": 1
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 0 1 4,growy"
|
"value": "cell 2 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider2"
|
name: "slider2"
|
||||||
"orientation": 1
|
"orientation": 1
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 0 1 4,growy"
|
"value": "cell 2 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider4"
|
name: "slider4"
|
||||||
@@ -62,7 +75,7 @@ new FormModel {
|
|||||||
"orientation": 1
|
"orientation": 1
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 0 1 4,growy"
|
"value": "cell 2 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
name: "scrollPane14"
|
name: "scrollPane14"
|
||||||
@@ -77,7 +90,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 0 1 4,growy"
|
"value": "cell 4 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar4"
|
name: "progressBar4"
|
||||||
@@ -88,7 +101,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 0 1 4,growy"
|
"value": "cell 4 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||||
name: "toolBar2"
|
name: "toolBar2"
|
||||||
@@ -113,7 +126,7 @@ new FormModel {
|
|||||||
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
|
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 0 1 4,growy"
|
"value": "cell 4 0 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "scrollBarLabel"
|
name: "scrollBarLabel"
|
||||||
@@ -134,41 +147,56 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 2,growx"
|
"value": "cell 1 2,growx"
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar5"
|
||||||
|
"orientation": 0
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 3,growx"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar6"
|
||||||
|
"orientation": 0
|
||||||
|
"enabled": false
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 4,growx"
|
||||||
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "separatorLabel"
|
name: "separatorLabel"
|
||||||
"text": "JSeparator:"
|
"text": "JSeparator:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 3"
|
"value": "cell 0 5"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSeparator" ) {
|
add( new FormComponent( "javax.swing.JSeparator" ) {
|
||||||
name: "separator1"
|
name: "separator1"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 3,growx"
|
"value": "cell 1 5,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
|
||||||
name: "panel2"
|
name: "panel2"
|
||||||
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
|
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 3,grow"
|
"value": "cell 3 5,grow"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "sliderLabel"
|
name: "sliderLabel"
|
||||||
"text": "JSlider:"
|
"text": "JSlider:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 4"
|
"value": "cell 0 6"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider1"
|
name: "slider1"
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 4 3 1,aligny top,grow 100 0"
|
"value": "cell 1 6 3 1,aligny top,grow 100 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider6"
|
name: "slider6"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 4 3 1,aligny top,growy 0"
|
"value": "cell 1 6 3 1,aligny top,growy 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider3"
|
name: "slider3"
|
||||||
@@ -178,7 +206,7 @@ new FormModel {
|
|||||||
"paintLabels": true
|
"paintLabels": true
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 5 3 1,aligny top,grow 100 0"
|
"value": "cell 1 7 3 1,aligny top,grow 100 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider5"
|
name: "slider5"
|
||||||
@@ -189,13 +217,13 @@ new FormModel {
|
|||||||
"enabled": false
|
"enabled": false
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 5 3 1,aligny top,growy 0"
|
"value": "cell 1 7 3 1,aligny top,growy 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "progressBarLabel"
|
name: "progressBarLabel"
|
||||||
"text": "JProgressBar:"
|
"text": "JProgressBar:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 6"
|
"value": "cell 0 8"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar1"
|
name: "progressBar1"
|
||||||
@@ -204,7 +232,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 6 3 1,growx"
|
"value": "cell 1 8 3 1,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar2"
|
name: "progressBar2"
|
||||||
@@ -214,7 +242,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 6 3 1,growx"
|
"value": "cell 1 8 3 1,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "indeterminateCheckBox"
|
name: "indeterminateCheckBox"
|
||||||
@@ -224,31 +252,31 @@ new FormModel {
|
|||||||
}
|
}
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "indeterminateCheckBoxActionPerformed", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "indeterminateCheckBoxActionPerformed", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 6"
|
"value": "cell 4 8"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "toolTipLabel"
|
name: "toolTipLabel"
|
||||||
"text": "JToolTip:"
|
"text": "JToolTip:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 7"
|
"value": "cell 0 9"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolTip" ) {
|
add( new FormComponent( "javax.swing.JToolTip" ) {
|
||||||
name: "toolTip1"
|
name: "toolTip1"
|
||||||
"tipText": "Some text in tool tip."
|
"tipText": "Some text in tool tip."
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 7 3 1"
|
"value": "cell 1 9 3 1"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolTip" ) {
|
add( new FormComponent( "javax.swing.JToolTip" ) {
|
||||||
name: "toolTip2"
|
name: "toolTip2"
|
||||||
"tipText": "Tool tip with\nmultiple\nlines."
|
"tipText": "Tool tip with\nmultiple\nlines."
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 7 3 1"
|
"value": "cell 1 9 3 1"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "toolBarLabel"
|
name: "toolBarLabel"
|
||||||
"text": "JToolBar:"
|
"text": "JToolBar:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 8"
|
"value": "cell 0 10"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||||
name: "toolBar1"
|
name: "toolBar1"
|
||||||
@@ -282,7 +310,7 @@ new FormModel {
|
|||||||
"selected": true
|
"selected": true
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 8 3 1,growx"
|
"value": "cell 1 10 3 1,growx"
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( null ) {
|
}, new FormLayoutConstraints( null ) {
|
||||||
"location": new java.awt.Point( 0, 0 )
|
"location": new java.awt.Point( 0, 0 )
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import java.util.Comparator;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.function.Predicate;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.CompoundBorder;
|
import javax.swing.border.CompoundBorder;
|
||||||
import javax.swing.event.*;
|
import javax.swing.event.*;
|
||||||
@@ -46,6 +47,7 @@ import com.formdev.flatlaf.FlatIntelliJLaf;
|
|||||||
import com.formdev.flatlaf.FlatLaf;
|
import com.formdev.flatlaf.FlatLaf;
|
||||||
import com.formdev.flatlaf.FlatLightLaf;
|
import com.formdev.flatlaf.FlatLightLaf;
|
||||||
import com.formdev.flatlaf.IntelliJTheme;
|
import com.formdev.flatlaf.IntelliJTheme;
|
||||||
|
import com.formdev.flatlaf.demo.DemoPrefs;
|
||||||
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
||||||
import com.formdev.flatlaf.util.StringUtils;
|
import com.formdev.flatlaf.util.StringUtils;
|
||||||
import net.miginfocom.swing.*;
|
import net.miginfocom.swing.*;
|
||||||
@@ -222,12 +224,15 @@ public class IJThemesPanel
|
|||||||
} else if( themeInfo.themeFile != null ) {
|
} else if( themeInfo.themeFile != null ) {
|
||||||
try {
|
try {
|
||||||
FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( themeInfo.themeFile ) ) );
|
FlatLaf.install( IntelliJTheme.createLaf( new FileInputStream( themeInfo.themeFile ) ) );
|
||||||
|
DemoPrefs.getState().put( DemoPrefs.KEY_LAF_INTELLIJ_THEME, DemoPrefs.FILE_PREFIX + themeInfo.themeFile );
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
showInformationDialog( "Failed to load '" + themeInfo.themeFile + "'.", ex );
|
showInformationDialog( "Failed to load '" + themeInfo.themeFile + "'.", ex );
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
IntelliJTheme.install( getClass().getResourceAsStream( themeInfo.resourceName ) );
|
IntelliJTheme.install( getClass().getResourceAsStream( themeInfo.resourceName ) );
|
||||||
|
DemoPrefs.getState().put( DemoPrefs.KEY_LAF_INTELLIJ_THEME, DemoPrefs.RESOURCE_PREFIX + themeInfo.resourceName );
|
||||||
|
}
|
||||||
|
|
||||||
// update all components
|
// update all components
|
||||||
FlatLaf.updateUI();
|
FlatLaf.updateUI();
|
||||||
@@ -326,22 +331,36 @@ public class IJThemesPanel
|
|||||||
|
|
||||||
private void selectedCurrentLookAndFeel() {
|
private void selectedCurrentLookAndFeel() {
|
||||||
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
||||||
|
String intelliJTheme = UIManager.getLookAndFeelDefaults().getString( DemoPrefs.INTELLIJ_THEME_UI_KEY );
|
||||||
|
|
||||||
|
if( intelliJTheme == null && lookAndFeel instanceof IntelliJTheme.ThemeLaf )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Predicate<IJThemeInfo> test;
|
||||||
|
if( intelliJTheme != null && intelliJTheme.startsWith( DemoPrefs.RESOURCE_PREFIX ) ) {
|
||||||
|
String resourceName = intelliJTheme.substring( DemoPrefs.RESOURCE_PREFIX.length() );
|
||||||
|
test = ti -> Objects.equals( ti.resourceName, resourceName );
|
||||||
|
} else if( intelliJTheme != null && intelliJTheme.startsWith( DemoPrefs.FILE_PREFIX ) ) {
|
||||||
|
File themeFile = new File( intelliJTheme.substring( DemoPrefs.FILE_PREFIX.length() ) );
|
||||||
|
test = ti -> Objects.equals( ti.themeFile, themeFile );
|
||||||
|
} else {
|
||||||
|
String lafClassName = lookAndFeel.getClass().getName();
|
||||||
|
test = ti -> Objects.equals( ti.lafClassName, lafClassName );
|
||||||
|
}
|
||||||
|
|
||||||
int newSel = -1;
|
int newSel = -1;
|
||||||
if( !(lookAndFeel instanceof IntelliJTheme.ThemeLaf) ) {
|
for( int i = 0; i < themes.size(); i++ ) {
|
||||||
String lafClassName = lookAndFeel.getClass().getName();
|
if( test.test( themes.get( i ) ) ) {
|
||||||
for( int i = 0; i < themes.size(); i++ ) {
|
newSel = i;
|
||||||
if( lafClassName.equals( themes.get( i ).lafClassName ) ) {
|
break;
|
||||||
newSel = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( newSel >= 0 )
|
|
||||||
themesList.setSelectedIndex( newSel );
|
|
||||||
else
|
|
||||||
themesList.clearSelection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( newSel >= 0 ) {
|
||||||
|
if( newSel != themesList.getSelectedIndex() )
|
||||||
|
themesList.setSelectedIndex( newSel );
|
||||||
|
} else
|
||||||
|
themesList.clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ build script:
|
|||||||
|
|
||||||
groupId: com.formdev
|
groupId: com.formdev
|
||||||
artifactId: flatlaf-jide-oss
|
artifactId: flatlaf-jide-oss
|
||||||
version: 0.20
|
version: 0.21
|
||||||
|
|
||||||
Otherwise download `flatlaf-jide-oss-<version>.jar` here:
|
Otherwise download `flatlaf-jide-oss-<version>.jar` here:
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ build script:
|
|||||||
|
|
||||||
groupId: com.formdev
|
groupId: com.formdev
|
||||||
artifactId: flatlaf-swingx
|
artifactId: flatlaf-swingx
|
||||||
version: 0.20
|
version: 0.21
|
||||||
|
|
||||||
Otherwise download `flatlaf-swingx-<version>.jar` here:
|
Otherwise download `flatlaf-swingx-<version>.jar` here:
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,8 @@ public class FlatComponentsTest
|
|||||||
JPanel panel1 = new JPanel();
|
JPanel panel1 = new JPanel();
|
||||||
JScrollBar scrollBar2 = new JScrollBar();
|
JScrollBar scrollBar2 = new JScrollBar();
|
||||||
JScrollBar scrollBar3 = new JScrollBar();
|
JScrollBar scrollBar3 = new JScrollBar();
|
||||||
|
JScrollBar scrollBar7 = new JScrollBar();
|
||||||
|
JScrollBar scrollBar8 = new JScrollBar();
|
||||||
JSeparator separator2 = new JSeparator();
|
JSeparator separator2 = new JSeparator();
|
||||||
JSlider slider2 = new JSlider();
|
JSlider slider2 = new JSlider();
|
||||||
JSlider slider4 = new JSlider();
|
JSlider slider4 = new JSlider();
|
||||||
@@ -156,6 +158,8 @@ public class FlatComponentsTest
|
|||||||
JEditorPane editorPane6 = new JEditorPane();
|
JEditorPane editorPane6 = new JEditorPane();
|
||||||
JScrollPane scrollPane16 = new JScrollPane();
|
JScrollPane scrollPane16 = new JScrollPane();
|
||||||
JTextPane textPane6 = new JTextPane();
|
JTextPane textPane6 = new JTextPane();
|
||||||
|
JScrollBar scrollBar5 = new JScrollBar();
|
||||||
|
JScrollBar scrollBar6 = new JScrollBar();
|
||||||
JLabel separatorLabel = new JLabel();
|
JLabel separatorLabel = new JLabel();
|
||||||
JSeparator separator1 = new JSeparator();
|
JSeparator separator1 = new JSeparator();
|
||||||
JPanel panel2 = new JPanel();
|
JPanel panel2 = new JPanel();
|
||||||
@@ -211,6 +215,8 @@ public class FlatComponentsTest
|
|||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
|
"[]" +
|
||||||
|
"[]" +
|
||||||
"[]"));
|
"[]"));
|
||||||
|
|
||||||
//---- labelLabel ----
|
//---- labelLabel ----
|
||||||
@@ -695,20 +701,29 @@ public class FlatComponentsTest
|
|||||||
scrollPane13.setViewportView(panel1);
|
scrollPane13.setViewportView(panel1);
|
||||||
}
|
}
|
||||||
add(scrollPane13, "cell 1 13,grow,width 70,height 70");
|
add(scrollPane13, "cell 1 13,grow,width 70,height 70");
|
||||||
add(scrollBar2, "cell 2 13 1 4,growy");
|
add(scrollBar2, "cell 2 13 1 6,growy");
|
||||||
|
|
||||||
//---- scrollBar3 ----
|
//---- scrollBar3 ----
|
||||||
scrollBar3.setEnabled(false);
|
scrollBar3.setEnabled(false);
|
||||||
add(scrollBar3, "cell 2 13 1 4,growy");
|
add(scrollBar3, "cell 2 13 1 6,growy");
|
||||||
|
|
||||||
|
//---- scrollBar7 ----
|
||||||
|
scrollBar7.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar7, "cell 2 13 1 6,growy");
|
||||||
|
|
||||||
|
//---- scrollBar8 ----
|
||||||
|
scrollBar8.setEnabled(false);
|
||||||
|
scrollBar8.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar8, "cell 2 13 1 6,growy");
|
||||||
|
|
||||||
//---- separator2 ----
|
//---- separator2 ----
|
||||||
separator2.setOrientation(SwingConstants.VERTICAL);
|
separator2.setOrientation(SwingConstants.VERTICAL);
|
||||||
add(separator2, "cell 2 13 1 4,growy");
|
add(separator2, "cell 2 13 1 6,growy");
|
||||||
|
|
||||||
//---- slider2 ----
|
//---- slider2 ----
|
||||||
slider2.setOrientation(SwingConstants.VERTICAL);
|
slider2.setOrientation(SwingConstants.VERTICAL);
|
||||||
slider2.setValue(30);
|
slider2.setValue(30);
|
||||||
add(slider2, "cell 2 13 1 4,growy");
|
add(slider2, "cell 2 13 1 6,growy");
|
||||||
|
|
||||||
//---- slider4 ----
|
//---- slider4 ----
|
||||||
slider4.setMinorTickSpacing(10);
|
slider4.setMinorTickSpacing(10);
|
||||||
@@ -717,19 +732,19 @@ public class FlatComponentsTest
|
|||||||
slider4.setPaintLabels(true);
|
slider4.setPaintLabels(true);
|
||||||
slider4.setOrientation(SwingConstants.VERTICAL);
|
slider4.setOrientation(SwingConstants.VERTICAL);
|
||||||
slider4.setValue(30);
|
slider4.setValue(30);
|
||||||
add(slider4, "cell 2 13 1 4,growy");
|
add(slider4, "cell 2 13 1 6,growy");
|
||||||
add(scrollPane14, "cell 3 13,grow");
|
add(scrollPane14, "cell 3 13,grow");
|
||||||
|
|
||||||
//---- progressBar3 ----
|
//---- progressBar3 ----
|
||||||
progressBar3.setOrientation(SwingConstants.VERTICAL);
|
progressBar3.setOrientation(SwingConstants.VERTICAL);
|
||||||
progressBar3.setValue(50);
|
progressBar3.setValue(50);
|
||||||
add(progressBar3, "cell 4 13 1 4,growy");
|
add(progressBar3, "cell 4 13 1 6,growy");
|
||||||
|
|
||||||
//---- progressBar4 ----
|
//---- progressBar4 ----
|
||||||
progressBar4.setOrientation(SwingConstants.VERTICAL);
|
progressBar4.setOrientation(SwingConstants.VERTICAL);
|
||||||
progressBar4.setValue(55);
|
progressBar4.setValue(55);
|
||||||
progressBar4.setStringPainted(true);
|
progressBar4.setStringPainted(true);
|
||||||
add(progressBar4, "cell 4 13 1 4,growy");
|
add(progressBar4, "cell 4 13 1 6,growy");
|
||||||
|
|
||||||
//======== toolBar2 ========
|
//======== toolBar2 ========
|
||||||
{
|
{
|
||||||
@@ -752,7 +767,7 @@ public class FlatComponentsTest
|
|||||||
toggleButton7.setIcon(UIManager.getIcon("Tree.closedIcon"));
|
toggleButton7.setIcon(UIManager.getIcon("Tree.closedIcon"));
|
||||||
toolBar2.add(toggleButton7);
|
toolBar2.add(toggleButton7);
|
||||||
}
|
}
|
||||||
add(toolBar2, "cell 4 13 1 4,growy");
|
add(toolBar2, "cell 4 13 1 6,growy");
|
||||||
|
|
||||||
//---- scrollBarLabel ----
|
//---- scrollBarLabel ----
|
||||||
scrollBarLabel.setText("JScrollBar:");
|
scrollBarLabel.setText("JScrollBar:");
|
||||||
@@ -807,12 +822,23 @@ public class FlatComponentsTest
|
|||||||
}
|
}
|
||||||
panel3.add(scrollPane16, "cell 0 2,grow");
|
panel3.add(scrollPane16, "cell 0 2,grow");
|
||||||
}
|
}
|
||||||
add(panel3, "cell 5 15 1 7,aligny top,grow 100 0");
|
add(panel3, "cell 5 15 1 9,aligny top,grow 100 0");
|
||||||
|
|
||||||
|
//---- scrollBar5 ----
|
||||||
|
scrollBar5.setOrientation(Adjustable.HORIZONTAL);
|
||||||
|
scrollBar5.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar5, "cell 1 16,growx");
|
||||||
|
|
||||||
|
//---- scrollBar6 ----
|
||||||
|
scrollBar6.setOrientation(Adjustable.HORIZONTAL);
|
||||||
|
scrollBar6.setEnabled(false);
|
||||||
|
scrollBar6.putClientProperty("JScrollBar.showButtons", true);
|
||||||
|
add(scrollBar6, "cell 1 17,growx");
|
||||||
|
|
||||||
//---- separatorLabel ----
|
//---- separatorLabel ----
|
||||||
separatorLabel.setText("JSeparator:");
|
separatorLabel.setText("JSeparator:");
|
||||||
add(separatorLabel, "cell 0 16");
|
add(separatorLabel, "cell 0 18");
|
||||||
add(separator1, "cell 1 16,growx");
|
add(separator1, "cell 1 18,growx");
|
||||||
|
|
||||||
//======== panel2 ========
|
//======== panel2 ========
|
||||||
{
|
{
|
||||||
@@ -820,20 +846,20 @@ public class FlatComponentsTest
|
|||||||
panel2.setOpaque(false);
|
panel2.setOpaque(false);
|
||||||
panel2.setLayout(new FlowLayout());
|
panel2.setLayout(new FlowLayout());
|
||||||
}
|
}
|
||||||
add(panel2, "cell 3 16,grow");
|
add(panel2, "cell 3 18,grow");
|
||||||
|
|
||||||
//---- sliderLabel ----
|
//---- sliderLabel ----
|
||||||
sliderLabel.setText("JSlider:");
|
sliderLabel.setText("JSlider:");
|
||||||
add(sliderLabel, "cell 0 17");
|
add(sliderLabel, "cell 0 19");
|
||||||
|
|
||||||
//---- slider1 ----
|
//---- slider1 ----
|
||||||
slider1.setValue(30);
|
slider1.setValue(30);
|
||||||
add(slider1, "cell 1 17 3 1,aligny top,grow 100 0");
|
add(slider1, "cell 1 19 3 1,aligny top,grow 100 0");
|
||||||
|
|
||||||
//---- slider6 ----
|
//---- slider6 ----
|
||||||
slider6.setEnabled(false);
|
slider6.setEnabled(false);
|
||||||
slider6.setValue(30);
|
slider6.setValue(30);
|
||||||
add(slider6, "cell 1 17 3 1,aligny top,growy 0");
|
add(slider6, "cell 1 19 3 1,aligny top,growy 0");
|
||||||
|
|
||||||
//---- slider3 ----
|
//---- slider3 ----
|
||||||
slider3.setMinorTickSpacing(10);
|
slider3.setMinorTickSpacing(10);
|
||||||
@@ -841,7 +867,7 @@ public class FlatComponentsTest
|
|||||||
slider3.setMajorTickSpacing(50);
|
slider3.setMajorTickSpacing(50);
|
||||||
slider3.setPaintLabels(true);
|
slider3.setPaintLabels(true);
|
||||||
slider3.setValue(30);
|
slider3.setValue(30);
|
||||||
add(slider3, "cell 1 18 3 1,aligny top,grow 100 0");
|
add(slider3, "cell 1 20 3 1,aligny top,grow 100 0");
|
||||||
|
|
||||||
//---- slider5 ----
|
//---- slider5 ----
|
||||||
slider5.setMinorTickSpacing(10);
|
slider5.setMinorTickSpacing(10);
|
||||||
@@ -850,41 +876,41 @@ public class FlatComponentsTest
|
|||||||
slider5.setPaintLabels(true);
|
slider5.setPaintLabels(true);
|
||||||
slider5.setEnabled(false);
|
slider5.setEnabled(false);
|
||||||
slider5.setValue(30);
|
slider5.setValue(30);
|
||||||
add(slider5, "cell 1 18 3 1,aligny top,growy 0");
|
add(slider5, "cell 1 20 3 1,aligny top,growy 0");
|
||||||
|
|
||||||
//---- progressBarLabel ----
|
//---- progressBarLabel ----
|
||||||
progressBarLabel.setText("JProgressBar:");
|
progressBarLabel.setText("JProgressBar:");
|
||||||
add(progressBarLabel, "cell 0 19");
|
add(progressBarLabel, "cell 0 21");
|
||||||
|
|
||||||
//---- progressBar1 ----
|
//---- progressBar1 ----
|
||||||
progressBar1.setValue(50);
|
progressBar1.setValue(50);
|
||||||
add(progressBar1, "cell 1 19 3 1,growx");
|
add(progressBar1, "cell 1 21 3 1,growx");
|
||||||
|
|
||||||
//---- progressBar2 ----
|
//---- progressBar2 ----
|
||||||
progressBar2.setStringPainted(true);
|
progressBar2.setStringPainted(true);
|
||||||
progressBar2.setValue(55);
|
progressBar2.setValue(55);
|
||||||
add(progressBar2, "cell 1 19 3 1,growx");
|
add(progressBar2, "cell 1 21 3 1,growx");
|
||||||
|
|
||||||
//---- indeterminateCheckBox ----
|
//---- indeterminateCheckBox ----
|
||||||
indeterminateCheckBox.setText("indeterminate");
|
indeterminateCheckBox.setText("indeterminate");
|
||||||
indeterminateCheckBox.addActionListener(e -> indeterminateCheckBoxActionPerformed());
|
indeterminateCheckBox.addActionListener(e -> indeterminateCheckBoxActionPerformed());
|
||||||
add(indeterminateCheckBox, "cell 4 19");
|
add(indeterminateCheckBox, "cell 4 21");
|
||||||
|
|
||||||
//---- toolTipLabel ----
|
//---- toolTipLabel ----
|
||||||
toolTipLabel.setText("JToolTip:");
|
toolTipLabel.setText("JToolTip:");
|
||||||
add(toolTipLabel, "cell 0 20");
|
add(toolTipLabel, "cell 0 22");
|
||||||
|
|
||||||
//---- toolTip1 ----
|
//---- toolTip1 ----
|
||||||
toolTip1.setTipText("Some text in tool tip.");
|
toolTip1.setTipText("Some text in tool tip.");
|
||||||
add(toolTip1, "cell 1 20 3 1");
|
add(toolTip1, "cell 1 22 3 1");
|
||||||
|
|
||||||
//---- toolTip2 ----
|
//---- toolTip2 ----
|
||||||
toolTip2.setTipText("Tool tip with\nmultiple\nlines.");
|
toolTip2.setTipText("Tool tip with\nmultiple\nlines.");
|
||||||
add(toolTip2, "cell 1 20 3 1");
|
add(toolTip2, "cell 1 22 3 1");
|
||||||
|
|
||||||
//---- toolBarLabel ----
|
//---- toolBarLabel ----
|
||||||
toolBarLabel.setText("JToolBar:");
|
toolBarLabel.setText("JToolBar:");
|
||||||
add(toolBarLabel, "cell 0 21");
|
add(toolBarLabel, "cell 0 23");
|
||||||
|
|
||||||
//======== toolBar1 ========
|
//======== toolBar1 ========
|
||||||
{
|
{
|
||||||
@@ -914,7 +940,7 @@ public class FlatComponentsTest
|
|||||||
toggleButton6.setSelected(true);
|
toggleButton6.setSelected(true);
|
||||||
toolBar1.add(toggleButton6);
|
toolBar1.add(toggleButton6);
|
||||||
}
|
}
|
||||||
add(toolBar1, "cell 1 21 3 1,growx");
|
add(toolBar1, "cell 1 23 3 1,growx");
|
||||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||||
|
|
||||||
// BasicComboBoxRenderer customaRenderer = new BasicComboBoxRenderer();
|
// BasicComboBoxRenderer customaRenderer = new BasicComboBoxRenderer();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ new FormModel {
|
|||||||
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
||||||
"$columnConstraints": "[][][][][][]"
|
"$columnConstraints": "[][][][][][]"
|
||||||
"$rowConstraints": "[][][][][][][][][][][][][][][][][][][][][][]"
|
"$rowConstraints": "[][][][][][][][][][][][][][][][][][][][][][][][]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "this"
|
name: "this"
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
@@ -620,26 +620,39 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
name: "scrollBar2"
|
name: "scrollBar2"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 13 1 4,growy"
|
"value": "cell 2 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
name: "scrollBar3"
|
name: "scrollBar3"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 13 1 4,growy"
|
"value": "cell 2 13 1 6,growy"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar7"
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 13 1 6,growy"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar8"
|
||||||
|
"enabled": false
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 2 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSeparator" ) {
|
add( new FormComponent( "javax.swing.JSeparator" ) {
|
||||||
name: "separator2"
|
name: "separator2"
|
||||||
"orientation": 1
|
"orientation": 1
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 13 1 4,growy"
|
"value": "cell 2 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider2"
|
name: "slider2"
|
||||||
"orientation": 1
|
"orientation": 1
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 13 1 4,growy"
|
"value": "cell 2 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider4"
|
name: "slider4"
|
||||||
@@ -650,7 +663,7 @@ new FormModel {
|
|||||||
"orientation": 1
|
"orientation": 1
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 13 1 4,growy"
|
"value": "cell 2 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
|
||||||
name: "scrollPane14"
|
name: "scrollPane14"
|
||||||
@@ -665,7 +678,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 13 1 4,growy"
|
"value": "cell 4 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar4"
|
name: "progressBar4"
|
||||||
@@ -676,7 +689,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 13 1 4,growy"
|
"value": "cell 4 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||||
name: "toolBar2"
|
name: "toolBar2"
|
||||||
@@ -701,7 +714,7 @@ new FormModel {
|
|||||||
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
|
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 13 1 4,growy"
|
"value": "cell 4 13 1 6,growy"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "scrollBarLabel"
|
name: "scrollBarLabel"
|
||||||
@@ -762,44 +775,59 @@ new FormModel {
|
|||||||
"value": "cell 0 2,grow"
|
"value": "cell 0 2,grow"
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 5 15 1 7,aligny top,grow 100 0"
|
"value": "cell 5 15 1 9,aligny top,grow 100 0"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar5"
|
||||||
|
"orientation": 0
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 16,growx"
|
||||||
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JScrollBar" ) {
|
||||||
|
name: "scrollBar6"
|
||||||
|
"orientation": 0
|
||||||
|
"enabled": false
|
||||||
|
"$client.JScrollBar.showButtons": true
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 1 17,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "separatorLabel"
|
name: "separatorLabel"
|
||||||
"text": "JSeparator:"
|
"text": "JSeparator:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 16"
|
"value": "cell 0 18"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSeparator" ) {
|
add( new FormComponent( "javax.swing.JSeparator" ) {
|
||||||
name: "separator1"
|
name: "separator1"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 16,growx"
|
"value": "cell 1 18,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
|
||||||
name: "panel2"
|
name: "panel2"
|
||||||
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
|
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
|
||||||
"opaque": false
|
"opaque": false
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 16,grow"
|
"value": "cell 3 18,grow"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "sliderLabel"
|
name: "sliderLabel"
|
||||||
"text": "JSlider:"
|
"text": "JSlider:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 17"
|
"value": "cell 0 19"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider1"
|
name: "slider1"
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 17 3 1,aligny top,grow 100 0"
|
"value": "cell 1 19 3 1,aligny top,grow 100 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider6"
|
name: "slider6"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 17 3 1,aligny top,growy 0"
|
"value": "cell 1 19 3 1,aligny top,growy 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider3"
|
name: "slider3"
|
||||||
@@ -809,7 +837,7 @@ new FormModel {
|
|||||||
"paintLabels": true
|
"paintLabels": true
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 18 3 1,aligny top,grow 100 0"
|
"value": "cell 1 20 3 1,aligny top,grow 100 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider5"
|
name: "slider5"
|
||||||
@@ -820,13 +848,13 @@ new FormModel {
|
|||||||
"enabled": false
|
"enabled": false
|
||||||
"value": 30
|
"value": 30
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 18 3 1,aligny top,growy 0"
|
"value": "cell 1 20 3 1,aligny top,growy 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "progressBarLabel"
|
name: "progressBarLabel"
|
||||||
"text": "JProgressBar:"
|
"text": "JProgressBar:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 19"
|
"value": "cell 0 21"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar1"
|
name: "progressBar1"
|
||||||
@@ -835,7 +863,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 19 3 1,growx"
|
"value": "cell 1 21 3 1,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
add( new FormComponent( "javax.swing.JProgressBar" ) {
|
||||||
name: "progressBar2"
|
name: "progressBar2"
|
||||||
@@ -845,7 +873,7 @@ new FormModel {
|
|||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 19 3 1,growx"
|
"value": "cell 1 21 3 1,growx"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "indeterminateCheckBox"
|
name: "indeterminateCheckBox"
|
||||||
@@ -855,31 +883,31 @@ new FormModel {
|
|||||||
}
|
}
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "indeterminateCheckBoxActionPerformed", false ) )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "indeterminateCheckBoxActionPerformed", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 19"
|
"value": "cell 4 21"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "toolTipLabel"
|
name: "toolTipLabel"
|
||||||
"text": "JToolTip:"
|
"text": "JToolTip:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 20"
|
"value": "cell 0 22"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolTip" ) {
|
add( new FormComponent( "javax.swing.JToolTip" ) {
|
||||||
name: "toolTip1"
|
name: "toolTip1"
|
||||||
"tipText": "Some text in tool tip."
|
"tipText": "Some text in tool tip."
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 20 3 1"
|
"value": "cell 1 22 3 1"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToolTip" ) {
|
add( new FormComponent( "javax.swing.JToolTip" ) {
|
||||||
name: "toolTip2"
|
name: "toolTip2"
|
||||||
"tipText": "Tool tip with\nmultiple\nlines."
|
"tipText": "Tool tip with\nmultiple\nlines."
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 20 3 1"
|
"value": "cell 1 22 3 1"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "toolBarLabel"
|
name: "toolBarLabel"
|
||||||
"text": "JToolBar:"
|
"text": "JToolBar:"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 21"
|
"value": "cell 0 23"
|
||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||||
name: "toolBar1"
|
name: "toolBar1"
|
||||||
@@ -913,7 +941,7 @@ new FormModel {
|
|||||||
"selected": true
|
"selected": true
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 21 3 1,growx"
|
"value": "cell 1 23 3 1,growx"
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( null ) {
|
}, new FormLayoutConstraints( null ) {
|
||||||
"location": new java.awt.Point( 0, 0 )
|
"location": new java.awt.Point( 0, 0 )
|
||||||
|
|||||||
@@ -0,0 +1,142 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 FormDev Software GmbH
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.formdev.flatlaf.testing;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import javax.swing.*;
|
||||||
|
import net.miginfocom.swing.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatSystemColorsTest
|
||||||
|
extends FlatTestPanel
|
||||||
|
{
|
||||||
|
public static void main( String[] args ) {
|
||||||
|
SwingUtilities.invokeLater( () -> {
|
||||||
|
FlatTestFrame frame = FlatTestFrame.create( args, "FlatSystemColorsTest" );
|
||||||
|
frame.showFrame( FlatSystemColorsTest::new );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
FlatSystemColorsTest() {
|
||||||
|
initComponents();
|
||||||
|
|
||||||
|
String[] systemColors = {
|
||||||
|
"desktop",
|
||||||
|
"activeCaption",
|
||||||
|
"activeCaptionText",
|
||||||
|
"activeCaptionBorder",
|
||||||
|
"inactiveCaption",
|
||||||
|
"inactiveCaptionText",
|
||||||
|
"inactiveCaptionBorder",
|
||||||
|
"window",
|
||||||
|
"windowBorder",
|
||||||
|
"windowText",
|
||||||
|
"menu",
|
||||||
|
"menuText",
|
||||||
|
"text",
|
||||||
|
"textText",
|
||||||
|
"textHighlight",
|
||||||
|
"textHighlightText",
|
||||||
|
"textInactiveText",
|
||||||
|
"control",
|
||||||
|
"controlText",
|
||||||
|
"controlHighlight",
|
||||||
|
"controlLtHighlight",
|
||||||
|
"controlShadow",
|
||||||
|
"controlDkShadow",
|
||||||
|
"scrollbar",
|
||||||
|
"info",
|
||||||
|
"infoText",
|
||||||
|
};
|
||||||
|
|
||||||
|
for( String systemColor : systemColors ) {
|
||||||
|
systemColorsPanel.add( new JLabel( systemColor ) );
|
||||||
|
systemColorsPanel.add( new Preview( systemColor ), "wrap" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initComponents() {
|
||||||
|
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||||
|
systemColorsPanel = new JPanel();
|
||||||
|
|
||||||
|
//======== this ========
|
||||||
|
setLayout(new MigLayout(
|
||||||
|
"ltr,insets dialog,hidemode 3",
|
||||||
|
// columns
|
||||||
|
"[fill]",
|
||||||
|
// rows
|
||||||
|
"[grow,fill]"));
|
||||||
|
|
||||||
|
//======== systemColorsPanel ========
|
||||||
|
{
|
||||||
|
systemColorsPanel.setLayout(new MigLayout(
|
||||||
|
"hidemode 3",
|
||||||
|
// columns
|
||||||
|
"[fill]",
|
||||||
|
// rows
|
||||||
|
"[]"));
|
||||||
|
}
|
||||||
|
add(systemColorsPanel, "cell 0 0");
|
||||||
|
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||||
|
}
|
||||||
|
|
||||||
|
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||||
|
private JPanel systemColorsPanel;
|
||||||
|
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||||
|
|
||||||
|
//---- class Preview ----
|
||||||
|
|
||||||
|
private static class Preview
|
||||||
|
extends JPanel
|
||||||
|
{
|
||||||
|
private final String colorKey;
|
||||||
|
private final JPanel colorPreview;
|
||||||
|
private final JLabel colorCode;
|
||||||
|
|
||||||
|
Preview( String colorKey ) {
|
||||||
|
super( new MigLayout( "ltr,insets 0", "[50,fill][]", "[fill]0" ) );
|
||||||
|
|
||||||
|
this.colorKey = colorKey;
|
||||||
|
|
||||||
|
colorPreview = new JPanel();
|
||||||
|
colorPreview.setOpaque( true );
|
||||||
|
colorCode = new JLabel();
|
||||||
|
|
||||||
|
add( colorPreview );
|
||||||
|
add( colorCode, "wrap" );
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUI() {
|
||||||
|
super.updateUI();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update() {
|
||||||
|
if( colorKey == null )
|
||||||
|
return; // called from constructor
|
||||||
|
|
||||||
|
Color color = UIManager.getColor( colorKey );
|
||||||
|
colorPreview.setBackground( (color != null) ? new Color( color.getRGB(), true ) : null );
|
||||||
|
colorCode.setText( (color != null) ? String.format( "#%06x", color.getRGB() & 0xffffff ) : "-" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8"
|
||||||
|
|
||||||
|
new FormModel {
|
||||||
|
contentType: "form/swing"
|
||||||
|
root: new FormRoot {
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
|
}
|
||||||
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
|
"$layoutConstraints": "ltr,insets dialog,hidemode 3"
|
||||||
|
"$columnConstraints": "[fill]"
|
||||||
|
"$rowConstraints": "[grow,fill]"
|
||||||
|
} ) {
|
||||||
|
name: "this"
|
||||||
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
|
"$layoutConstraints": "hidemode 3"
|
||||||
|
"$columnConstraints": "[fill]"
|
||||||
|
"$rowConstraints": "[]"
|
||||||
|
} ) {
|
||||||
|
name: "systemColorsPanel"
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 0 0"
|
||||||
|
} )
|
||||||
|
}, new FormLayoutConstraints( null ) {
|
||||||
|
"location": new java.awt.Point( 0, 0 )
|
||||||
|
"size": new java.awt.Dimension( 415, 350 )
|
||||||
|
} )
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,7 +24,6 @@ import java.awt.event.WindowAdapter;
|
|||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.prefs.Preferences;
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.UIManager.LookAndFeelInfo;
|
import javax.swing.UIManager.LookAndFeelInfo;
|
||||||
import javax.swing.plaf.ColorUIResource;
|
import javax.swing.plaf.ColorUIResource;
|
||||||
@@ -37,6 +36,7 @@ import com.formdev.flatlaf.FlatLaf;
|
|||||||
import com.formdev.flatlaf.FlatLightLaf;
|
import com.formdev.flatlaf.FlatLightLaf;
|
||||||
import com.formdev.flatlaf.IntelliJTheme;
|
import com.formdev.flatlaf.IntelliJTheme;
|
||||||
import com.formdev.flatlaf.demo.LookAndFeelsComboBox;
|
import com.formdev.flatlaf.demo.LookAndFeelsComboBox;
|
||||||
|
import com.formdev.flatlaf.demo.DemoPrefs;
|
||||||
import com.formdev.flatlaf.demo.intellijthemes.*;
|
import com.formdev.flatlaf.demo.intellijthemes.*;
|
||||||
import com.formdev.flatlaf.extras.*;
|
import com.formdev.flatlaf.extras.*;
|
||||||
import com.formdev.flatlaf.extras.TriStateCheckBox.State;
|
import com.formdev.flatlaf.extras.TriStateCheckBox.State;
|
||||||
@@ -52,7 +52,6 @@ public class FlatTestFrame
|
|||||||
extends JFrame
|
extends JFrame
|
||||||
{
|
{
|
||||||
private static final String PREFS_ROOT_PATH = "/flatlaf-test";
|
private static final String PREFS_ROOT_PATH = "/flatlaf-test";
|
||||||
private static final String KEY_LAF = "laf";
|
|
||||||
private static final String KEY_SCALE_FACTOR = "scaleFactor";
|
private static final String KEY_SCALE_FACTOR = "scaleFactor";
|
||||||
|
|
||||||
private final String title;
|
private final String title;
|
||||||
@@ -63,29 +62,17 @@ public class FlatTestFrame
|
|||||||
public boolean useApplyComponentOrientation;
|
public boolean useApplyComponentOrientation;
|
||||||
|
|
||||||
public static FlatTestFrame create( String[] args, String title ) {
|
public static FlatTestFrame create( String[] args, String title ) {
|
||||||
Preferences prefs = Preferences.userRoot().node( PREFS_ROOT_PATH );
|
DemoPrefs.init( PREFS_ROOT_PATH );
|
||||||
|
|
||||||
// set scale factor
|
// set scale factor
|
||||||
if( System.getProperty( "flatlaf.uiScale", System.getProperty( "sun.java2d.uiScale" ) ) == null ) {
|
if( System.getProperty( "flatlaf.uiScale", System.getProperty( "sun.java2d.uiScale" ) ) == null ) {
|
||||||
String scaleFactor = prefs.get( KEY_SCALE_FACTOR, null );
|
String scaleFactor = DemoPrefs.getState().get( KEY_SCALE_FACTOR, null );
|
||||||
if( scaleFactor != null )
|
if( scaleFactor != null )
|
||||||
System.setProperty( "flatlaf.uiScale", scaleFactor );
|
System.setProperty( "flatlaf.uiScale", scaleFactor );
|
||||||
}
|
}
|
||||||
|
|
||||||
// set look and feel
|
// set look and feel
|
||||||
try {
|
DemoPrefs.initLaf( args );
|
||||||
if( args.length > 0 )
|
|
||||||
UIManager.setLookAndFeel( args[0] );
|
|
||||||
else {
|
|
||||||
String lafClassName = prefs.get( KEY_LAF, FlatLightLaf.class.getName() );
|
|
||||||
UIManager.setLookAndFeel( lafClassName );
|
|
||||||
}
|
|
||||||
} catch( Exception ex ) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
|
|
||||||
// fallback
|
|
||||||
FlatLightLaf.install();
|
|
||||||
}
|
|
||||||
|
|
||||||
// create frame
|
// create frame
|
||||||
return new FlatTestFrame( title );
|
return new FlatTestFrame( title );
|
||||||
@@ -239,8 +226,6 @@ public class FlatTestFrame
|
|||||||
// hide popup to avoid occasional StackOverflowError when updating UI
|
// hide popup to avoid occasional StackOverflowError when updating UI
|
||||||
lookAndFeelComboBox.setPopupVisible( false );
|
lookAndFeelComboBox.setPopupVisible( false );
|
||||||
|
|
||||||
Preferences.userRoot().node( PREFS_ROOT_PATH ).put( KEY_LAF, lafClassName );
|
|
||||||
|
|
||||||
applyLookAndFeel( lafClassName, null, false );
|
applyLookAndFeel( lafClassName, null, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,14 +343,12 @@ public class FlatTestFrame
|
|||||||
// hide popup to avoid occasional StackOverflowError when updating UI
|
// hide popup to avoid occasional StackOverflowError when updating UI
|
||||||
scaleFactorComboBox.setPopupVisible( false );
|
scaleFactorComboBox.setPopupVisible( false );
|
||||||
|
|
||||||
Preferences prefs = Preferences.userRoot().node( PREFS_ROOT_PATH );
|
|
||||||
|
|
||||||
if( scaleFactor != null ) {
|
if( scaleFactor != null ) {
|
||||||
System.setProperty( "flatlaf.uiScale", scaleFactor );
|
System.setProperty( "flatlaf.uiScale", scaleFactor );
|
||||||
prefs.put( KEY_SCALE_FACTOR, scaleFactor );
|
DemoPrefs.getState().put( KEY_SCALE_FACTOR, scaleFactor );
|
||||||
} else {
|
} else {
|
||||||
System.clearProperty( "flatlaf.uiScale" );
|
System.clearProperty( "flatlaf.uiScale" );
|
||||||
prefs.remove( KEY_SCALE_FACTOR );
|
DemoPrefs.getState().remove( KEY_SCALE_FACTOR );
|
||||||
}
|
}
|
||||||
|
|
||||||
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
@background=#ccffcc
|
@background=#ccffcc
|
||||||
@foreground=#ff0000
|
@foreground=#ff0000
|
||||||
@selectionBackground=#00aa00
|
@selectionBackground=#00aa00
|
||||||
|
@selectionForeground=#ffff00
|
||||||
@selectionInactiveBackground=#888888
|
@selectionInactiveBackground=#888888
|
||||||
@selectionInactiveForeground=#ffffff
|
@selectionInactiveForeground=#ffffff
|
||||||
@disabledText=#000088
|
@disabledText=#000088
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
*.inactiveBackground=#f0f0f0
|
*.inactiveBackground=#f0f0f0
|
||||||
*.inactiveForeground=#000088
|
*.inactiveForeground=#000088
|
||||||
*.selectionBackground=@selectionBackground
|
*.selectionBackground=@selectionBackground
|
||||||
*.selectionForeground=#ffff00
|
*.selectionForeground=@selectionForeground
|
||||||
*.disabledBackground=#e0e0e0
|
*.disabledBackground=#e0e0e0
|
||||||
*.disabledForeground=@disabledText
|
*.disabledForeground=@disabledText
|
||||||
*.disabledText=@disabledText
|
*.disabledText=@disabledText
|
||||||
@@ -45,24 +46,38 @@
|
|||||||
*.acceleratorSelectionForeground=#ffffff
|
*.acceleratorSelectionForeground=#ffffff
|
||||||
|
|
||||||
|
|
||||||
|
#---- system colors ----
|
||||||
|
|
||||||
|
activeCaption=#99b4d1
|
||||||
|
inactiveCaption=#bfcddb
|
||||||
|
controlHighlight=#e3e3e3
|
||||||
|
controlLtHighlight=#fff
|
||||||
|
controlShadow=#a0a0a0
|
||||||
|
controlDkShadow=#696969
|
||||||
|
|
||||||
|
|
||||||
#---- Button ----
|
#---- Button ----
|
||||||
|
|
||||||
Button.background=#ffffff
|
Button.startBackground=#fff
|
||||||
|
Button.endBackground=#bbb
|
||||||
Button.focusedBackground=#00ffff
|
Button.focusedBackground=#00ffff
|
||||||
Button.hoverBackground=#ffff00
|
Button.hoverBackground=#ffff00
|
||||||
Button.pressedBackground=#FFC800
|
Button.pressedBackground=#FFC800
|
||||||
|
|
||||||
Button.borderColor=#0000ff
|
Button.startBorderColor=#00f
|
||||||
|
Button.endBorderColor=#f00
|
||||||
Button.disabledBorderColor=#000088
|
Button.disabledBorderColor=#000088
|
||||||
Button.focusedBorderColor=#466d94
|
Button.focusedBorderColor=#466d94
|
||||||
Button.hoverBorderColor=#ff0000
|
Button.hoverBorderColor=#ff0000
|
||||||
|
|
||||||
Button.default.background=#dddddd
|
Button.default.startBackground=#ddd
|
||||||
|
Button.default.endBackground=#888
|
||||||
Button.default.foreground=#880000
|
Button.default.foreground=#880000
|
||||||
Button.default.focusedBackground=#00ffff
|
Button.default.focusedBackground=#00ffff
|
||||||
Button.default.hoverBackground=#ffff00
|
Button.default.hoverBackground=#ffff00
|
||||||
Button.default.pressedBackground=#FFC800
|
Button.default.pressedBackground=#FFC800
|
||||||
Button.default.borderColor=#ff0000
|
Button.default.startBorderColor=#f00
|
||||||
|
Button.default.endBorderColor=#00f
|
||||||
Button.default.hoverBorderColor=#ff0000
|
Button.default.hoverBorderColor=#ff0000
|
||||||
Button.default.focusedBorderColor=#537699
|
Button.default.focusedBorderColor=#537699
|
||||||
Button.default.focusColor=#ff0000
|
Button.default.focusColor=#ff0000
|
||||||
|
|||||||
@@ -69,3 +69,8 @@ TaskPane.titleOver=#0000aa
|
|||||||
TaskPane.specialTitleBackground=#00ffff
|
TaskPane.specialTitleBackground=#00ffff
|
||||||
TaskPane.specialTitleForeground=#444444
|
TaskPane.specialTitleForeground=#444444
|
||||||
TaskPane.specialTitleOver=#dd0000
|
TaskPane.specialTitleOver=#dd0000
|
||||||
|
|
||||||
|
|
||||||
|
#---- TitledPanel ----
|
||||||
|
|
||||||
|
JXTitledPanel.borderColor=@@Button.startBorderColor
|
||||||
|
|||||||
Reference in New Issue
Block a user