Theme Editor: Switches" preview:

- zoom 2x, 3x and 4x icons via toolbar
- hide indeterminate state for checkboxes via toolbar
This commit is contained in:
Karl Tauber
2021-11-04 00:17:24 +01:00
parent c8ea61dc79
commit 52f6e7fc32
3 changed files with 530 additions and 163 deletions

View File

@@ -60,7 +60,7 @@ class FlatThemePreview
// add tabs
allTab = new FlatThemePreviewAll( this );
buttonsTab = new FlatThemePreviewButtons( this );
switchesTab = new FlatThemePreviewSwitches();
switchesTab = new FlatThemePreviewSwitches( this );
tabbedPane.addTab( "All", createPreviewTab( allTab ) );
tabbedPane.addTab( "Buttons", createPreviewTab( buttonsTab ) );
tabbedPane.addTab( "Switches", createPreviewTab( switchesTab ) );
@@ -99,6 +99,7 @@ class FlatThemePreview
switch( selectedTab ) {
case 0: allTab.activated(); break;
case 1: buttonsTab.activated(); break;
case 2: switchesTab.activated(); break;
}
}
}

View File

@@ -16,10 +16,20 @@
package com.formdev.flatlaf.themeeditor;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.beans.Beans;
import java.util.function.Predicate;
import javax.swing.*;
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.extras.components.FlatTriStateCheckBox;
import com.formdev.flatlaf.icons.FlatCheckBoxIcon;
import com.formdev.flatlaf.icons.FlatRadioButtonIcon;
import net.miginfocom.layout.AC;
import net.miginfocom.layout.BoundSize;
import net.miginfocom.layout.ConstraintParser;
import net.miginfocom.layout.DimConstraint;
import net.miginfocom.swing.*;
/**
@@ -28,12 +38,110 @@ import net.miginfocom.swing.*;
class FlatThemePreviewSwitches
extends JPanel
{
FlatThemePreviewSwitches() {
private static final String KEY_SWITCHES_ZOOM = "preview.switchesZoom";
private static final String KEY_SHOW_INDETERMINATE = "preview.showIndeterminate";
private final FlatThemePreview preview;
private static float zoom = 1;
FlatThemePreviewSwitches( FlatThemePreview preview ) {
this.preview = preview;
initComponents();
}
void activated() {
float zoom = preview.state.getFloat( KEY_SWITCHES_ZOOM, 1 );
boolean showIndeterminate = preview.state.getBoolean( KEY_SHOW_INDETERMINATE, true );
if( zoom != getZoom() ) {
setZoom( zoom );
zoomChanged();
}
if( showIndeterminate != indeterminateButton.isSelected() ) {
indeterminateButton.setSelected( showIndeterminate );
indeterminateChanged();
}
}
private float getZoom() {
if( zoom2xButton.isSelected() )
return 2;
if( zoom3xButton.isSelected() )
return 3;
if( zoom4xButton.isSelected() )
return 4;
return 1;
}
private void setZoom( float zoom ) {
if( zoom == 2 )
zoom2xButton.setSelected( true );
else if( zoom == 3 )
zoom3xButton.setSelected( true );
else if( zoom == 4 )
zoom4xButton.setSelected( true );
else
zoom1xButton.setSelected( true );
}
private void zoomChanged() {
zoom = getZoom();
preview.revalidate();
revalidate();
repaint();
if( zoom != 1 )
preview.state.putFloat( KEY_SWITCHES_ZOOM, zoom );
else
preview.state.remove( KEY_SWITCHES_ZOOM );
}
private void indeterminateChanged() {
boolean show = indeterminateButton.isSelected();
// show/hide indeterminate checkboxes
for( Component c : getComponents() ) {
if( (c instanceof TestStateCheckBox && ((TestStateCheckBox)c).isStateIndeterminate()) ||
c instanceof FlatTriStateCheckBox ||
(c instanceof JLabel && ((JLabel)c).getText().startsWith( "ind" )) )
c.setVisible( show );
}
// update layout
MigLayout layout = (MigLayout) getLayout();
Object columnCons = layout.getColumnConstraints();
AC ac = (columnCons instanceof String)
? ConstraintParser.parseColumnConstraints( (String) columnCons )
: (AC) columnCons;
DimConstraint[] constaints = ac.getConstaints();
constaints[3].setSizeGroup( show ? "1" : null );
constaints[6].setSizeGroup( show ? "2" : null );
BoundSize gap = show ? null : ConstraintParser.parseBoundSize( "0", true, true );
constaints[3].setGapBefore( gap );
constaints[6].setGapBefore( gap );
layout.setColumnConstraints( ac );
preview.revalidate();
revalidate();
repaint();
FlatThemeFileEditor.putPrefsBoolean( preview.state, KEY_SHOW_INDETERMINATE, show, true );
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
JPanel panel1 = new JPanel();
JLabel zoomLabel = new JLabel();
JToolBar zoomToolBar = new JToolBar();
zoom1xButton = new JToggleButton();
zoom2xButton = new JToggleButton();
zoom3xButton = new JToggleButton();
zoom4xButton = new JToggleButton();
indeterminateButton = new JToggleButton();
JLabel label22 = new JLabel();
JLabel label1 = new JLabel();
JLabel label2 = new JLabel();
@@ -69,9 +177,9 @@ class FlatThemePreviewSwitches
FlatThemePreviewSwitches.TestStateCheckBox testStateCheckBox11 = new FlatThemePreviewSwitches.TestStateCheckBox();
FlatThemePreviewSwitches.TestStateCheckBox testStateCheckBox18 = new FlatThemePreviewSwitches.TestStateCheckBox();
JLabel label21 = new JLabel();
JCheckBox checkBox1 = new JCheckBox();
JCheckBox checkBox2 = new JCheckBox();
FlatTriStateCheckBox triStateCheckBox1 = new FlatTriStateCheckBox();
FlatThemePreviewSwitches.ZoomCheckBox checkBox1 = new FlatThemePreviewSwitches.ZoomCheckBox();
FlatThemePreviewSwitches.ZoomCheckBox checkBox2 = new FlatThemePreviewSwitches.ZoomCheckBox();
FlatThemePreviewSwitches.ZoomTriStateCheckBox triStateCheckBox1 = new FlatThemePreviewSwitches.ZoomTriStateCheckBox();
JLabel label27 = new JLabel();
JLabel label3 = new JLabel();
JLabel label4 = new JLabel();
@@ -98,8 +206,8 @@ class FlatThemePreviewSwitches
FlatThemePreviewSwitches.TestStateRadioButton testStateRadioButton4 = new FlatThemePreviewSwitches.TestStateRadioButton();
FlatThemePreviewSwitches.TestStateRadioButton testStateRadioButton14 = new FlatThemePreviewSwitches.TestStateRadioButton();
JLabel label32 = new JLabel();
JRadioButton radioButton1 = new JRadioButton();
JRadioButton radioButton2 = new JRadioButton();
FlatThemePreviewSwitches.ZoomRadioButton radioButton1 = new FlatThemePreviewSwitches.ZoomRadioButton();
FlatThemePreviewSwitches.ZoomRadioButton radioButton2 = new FlatThemePreviewSwitches.ZoomRadioButton();
//======== this ========
setLayout(new MigLayout(
@@ -111,8 +219,10 @@ class FlatThemePreviewSwitches
"[sizegroup 1,center]para" +
"[sizegroup 2,center]" +
"[sizegroup 2,center]" +
"[sizegroup 2,center]",
"[sizegroup 2,center]0" +
"[grow,fill]",
// rows
"[]para" +
"[]" +
"[]3" +
"[]" +
@@ -130,304 +240,413 @@ class FlatThemePreviewSwitches
"[]unrel" +
"[]"));
//======== panel1 ========
{
panel1.setLayout(new MigLayout(
"insets 0,hidemode 3",
// columns
"[fill]" +
"[fill]",
// rows
"[]0"));
//---- zoomLabel ----
zoomLabel.setText("Zoom:");
panel1.add(zoomLabel, "cell 0 0");
//======== zoomToolBar ========
{
zoomToolBar.setFloatable(false);
zoomToolBar.setBorder(BorderFactory.createEmptyBorder());
//---- zoom1xButton ----
zoom1xButton.setText("1x");
zoom1xButton.setSelected(true);
zoom1xButton.setFont(zoom1xButton.getFont().deriveFont(zoom1xButton.getFont().getSize() - 2f));
zoom1xButton.addActionListener(e -> zoomChanged());
zoomToolBar.add(zoom1xButton);
//---- zoom2xButton ----
zoom2xButton.setText("2x");
zoom2xButton.setFont(zoom2xButton.getFont().deriveFont(zoom2xButton.getFont().getSize() - 2f));
zoom2xButton.addActionListener(e -> zoomChanged());
zoomToolBar.add(zoom2xButton);
//---- zoom3xButton ----
zoom3xButton.setText("3x");
zoom3xButton.setFont(zoom3xButton.getFont().deriveFont(zoom3xButton.getFont().getSize() - 2f));
zoom3xButton.addActionListener(e -> zoomChanged());
zoomToolBar.add(zoom3xButton);
//---- zoom4xButton ----
zoom4xButton.setText("4x");
zoom4xButton.setFont(zoom4xButton.getFont().deriveFont(zoom4xButton.getFont().getSize() - 2f));
zoom4xButton.addActionListener(e -> zoomChanged());
zoomToolBar.add(zoom4xButton);
zoomToolBar.addSeparator();
//---- indeterminateButton ----
indeterminateButton.setText("indeterminate");
indeterminateButton.setSelected(true);
indeterminateButton.addActionListener(e -> indeterminateChanged());
zoomToolBar.add(indeterminateButton);
}
panel1.add(zoomToolBar, "cell 1 0");
}
add(panel1, "cell 0 0 8 1,alignx right,growx 0");
//---- label22 ----
label22.setText("JCheckBox");
label22.setFont(label22.getFont().deriveFont(label22.getFont().getSize() + 4f));
add(label22, "cell 0 0 3 1");
add(label22, "cell 0 1 3 1");
//---- label1 ----
label1.setText("unfocused");
add(label1, "cell 1 1 3 1,alignx center,growx 0");
add(label1, "cell 1 2 3 1,alignx center,growx 0");
//---- label2 ----
label2.setText("focused");
add(label2, "cell 4 1 3 1,alignx center,growx 0");
add(label2, "cell 4 2 3 1,alignx center,growx 0");
//---- label23 ----
label23.setText("unsel.");
label23.setFont(label23.getFont().deriveFont(label23.getFont().getSize() - 2f));
add(label23, "cell 1 2,alignx center,growx 0");
add(label23, "cell 1 3,alignx center,growx 0");
//---- label28 ----
label28.setText("sel.");
label28.setFont(label28.getFont().deriveFont(label28.getFont().getSize() - 2f));
add(label28, "cell 2 2,alignx center,growx 0");
add(label28, "cell 2 3,alignx center,growx 0");
//---- label37 ----
label37.setText("ind.");
label37.setFont(label37.getFont().deriveFont(label37.getFont().getSize() - 2f));
add(label37, "cell 3 2,alignx center,growx 0");
add(label37, "cell 3 3,alignx center,growx 0");
//---- label24 ----
label24.setText("unsel.");
label24.setFont(label24.getFont().deriveFont(label24.getFont().getSize() - 2f));
add(label24, "cell 4 2,alignx center,growx 0");
add(label24, "cell 4 3,alignx center,growx 0");
//---- label29 ----
label29.setText("sel.");
label29.setFont(label29.getFont().deriveFont(label29.getFont().getSize() - 2f));
add(label29, "cell 5 2,alignx center,growx 0");
add(label29, "cell 5 3,alignx center,growx 0");
//---- label38 ----
label38.setText("ind.");
label38.setFont(label38.getFont().deriveFont(label38.getFont().getSize() - 2f));
add(label38, "cell 6 2,alignx center,growx 0");
add(label38, "cell 6 3,alignx center,growx 0");
//---- label17 ----
label17.setText("none");
add(label17, "cell 0 3");
add(testStateCheckBox1, "cell 1 3");
add(label17, "cell 0 4");
add(testStateCheckBox1, "cell 1 4");
//---- testStateCheckBox8 ----
testStateCheckBox8.setStateSelected(true);
add(testStateCheckBox8, "cell 2 3");
add(testStateCheckBox8, "cell 2 4");
//---- testStateCheckBox15 ----
testStateCheckBox15.setStateIndeterminate(true);
add(testStateCheckBox15, "cell 3 3");
add(testStateCheckBox15, "cell 3 4");
//---- testStateCheckBox5 ----
testStateCheckBox5.setStateFocused(true);
add(testStateCheckBox5, "cell 4 3");
add(testStateCheckBox5, "cell 4 4");
//---- testStateCheckBox12 ----
testStateCheckBox12.setStateFocused(true);
testStateCheckBox12.setStateSelected(true);
add(testStateCheckBox12, "cell 5 3");
add(testStateCheckBox12, "cell 5 4");
//---- testStateCheckBox20 ----
testStateCheckBox20.setStateIndeterminate(true);
testStateCheckBox20.setStateFocused(true);
add(testStateCheckBox20, "cell 6 3");
add(testStateCheckBox20, "cell 6 4");
//---- label18 ----
label18.setText("hover");
add(label18, "cell 0 4");
add(label18, "cell 0 5");
//---- testStateCheckBox2 ----
testStateCheckBox2.setStateHover(true);
add(testStateCheckBox2, "cell 1 4");
add(testStateCheckBox2, "cell 1 5");
//---- testStateCheckBox9 ----
testStateCheckBox9.setStateHover(true);
testStateCheckBox9.setStateSelected(true);
add(testStateCheckBox9, "cell 2 4");
add(testStateCheckBox9, "cell 2 5");
//---- testStateCheckBox16 ----
testStateCheckBox16.setStateIndeterminate(true);
testStateCheckBox16.setStateHover(true);
add(testStateCheckBox16, "cell 3 4");
add(testStateCheckBox16, "cell 3 5");
//---- testStateCheckBox6 ----
testStateCheckBox6.setStateFocused(true);
testStateCheckBox6.setStateHover(true);
add(testStateCheckBox6, "cell 4 4");
add(testStateCheckBox6, "cell 4 5");
//---- testStateCheckBox13 ----
testStateCheckBox13.setStateFocused(true);
testStateCheckBox13.setStateHover(true);
testStateCheckBox13.setStateSelected(true);
add(testStateCheckBox13, "cell 5 4");
add(testStateCheckBox13, "cell 5 5");
//---- testStateCheckBox21 ----
testStateCheckBox21.setStateIndeterminate(true);
testStateCheckBox21.setStateHover(true);
testStateCheckBox21.setStateFocused(true);
add(testStateCheckBox21, "cell 6 4");
add(testStateCheckBox21, "cell 6 5");
//---- label19 ----
label19.setText("pressed");
add(label19, "cell 0 5");
add(label19, "cell 0 6");
//---- testStateCheckBox3 ----
testStateCheckBox3.setStatePressed(true);
add(testStateCheckBox3, "cell 1 5");
add(testStateCheckBox3, "cell 1 6");
//---- testStateCheckBox10 ----
testStateCheckBox10.setStatePressed(true);
testStateCheckBox10.setStateSelected(true);
add(testStateCheckBox10, "cell 2 5");
add(testStateCheckBox10, "cell 2 6");
//---- testStateCheckBox17 ----
testStateCheckBox17.setStateIndeterminate(true);
testStateCheckBox17.setStatePressed(true);
add(testStateCheckBox17, "cell 3 5");
add(testStateCheckBox17, "cell 3 6");
//---- testStateCheckBox7 ----
testStateCheckBox7.setStateFocused(true);
testStateCheckBox7.setStatePressed(true);
add(testStateCheckBox7, "cell 4 5");
add(testStateCheckBox7, "cell 4 6");
//---- testStateCheckBox14 ----
testStateCheckBox14.setStateFocused(true);
testStateCheckBox14.setStatePressed(true);
testStateCheckBox14.setStateSelected(true);
add(testStateCheckBox14, "cell 5 5");
add(testStateCheckBox14, "cell 5 6");
//---- testStateCheckBox22 ----
testStateCheckBox22.setStateIndeterminate(true);
testStateCheckBox22.setStatePressed(true);
testStateCheckBox22.setStateFocused(true);
add(testStateCheckBox22, "cell 6 5");
add(testStateCheckBox22, "cell 6 6");
//---- label20 ----
label20.setText("disabled");
add(label20, "cell 0 6");
add(label20, "cell 0 7");
//---- testStateCheckBox4 ----
testStateCheckBox4.setEnabled(false);
add(testStateCheckBox4, "cell 1 6");
add(testStateCheckBox4, "cell 1 7");
//---- testStateCheckBox11 ----
testStateCheckBox11.setEnabled(false);
testStateCheckBox11.setStateSelected(true);
add(testStateCheckBox11, "cell 2 6");
add(testStateCheckBox11, "cell 2 7");
//---- testStateCheckBox18 ----
testStateCheckBox18.setStateIndeterminate(true);
testStateCheckBox18.setEnabled(false);
add(testStateCheckBox18, "cell 3 6");
add(testStateCheckBox18, "cell 3 7");
//---- label21 ----
label21.setText("try me");
add(label21, "cell 0 7");
add(checkBox1, "cell 1 7");
add(label21, "cell 0 8");
add(checkBox1, "cell 1 8");
//---- checkBox2 ----
checkBox2.setSelected(true);
add(checkBox2, "cell 2 7");
add(triStateCheckBox1, "cell 3 7");
add(checkBox2, "cell 2 8");
add(triStateCheckBox1, "cell 3 8");
//---- label27 ----
label27.setText("JRadioButton");
label27.setFont(label27.getFont().deriveFont(label27.getFont().getSize() + 4f));
add(label27, "cell 0 8 3 1");
add(label27, "cell 0 9 3 1");
//---- label3 ----
label3.setText("unfocused");
add(label3, "cell 1 9 2 1,alignx center,growx 0");
add(label3, "cell 1 10 2 1,alignx center,growx 0");
//---- label4 ----
label4.setText("focused");
add(label4, "cell 4 9 2 1,alignx center,growx 0");
add(label4, "cell 4 10 2 1,alignx center,growx 0");
//---- label25 ----
label25.setText("unsel.");
label25.setFont(label25.getFont().deriveFont(label25.getFont().getSize() - 2f));
add(label25, "cell 1 10,alignx center,growx 0");
add(label25, "cell 1 11,alignx center,growx 0");
//---- label30 ----
label30.setText("sel.");
label30.setFont(label30.getFont().deriveFont(label30.getFont().getSize() - 2f));
add(label30, "cell 2 10,alignx center,growx 0");
add(label30, "cell 2 11,alignx center,growx 0");
//---- label26 ----
label26.setText("unsel.");
label26.setFont(label26.getFont().deriveFont(label26.getFont().getSize() - 2f));
add(label26, "cell 4 10,alignx center,growx 0");
add(label26, "cell 4 11,alignx center,growx 0");
//---- label31 ----
label31.setText("sel.");
label31.setFont(label31.getFont().deriveFont(label31.getFont().getSize() - 2f));
add(label31, "cell 5 10,alignx center,growx 0");
add(label31, "cell 5 11,alignx center,growx 0");
//---- label36 ----
label36.setText("none");
add(label36, "cell 0 11");
add(testStateRadioButton1, "cell 1 11");
add(label36, "cell 0 12");
add(testStateRadioButton1, "cell 1 12");
//---- testStateRadioButton8 ----
testStateRadioButton8.setStateSelected(true);
add(testStateRadioButton8, "cell 2 11");
add(testStateRadioButton8, "cell 2 12");
//---- testStateRadioButton5 ----
testStateRadioButton5.setStateFocused(true);
add(testStateRadioButton5, "cell 4 11");
add(testStateRadioButton5, "cell 4 12");
//---- testStateRadioButton9 ----
testStateRadioButton9.setStateFocused(true);
testStateRadioButton9.setStateSelected(true);
add(testStateRadioButton9, "cell 5 11");
add(testStateRadioButton9, "cell 5 12");
//---- label35 ----
label35.setText("hover");
add(label35, "cell 0 12");
add(label35, "cell 0 13");
//---- testStateRadioButton2 ----
testStateRadioButton2.setStateHover(true);
add(testStateRadioButton2, "cell 1 12");
add(testStateRadioButton2, "cell 1 13");
//---- testStateRadioButton10 ----
testStateRadioButton10.setStateHover(true);
testStateRadioButton10.setStateSelected(true);
add(testStateRadioButton10, "cell 2 12");
add(testStateRadioButton10, "cell 2 13");
//---- testStateRadioButton6 ----
testStateRadioButton6.setStateFocused(true);
testStateRadioButton6.setStateHover(true);
add(testStateRadioButton6, "cell 4 12");
add(testStateRadioButton6, "cell 4 13");
//---- testStateRadioButton11 ----
testStateRadioButton11.setStateFocused(true);
testStateRadioButton11.setStateHover(true);
testStateRadioButton11.setStateSelected(true);
add(testStateRadioButton11, "cell 5 12");
add(testStateRadioButton11, "cell 5 13");
//---- label34 ----
label34.setText("pressed");
add(label34, "cell 0 13");
add(label34, "cell 0 14");
//---- testStateRadioButton3 ----
testStateRadioButton3.setStatePressed(true);
add(testStateRadioButton3, "cell 1 13");
add(testStateRadioButton3, "cell 1 14");
//---- testStateRadioButton12 ----
testStateRadioButton12.setStatePressed(true);
testStateRadioButton12.setStateSelected(true);
add(testStateRadioButton12, "cell 2 13");
add(testStateRadioButton12, "cell 2 14");
//---- testStateRadioButton7 ----
testStateRadioButton7.setStateFocused(true);
testStateRadioButton7.setStatePressed(true);
add(testStateRadioButton7, "cell 4 13");
add(testStateRadioButton7, "cell 4 14");
//---- testStateRadioButton13 ----
testStateRadioButton13.setStateFocused(true);
testStateRadioButton13.setStatePressed(true);
testStateRadioButton13.setStateSelected(true);
add(testStateRadioButton13, "cell 5 13");
add(testStateRadioButton13, "cell 5 14");
//---- label33 ----
label33.setText("disabled");
add(label33, "cell 0 14");
add(label33, "cell 0 15");
//---- testStateRadioButton4 ----
testStateRadioButton4.setEnabled(false);
add(testStateRadioButton4, "cell 1 14");
add(testStateRadioButton4, "cell 1 15");
//---- testStateRadioButton14 ----
testStateRadioButton14.setEnabled(false);
testStateRadioButton14.setStateSelected(true);
add(testStateRadioButton14, "cell 2 14");
add(testStateRadioButton14, "cell 2 15");
//---- label32 ----
label32.setText("try me");
add(label32, "cell 0 15");
add(radioButton1, "cell 1 15");
add(label32, "cell 0 16");
add(radioButton1, "cell 1 16");
//---- radioButton2 ----
radioButton2.setSelected(true);
add(radioButton2, "cell 2 15");
add(radioButton2, "cell 2 16");
//---- buttonGroup1 ----
ButtonGroup buttonGroup1 = new ButtonGroup();
buttonGroup1.add(zoom1xButton);
buttonGroup1.add(zoom2xButton);
buttonGroup1.add(zoom3xButton);
buttonGroup1.add(zoom4xButton);
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JToggleButton zoom1xButton;
private JToggleButton zoom2xButton;
private JToggleButton zoom3xButton;
private JToggleButton zoom4xButton;
private JToggleButton indeterminateButton;
// JFormDesigner - End of variables declaration //GEN-END:variables
//---- class ZoomCheckBox -------------------------------------------------
private static class ZoomCheckBox
extends JCheckBox
{
@Override
public void updateUI() {
super.updateUI();
if( !Beans.isDesignTime() )
setIcon( new ZoomCheckBoxIcon() );
}
}
//---- class ZoomRadioButton ----------------------------------------------
private static class ZoomRadioButton
extends JRadioButton
{
@Override
public void updateUI() {
super.updateUI();
if( !Beans.isDesignTime() )
setIcon( new ZoomRadioButtonIcon() );
}
}
//---- class ZoomTriStateCheckBox -----------------------------------------
private static class ZoomTriStateCheckBox
extends FlatTriStateCheckBox
{
@Override
public void updateUI() {
super.updateUI();
if( !Beans.isDesignTime() )
setIcon( new ZoomCheckBoxIcon() );
}
}
//---- class TestStateCheckBox --------------------------------------------
private static class TestStateCheckBox
extends JCheckBox
extends ZoomCheckBox
{
private boolean stateHover;
private boolean statePressed;
@@ -489,7 +708,6 @@ class FlatThemePreviewSwitches
this.stateSelected = stateSelected;
}
@SuppressWarnings( "unused" )
public boolean isStateIndeterminate() {
return stateIndeterminate;
}
@@ -505,7 +723,7 @@ class FlatThemePreviewSwitches
//---- class TestStateRadioButton -----------------------------------------
private static class TestStateRadioButton
extends JRadioButton
extends ZoomRadioButton
{
private boolean stateHover;
private boolean statePressed;
@@ -566,4 +784,72 @@ class FlatThemePreviewSwitches
this.stateSelected = stateSelected;
}
}
//---- class ZoomCheckBoxIcon ---------------------------------------------
private static class ZoomCheckBoxIcon
extends FlatCheckBoxIcon
{
@Override
public void paintIcon( Component c, Graphics g, int x, int y ) {
Graphics2D g2 = (Graphics2D) g.create();
try {
g2.translate( x, y );
g2.scale( zoom, zoom );
super.paintIcon( c, g2, 0, 0 );
} finally {
g2.dispose();
}
}
@Override
public int getIconWidth() {
return Math.round( super.getIconWidth() * zoom );
}
@Override
public int getIconHeight() {
return Math.round( super.getIconHeight() * zoom );
}
@Override
public float getFocusWidth() {
return super.getFocusWidth() * zoom;
}
}
//---- class ZoomRadioButtonIcon ------------------------------------------
private static class ZoomRadioButtonIcon
extends FlatRadioButtonIcon
{
@Override
public void paintIcon( Component c, Graphics g, int x, int y ) {
Graphics2D g2 = (Graphics2D) g.create();
try {
g2.translate( x, y );
g2.scale( zoom, zoom );
super.paintIcon( c, g2, 0, 0 );
} finally {
g2.dispose();
}
}
@Override
public int getIconWidth() {
return Math.round( super.getIconWidth() * zoom );
}
@Override
public int getIconHeight() {
return Math.round( super.getIconHeight() * zoom );
}
@Override
public float getFocusWidth() {
return super.getFocusWidth() * zoom;
}
}
}

View File

@@ -8,146 +8,221 @@ new FormModel {
}
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets dialog,hidemode 3"
"$columnConstraints": "[fill][sizegroup 1,center][sizegroup 1,center][sizegroup 1,center]para[sizegroup 2,center][sizegroup 2,center][sizegroup 2,center]"
"$rowConstraints": "[][]3[][][][][]unrel[]para[][]3[][][][][]unrel[]"
"$columnConstraints": "[fill][sizegroup 1,center][sizegroup 1,center][sizegroup 1,center]para[sizegroup 2,center][sizegroup 2,center][sizegroup 2,center]0[grow,fill]"
"$rowConstraints": "[]para[][]3[][][][][]unrel[]para[][]3[][][][][]unrel[]"
} ) {
name: "this"
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 0,hidemode 3"
"$columnConstraints": "[fill][fill]"
"$rowConstraints": "[]0"
} ) {
name: "panel1"
add( new FormComponent( "javax.swing.JLabel" ) {
name: "zoomLabel"
"text": "Zoom:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
name: "zoomToolBar"
"floatable": false
"border": new javax.swing.border.EmptyBorder( 0, 0, 0, 0 )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "zoom1xButton"
"text": "1x"
"selected": true
"font": &SwingDerivedFont0 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false )
"$buttonGroup": new FormReference( "buttonGroup1" )
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "zoomChanged", false ) )
} )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "zoom2xButton"
"text": "2x"
"font": #SwingDerivedFont0
"$buttonGroup": &FormReference0 new FormReference( "buttonGroup1" )
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "zoomChanged", false ) )
} )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "zoom3xButton"
"text": "3x"
"font": #SwingDerivedFont0
"$buttonGroup": #FormReference0
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "zoomChanged", false ) )
} )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "zoom4xButton"
"text": "4x"
"font": #SwingDerivedFont0
"$buttonGroup": #FormReference0
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "zoomChanged", false ) )
} )
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
name: "separator1"
} )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "indeterminateButton"
"text": "indeterminate"
"selected": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "indeterminateChanged", false ) )
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 0"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0 8 1,alignx right,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label22"
"text": "JCheckBox"
"font": &SwingDerivedFont0 new com.jformdesigner.model.SwingDerivedFont( null, 0, 4, false )
"font": &SwingDerivedFont1 new com.jformdesigner.model.SwingDerivedFont( null, 0, 4, false )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0 3 1"
"value": "cell 0 1 3 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1"
"text": "unfocused"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1 3 1,alignx center,growx 0"
"value": "cell 1 2 3 1,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label2"
"text": "focused"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 1 3 1,alignx center,growx 0"
"value": "cell 4 2 3 1,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label23"
"text": "unsel."
"font": &SwingDerivedFont1 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false )
"font": &SwingDerivedFont2 new com.jformdesigner.model.SwingDerivedFont( null, 0, -2, false )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2,alignx center,growx 0"
"value": "cell 1 3,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label28"
"text": "sel."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 2,alignx center,growx 0"
"value": "cell 2 3,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label37"
"text": "ind."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 2,alignx center,growx 0"
"value": "cell 3 3,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label24"
"text": "unsel."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 2,alignx center,growx 0"
"value": "cell 4 3,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label29"
"text": "sel."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 2,alignx center,growx 0"
"value": "cell 5 3,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label38"
"text": "ind."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 6 2,alignx center,growx 0"
"value": "cell 6 3,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label17"
"text": "none"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3"
"value": "cell 0 4"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox1"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 3"
"value": "cell 1 4"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox8"
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 3"
"value": "cell 2 4"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox15"
"stateIndeterminate": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 3"
"value": "cell 3 4"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox5"
"stateFocused": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 3"
"value": "cell 4 4"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox12"
"stateFocused": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 3"
"value": "cell 5 4"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox20"
"stateIndeterminate": true
"stateFocused": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 6 3"
"value": "cell 6 4"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label18"
"text": "hover"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4"
"value": "cell 0 5"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox2"
"stateHover": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 4"
"value": "cell 1 5"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox9"
"stateHover": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 4"
"value": "cell 2 5"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox16"
"stateIndeterminate": true
"stateHover": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 4"
"value": "cell 3 5"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox6"
"stateFocused": true
"stateHover": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 4"
"value": "cell 4 5"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox13"
@@ -155,7 +230,7 @@ new FormModel {
"stateHover": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 4"
"value": "cell 5 5"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox21"
@@ -163,40 +238,40 @@ new FormModel {
"stateHover": true
"stateFocused": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 6 4"
"value": "cell 6 5"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label19"
"text": "pressed"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 5"
"value": "cell 0 6"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox3"
"statePressed": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5"
"value": "cell 1 6"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox10"
"statePressed": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 5"
"value": "cell 2 6"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox17"
"stateIndeterminate": true
"statePressed": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 5"
"value": "cell 3 6"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox7"
"stateFocused": true
"statePressed": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 5"
"value": "cell 4 6"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox14"
@@ -204,7 +279,7 @@ new FormModel {
"statePressed": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 5"
"value": "cell 5 6"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox22"
@@ -212,158 +287,158 @@ new FormModel {
"statePressed": true
"stateFocused": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 6 5"
"value": "cell 6 6"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label20"
"text": "disabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 6"
"value": "cell 0 7"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox4"
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 6"
"value": "cell 1 7"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox11"
"enabled": false
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 6"
"value": "cell 2 7"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateCheckBox" ) {
name: "testStateCheckBox18"
"stateIndeterminate": true
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 6"
"value": "cell 3 7"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label21"
"text": "try me"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 7"
"value": "cell 0 8"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomCheckBox" ) {
name: "checkBox1"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 7"
"value": "cell 1 8"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomCheckBox" ) {
name: "checkBox2"
"selected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 7"
"value": "cell 2 8"
} )
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatTriStateCheckBox" ) {
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomTriStateCheckBox" ) {
name: "triStateCheckBox1"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 7"
"value": "cell 3 8"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label27"
"text": "JRadioButton"
"font": #SwingDerivedFont0
"font": #SwingDerivedFont1
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 8 3 1"
"value": "cell 0 9 3 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label3"
"text": "unfocused"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 9 2 1,alignx center,growx 0"
"value": "cell 1 10 2 1,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label4"
"text": "focused"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 9 2 1,alignx center,growx 0"
"value": "cell 4 10 2 1,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label25"
"text": "unsel."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 10,alignx center,growx 0"
"value": "cell 1 11,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label30"
"text": "sel."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 10,alignx center,growx 0"
"value": "cell 2 11,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label26"
"text": "unsel."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 10,alignx center,growx 0"
"value": "cell 4 11,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label31"
"text": "sel."
"font": #SwingDerivedFont1
"font": #SwingDerivedFont2
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 10,alignx center,growx 0"
"value": "cell 5 11,alignx center,growx 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label36"
"text": "none"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 11"
"value": "cell 0 12"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton1"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 11"
"value": "cell 1 12"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton8"
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 11"
"value": "cell 2 12"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton5"
"stateFocused": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 11"
"value": "cell 4 12"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton9"
"stateFocused": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 11"
"value": "cell 5 12"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label35"
"text": "hover"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 12"
"value": "cell 0 13"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton2"
"stateHover": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 12"
"value": "cell 1 13"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton10"
"stateHover": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 12"
"value": "cell 2 13"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton6"
"stateFocused": true
"stateHover": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 12"
"value": "cell 4 13"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton11"
@@ -371,33 +446,33 @@ new FormModel {
"stateHover": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 12"
"value": "cell 5 13"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label34"
"text": "pressed"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 13"
"value": "cell 0 14"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton3"
"statePressed": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 13"
"value": "cell 1 14"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton12"
"statePressed": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 13"
"value": "cell 2 14"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton7"
"stateFocused": true
"statePressed": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 4 13"
"value": "cell 4 14"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton13"
@@ -405,47 +480,52 @@ new FormModel {
"statePressed": true
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 5 13"
"value": "cell 5 14"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label33"
"text": "disabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 14"
"value": "cell 0 15"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton4"
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 14"
"value": "cell 1 15"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$TestStateRadioButton" ) {
name: "testStateRadioButton14"
"enabled": false
"stateSelected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 14"
"value": "cell 2 15"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label32"
"text": "try me"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 15"
"value": "cell 0 16"
} )
add( new FormComponent( "javax.swing.JRadioButton" ) {
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) {
name: "radioButton1"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 15"
"value": "cell 1 16"
} )
add( new FormComponent( "javax.swing.JRadioButton" ) {
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) {
name: "radioButton2"
"selected": true
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 15"
"value": "cell 2 16"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 385, 685 )
"size": new java.awt.Dimension( 325, 515 )
} )
add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
name: "buttonGroup1"
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 580 )
} )
}
}