mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 22:47:13 -06:00
FlatSVGIcon: Removed unnecessary getInstance method. Changed the demo a little and added a utility method to ColorFilter to easily create a brightness/contrast/alpha filter.
This commit is contained in:
@@ -20,6 +20,7 @@ import javax.swing.*;
|
||||
import com.formdev.flatlaf.extras.*;
|
||||
import com.formdev.flatlaf.extras.FlatSVGIcon.ColorFilter;
|
||||
import com.formdev.flatlaf.extras.components.FlatTriStateCheckBox;
|
||||
import com.formdev.flatlaf.util.GrayFilter;
|
||||
import net.miginfocom.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
@@ -152,13 +153,13 @@ public class ExtrasPanel
|
||||
add(label7, "cell 1 7");
|
||||
|
||||
// ---- button1 ----
|
||||
toggleButton1.setText( "Toggle red" );
|
||||
toggleButton1.setText( "Toggle brighter" );
|
||||
add(toggleButton1, "cell 1 7");
|
||||
|
||||
// ---- toggleButton1 ----
|
||||
toggleButton1.addActionListener( (e) -> {
|
||||
if (toggleButton1.isSelected())
|
||||
FlatSVGIcon.ColorFilter.getInstance().setFilter( color -> Color.RED );
|
||||
FlatSVGIcon.ColorFilter.getInstance().setFilter( color -> color.brighter().brighter() );
|
||||
else
|
||||
FlatSVGIcon.ColorFilter.getInstance().setFilter( null );
|
||||
SwingUtilities.getRootPane( toggleButton1 ).repaint();
|
||||
|
||||
Reference in New Issue
Block a user