Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f60755f02 | ||
|
|
44c455419b | ||
|
|
129bc9b3ae | ||
|
|
08ba7dd065 | ||
|
|
e9cb85127a | ||
|
|
c9c703fe98 | ||
|
|
0141dfbea2 | ||
|
|
fb7dafbc39 | ||
|
|
0660f9a511 | ||
|
|
a39ae5a8c5 | ||
|
|
03e22e3dbf | ||
|
|
d5e9fd0e5c | ||
|
|
141138ebea | ||
|
|
37ecd9bd4f | ||
|
|
2250185487 | ||
|
|
73cb63c9f9 | ||
|
|
f61f6b6006 | ||
|
|
a8f659f2ac | ||
|
|
a878ebc368 | ||
|
|
8ee6588d46 | ||
|
|
7c25f087fb | ||
|
|
d0b0f098d9 |
21
CHANGELOG.md
@@ -1,12 +1,29 @@
|
||||
FlatLaf Change Log
|
||||
==================
|
||||
|
||||
## 0.33
|
||||
|
||||
- Improved creation of disabled grayscale icons used in disabled buttons, labels
|
||||
and tabs. They now have more contrast and are lighter in light themes and
|
||||
darker in dark themes. (issue #70)
|
||||
- IntelliJ Themes: Fixed ComboBox size and Spinner border in all Material UI
|
||||
Lite themes and limit tree row height in all Material UI Lite themes and some
|
||||
other themes.
|
||||
- IntelliJ Themes: Material UI Lite themes did not work when using
|
||||
[IntelliJ Themes Pack](flatlaf-intellij-themes) addon. (PR #88, issue #89)
|
||||
- IntelliJ Themes: Added Java 9 module descriptor to
|
||||
`flatlaf-intellij-themes-<version>.jar`.
|
||||
|
||||
|
||||
## 0.32
|
||||
|
||||
- ToggleButton: Compute selected background color based on current component
|
||||
background. (issue #32)
|
||||
- New [IntelliJ Themes Pack](flatlaf-intellij-themes) addon bundles many popular
|
||||
open-source 3rd party themes from JetBrains Plugins Repository into a JAR and
|
||||
provides Java classes to use them.
|
||||
- IntelliJ Themes: Fixed button and toggle button colors. (issue #86)
|
||||
- Updated IntelliJ Themes in demo to the latest versions.
|
||||
- ToggleButton: Compute selected background color based on current component
|
||||
background. (issue #32)
|
||||
|
||||
|
||||
## 0.31
|
||||
|
||||
@@ -19,7 +19,8 @@ IntelliJ IDEA 2019.2+ and uses almost the same colors and icons.
|
||||
IntelliJ Platform Themes
|
||||
------------------------
|
||||
|
||||
FlatLaf can use 3rd party themes created for IntelliJ Platform:
|
||||
FlatLaf can use 3rd party themes created for IntelliJ Platform (see
|
||||
[IntelliJ Themes Pack](flatlaf-intellij-themes)):
|
||||
|
||||

|
||||
|
||||
@@ -70,6 +71,7 @@ Addons
|
||||
|
||||
- [SwingX](flatlaf-swingx)
|
||||
- [JIDE Common Layer](flatlaf-jide-oss)
|
||||
- [IntelliJ Themes Pack](flatlaf-intellij-themes)
|
||||
|
||||
|
||||
Projects using FlatLaf
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
val releaseVersion = "0.32"
|
||||
val developmentVersion = "0.33-SNAPSHOT"
|
||||
val releaseVersion = "0.33"
|
||||
val developmentVersion = "0.34-SNAPSHOT"
|
||||
|
||||
version = if( java.lang.Boolean.getBoolean( "release" ) ) releaseVersion else developmentVersion
|
||||
|
||||
|
||||
@@ -23,6 +23,11 @@ plugins {
|
||||
|
||||
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||
sourceSets {
|
||||
create( "java9" ) {
|
||||
java {
|
||||
setSrcDirs( listOf( "src/main/java9" ) )
|
||||
}
|
||||
}
|
||||
create( "module-info" ) {
|
||||
java {
|
||||
// include "src/main/java" here to get compile errors if classes are
|
||||
@@ -52,6 +57,12 @@ tasks {
|
||||
archiveBaseName.set( "flatlaf" )
|
||||
|
||||
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||
manifest.attributes( "Multi-Release" to "true" )
|
||||
|
||||
into( "META-INF/versions/9" ) {
|
||||
from( sourceSets["java9"].output )
|
||||
}
|
||||
|
||||
from( sourceSets["module-info"].output ) {
|
||||
include( "module-info.class" )
|
||||
}
|
||||
|
||||
@@ -21,12 +21,16 @@ import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Font;
|
||||
import java.awt.Image;
|
||||
import java.awt.KeyEventPostProcessor;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.image.FilteredImageSource;
|
||||
import java.awt.image.ImageFilter;
|
||||
import java.awt.image.ImageProducer;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.lang.ref.WeakReference;
|
||||
@@ -37,9 +41,13 @@ import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.JTabbedPane;
|
||||
@@ -56,6 +64,8 @@ import javax.swing.plaf.UIResource;
|
||||
import javax.swing.plaf.basic.BasicLookAndFeel;
|
||||
import javax.swing.text.StyleContext;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
import com.formdev.flatlaf.util.GrayFilter;
|
||||
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
@@ -117,6 +127,30 @@ public abstract class FlatLaf
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getDisabledIcon( JComponent component, Icon icon ) {
|
||||
if( icon instanceof ImageIcon ) {
|
||||
Object grayFilter = UIManager.get( "Component.grayFilter" );
|
||||
if( !(grayFilter instanceof ImageFilter) ) {
|
||||
// fallback
|
||||
grayFilter = isDark()
|
||||
? new GrayFilter( -20, -70, 100 )
|
||||
: new GrayFilter( 25, -25, 100 );
|
||||
}
|
||||
|
||||
ImageFilter filter = (ImageFilter) grayFilter;
|
||||
Function<Image, Image> mapper = img -> {
|
||||
ImageProducer producer = new FilteredImageSource( img.getSource(), filter );
|
||||
return Toolkit.getDefaultToolkit().createImage( producer );
|
||||
};
|
||||
|
||||
Image image = ((ImageIcon)icon).getImage();
|
||||
return new ImageIconUIResource( MultiResolutionImageSupport.map( image, mapper ) );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
if( SystemInfo.IS_MAC )
|
||||
@@ -620,4 +654,15 @@ public abstract class FlatLaf
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
//---- class ImageIconUIResource ------------------------------------------
|
||||
|
||||
private static class ImageIconUIResource
|
||||
extends ImageIcon
|
||||
implements UIResource
|
||||
{
|
||||
ImageIconUIResource( Image image ) {
|
||||
super( image );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class IntelliJTheme
|
||||
* Using a buffered input stream is not necessary.
|
||||
*/
|
||||
public static FlatLaf createLaf( InputStream in )
|
||||
throws IOException, ParseException
|
||||
throws IOException
|
||||
{
|
||||
return createLaf( new IntelliJTheme( in ) );
|
||||
}
|
||||
@@ -106,11 +106,13 @@ public class IntelliJTheme
|
||||
*/
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public IntelliJTheme( InputStream in )
|
||||
throws IOException, ParseException
|
||||
throws IOException
|
||||
{
|
||||
Map<String, Object> json;
|
||||
try( Reader reader = new InputStreamReader( in, StandardCharsets.UTF_8 ) ) {
|
||||
json = (Map<String, Object>) Json.parse( reader );
|
||||
} catch( ParseException ex ) {
|
||||
throw new IOException( ex.getMessage(), ex );
|
||||
}
|
||||
|
||||
name = (String) json.get( "name" );
|
||||
@@ -194,6 +196,11 @@ public class IntelliJTheme
|
||||
if( !uiKeys.contains( "ToggleButton.foreground" ) && uiKeys.contains( "Button.foreground" ) )
|
||||
defaults.put( "ToggleButton.foreground", defaults.get( "Button.foreground" ) );
|
||||
|
||||
// limit tree row height
|
||||
int rowHeight = defaults.getInt( "Tree.rowHeight" );
|
||||
if( rowHeight > 22 )
|
||||
defaults.put( "Tree.rowHeight", 22 );
|
||||
|
||||
// apply theme specific UI defaults at the end to allow overwriting
|
||||
defaults.putAll( themeSpecificDefaults );
|
||||
}
|
||||
@@ -249,6 +256,11 @@ public class IntelliJTheme
|
||||
} else {
|
||||
uiKeys.add( key );
|
||||
|
||||
// fix ComboBox size and Spinner border in all Material UI Lite themes
|
||||
boolean isMaterialUILite = author.equals( "Mallowigi" );
|
||||
if( isMaterialUILite && (key.equals( "ComboBox.padding" ) || key.equals( "Spinner.border" )) )
|
||||
return; // ignore
|
||||
|
||||
// map keys
|
||||
key = uiKeyMapping.getOrDefault( key, key );
|
||||
if( key.isEmpty() )
|
||||
|
||||
@@ -41,6 +41,7 @@ import com.formdev.flatlaf.ui.FlatEmptyBorder;
|
||||
import com.formdev.flatlaf.ui.FlatLineBorder;
|
||||
import com.formdev.flatlaf.util.ColorFunctions;
|
||||
import com.formdev.flatlaf.util.DerivedColor;
|
||||
import com.formdev.flatlaf.util.GrayFilter;
|
||||
import com.formdev.flatlaf.util.HSLColor;
|
||||
import com.formdev.flatlaf.util.StringUtils;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
@@ -236,7 +237,7 @@ class UIDefaultsLoader
|
||||
}
|
||||
|
||||
private enum ValueType { UNKNOWN, STRING, CHARACTER, INTEGER, FLOAT, BORDER, ICON, INSETS, DIMENSION, COLOR,
|
||||
SCALEDINTEGER, SCALEDFLOAT, SCALEDINSETS, SCALEDDIMENSION, INSTANCE, CLASS }
|
||||
SCALEDINTEGER, SCALEDFLOAT, SCALEDINSETS, SCALEDDIMENSION, INSTANCE, CLASS, GRAYFILTER }
|
||||
|
||||
static Object parseValue( String key, String value ) {
|
||||
return parseValue( key, value, v -> v, Collections.emptyList() );
|
||||
@@ -303,6 +304,8 @@ class UIDefaultsLoader
|
||||
valueType = ValueType.CHARACTER;
|
||||
else if( key.endsWith( "UI" ) )
|
||||
valueType = ValueType.STRING;
|
||||
else if( key.endsWith( "grayFilter" ) )
|
||||
valueType = ValueType.GRAYFILTER;
|
||||
}
|
||||
|
||||
// parse value
|
||||
@@ -322,6 +325,7 @@ class UIDefaultsLoader
|
||||
case SCALEDDIMENSION:return parseScaledDimension( value );
|
||||
case INSTANCE: return parseInstance( value, addonClassLoaders );
|
||||
case CLASS: return parseClass( value, addonClassLoaders );
|
||||
case GRAYFILTER: return parseGrayFilter( value );
|
||||
case UNKNOWN:
|
||||
default:
|
||||
// colors
|
||||
@@ -680,6 +684,21 @@ class UIDefaultsLoader
|
||||
};
|
||||
}
|
||||
|
||||
private static Object parseGrayFilter( String value ) {
|
||||
List<String> numbers = split( value, ',' );
|
||||
try {
|
||||
int brightness = Integer.parseInt( numbers.get( 0 ) );
|
||||
int contrast = Integer.parseInt( numbers.get( 1 ) );
|
||||
int alpha = Integer.parseInt( numbers.get( 2 ) );
|
||||
|
||||
return (LazyValue) t -> {
|
||||
return new GrayFilter( brightness, contrast, alpha );
|
||||
};
|
||||
} catch( NumberFormatException ex ) {
|
||||
throw new IllegalArgumentException( "invalid gray filter '" + value + "'" );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Split string and trim parts.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.formdev.flatlaf.util;
|
||||
|
||||
import java.awt.image.RGBImageFilter;
|
||||
|
||||
// based on https://github.com/JetBrains/intellij-community/blob/3840eab54746f5c4f301bb3ac78f00a980b5fd6e/platform/util/ui/src/com/intellij/util/ui/UIUtil.java#L253-L347
|
||||
|
||||
/**
|
||||
* An image filter that turns an image into a grayscale image.
|
||||
* Used for icons in disabled buttons and labels.
|
||||
*/
|
||||
public class GrayFilter
|
||||
extends RGBImageFilter
|
||||
{
|
||||
private final float brightness;
|
||||
private final float contrast;
|
||||
private final int alpha;
|
||||
|
||||
private final int origContrast;
|
||||
private final int origBrightness;
|
||||
|
||||
/**
|
||||
* @param brightness in range [-100..100] where 0 has no effect
|
||||
* @param contrast in range [-100..100] where 0 has no effect
|
||||
* @param alpha in range [0..100] where 0 is transparent, 100 has no effect
|
||||
*/
|
||||
public GrayFilter( int brightness, int contrast, int alpha ) {
|
||||
this.origBrightness = Math.max( -100, Math.min( 100, brightness ) );
|
||||
this.origContrast = Math.max( -100, Math.min( 100, contrast ) );
|
||||
this.alpha = Math.max( 0, Math.min( 100, alpha ) );
|
||||
|
||||
this.brightness = (float) (Math.pow( origBrightness, 3 ) / (100f * 100f)); // cubic in [0..100]
|
||||
this.contrast = origContrast / 100f;
|
||||
|
||||
canFilterIndexColorModel = true;
|
||||
}
|
||||
|
||||
public GrayFilter() {
|
||||
this( 0, 0, 100 );
|
||||
}
|
||||
|
||||
public int getBrightness() {
|
||||
return origBrightness;
|
||||
}
|
||||
|
||||
public int getContrast() {
|
||||
return origContrast;
|
||||
}
|
||||
|
||||
public int getAlpha() {
|
||||
return alpha;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int filterRGB( int x, int y, int rgb ) {
|
||||
// use NTSC conversion formula
|
||||
int gray = (int)(
|
||||
0.30 * (rgb >> 16 & 0xff) +
|
||||
0.59 * (rgb >> 8 & 0xff) +
|
||||
0.11 * (rgb & 0xff));
|
||||
|
||||
if( brightness >= 0 )
|
||||
gray = (int) ((gray + brightness * 255) / (1 + brightness));
|
||||
else
|
||||
gray = (int) (gray / (1 - brightness));
|
||||
|
||||
if( contrast >= 0 ) {
|
||||
if( gray >= 127 )
|
||||
gray = (int) (gray + (255 - gray) * contrast);
|
||||
else
|
||||
gray = (int) (gray - gray * contrast);
|
||||
} else
|
||||
gray = (int) (127 + (gray - 127) * (contrast + 1));
|
||||
|
||||
int a = (alpha != 100)
|
||||
? (((rgb >> 24) & 0xff) * alpha / 100) << 24
|
||||
: (rgb & 0xff000000);
|
||||
|
||||
return a | (gray << 16) | (gray << 8) | gray;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2020 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
|
||||
*
|
||||
* https://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.util;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Support for multi-resolution images available since Java 9.
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class MultiResolutionImageSupport
|
||||
{
|
||||
public static boolean isAvailable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isMultiResolutionImage( Image image ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Image create( int baseImageIndex, Image... resolutionVariants ) {
|
||||
return resolutionVariants[baseImageIndex];
|
||||
}
|
||||
|
||||
public static Image map( Image image, Function<Image, Image> mapper ) {
|
||||
return mapper.apply( image );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2020 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
|
||||
*
|
||||
* https://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.util;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.awt.image.AbstractMultiResolutionImage;
|
||||
import java.awt.image.BaseMultiResolutionImage;
|
||||
import java.awt.image.MultiResolutionImage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
/**
|
||||
* Support for multi-resolution images available since Java 9.
|
||||
*
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class MultiResolutionImageSupport
|
||||
{
|
||||
public static boolean isAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isMultiResolutionImage( Image image ) {
|
||||
return image instanceof MultiResolutionImage;
|
||||
}
|
||||
|
||||
public static Image create( int baseImageIndex, Image... resolutionVariants ) {
|
||||
return new BaseMultiResolutionImage( baseImageIndex, resolutionVariants );
|
||||
}
|
||||
|
||||
public static Image map( Image image, Function<Image, Image> mapper ) {
|
||||
return image instanceof MultiResolutionImage
|
||||
? new MappedMultiResolutionImage( image, mapper )
|
||||
: mapper.apply( image );
|
||||
}
|
||||
|
||||
//---- class MappedMultiResolutionImage -----------------------------------
|
||||
|
||||
private static class MappedMultiResolutionImage
|
||||
extends AbstractMultiResolutionImage
|
||||
{
|
||||
private final Image mrImage;
|
||||
private final Function<Image, Image> mapper;
|
||||
private final IdentityHashMap<Image, Image> cache = new IdentityHashMap<>();
|
||||
|
||||
MappedMultiResolutionImage( Image mrImage, Function<Image, Image> mapper ) {
|
||||
assert mrImage instanceof MultiResolutionImage;
|
||||
|
||||
this.mrImage = mrImage;
|
||||
this.mapper = mapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getResolutionVariant( double destImageWidth, double destImageHeight ) {
|
||||
Image variant = ((MultiResolutionImage)mrImage).getResolutionVariant( destImageWidth, destImageHeight );
|
||||
return mapAndCacheImage( variant );
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Image> getResolutionVariants() {
|
||||
List<Image> variants = ((MultiResolutionImage)mrImage).getResolutionVariants();
|
||||
List<Image> mappedVariants = new ArrayList<>();
|
||||
for( Image image : variants )
|
||||
mappedVariants.add( mapAndCacheImage( image ) );
|
||||
return mappedVariants;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Image getBaseImage() {
|
||||
return mapAndCacheImage( mrImage );
|
||||
}
|
||||
|
||||
private Image mapAndCacheImage( Image image ) {
|
||||
return cache.computeIfAbsent( image, img -> {
|
||||
return new ImageIcon( mapper.apply( img ) ).getImage();
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,6 +125,7 @@ Component.disabledBorderColor=#646464
|
||||
Component.focusedBorderColor=#466d94
|
||||
Component.focusColor=#3d6185
|
||||
Component.linkColor=#589df6
|
||||
Component.grayFilter=-20,-70,100
|
||||
|
||||
|
||||
#---- Desktop ----
|
||||
|
||||
@@ -127,6 +127,7 @@ Component.disabledBorderColor=#cfcfcf
|
||||
Component.focusedBorderColor=#87afda
|
||||
Component.focusColor=#97c3f3
|
||||
Component.linkColor=#2470B3
|
||||
Component.grayFilter=25,-25,100
|
||||
|
||||
|
||||
#---- Desktop ----
|
||||
|
||||
@@ -43,9 +43,12 @@ tasks {
|
||||
|
||||
manifest {
|
||||
attributes( "Main-Class" to "com.formdev.flatlaf.demo.FlatLafDemo" )
|
||||
|
||||
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 )
|
||||
attributes( "Multi-Release" to "true" )
|
||||
}
|
||||
|
||||
exclude( "META-INF/versions/**" )
|
||||
exclude( "module-info.class" )
|
||||
|
||||
// include all dependencies in jar
|
||||
from( {
|
||||
|
||||
@@ -101,6 +101,7 @@ class MoreComponentsPanel
|
||||
JButton button7 = new JButton();
|
||||
JButton button8 = new JButton();
|
||||
JToggleButton toggleButton6 = new JToggleButton();
|
||||
JButton button1 = new JButton();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new MigLayout(
|
||||
@@ -380,6 +381,11 @@ class MoreComponentsPanel
|
||||
toggleButton6.setIcon(UIManager.getIcon("Tree.leafIcon"));
|
||||
toggleButton6.setSelected(true);
|
||||
toolBar1.add(toggleButton6);
|
||||
|
||||
//---- button1 ----
|
||||
button1.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess.png")));
|
||||
button1.setEnabled(false);
|
||||
toolBar1.add(button1);
|
||||
}
|
||||
add(toolBar1, "cell 1 10 3 1,growx");
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8"
|
||||
JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8"
|
||||
|
||||
new FormModel {
|
||||
contentType: "form/swing"
|
||||
@@ -355,6 +355,11 @@ new FormModel {
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" )
|
||||
"selected": true
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button1"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/demo/icons/intellij-showWriteAccess.png" )
|
||||
"enabled": false
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 10 3 1,growx"
|
||||
} )
|
||||
|
||||
@@ -37,20 +37,25 @@ public class IJThemesClassGenerator
|
||||
String toPath = "../flatlaf-intellij-themes/src/main/java" + IJThemesPanel.THEMES_PACKAGE + "..";
|
||||
|
||||
StringBuilder allInfos = new StringBuilder();
|
||||
StringBuilder markdownTable = new StringBuilder();
|
||||
markdownTable.append( "Name | Class\n" );
|
||||
markdownTable.append( "-----|------\n" );
|
||||
|
||||
for( IJThemeInfo ti : themesManager.bundledThemes ) {
|
||||
if( ti.sourceCodeUrl == null || ti.sourceCodePath == null )
|
||||
continue;
|
||||
|
||||
generateClass( ti, toPath, allInfos );
|
||||
generateClass( ti, toPath, allInfos, markdownTable );
|
||||
}
|
||||
|
||||
Path out = new File( toPath, "FlatAllIJThemes.java" ).toPath();
|
||||
String allThemes = CLASS_HEADER + ALL_THEMES_TEMPLATE.replace( "${allInfos}", allInfos );
|
||||
writeFile( out, allThemes );
|
||||
|
||||
System.out.println( markdownTable );
|
||||
}
|
||||
|
||||
private static void generateClass( IJThemeInfo ti, String toPath, StringBuilder allInfos ) {
|
||||
private static void generateClass( IJThemeInfo ti, String toPath, StringBuilder allInfos, StringBuilder markdownTable ) {
|
||||
String resourceName = ti.resourceName;
|
||||
String resourcePath = null;
|
||||
int resSep = resourceName.indexOf( '/' );
|
||||
@@ -97,6 +102,9 @@ public class IJThemesClassGenerator
|
||||
.replace( "${subPackage}", subPackage )
|
||||
.replace( "${themeClass}", themeClass )
|
||||
.replace( "${themeName}", name ) );
|
||||
|
||||
markdownTable.append( String.format( "[%s](%s) | `com.formdev.flatlaf.intellijthemes%s.%s`\n",
|
||||
name, ti.sourceCodeUrl, subPackage, themeClass ) );
|
||||
}
|
||||
|
||||
private static void writeFile( Path out, String content ) {
|
||||
|
||||
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 495 B |
108
flatlaf-intellij-themes/README.md
Normal file
@@ -0,0 +1,108 @@
|
||||
FlatLaf IntelliJ Themes Pack
|
||||
============================
|
||||
|
||||
This addon for FlatLaf bundles many popular open-source 3rd party themes from
|
||||
JetBrains Plugins Repository into a JAR and provides Java classes to use them.
|
||||
|
||||
Use [FlatLaf Demo](https://github.com/JFormDesigner/FlatLaf#demo) to try them
|
||||
out.
|
||||
|
||||
|
||||
Download
|
||||
--------
|
||||
|
||||
FlatLaf IntelliJ Themes Pack binaries are available on **JCenter** and **Maven
|
||||
Central**.
|
||||
|
||||
If you use Maven or Gradle, add a dependency with following coordinates to your
|
||||
build script:
|
||||
|
||||
groupId: com.formdev
|
||||
artifactId: flatlaf-intellij-themes
|
||||
version: (see button below)
|
||||
|
||||
Otherwise download `flatlaf-intellij-themes-<version>.jar` here:
|
||||
|
||||
[](https://bintray.com/jformdesigner/flatlaf/flatlaf-intellij-themes/_latestVersion)
|
||||
|
||||
You also need `flatlaf-<version>.jar`, which you can download here:
|
||||
|
||||
[](https://bintray.com/jformdesigner/flatlaf/flatlaf/_latestVersion)
|
||||
|
||||
|
||||
How to use?
|
||||
-----------
|
||||
|
||||
Choose a theme (see list below) and invoke its `install` method. E.g.:
|
||||
|
||||
~~~java
|
||||
FlatArcOrangeIJTheme.install();
|
||||
~~~
|
||||
|
||||
|
||||
Themes
|
||||
------
|
||||
|
||||
This addon contains following themes.
|
||||
|
||||
Name | Class
|
||||
-----|------
|
||||
[Arc](https://gitlab.com/zlamalp/arc-theme-idea) | `com.formdev.flatlaf.intellijthemes.FlatArcIJTheme`
|
||||
[Arc - Orange](https://gitlab.com/zlamalp/arc-theme-idea) | `com.formdev.flatlaf.intellijthemes.FlatArcOrangeIJTheme`
|
||||
[Cyan light](https://github.com/OlyaB/CyanTheme) | `com.formdev.flatlaf.intellijthemes.FlatCyanLightIJTheme`
|
||||
[Dark Flat](https://github.com/nerzhulart/DarkFlatTheme) | `com.formdev.flatlaf.intellijthemes.FlatDarkFlatIJTheme`
|
||||
[Dark purple](https://github.com/OlyaB/DarkPurpleTheme) | `com.formdev.flatlaf.intellijthemes.FlatDarkPurpleIJTheme`
|
||||
[Dracula](https://github.com/dracula/jetbrains) | `com.formdev.flatlaf.intellijthemes.FlatDraculaIJTheme`
|
||||
[Gradianto Dark Fuchsia](https://github.com/thvardhan/Gradianto) | `com.formdev.flatlaf.intellijthemes.FlatGradiantoDarkFuchsiaIJTheme`
|
||||
[Gradianto Deep Ocean](https://github.com/thvardhan/Gradianto) | `com.formdev.flatlaf.intellijthemes.FlatGradiantoDeepOceanIJTheme`
|
||||
[Gradianto Midnight Blue](https://github.com/thvardhan/Gradianto) | `com.formdev.flatlaf.intellijthemes.FlatGradiantoMidnightBlueIJTheme`
|
||||
[Gray](https://github.com/OlyaB/GreyTheme) | `com.formdev.flatlaf.intellijthemes.FlatGrayIJTheme`
|
||||
[Gruvbox Dark Hard](https://github.com/Vincent-P/gruvbox-intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkHardIJTheme`
|
||||
[Gruvbox Dark Medium](https://github.com/Vincent-P/gruvbox-intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkMediumIJTheme`
|
||||
[Gruvbox Dark Soft](https://github.com/Vincent-P/gruvbox-intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatGruvboxDarkSoftIJTheme`
|
||||
[Hiberbee Dark](https://github.com/Hiberbee/code-highlight-themes) | `com.formdev.flatlaf.intellijthemes.FlatHiberbeeDarkIJTheme`
|
||||
[High contrast](https://github.com/OlyaB/HighContrastTheme) | `com.formdev.flatlaf.intellijthemes.FlatHighContrastIJTheme`
|
||||
[Light Flat](https://github.com/nerzhulart/LightFlatTheme) | `com.formdev.flatlaf.intellijthemes.FlatLightFlatIJTheme`
|
||||
[Material Design Dark](https://github.com/xinkunZ/NotReallyMDTheme) | `com.formdev.flatlaf.intellijthemes.FlatMaterialDesignDarkIJTheme`
|
||||
[Monocai](https://github.com/bmikaili/intellij-monocai-theme) | `com.formdev.flatlaf.intellijthemes.FlatMonocaiIJTheme`
|
||||
[Nord](https://github.com/arcticicestudio/nord-jetbrains) | `com.formdev.flatlaf.intellijthemes.FlatNordIJTheme`
|
||||
[One Dark](https://github.com/one-dark/jetbrains-one-dark-theme) | `com.formdev.flatlaf.intellijthemes.FlatOneDarkIJTheme`
|
||||
[Solarized Dark](https://github.com/snowe2010/solarized-jetbrains) | `com.formdev.flatlaf.intellijthemes.FlatSolarizedDarkIJTheme`
|
||||
[Solarized Light](https://github.com/snowe2010/solarized-jetbrains) | `com.formdev.flatlaf.intellijthemes.FlatSolarizedLightIJTheme`
|
||||
[Spacegray](https://github.com/mturlo/intellij-spacegray) | `com.formdev.flatlaf.intellijthemes.FlatSpacegrayIJTheme`
|
||||
[Vuesion](https://github.com/vuesion/intellij-theme) | `com.formdev.flatlaf.intellijthemes.FlatVuesionIJTheme`
|
||||
|
||||
Material Theme UI Lite:
|
||||
|
||||
Name | Class
|
||||
-----|------
|
||||
[Arc Dark](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkIJTheme`
|
||||
[Arc Dark Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatArcDarkContrastIJTheme`
|
||||
[Atom One Dark](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkIJTheme`
|
||||
[Atom One Dark Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneDarkContrastIJTheme`
|
||||
[Atom One Light](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightIJTheme`
|
||||
[Atom One Light Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatAtomOneLightContrastIJTheme`
|
||||
[Dracula](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaIJTheme`
|
||||
[Dracula Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaContrastIJTheme`
|
||||
[GitHub](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubIJTheme`
|
||||
[GitHub Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatGitHubContrastIJTheme`
|
||||
[Light Owl](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlIJTheme`
|
||||
[Light Owl Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatLightOwlContrastIJTheme`
|
||||
[Material Darker](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerIJTheme`
|
||||
[Material Darker Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDarkerContrastIJTheme`
|
||||
[Material Deep Ocean](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDeepOceanIJTheme`
|
||||
[Material Deep Ocean Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialDeepOceanContrastIJTheme`
|
||||
[Material Lighter](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialLighterIJTheme`
|
||||
[Material Lighter Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialLighterContrastIJTheme`
|
||||
[Material Oceanic](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialOceanicIJTheme`
|
||||
[Material Oceanic Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialOceanicContrastIJTheme`
|
||||
[Material Palenight](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialPalenightIJTheme`
|
||||
[Material Palenight Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMaterialPalenightContrastIJTheme`
|
||||
[Monokai Pro](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProIJTheme`
|
||||
[Monokai Pro Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatMonokaiProContrastIJTheme`
|
||||
[Night Owl](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlIJTheme`
|
||||
[Night Owl Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatNightOwlContrastIJTheme`
|
||||
[Solarized Dark](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkIJTheme`
|
||||
[Solarized Dark Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedDarkContrastIJTheme`
|
||||
[Solarized Light](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightIJTheme`
|
||||
[Solarized Light Contrast](https://github.com/mallowigi/material-theme-ui-lite) | `com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatSolarizedLightContrastIJTheme`
|
||||
@@ -25,6 +25,18 @@ dependencies {
|
||||
implementation( project( ":flatlaf-core" ) )
|
||||
}
|
||||
|
||||
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||
sourceSets {
|
||||
create( "module-info" ) {
|
||||
java {
|
||||
// include "src/main/java" here to get compile errors if classes are
|
||||
// used from other modules that are not specified in module dependencies
|
||||
setSrcDirs( listOf( "src/main/module-info", "src/main/java" ) )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
assemble {
|
||||
dependsOn(
|
||||
@@ -33,6 +45,26 @@ tasks {
|
||||
)
|
||||
}
|
||||
|
||||
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||
named<JavaCompile>( "compileModuleInfoJava" ) {
|
||||
sourceCompatibility = "9"
|
||||
targetCompatibility = "9"
|
||||
|
||||
dependsOn( ":flatlaf-core:jar" )
|
||||
|
||||
options.compilerArgs.add( "--module-path" )
|
||||
options.compilerArgs.add( project( ":flatlaf-core" ).tasks["jar"].outputs.files.asPath )
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
|
||||
from( sourceSets["module-info"].output ) {
|
||||
include( "module-info.class" )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options {
|
||||
this as StandardJavadocDocletOptions
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.IntelliJTheme;
|
||||
import com.formdev.flatlaf.json.ParseException;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
@@ -32,8 +31,9 @@ class Utils
|
||||
|
||||
static IntelliJTheme loadTheme( String name ) {
|
||||
try {
|
||||
return new IntelliJTheme( Utils.class.getResourceAsStream( "themes/" + name ) );
|
||||
} catch( ParseException | IOException ex ) {
|
||||
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
||||
"/com/formdev/flatlaf/intellijthemes/themes/" + name ) );
|
||||
} catch( IOException ex ) {
|
||||
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
||||
LOG.log( Level.SEVERE, msg, ex );
|
||||
throw new RuntimeException( msg, ex );
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.IntelliJTheme;
|
||||
import com.formdev.flatlaf.json.ParseException;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
@@ -32,8 +31,9 @@ class Utils
|
||||
|
||||
static IntelliJTheme loadTheme( String name ) {
|
||||
try {
|
||||
return new IntelliJTheme( Utils.class.getResourceAsStream( "../themes/material-theme-ui-lite/" + name ) );
|
||||
} catch( ParseException | IOException ex ) {
|
||||
return new IntelliJTheme( Utils.class.getResourceAsStream(
|
||||
"/com/formdev/flatlaf/intellijthemes/themes/material-theme-ui-lite/" + name ) );
|
||||
} catch( IOException ex ) {
|
||||
String msg = "FlatLaf: Failed to load IntelliJ theme '" + name + "'";
|
||||
LOG.log( Level.SEVERE, msg, ex );
|
||||
throw new RuntimeException( msg, ex );
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2020 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
module com.formdev.flatlaf.intellijthemes {
|
||||
requires java.desktop;
|
||||
requires java.logging;
|
||||
requires com.formdev.flatlaf;
|
||||
|
||||
exports com.formdev.flatlaf.intellijthemes;
|
||||
exports com.formdev.flatlaf.intellijthemes.materialthemeuilite;
|
||||
}
|
||||
@@ -0,0 +1,943 @@
|
||||
/*
|
||||
* Copyright 2020 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
|
||||
*
|
||||
* https://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 java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.FilteredImageSource;
|
||||
import java.awt.image.ImageProducer;
|
||||
import java.awt.image.RGBImageFilter;
|
||||
import java.beans.*;
|
||||
import java.net.URL;
|
||||
import javax.swing.*;
|
||||
import com.formdev.flatlaf.FlatLaf;
|
||||
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import net.miginfocom.swing.*;
|
||||
|
||||
/**
|
||||
* @author Karl Tauber
|
||||
*/
|
||||
public class FlatDisabledIconsTest
|
||||
extends FlatTestPanel
|
||||
{
|
||||
public static void main( String[] args ) {
|
||||
SwingUtilities.invokeLater( () -> {
|
||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatDisabledIconsTest" );
|
||||
frame.showFrame( FlatDisabledIconsTest::new );
|
||||
} );
|
||||
}
|
||||
|
||||
FlatDisabledIconsTest() {
|
||||
initComponents();
|
||||
|
||||
RGBImageFilter plasticLafFilter = new PlasticRGBGrayFilter();
|
||||
RGBImageFilter intellijTextFilter = new IntelliJGrayFilter( 20, 0, 100 );
|
||||
RGBImageFilter netbeansFilter = new NetBeansDisabledButtonFilter();
|
||||
|
||||
for( Component c : enabledToolBar.getComponents() ) {
|
||||
AbstractButton b = (AbstractButton) c;
|
||||
Icon icon = b.getIcon();
|
||||
|
||||
JToggleButton cb = new JToggleButton( icon );
|
||||
cb.setEnabled( false );
|
||||
currentLafToolBar.add( cb );
|
||||
basicLafToolBar.add( new FilterButton( null, icon ) );
|
||||
metalLafToolBar.add( new FilterButton( null, icon ) );
|
||||
plasticToolBar.add( new FilterButton( plasticLafFilter, icon ) );
|
||||
intellijTextToolBar.add( new FilterButton( intellijTextFilter, icon ) );
|
||||
intellijLightToolBar.add( new FilterButton( null, icon ) );
|
||||
intellijDarkToolBar.add( new FilterButton( null, icon ) );
|
||||
netbeansToolBar.add( new FilterButton( netbeansFilter, icon ) );
|
||||
}
|
||||
|
||||
Icon zipIcon = zipButton.getIcon();
|
||||
JToggleButton cb = new JToggleButton( zipIcon );
|
||||
cb.setEnabled( false );
|
||||
zipToolBar.add( cb );
|
||||
zipToolBar.add( new FilterButton( null, zipIcon ) );
|
||||
zipToolBar.add( new FilterButton( null, zipIcon ) );
|
||||
zipToolBar.add( new FilterButton( plasticLafFilter, zipIcon ) );
|
||||
zipToolBar.add( new FilterButton( intellijTextFilter, zipIcon ) );
|
||||
zipToolBar.add( new FilterButton( null, zipIcon ) );
|
||||
zipToolBar.add( new FilterButton( null, zipIcon ) );
|
||||
zipToolBar.add( new FilterButton( netbeansFilter, zipIcon ) );
|
||||
|
||||
basicLafReset();
|
||||
metalLafReset();
|
||||
|
||||
intelliJTextFilterController.defaultBrightness = 20;
|
||||
intelliJTextFilterController.defaultContrast = 0;
|
||||
intelliJTextFilterController.reset();
|
||||
|
||||
// values from intellijlaf.properties
|
||||
intelliJLightFilterController.defaultBrightness = 33;
|
||||
intelliJLightFilterController.defaultContrast = -35;
|
||||
intelliJLightFilterController.reset();
|
||||
|
||||
// values from darcula.properties
|
||||
intelliJDarkFilterController.defaultBrightness = -70;
|
||||
intelliJDarkFilterController.defaultContrast = -70;
|
||||
intelliJDarkFilterController.reset();
|
||||
|
||||
toolBars = new JToolBar[] {
|
||||
enabledToolBar,
|
||||
currentLafToolBar,
|
||||
basicLafToolBar,
|
||||
metalLafToolBar,
|
||||
plasticToolBar,
|
||||
intellijTextToolBar,
|
||||
intellijLightToolBar,
|
||||
intellijDarkToolBar,
|
||||
netbeansToolBar
|
||||
};
|
||||
}
|
||||
|
||||
private void selectedChanged() {
|
||||
boolean armed = selectedCheckBox.isSelected();
|
||||
for( Component c : getComponents() ) {
|
||||
if( c instanceof JToolBar ) {
|
||||
for( Component c2 : ((JToolBar)c).getComponents() ) {
|
||||
if( c2 instanceof JToggleButton )
|
||||
((JToggleButton)c2).getModel().setSelected( armed );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final JToolBar[] toolBars;
|
||||
private Icon[] oldIcons;
|
||||
private static final String[] COLOR_NAMES = {
|
||||
"Actions.Red",
|
||||
"Actions.Yellow",
|
||||
"Actions.Green",
|
||||
"Actions.Blue",
|
||||
"Actions.Grey",
|
||||
"Actions.GreyInline",
|
||||
|
||||
"Objects.Grey",
|
||||
"Objects.Blue",
|
||||
"Objects.Green",
|
||||
"Objects.Yellow",
|
||||
"Objects.YellowDark",
|
||||
"Objects.Purple",
|
||||
"Objects.Pink",
|
||||
"Objects.Red",
|
||||
"Objects.RedStatus",
|
||||
"Objects.GreenAndroid",
|
||||
"Objects.BlackText",
|
||||
|
||||
"", // black
|
||||
};
|
||||
|
||||
private void paletteIconsChanged() {
|
||||
if( paletteIconsCheckBox.isSelected() ) {
|
||||
oldIcons = new Icon[COLOR_NAMES.length];
|
||||
for( int i = 0; i < COLOR_NAMES.length; i++ )
|
||||
oldIcons[i] = ((JToggleButton)enabledToolBar.getComponent( i )).getIcon();
|
||||
|
||||
for( int i = 0; i < COLOR_NAMES.length; i++ ) {
|
||||
ColorIcon icon = new ColorIcon( UIManager.getColor( COLOR_NAMES[i] ) );
|
||||
for( JToolBar toolBar : toolBars )
|
||||
((JToggleButton)toolBar.getComponent( i )).setIcon( icon );
|
||||
}
|
||||
} else if( oldIcons != null ){
|
||||
for( int i = 0; i < COLOR_NAMES.length; i++ ) {
|
||||
for( JToolBar toolBar : toolBars )
|
||||
((JToggleButton)toolBar.getComponent( i )).setIcon( oldIcons[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void basicLafChanged() {
|
||||
boolean brighter = basicLafBrighterCheckBox.isSelected();
|
||||
int percent = basicLafPercentSlider.getValue();
|
||||
|
||||
basicLafPercentValue.setText( String.valueOf( percent ) );
|
||||
|
||||
RGBImageFilter filter = new GrayFilter( brighter, percent );
|
||||
updateFilter( basicLafToolBar, 2, filter );
|
||||
}
|
||||
|
||||
private void basicLafReset() {
|
||||
basicLafBrighterCheckBox.setSelected( true );
|
||||
basicLafPercentSlider.setValue( 50 );
|
||||
basicLafChanged();
|
||||
}
|
||||
|
||||
private void metalLafChanged() {
|
||||
int min = metalLafMinSlider.getValue();
|
||||
int max = metalLafMaxSlider.getValue();
|
||||
|
||||
metalLafMinValue.setText( String.valueOf( min ) );
|
||||
metalLafMaxValue.setText( String.valueOf( max ) );
|
||||
|
||||
RGBImageFilter filter = new MetalDisabledButtonImageFilter( min, max );
|
||||
updateFilter( metalLafToolBar, 3, filter );
|
||||
}
|
||||
|
||||
private void metalLafReset() {
|
||||
metalLafMinSlider.setValue( 180 );
|
||||
metalLafMaxSlider.setValue( 215 );
|
||||
metalLafChanged();
|
||||
}
|
||||
|
||||
private void intelliJTextFilterChanged(PropertyChangeEvent e) {
|
||||
updateFilter( intellijTextToolBar, 5, (RGBImageFilter) e.getNewValue() );
|
||||
}
|
||||
|
||||
private void intelliJLightFilterChanged(PropertyChangeEvent e) {
|
||||
updateFilter( intellijLightToolBar, 6, (RGBImageFilter) e.getNewValue() );
|
||||
}
|
||||
|
||||
private void intelliJDarkFilterChanged(PropertyChangeEvent e) {
|
||||
updateFilter( intellijDarkToolBar, 7, (RGBImageFilter) e.getNewValue() );
|
||||
}
|
||||
|
||||
private void updateFilter( JToolBar toolBar, int zipIndex, RGBImageFilter filter ) {
|
||||
for( Component c : toolBar.getComponents() )
|
||||
((FilterButton)c).setFilter( filter );
|
||||
|
||||
((FilterButton)zipToolBar.getComponent( zipIndex )).setFilter( filter );
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
JLabel enabledLabel = new JLabel();
|
||||
enabledToolBar = new JToolBar();
|
||||
JToggleButton button1 = new JToggleButton();
|
||||
JToggleButton button2 = new JToggleButton();
|
||||
JToggleButton button3 = new JToggleButton();
|
||||
JToggleButton button4 = new JToggleButton();
|
||||
JToggleButton button5 = new JToggleButton();
|
||||
JToggleButton button6 = new JToggleButton();
|
||||
JToggleButton button7 = new JToggleButton();
|
||||
JToggleButton button8 = new JToggleButton();
|
||||
JToggleButton button9 = new JToggleButton();
|
||||
JToggleButton button10 = new JToggleButton();
|
||||
JToggleButton button11 = new JToggleButton();
|
||||
JToggleButton button12 = new JToggleButton();
|
||||
JToggleButton button13 = new JToggleButton();
|
||||
JToggleButton button14 = new JToggleButton();
|
||||
JToggleButton button15 = new JToggleButton();
|
||||
JToggleButton button16 = new JToggleButton();
|
||||
JToggleButton button17 = new JToggleButton();
|
||||
JToggleButton button18 = new JToggleButton();
|
||||
JLabel currentLabel = new JLabel();
|
||||
currentLafToolBar = new JToolBar();
|
||||
JLabel basicLafLabel = new JLabel();
|
||||
basicLafToolBar = new JToolBar();
|
||||
JPanel panel2 = new JPanel();
|
||||
basicLafBrighterCheckBox = new JCheckBox();
|
||||
JLabel basicLafPercentLabel = new JLabel();
|
||||
basicLafPercentSlider = new JSlider();
|
||||
basicLafPercentValue = new JLabel();
|
||||
JButton basicLafResetButton = new JButton();
|
||||
JLabel metalLafLabel = new JLabel();
|
||||
metalLafToolBar = new JToolBar();
|
||||
JPanel panel4 = new JPanel();
|
||||
JLabel metalLafMinLabel = new JLabel();
|
||||
metalLafMinSlider = new JSlider();
|
||||
metalLafMinValue = new JLabel();
|
||||
JButton metalLafResetButton = new JButton();
|
||||
JLabel metalLafMaxLabel = new JLabel();
|
||||
metalLafMaxSlider = new JSlider();
|
||||
metalLafMaxValue = new JLabel();
|
||||
JLabel plasticLabel = new JLabel();
|
||||
plasticToolBar = new JToolBar();
|
||||
JLabel intellijTextLabel = new JLabel();
|
||||
intellijTextToolBar = new JToolBar();
|
||||
intelliJTextFilterController = new FlatDisabledIconsTest.IntelliJFilterController();
|
||||
JLabel intellijLightLabel = new JLabel();
|
||||
intellijLightToolBar = new JToolBar();
|
||||
intelliJLightFilterController = new FlatDisabledIconsTest.IntelliJFilterController();
|
||||
JLabel intellijDarkLabel = new JLabel();
|
||||
intellijDarkToolBar = new JToolBar();
|
||||
intelliJDarkFilterController = new FlatDisabledIconsTest.IntelliJFilterController();
|
||||
JLabel netbeansLabel = new JLabel();
|
||||
netbeansToolBar = new JToolBar();
|
||||
zipToolBar = new JToolBar();
|
||||
zipButton = new JToggleButton();
|
||||
selectedCheckBox = new JCheckBox();
|
||||
paletteIconsCheckBox = new JCheckBox();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new MigLayout(
|
||||
"ltr,insets dialog,hidemode 3",
|
||||
// columns
|
||||
"[fill]" +
|
||||
"[fill]" +
|
||||
"[left]" +
|
||||
"[fill]",
|
||||
// rows
|
||||
"[]" +
|
||||
"[]" +
|
||||
"[center]" +
|
||||
"[center]" +
|
||||
"[center]" +
|
||||
"[center]" +
|
||||
"[center]" +
|
||||
"[center]" +
|
||||
"[center]para" +
|
||||
"[center]" +
|
||||
"[]"));
|
||||
|
||||
//---- enabledLabel ----
|
||||
enabledLabel.setText("enabled");
|
||||
add(enabledLabel, "cell 0 0");
|
||||
|
||||
//======== enabledToolBar ========
|
||||
{
|
||||
|
||||
//---- button1 ----
|
||||
button1.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-cut24.gif")));
|
||||
enabledToolBar.add(button1);
|
||||
|
||||
//---- button2 ----
|
||||
button2.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-copy24.gif")));
|
||||
enabledToolBar.add(button2);
|
||||
|
||||
//---- button3 ----
|
||||
button3.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-paste24.gif")));
|
||||
enabledToolBar.add(button3);
|
||||
|
||||
//---- button4 ----
|
||||
button4.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-undo24.gif")));
|
||||
enabledToolBar.add(button4);
|
||||
|
||||
//---- button5 ----
|
||||
button5.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-redo24.gif")));
|
||||
enabledToolBar.add(button5);
|
||||
|
||||
//---- button6 ----
|
||||
button6.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-find24.gif")));
|
||||
enabledToolBar.add(button6);
|
||||
enabledToolBar.add(button7);
|
||||
enabledToolBar.add(button8);
|
||||
enabledToolBar.add(button9);
|
||||
enabledToolBar.add(button10);
|
||||
enabledToolBar.add(button11);
|
||||
enabledToolBar.add(button12);
|
||||
enabledToolBar.add(button13);
|
||||
enabledToolBar.add(button14);
|
||||
enabledToolBar.add(button15);
|
||||
enabledToolBar.add(button16);
|
||||
enabledToolBar.add(button17);
|
||||
enabledToolBar.add(button18);
|
||||
}
|
||||
add(enabledToolBar, "cell 1 0");
|
||||
|
||||
//---- currentLabel ----
|
||||
currentLabel.setText("current LaF");
|
||||
add(currentLabel, "cell 0 1");
|
||||
add(currentLafToolBar, "cell 1 1");
|
||||
|
||||
//---- basicLafLabel ----
|
||||
basicLafLabel.setText("Basic LaF");
|
||||
add(basicLafLabel, "cell 0 2");
|
||||
add(basicLafToolBar, "cell 1 2");
|
||||
|
||||
//======== panel2 ========
|
||||
{
|
||||
panel2.setLayout(new MigLayout(
|
||||
"insets 0,hidemode 3,gap 0 0",
|
||||
// columns
|
||||
"[60,fill]" +
|
||||
"[fill]" +
|
||||
"[25,right]rel" +
|
||||
"[fill]",
|
||||
// rows
|
||||
"[center]" +
|
||||
"[center]"));
|
||||
|
||||
//---- basicLafBrighterCheckBox ----
|
||||
basicLafBrighterCheckBox.setText("brighter");
|
||||
basicLafBrighterCheckBox.addActionListener(e -> basicLafChanged());
|
||||
panel2.add(basicLafBrighterCheckBox, "cell 0 0 2 1,alignx left,growx 0");
|
||||
|
||||
//---- basicLafPercentLabel ----
|
||||
basicLafPercentLabel.setText("Percent");
|
||||
panel2.add(basicLafPercentLabel, "cell 0 1");
|
||||
|
||||
//---- basicLafPercentSlider ----
|
||||
basicLafPercentSlider.setToolTipText("Percent");
|
||||
basicLafPercentSlider.setValue(0);
|
||||
basicLafPercentSlider.addChangeListener(e -> basicLafChanged());
|
||||
panel2.add(basicLafPercentSlider, "cell 1 1");
|
||||
|
||||
//---- basicLafPercentValue ----
|
||||
basicLafPercentValue.setText("000");
|
||||
panel2.add(basicLafPercentValue, "cell 2 1");
|
||||
|
||||
//---- basicLafResetButton ----
|
||||
basicLafResetButton.setText("Reset");
|
||||
basicLafResetButton.addActionListener(e -> basicLafReset());
|
||||
panel2.add(basicLafResetButton, "cell 3 0 1 2");
|
||||
}
|
||||
add(panel2, "cell 2 2");
|
||||
|
||||
//---- metalLafLabel ----
|
||||
metalLafLabel.setText("Metal LaF");
|
||||
add(metalLafLabel, "cell 0 3");
|
||||
add(metalLafToolBar, "cell 1 3");
|
||||
|
||||
//======== panel4 ========
|
||||
{
|
||||
panel4.setLayout(new MigLayout(
|
||||
"insets 0,hidemode 3,gap 0 0",
|
||||
// columns
|
||||
"[60,fill]" +
|
||||
"[fill]" +
|
||||
"[25,right]rel" +
|
||||
"[fill]",
|
||||
// rows
|
||||
"[center]" +
|
||||
"[center]"));
|
||||
|
||||
//---- metalLafMinLabel ----
|
||||
metalLafMinLabel.setText("Min");
|
||||
panel4.add(metalLafMinLabel, "cell 0 0");
|
||||
|
||||
//---- metalLafMinSlider ----
|
||||
metalLafMinSlider.setMaximum(255);
|
||||
metalLafMinSlider.addChangeListener(e -> metalLafChanged());
|
||||
panel4.add(metalLafMinSlider, "cell 1 0");
|
||||
|
||||
//---- metalLafMinValue ----
|
||||
metalLafMinValue.setText("000");
|
||||
panel4.add(metalLafMinValue, "cell 2 0");
|
||||
|
||||
//---- metalLafResetButton ----
|
||||
metalLafResetButton.setText("Reset");
|
||||
metalLafResetButton.addActionListener(e -> metalLafReset());
|
||||
panel4.add(metalLafResetButton, "cell 3 0 1 2");
|
||||
|
||||
//---- metalLafMaxLabel ----
|
||||
metalLafMaxLabel.setText("Max");
|
||||
panel4.add(metalLafMaxLabel, "cell 0 1");
|
||||
|
||||
//---- metalLafMaxSlider ----
|
||||
metalLafMaxSlider.setMaximum(255);
|
||||
metalLafMaxSlider.addChangeListener(e -> metalLafChanged());
|
||||
panel4.add(metalLafMaxSlider, "cell 1 1");
|
||||
|
||||
//---- metalLafMaxValue ----
|
||||
metalLafMaxValue.setText("000");
|
||||
panel4.add(metalLafMaxValue, "cell 2 1");
|
||||
}
|
||||
add(panel4, "cell 2 3");
|
||||
|
||||
//---- plasticLabel ----
|
||||
plasticLabel.setText("Plastic LaF");
|
||||
add(plasticLabel, "cell 0 4");
|
||||
add(plasticToolBar, "cell 1 4");
|
||||
|
||||
//---- intellijTextLabel ----
|
||||
intellijTextLabel.setText("IntelliJ text");
|
||||
add(intellijTextLabel, "cell 0 5");
|
||||
add(intellijTextToolBar, "cell 1 5");
|
||||
|
||||
//---- intelliJTextFilterController ----
|
||||
intelliJTextFilterController.addPropertyChangeListener("filter", e -> intelliJTextFilterChanged(e));
|
||||
add(intelliJTextFilterController, "cell 2 5");
|
||||
|
||||
//---- intellijLightLabel ----
|
||||
intellijLightLabel.setText("IntelliJ light");
|
||||
add(intellijLightLabel, "cell 0 6");
|
||||
add(intellijLightToolBar, "cell 1 6");
|
||||
|
||||
//---- intelliJLightFilterController ----
|
||||
intelliJLightFilterController.addPropertyChangeListener("filter", e -> intelliJLightFilterChanged(e));
|
||||
add(intelliJLightFilterController, "cell 2 6");
|
||||
|
||||
//---- intellijDarkLabel ----
|
||||
intellijDarkLabel.setText("IntelliJ dark");
|
||||
add(intellijDarkLabel, "cell 0 7");
|
||||
add(intellijDarkToolBar, "cell 1 7");
|
||||
|
||||
//---- intelliJDarkFilterController ----
|
||||
intelliJDarkFilterController.addPropertyChangeListener("filter", e -> intelliJDarkFilterChanged(e));
|
||||
add(intelliJDarkFilterController, "cell 2 7");
|
||||
|
||||
//---- netbeansLabel ----
|
||||
netbeansLabel.setText("NetBeans");
|
||||
add(netbeansLabel, "cell 0 8");
|
||||
add(netbeansToolBar, "cell 1 8");
|
||||
|
||||
//======== zipToolBar ========
|
||||
{
|
||||
|
||||
//---- zipButton ----
|
||||
zipButton.setIcon(new ImageIcon(getClass().getResource("/com/formdev/flatlaf/testing/disabled_icons_test/zip128.png")));
|
||||
zipToolBar.add(zipButton);
|
||||
}
|
||||
add(zipToolBar, "cell 1 9 3 1");
|
||||
|
||||
//---- selectedCheckBox ----
|
||||
selectedCheckBox.setText("selected");
|
||||
selectedCheckBox.addActionListener(e -> selectedChanged());
|
||||
add(selectedCheckBox, "cell 0 10");
|
||||
|
||||
//---- paletteIconsCheckBox ----
|
||||
paletteIconsCheckBox.setText("palette icons");
|
||||
paletteIconsCheckBox.addActionListener(e -> paletteIconsChanged());
|
||||
add(paletteIconsCheckBox, "cell 1 10,alignx left,growx 0");
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
|
||||
button7.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark.png" ) );
|
||||
button8.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark.png" ) );
|
||||
button9.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark.png" ) );
|
||||
button10.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark.png" ) );
|
||||
button11.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark.png" ) );
|
||||
button12.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark.png" ) );
|
||||
|
||||
button13.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut@2x.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-cut_dark@2x.png" ) );
|
||||
button14.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste@2x.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-menu-paste_dark@2x.png" ) );
|
||||
button15.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show@2x.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-show_dark@2x.png" ) );
|
||||
button16.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess@2x.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showReadAccess_dark@2x.png" ) );
|
||||
button17.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess@2x.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-showWriteAccess_dark@2x.png" ) );
|
||||
button18.setIcon( new LightOrDarkIcon(
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search@2x.png",
|
||||
"/com/formdev/flatlaf/testing/disabled_icons_test/intellij-search_dark@2x.png" ) );
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JToolBar enabledToolBar;
|
||||
private JToolBar currentLafToolBar;
|
||||
private JToolBar basicLafToolBar;
|
||||
private JCheckBox basicLafBrighterCheckBox;
|
||||
private JSlider basicLafPercentSlider;
|
||||
private JLabel basicLafPercentValue;
|
||||
private JToolBar metalLafToolBar;
|
||||
private JSlider metalLafMinSlider;
|
||||
private JLabel metalLafMinValue;
|
||||
private JSlider metalLafMaxSlider;
|
||||
private JLabel metalLafMaxValue;
|
||||
private JToolBar plasticToolBar;
|
||||
private JToolBar intellijTextToolBar;
|
||||
private FlatDisabledIconsTest.IntelliJFilterController intelliJTextFilterController;
|
||||
private JToolBar intellijLightToolBar;
|
||||
private FlatDisabledIconsTest.IntelliJFilterController intelliJLightFilterController;
|
||||
private JToolBar intellijDarkToolBar;
|
||||
private FlatDisabledIconsTest.IntelliJFilterController intelliJDarkFilterController;
|
||||
private JToolBar netbeansToolBar;
|
||||
private JToolBar zipToolBar;
|
||||
private JToggleButton zipButton;
|
||||
private JCheckBox selectedCheckBox;
|
||||
private JCheckBox paletteIconsCheckBox;
|
||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||
|
||||
//---- class LightOrDarkIcon ----------------------------------------------
|
||||
|
||||
private static class LightOrDarkIcon
|
||||
extends ImageIcon
|
||||
{
|
||||
private final ImageIcon lightIcon;
|
||||
private final ImageIcon darkIcon;
|
||||
|
||||
LightOrDarkIcon( String lightIconName, String darkIconName ) {
|
||||
this.lightIcon = loadIcon( lightIconName );
|
||||
this.darkIcon = loadIcon( darkIconName );
|
||||
}
|
||||
|
||||
private static ImageIcon loadIcon( String iconName ) {
|
||||
ImageIcon icon = new ImageIcon( LightOrDarkIcon.class.getResource( iconName ) );
|
||||
|
||||
if( SystemInfo.IS_MAC || !MultiResolutionImageSupport.isAvailable() || !iconName.endsWith( ".png" ) )
|
||||
return icon;
|
||||
|
||||
String iconName2x = iconName.replace( ".png", "@2x.png" );
|
||||
URL url2x = LightOrDarkIcon.class.getResource( iconName2x );
|
||||
if( url2x == null )
|
||||
return icon;
|
||||
|
||||
ImageIcon icon2x = new ImageIcon( url2x );
|
||||
return new ImageIcon( MultiResolutionImageSupport.create( 0, icon.getImage(), icon2x.getImage() ) );
|
||||
}
|
||||
|
||||
private ImageIcon getCurrentIcon() {
|
||||
return isDark() ? darkIcon : lightIcon;
|
||||
}
|
||||
|
||||
private boolean isDark() {
|
||||
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
|
||||
return lookAndFeel instanceof FlatLaf && ((FlatLaf)lookAndFeel).isDark();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return getCurrentIcon().getIconWidth();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return getCurrentIcon().getIconHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void paintIcon( Component c, Graphics g, int x, int y ) {
|
||||
getCurrentIcon().paintIcon( c, g, x, y );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getImage() {
|
||||
return getCurrentIcon().getImage();
|
||||
}
|
||||
}
|
||||
|
||||
//---- class ColorIcon ----------------------------------------------------
|
||||
|
||||
private static class ColorIcon
|
||||
extends ImageIcon
|
||||
{
|
||||
ColorIcon( Color color ) {
|
||||
super( createColorImage( color ) );
|
||||
}
|
||||
|
||||
private static Image createColorImage( Color color ) {
|
||||
if( color == null )
|
||||
color = Color.black;
|
||||
|
||||
BufferedImage image = new BufferedImage( UIScale.scale( 16 ), UIScale.scale( 16 ), BufferedImage.TYPE_INT_ARGB );
|
||||
Graphics2D g = image.createGraphics();
|
||||
try {
|
||||
g.setColor( color );
|
||||
g.fillRect( UIScale.scale( 1 ), UIScale.scale( 2 ), UIScale.scale( 14 ), UIScale.scale( 12 ) );
|
||||
} finally {
|
||||
g.dispose();
|
||||
}
|
||||
return image;
|
||||
}
|
||||
}
|
||||
|
||||
//---- class IntelliJFilterController ------------------------------------
|
||||
|
||||
private static class IntelliJFilterController
|
||||
extends JPanel
|
||||
{
|
||||
int defaultBrightness;
|
||||
int defaultContrast;
|
||||
|
||||
private IntelliJFilterController() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
private void changed() {
|
||||
int brightness = intellijBrightnessSlider.getValue();
|
||||
int contrast = intellijContrastSlider.getValue();
|
||||
|
||||
intellijBrightnessValue.setText( String.valueOf( brightness ) );
|
||||
intellijContrastValue.setText( String.valueOf( contrast ) );
|
||||
|
||||
RGBImageFilter filter = new IntelliJGrayFilter( brightness, contrast, 100 );
|
||||
firePropertyChange( "filter", null, filter );
|
||||
}
|
||||
|
||||
private void reset() {
|
||||
intellijBrightnessSlider.setValue( defaultBrightness );
|
||||
intellijContrastSlider.setValue( defaultContrast );
|
||||
changed();
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
|
||||
JLabel intellijBrightnessLabel = new JLabel();
|
||||
intellijBrightnessSlider = new JSlider();
|
||||
intellijBrightnessValue = new JLabel();
|
||||
JLabel intellijContrastLabel = new JLabel();
|
||||
intellijContrastSlider = new JSlider();
|
||||
intellijContrastValue = new JLabel();
|
||||
JButton intellijLightResetButton = new JButton();
|
||||
|
||||
//======== this ========
|
||||
setLayout(new MigLayout(
|
||||
"insets 0,hidemode 3,gap 0 0",
|
||||
// columns
|
||||
"[60,fill]" +
|
||||
"[fill]" +
|
||||
"[25,right]rel" +
|
||||
"[fill]",
|
||||
// rows
|
||||
"[center]" +
|
||||
"[center]"));
|
||||
|
||||
//---- intellijBrightnessLabel ----
|
||||
intellijBrightnessLabel.setText("Brightness");
|
||||
add(intellijBrightnessLabel, "cell 0 0");
|
||||
|
||||
//---- intellijBrightnessSlider ----
|
||||
intellijBrightnessSlider.setMinimum(-100);
|
||||
intellijBrightnessSlider.addChangeListener(e -> changed());
|
||||
add(intellijBrightnessSlider, "cell 1 0");
|
||||
|
||||
//---- intellijBrightnessValue ----
|
||||
intellijBrightnessValue.setText("000");
|
||||
add(intellijBrightnessValue, "cell 2 0");
|
||||
|
||||
//---- intellijContrastLabel ----
|
||||
intellijContrastLabel.setText("Contrast");
|
||||
add(intellijContrastLabel, "cell 0 1");
|
||||
|
||||
//---- intellijContrastSlider ----
|
||||
intellijContrastSlider.setMinimum(-100);
|
||||
intellijContrastSlider.addChangeListener(e -> changed());
|
||||
add(intellijContrastSlider, "cell 1 1");
|
||||
|
||||
//---- intellijContrastValue ----
|
||||
intellijContrastValue.setText("-000");
|
||||
add(intellijContrastValue, "cell 2 1");
|
||||
|
||||
//---- intellijLightResetButton ----
|
||||
intellijLightResetButton.setText("Reset");
|
||||
intellijLightResetButton.addActionListener(e -> reset());
|
||||
add(intellijLightResetButton, "cell 3 0 1 2");
|
||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||
}
|
||||
|
||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||
private JSlider intellijBrightnessSlider;
|
||||
private JLabel intellijBrightnessValue;
|
||||
private JSlider intellijContrastSlider;
|
||||
private JLabel intellijContrastValue;
|
||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||
}
|
||||
|
||||
//---- class FilterButton -------------------------------------------------
|
||||
|
||||
private static class FilterButton
|
||||
extends JToggleButton
|
||||
{
|
||||
private RGBImageFilter filter;
|
||||
|
||||
FilterButton( RGBImageFilter filter, Icon icon ) {
|
||||
this.filter = filter;
|
||||
|
||||
setEnabled( false );
|
||||
setIcon( icon );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIcon( Icon defaultIcon ) {
|
||||
super.setIcon( defaultIcon );
|
||||
|
||||
if( filter != null )
|
||||
updateDisabledIcon();
|
||||
}
|
||||
|
||||
void setFilter( RGBImageFilter filter ) {
|
||||
this.filter = filter;
|
||||
updateDisabledIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUI() {
|
||||
super.updateUI();
|
||||
updateDisabledIcon();
|
||||
}
|
||||
|
||||
private void updateDisabledIcon() {
|
||||
setDisabledIcon( createDisabledIcon( getIcon() ) );
|
||||
}
|
||||
|
||||
protected Icon createDisabledIcon( Icon icon ) {
|
||||
if( !(icon instanceof ImageIcon) )
|
||||
return null;
|
||||
|
||||
Image image = ((ImageIcon) icon).getImage();
|
||||
ImageProducer producer = new FilteredImageSource( image.getSource(), filter );
|
||||
Image disabledImage = Toolkit.getDefaultToolkit().createImage( producer );
|
||||
return new ImageIcon( disabledImage );
|
||||
}
|
||||
}
|
||||
|
||||
//---- class PlasticRGBGrayFilter -----------------------------------------
|
||||
|
||||
// from https://github.com/openjdk/jdk/blob/6bab0f539fba8fb441697846347597b4a0ade428/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalUtils.java#L415-L434
|
||||
// license https://github.com/openjdk/jdk/blob/master/LICENSE
|
||||
private static class MetalDisabledButtonImageFilter
|
||||
extends RGBImageFilter
|
||||
{
|
||||
private final float min;
|
||||
private final float factor;
|
||||
|
||||
MetalDisabledButtonImageFilter(int min, int max) {
|
||||
canFilterIndexColorModel = true;
|
||||
this.min = min;
|
||||
this.factor = (max - min) / 255f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int filterRGB(int x, int y, int rgb) {
|
||||
// Coefficients are from the sRGB color space:
|
||||
int gray = Math.min(255, (int)(((0.2125f * ((rgb >> 16) & 0xFF)) +
|
||||
(0.7154f * ((rgb >> 8) & 0xFF)) +
|
||||
(0.0721f * (rgb & 0xFF)) + .5f) * factor + min));
|
||||
|
||||
return (rgb & 0xff000000) | (gray << 16) | (gray << 8) |
|
||||
(gray << 0);
|
||||
}
|
||||
}
|
||||
|
||||
//---- class PlasticRGBGrayFilter -----------------------------------------
|
||||
|
||||
// from https://github.com/JFormDesigner/swing-jgoodies-looks/blob/master/src/main/java/com/jgoodies/looks/common/RGBGrayFilter.java
|
||||
// license https://github.com/JFormDesigner/swing-jgoodies-looks/blob/master/LICENSE.txt
|
||||
private static final class PlasticRGBGrayFilter
|
||||
extends RGBImageFilter
|
||||
{
|
||||
private PlasticRGBGrayFilter() {
|
||||
canFilterIndexColorModel = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int filterRGB(int x, int y, int rgb) {
|
||||
// Find the average of red, green, and blue.
|
||||
float avg = (((rgb >> 16) & 0xff) / 255f +
|
||||
((rgb >> 8) & 0xff) / 255f +
|
||||
(rgb & 0xff) / 255f) / 3;
|
||||
// Pull out the alpha channel.
|
||||
float alpha = (((rgb >> 24) & 0xff) / 255f);
|
||||
|
||||
// Calculate the average.
|
||||
// Sun's formula: Math.min(1.0f, (1f - avg) / (100.0f / 35.0f) + avg);
|
||||
// The following formula uses less operations and hence is faster.
|
||||
avg = Math.min(1.0f, 0.35f + 0.65f * avg);
|
||||
// Convert back into RGB.
|
||||
return (int) (alpha * 255f) << 24 |
|
||||
(int) (avg * 255f) << 16 |
|
||||
(int) (avg * 255f) << 8 |
|
||||
(int) (avg * 255f);
|
||||
}
|
||||
}
|
||||
|
||||
//---- class IntelliJGrayFilter -------------------------------------------
|
||||
|
||||
// from https://github.com/JetBrains/intellij-community/blob/3840eab54746f5c4f301bb3ac78f00a980b5fd6e/platform/util/ui/src/com/intellij/util/ui/UIUtil.java#L253-L347
|
||||
// license https://github.com/JetBrains/intellij-community/blob/master/LICENSE.txt
|
||||
private static class IntelliJGrayFilter
|
||||
extends RGBImageFilter
|
||||
{
|
||||
private float brightness;
|
||||
private float contrast;
|
||||
private int alpha;
|
||||
|
||||
private int origContrast;
|
||||
private int origBrightness;
|
||||
|
||||
/**
|
||||
* @param brightness in range [-100..100] where 0 has no effect
|
||||
* @param contrast in range [-100..100] where 0 has no effect
|
||||
* @param alpha in range [0..100] where 0 is transparent, 100 has no effect
|
||||
*/
|
||||
public IntelliJGrayFilter(int brightness, int contrast, int alpha) {
|
||||
setBrightness(brightness);
|
||||
setContrast(contrast);
|
||||
setAlpha(alpha);
|
||||
}
|
||||
|
||||
private void setBrightness(int brightness) {
|
||||
origBrightness = Math.max(-100, Math.min(100, brightness));
|
||||
this.brightness = (float)(Math.pow(origBrightness, 3) / (100f * 100f)); // cubic in [0..100]
|
||||
}
|
||||
|
||||
private void setContrast(int contrast) {
|
||||
origContrast = Math.max(-100, Math.min(100, contrast));
|
||||
this.contrast = origContrast / 100f;
|
||||
}
|
||||
|
||||
private void setAlpha(int alpha) {
|
||||
this.alpha = Math.max(0, Math.min(100, alpha));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int filterRGB(int x, int y, int rgb) {
|
||||
// Use NTSC conversion formula.
|
||||
int gray = (int)(0.30 * (rgb >> 16 & 0xff) +
|
||||
0.59 * (rgb >> 8 & 0xff) +
|
||||
0.11 * (rgb & 0xff));
|
||||
|
||||
if (brightness >= 0) {
|
||||
gray = (int)((gray + brightness * 255) / (1 + brightness));
|
||||
}
|
||||
else {
|
||||
gray = (int)(gray / (1 - brightness));
|
||||
}
|
||||
|
||||
if (contrast >= 0) {
|
||||
if (gray >= 127) {
|
||||
gray = (int)(gray + (255 - gray) * contrast);
|
||||
}
|
||||
else {
|
||||
gray = (int)(gray - gray * contrast);
|
||||
}
|
||||
}
|
||||
else {
|
||||
gray = (int)(127 + (gray - 127) * (contrast + 1));
|
||||
}
|
||||
|
||||
int a = ((rgb >> 24) & 0xff) * alpha / 100;
|
||||
|
||||
return (a << 24) | (gray << 16) | (gray << 8) | gray;
|
||||
}
|
||||
}
|
||||
|
||||
//---- NetBeansDisabledButtonFilter ---------------------------------------
|
||||
|
||||
// from https://github.com/apache/netbeans/blob/166e2bb491c29f6778223c6e9e16f70664252bce/platform/openide.util.ui/src/org/openide/util/ImageUtilities.java#L1202-L1221
|
||||
// license https://github.com/apache/netbeans/blob/master/LICENSE
|
||||
private static class NetBeansDisabledButtonFilter
|
||||
extends RGBImageFilter
|
||||
{
|
||||
NetBeansDisabledButtonFilter() {
|
||||
canFilterIndexColorModel = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int filterRGB(int x, int y, int rgb) {
|
||||
// Reduce the color bandwidth in quarter (>> 2) and Shift 0x88.
|
||||
return (rgb & 0xff000000) + 0x888888 + ((((rgb >> 16) & 0xff) >> 2) << 16) + ((((rgb >> 8) & 0xff) >> 2) << 8) + (((rgb) & 0xff) >> 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,456 @@
|
||||
JFDML JFormDesigner: "7.0.1.0.272" Java: "13.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][fill][left][fill]"
|
||||
"$rowConstraints": "[][][center][center][center][center][center][center][center]para[center][]"
|
||||
} ) {
|
||||
name: "this"
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "enabledLabel"
|
||||
"text": "enabled"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "enabledToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button1"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-cut24.gif" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button2"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-copy24.gif" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button3"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-paste24.gif" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button4"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-undo24.gif" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button5"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-redo24.gif" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button6"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/netbeans-find24.gif" )
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button8"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button9"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button10"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button11"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button12"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button13"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button14"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button15"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button16"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button17"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "button18"
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "currentLabel"
|
||||
"text": "current LaF"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "currentLafToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "basicLafLabel"
|
||||
"text": "Basic LaF"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 2"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "basicLafToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 2"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "insets 0,hidemode 3,gap 0 0"
|
||||
"$columnConstraints": "[60,fill][fill][25,right]rel[fill]"
|
||||
"$rowConstraints": "[center][center]"
|
||||
} ) {
|
||||
name: "panel2"
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "basicLafBrighterCheckBox"
|
||||
"text": "brighter"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "basicLafChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0 2 1,alignx left,growx 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "basicLafPercentLabel"
|
||||
"text": "Percent"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||
name: "basicLafPercentSlider"
|
||||
"toolTipText": "Percent"
|
||||
"value": 0
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "basicLafChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "basicLafPercentValue"
|
||||
"text": "000"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "basicLafResetButton"
|
||||
"text": "Reset"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "basicLafReset", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 0 1 2"
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "metalLafLabel"
|
||||
"text": "Metal LaF"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 3"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "metalLafToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 3"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "insets 0,hidemode 3,gap 0 0"
|
||||
"$columnConstraints": "[60,fill][fill][25,right]rel[fill]"
|
||||
"$rowConstraints": "[center][center]"
|
||||
} ) {
|
||||
name: "panel4"
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "metalLafMinLabel"
|
||||
"text": "Min"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||
name: "metalLafMinSlider"
|
||||
"maximum": 255
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "metalLafChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "metalLafMinValue"
|
||||
"text": "000"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "metalLafResetButton"
|
||||
"text": "Reset"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "metalLafReset", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 0 1 2"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "metalLafMaxLabel"
|
||||
"text": "Max"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||
name: "metalLafMaxSlider"
|
||||
"maximum": 255
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "metalLafChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "metalLafMaxValue"
|
||||
"text": "000"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 1"
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 3"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "plasticLabel"
|
||||
"text": "Plastic LaF"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 4"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "plasticToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 4"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "intellijTextLabel"
|
||||
"text": "IntelliJ text"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 5"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "intellijTextToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 5"
|
||||
} )
|
||||
add( new FormComponent( "com.formdev.flatlaf.testing.FlatDisabledIconsTest$IntelliJFilterController" ) {
|
||||
name: "intelliJTextFilterController"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.beans.PropertyChangeListener", "propertyChange", "intelliJTextFilterChanged", true, "filter" ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 5"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "intellijLightLabel"
|
||||
"text": "IntelliJ light"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 6"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "intellijLightToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 6"
|
||||
} )
|
||||
add( new FormComponent( "com.formdev.flatlaf.testing.FlatDisabledIconsTest$IntelliJFilterController" ) {
|
||||
name: "intelliJLightFilterController"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.beans.PropertyChangeListener", "propertyChange", "intelliJLightFilterChanged", true, "filter" ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 6"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "intellijDarkLabel"
|
||||
"text": "IntelliJ dark"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 7"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "intellijDarkToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 7"
|
||||
} )
|
||||
add( new FormComponent( "com.formdev.flatlaf.testing.FlatDisabledIconsTest$IntelliJFilterController" ) {
|
||||
name: "intelliJDarkFilterController"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.beans.PropertyChangeListener", "propertyChange", "intelliJDarkFilterChanged", true, "filter" ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 7"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "netbeansLabel"
|
||||
"text": "NetBeans"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 8"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "netbeansToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 8"
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
|
||||
name: "zipToolBar"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||
name: "zipButton"
|
||||
"icon": new com.jformdesigner.model.SwingIcon( 0, "/com/formdev/flatlaf/testing/disabled_icons_test/zip128.png" )
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
} )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 9 3 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "selectedCheckBox"
|
||||
"text": "selected"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "selectedChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 10"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||
name: "paletteIconsCheckBox"
|
||||
"text": "palette icons"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paletteIconsChanged", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 10,alignx left,growx 0"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 0 )
|
||||
"size": new java.awt.Dimension( 1095, 625 )
|
||||
} )
|
||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||
"$layoutConstraints": "insets 0,hidemode 3,gap 0 0"
|
||||
"$columnConstraints": "[60,fill][fill][25,right]rel[fill]"
|
||||
"$rowConstraints": "[center][center]"
|
||||
} ) {
|
||||
name: "panel1"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.className": "IntelliJFilterController"
|
||||
}
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "intellijBrightnessLabel"
|
||||
"text": "Brightness"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||
name: "intellijBrightnessSlider"
|
||||
"minimum": -100
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "changed", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "intellijBrightnessValue"
|
||||
"text": "000"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 0"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "intellijContrastLabel"
|
||||
"text": "Contrast"
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 0 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||
name: "intellijContrastSlider"
|
||||
"minimum": -100
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
addEvent( new FormEvent( "javax.swing.event.ChangeListener", "stateChanged", "changed", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 1 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||
name: "intellijContrastValue"
|
||||
"text": "-000"
|
||||
auxiliary() {
|
||||
"JavaCodeGenerator.variableLocal": false
|
||||
}
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 2 1"
|
||||
} )
|
||||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "intellijLightResetButton"
|
||||
"text": "Reset"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "reset", false ) )
|
||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||
"value": "cell 3 0 1 2"
|
||||
} )
|
||||
}, new FormLayoutConstraints( null ) {
|
||||
"location": new java.awt.Point( 0, 660 )
|
||||
"size": new java.awt.Dimension( 286, 39 )
|
||||
} )
|
||||
}
|
||||
}
|
||||
@@ -128,6 +128,7 @@ Component.focusedBorderColor=#466d94
|
||||
Component.focusColor=#97c3f3
|
||||
#Component.focusWidth=5
|
||||
#Component.arc=8
|
||||
Component.grayFilter=25,25,100
|
||||
|
||||
|
||||
#---- Desktop ----
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
The icons in this folder starting with 'intellij-' are from IntelliJ IDEA Community Edition,
|
||||
which is licensed under the Apache 2.0 license. Copyright 2000-2020 JetBrains s.r.o.
|
||||
See: https://github.com/JetBrains/intellij-community/
|
||||
|
||||
The icons in this folder starting with 'netbeans-' are from Apache NetBeans,
|
||||
which is licensed under the Apache 2.0 license to the Apache Software Foundation (ASF).
|
||||
See: https://github.com/apache/netbeans/
|
||||
|
||||
zip128.png is from
|
||||
http://www.iconarchive.com/show/plump-icons-by-zerode/Folder-Archive-zip-icon.html
|
||||
License: Free for non-commercial use.
|
||||
Commercial usage: Not allowed
|
||||
|
After Width: | Height: | Size: 262 B |
|
After Width: | Height: | Size: 504 B |
|
After Width: | Height: | Size: 285 B |
|
After Width: | Height: | Size: 536 B |
|
After Width: | Height: | Size: 98 B |
|
After Width: | Height: | Size: 122 B |
|
After Width: | Height: | Size: 99 B |
|
After Width: | Height: | Size: 124 B |
|
After Width: | Height: | Size: 309 B |
|
After Width: | Height: | Size: 687 B |
|
After Width: | Height: | Size: 308 B |
|
After Width: | Height: | Size: 687 B |
|
After Width: | Height: | Size: 246 B |
|
After Width: | Height: | Size: 422 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 498 B |
|
After Width: | Height: | Size: 324 B |
|
After Width: | Height: | Size: 511 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 495 B |
|
After Width: | Height: | Size: 330 B |
|
After Width: | Height: | Size: 492 B |
|
After Width: | Height: | Size: 273 B |
|
After Width: | Height: | Size: 467 B |
|
After Width: | Height: | Size: 733 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 880 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 17 KiB |
4
flatlaf-theme-editor/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
FlatLaf Theme Editor
|
||||
====================
|
||||
|
||||
under development
|
||||