Theme Editor: Preview: added style classes to all preview components (syntax flatlaf-preview-<componenttype>) to allow experimenting with styles in editor

This commit is contained in:
Karl Tauber
2021-12-26 21:23:42 +01:00
parent 01170b669b
commit 1c10c41808
4 changed files with 133 additions and 1 deletions

View File

@@ -388,6 +388,7 @@ class FlatThemePreviewAll
//---- label1 ----
label1.setText("Some Text");
label1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-label");
add(label1, "cell 1 1 2 1");
//---- flatButton1 ----
@@ -402,10 +403,12 @@ class FlatThemePreviewAll
//---- button1 ----
button1.setText("OK");
button1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-button");
add(button1, "cell 1 2");
//---- testDefaultButton1 ----
testDefaultButton1.setText("Default");
testDefaultButton1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-button");
add(testDefaultButton1, "cell 2 2");
//---- toggleButtonLabel ----
@@ -414,11 +417,13 @@ class FlatThemePreviewAll
//---- toggleButton1 ----
toggleButton1.setText("Unselected");
toggleButton1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-togglebutton");
add(toggleButton1, "cell 1 3");
//---- toggleButton3 ----
toggleButton3.setText("Selected");
toggleButton3.setSelected(true);
toggleButton3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-togglebutton");
add(toggleButton3, "cell 2 3");
//---- checkBoxLabel ----
@@ -427,11 +432,13 @@ class FlatThemePreviewAll
//---- checkBox1 ----
checkBox1.setText("Unselected");
checkBox1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkbox");
add(checkBox1, "cell 1 4,alignx left,growx 0");
//---- checkBox3 ----
checkBox3.setText("Selected");
checkBox3.setSelected(true);
checkBox3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkbox");
add(checkBox3, "cell 2 4,alignx left,growx 0");
//---- radioButtonLabel ----
@@ -440,11 +447,13 @@ class FlatThemePreviewAll
//---- radioButton1 ----
radioButton1.setText("Unselected");
radioButton1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobutton");
add(radioButton1, "cell 1 5,alignx left,growx 0");
//---- radioButton3 ----
radioButton3.setText("Selected");
radioButton3.setSelected(true);
radioButton3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobutton");
add(radioButton3, "cell 2 5,alignx left,growx 0");
//---- comboBoxLabel ----
@@ -469,6 +478,7 @@ class FlatThemePreviewAll
}));
comboBox1.setMaximumRowCount(6);
comboBox1.setPlaceholderText("placeholder text");
comboBox1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-combobox");
add(comboBox1, "cell 1 6");
//---- comboBox3 ----
@@ -487,11 +497,15 @@ class FlatThemePreviewAll
"kkk"
}));
comboBox3.setMaximumRowCount(6);
comboBox3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-combobox");
add(comboBox3, "cell 2 6");
//---- spinnerLabel ----
spinnerLabel.setText("JSpinner:");
add(spinnerLabel, "cell 0 7");
//---- spinner1 ----
spinner1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-spinner");
add(spinner1, "cell 1 7 2 1");
//---- textFieldLabel ----
@@ -501,16 +515,19 @@ class FlatThemePreviewAll
//---- textField1 ----
textField1.setText("Some Text");
textField1.setPlaceholderText("placeholder text");
textField1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-textfield");
add(textField1, "cell 1 8 2 1");
//---- formattedTextField1 ----
formattedTextField1.setText("Some Text");
formattedTextField1.setPlaceholderText("placeholder text");
formattedTextField1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-formattedtextfield");
add(formattedTextField1, "cell 1 9");
//---- passwordField1 ----
passwordField1.setText("Some Text");
passwordField1.setPlaceholderText("placeholder text");
passwordField1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-passwordfield");
add(passwordField1, "cell 2 9");
//---- textAreaLabel ----
@@ -525,6 +542,7 @@ class FlatThemePreviewAll
//---- textArea1 ----
textArea1.setText("Text");
textArea1.setRows(2);
textArea1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-textarea");
scrollPane1.setViewportView(textArea1);
}
add(scrollPane1, "cell 1 10 2 1,width 40");
@@ -536,6 +554,7 @@ class FlatThemePreviewAll
//---- editorPane1 ----
editorPane1.setText("Text");
editorPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-editorpane");
scrollPane5.setViewportView(editorPane1);
}
add(scrollPane5, "cell 1 10 2 1,width 40");
@@ -547,6 +566,7 @@ class FlatThemePreviewAll
//---- textPane1 ----
textPane1.setText("Text");
textPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-textpane");
scrollPane9.setViewportView(textPane1);
}
add(scrollPane9, "cell 1 10 2 1,width 40");
@@ -566,46 +586,56 @@ class FlatThemePreviewAll
//======== menuBar1 ========
{
menuBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menubar");
//======== menu2 ========
{
menu2.setText("JMenu");
menu2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem3 ----
menuItem3.setText("JMenuItem");
menuItem3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu2.add(menuItem3);
//---- menuItem4 ----
menuItem4.setText("JMenuItem");
menuItem4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu2.add(menuItem4);
menu2.addSeparator();
//---- checkBoxMenuItem2 ----
checkBoxMenuItem2.setText("JCheckBoxMenuItem");
checkBoxMenuItem2.setSelected(true);
checkBoxMenuItem2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkboxmenuitem");
menu2.add(checkBoxMenuItem2);
//---- checkBoxMenuItem3 ----
checkBoxMenuItem3.setText("JCheckBoxMenuItem");
checkBoxMenuItem3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-checkboxmenuitem");
menu2.add(checkBoxMenuItem3);
menu2.addSeparator();
//---- radioButtonMenuItem4 ----
radioButtonMenuItem4.setText("JRadioButtonMenuItem");
radioButtonMenuItem4.setSelected(true);
radioButtonMenuItem4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobuttonmenuitem");
menu2.add(radioButtonMenuItem4);
//---- radioButtonMenuItem5 ----
radioButtonMenuItem5.setText("JRadioButtonMenuItem");
radioButtonMenuItem5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-radiobuttonmenuitem");
menu2.add(radioButtonMenuItem5);
menu2.addSeparator();
//======== menu4 ========
{
menu4.setText("JMenu");
menu4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem6 ----
menuItem6.setText("JMenuItem");
menuItem6.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu4.add(menuItem6);
}
menu2.add(menu4);
@@ -613,9 +643,11 @@ class FlatThemePreviewAll
//======== menu5 ========
{
menu5.setText("JMenu");
menu5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem7 ----
menuItem7.setText("JMenuItem");
menuItem7.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu5.add(menuItem7);
}
menu2.add(menu5);
@@ -625,18 +657,22 @@ class FlatThemePreviewAll
//======== menu3 ========
{
menu3.setText("JMenu");
menu3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menu");
//---- menuItem5 ----
menuItem5.setText("JMenuItem");
menuItem5.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_DOWN_MASK|KeyEvent.ALT_DOWN_MASK|KeyEvent.SHIFT_DOWN_MASK));
menuItem5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu3.add(menuItem5);
//---- menuItem8 ----
menuItem8.setText("JMenuItem");
menuItem8.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu3.add(menuItem8);
//---- menuItem9 ----
menuItem9.setText("JMenuItem");
menuItem9.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-menuitem");
menu3.add(menuItem9);
}
menuBar1.add(menu3);
@@ -649,16 +685,21 @@ class FlatThemePreviewAll
//---- scrollBar1 ----
scrollBar1.setOrientation(Adjustable.HORIZONTAL);
scrollBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
add(scrollBar1, "cell 1 12 2 1");
//---- scrollBar5 ----
scrollBar5.setOrientation(Adjustable.HORIZONTAL);
scrollBar5.setShowButtons(true);
scrollBar5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
add(scrollBar5, "cell 1 13 2 1");
//---- separatorLabel ----
separatorLabel.setText("JSeparator:");
add(separatorLabel, "cell 0 14");
//---- separator1 ----
separator1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-separator");
add(separator1, "cell 1 14 2 1");
//---- sliderLabel ----
@@ -667,6 +708,7 @@ class FlatThemePreviewAll
//---- slider1 ----
slider1.setValue(30);
slider1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
add(slider1, "cell 1 15 2 1,width 100");
//---- slider3 ----
@@ -675,6 +717,7 @@ class FlatThemePreviewAll
slider3.setMajorTickSpacing(50);
slider3.setPaintLabels(true);
slider3.setValue(30);
slider3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
slider3.addChangeListener(e -> changeProgress());
add(slider3, "cell 1 16 2 1,width 100");
@@ -684,11 +727,13 @@ class FlatThemePreviewAll
//---- progressBar1 ----
progressBar1.setValue(60);
progressBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-progressbar");
add(progressBar1, "cell 1 17 2 1");
//---- progressBar2 ----
progressBar2.setValue(50);
progressBar2.setStringPainted(true);
progressBar2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-progressbar");
add(progressBar2, "cell 1 18 2 1");
//---- toolTipLabel ----
@@ -697,6 +742,7 @@ class FlatThemePreviewAll
//---- toolTip1 ----
toolTip1.setTipText("Some text in tool tip.");
toolTip1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-tooltip");
add(toolTip1, "cell 1 19 2 1,alignx left,growx 0");
//---- toolBarLabel ----
@@ -705,28 +751,34 @@ class FlatThemePreviewAll
//======== toolBar1 ========
{
toolBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar");
//---- button4 ----
button4.setIcon(UIManager.getIcon("Tree.closedIcon"));
button4.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-button");
toolBar1.add(button4);
//---- button6 ----
button6.setIcon(UIManager.getIcon("Tree.openIcon"));
button6.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-button");
toolBar1.add(button6);
toolBar1.addSeparator();
//---- button7 ----
button7.setIcon(UIManager.getIcon("Tree.leafIcon"));
button7.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-togglebutton");
toolBar1.add(button7);
//---- button8 ----
button8.setIcon(UIManager.getIcon("Tree.leafIcon"));
button8.setSelected(true);
button8.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-togglebutton");
toolBar1.add(button8);
//---- button9 ----
button9.setIcon(UIManager.getIcon("Tree.leafIcon"));
button9.setSelected(true);
button9.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-toolbar-togglebutton");
toolBar1.add(button9);
}
add(toolBar1, "cell 1 20 2 1");
@@ -734,6 +786,11 @@ class FlatThemePreviewAll
//---- tabbedPaneLabel ----
tabbedPaneLabel.setText("JTabbedPane:");
add(tabbedPaneLabel, "cell 0 21");
//======== tabbedPane1 ========
{
tabbedPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-tabbedpane");
}
add(tabbedPane1, "cell 1 21 2 1");
//---- listTreeLabel ----
@@ -743,6 +800,7 @@ class FlatThemePreviewAll
//======== splitPane1 ========
{
splitPane1.setResizeWeight(0.5);
splitPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-splitpane");
//======== scrollPane2 ========
{
@@ -760,6 +818,7 @@ class FlatThemePreviewAll
@Override
public String getElementAt(int i) { return values[i]; }
});
list1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-list");
scrollPane2.setViewportView(list1);
}
splitPane1.setLeftComponent(scrollPane2);
@@ -780,6 +839,7 @@ class FlatThemePreviewAll
add(node1);
}
}));
tree1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-tree");
scrollPane3.setViewportView(tree1);
}
splitPane1.setRightComponent(scrollPane3);
@@ -803,6 +863,7 @@ class FlatThemePreviewAll
"Column 1", "Column 2"
}
));
table1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-table");
scrollPane4.setViewportView(table1);
}
add(scrollPane4, "cell 1 23 2 1,width 100,height 70");
@@ -813,6 +874,7 @@ class FlatThemePreviewAll
//======== desktopPane1 ========
{
desktopPane1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-desktoppane");
//======== internalFrame1 ========
{
@@ -822,6 +884,7 @@ class FlatThemePreviewAll
internalFrame1.setMaximizable(true);
internalFrame1.setIconifiable(true);
internalFrame1.setResizable(true);
internalFrame1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-internalframe");
Container internalFrame1ContentPane = internalFrame1.getContentPane();
internalFrame1ContentPane.setLayout(new BorderLayout());
}
@@ -836,6 +899,7 @@ class FlatThemePreviewAll
internalFrame2.setMaximizable(true);
internalFrame2.setResizable(true);
internalFrame2.setTitle("Inactive");
internalFrame2.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-internalframe");
Container internalFrame2ContentPane = internalFrame2.getContentPane();
internalFrame2ContentPane.setLayout(new BorderLayout());
}

View File

@@ -58,6 +58,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1"
"text": "Some Text"
"$client.FlatLaf.styleClass": "flatlaf-preview-label"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -81,12 +82,14 @@ new FormModel {
add( new FormComponent( "javax.swing.JButton" ) {
name: "button1"
"text": "OK"
"$client.FlatLaf.styleClass": "flatlaf-preview-button"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewDefaultButton" ) {
name: "testDefaultButton1"
"text": "Default"
"$client.FlatLaf.styleClass": "flatlaf-preview-button"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 2"
} )
@@ -99,6 +102,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "toggleButton1"
"text": "Unselected"
"$client.FlatLaf.styleClass": "flatlaf-preview-togglebutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 3"
} )
@@ -106,6 +110,7 @@ new FormModel {
name: "toggleButton3"
"text": "Selected"
"selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-togglebutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 3"
} )
@@ -118,6 +123,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "checkBox1"
"text": "Unselected"
"$client.FlatLaf.styleClass": "flatlaf-preview-checkbox"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 4,alignx left,growx 0"
} )
@@ -125,6 +131,7 @@ new FormModel {
name: "checkBox3"
"text": "Selected"
"selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-checkbox"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 4,alignx left,growx 0"
} )
@@ -138,6 +145,7 @@ new FormModel {
name: "radioButton1"
"text": "Unselected"
"$buttonGroup": new FormReference( "buttonGroup1" )
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5,alignx left,growx 0"
} )
@@ -146,6 +154,7 @@ new FormModel {
"text": "Selected"
"selected": true
"$buttonGroup": new FormReference( "buttonGroup1" )
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobutton"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 5,alignx left,growx 0"
} )
@@ -175,6 +184,7 @@ new FormModel {
}
"maximumRowCount": 6
"placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-combobox"
auxiliary() {
"JavaCodeGenerator.typeParameters": "String"
}
@@ -199,6 +209,7 @@ new FormModel {
addElement( "kkk" )
}
"maximumRowCount": 6
"$client.FlatLaf.styleClass": "flatlaf-preview-combobox"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 6"
} )
@@ -210,6 +221,7 @@ new FormModel {
} )
add( new FormComponent( "javax.swing.JSpinner" ) {
name: "spinner1"
"$client.FlatLaf.styleClass": "flatlaf-preview-spinner"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 7 2 1"
} )
@@ -223,6 +235,7 @@ new FormModel {
name: "textField1"
"text": "Some Text"
"placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-textfield"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -233,6 +246,7 @@ new FormModel {
name: "formattedTextField1"
"text": "Some Text"
"placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-formattedtextfield"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -243,6 +257,7 @@ new FormModel {
name: "passwordField1"
"text": "Some Text"
"placeholderText": "placeholder text"
"$client.FlatLaf.styleClass": "flatlaf-preview-passwordfield"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -263,6 +278,7 @@ new FormModel {
name: "textArea1"
"text": "Text"
"rows": 2
"$client.FlatLaf.styleClass": "flatlaf-preview-textarea"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -277,6 +293,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JEditorPane" ) {
name: "editorPane1"
"text": "Text"
"$client.FlatLaf.styleClass": "flatlaf-preview-editorpane"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -291,6 +308,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JTextPane" ) {
name: "textPane1"
"text": "Text"
"$client.FlatLaf.styleClass": "flatlaf-preview-textpane"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -320,19 +338,23 @@ new FormModel {
} )
add( new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) {
name: "menuBar1"
"$client.FlatLaf.styleClass": "flatlaf-preview-menubar"
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu2"
"text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem3"
"text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} )
add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem4"
"text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} )
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
name: "separator7"
@@ -341,10 +363,12 @@ new FormModel {
name: "checkBoxMenuItem2"
"text": "JCheckBoxMenuItem"
"selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-checkboxmenuitem"
} )
add( new FormComponent( "javax.swing.JCheckBoxMenuItem" ) {
name: "checkBoxMenuItem3"
"text": "JCheckBoxMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-checkboxmenuitem"
} )
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
name: "separator9"
@@ -354,11 +378,13 @@ new FormModel {
"text": "JRadioButtonMenuItem"
"$buttonGroup": new FormReference( "buttonGroup2" )
"selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobuttonmenuitem"
} )
add( new FormComponent( "javax.swing.JRadioButtonMenuItem" ) {
name: "radioButtonMenuItem5"
"text": "JRadioButtonMenuItem"
"$buttonGroup": new FormReference( "buttonGroup2" )
"$client.FlatLaf.styleClass": "flatlaf-preview-radiobuttonmenuitem"
} )
add( new FormComponent( "javax.swing.JPopupMenu$Separator" ) {
name: "separator3"
@@ -366,35 +392,43 @@ new FormModel {
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu4"
"text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem6"
"text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} )
} )
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu5"
"text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem7"
"text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} )
} )
} )
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
name: "menu3"
"text": "JMenu"
"$client.FlatLaf.styleClass": "flatlaf-preview-menu"
add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem5"
"text": "JMenuItem"
"accelerator": static javax.swing.KeyStroke getKeyStroke( 80, 715, false )
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} )
add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem8"
"text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} )
add( new FormComponent( "javax.swing.JMenuItem" ) {
name: "menuItem9"
"text": "JMenuItem"
"$client.FlatLaf.styleClass": "flatlaf-preview-menuitem"
} )
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
@@ -409,6 +443,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JScrollBar" ) {
name: "scrollBar1"
"orientation": 0
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 12 2 1"
} )
@@ -416,6 +451,7 @@ new FormModel {
name: "scrollBar5"
"orientation": 0
"showButtons": true
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 13 2 1"
} )
@@ -427,6 +463,7 @@ new FormModel {
} )
add( new FormComponent( "javax.swing.JSeparator" ) {
name: "separator1"
"$client.FlatLaf.styleClass": "flatlaf-preview-separator"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 14 2 1"
} )
@@ -439,6 +476,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JSlider" ) {
name: "slider1"
"value": 30
"$client.FlatLaf.styleClass": "flatlaf-preview-slider"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -452,6 +490,7 @@ new FormModel {
"majorTickSpacing": 50
"paintLabels": true
"value": 30
"$client.FlatLaf.styleClass": "flatlaf-preview-slider"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -468,6 +507,7 @@ new FormModel {
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatProgressBar" ) {
name: "progressBar1"
"value": 60
"$client.FlatLaf.styleClass": "flatlaf-preview-progressbar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -478,6 +518,7 @@ new FormModel {
name: "progressBar2"
"value": 50
"stringPainted": true
"$client.FlatLaf.styleClass": "flatlaf-preview-progressbar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -493,6 +534,7 @@ new FormModel {
add( new FormComponent( "javax.swing.JToolTip" ) {
name: "toolTip1"
"tipText": "Some text in tool tip."
"$client.FlatLaf.styleClass": "flatlaf-preview-tooltip"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 19 2 1,alignx left,growx 0"
} )
@@ -504,16 +546,19 @@ new FormModel {
} )
add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) {
name: "toolBar1"
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
add( new FormComponent( "javax.swing.JButton" ) {
name: "button4"
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-button"
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button6"
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.openIcon" )
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-button"
} )
add( new FormComponent( "javax.swing.JToolBar$Separator" ) {
name: "separator4"
@@ -521,16 +566,19 @@ new FormModel {
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "button7"
"icon": &SwingIcon0 new com.jformdesigner.model.SwingIcon( 2, "Tree.leafIcon" )
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-togglebutton"
} )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "button8"
"icon": #SwingIcon0
"selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-togglebutton"
} )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "button9"
"icon": #SwingIcon0
"selected": true
"$client.FlatLaf.styleClass": "flatlaf-preview-toolbar-togglebutton"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 20 2 1"
@@ -543,6 +591,7 @@ new FormModel {
} )
add( new FormContainer( "com.formdev.flatlaf.themeeditor.FlatThemePreviewAll$PreviewTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) {
name: "tabbedPane1"
"$client.FlatLaf.styleClass": "flatlaf-preview-tabbedpane"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -558,6 +607,7 @@ new FormModel {
add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) {
name: "splitPane1"
"resizeWeight": 0.5
"$client.FlatLaf.styleClass": "flatlaf-preview-splitpane"
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane2"
"preferredSize": new java.awt.Dimension( 50, 50 )
@@ -568,6 +618,7 @@ new FormModel {
addElement( "Item 2" )
addElement( "Item 3" )
}
"$client.FlatLaf.styleClass": "flatlaf-preview-list"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -596,6 +647,7 @@ new FormModel {
} )
} )
} )
"$client.FlatLaf.styleClass": "flatlaf-preview-tree"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -638,6 +690,7 @@ new FormModel {
add( null )
add( null )
} )
"$client.FlatLaf.styleClass": "flatlaf-preview-table"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -653,6 +706,7 @@ new FormModel {
} )
add( new FormContainer( "javax.swing.JDesktopPane", new FormLayoutManager( class javax.swing.JDesktopPane ) ) {
name: "desktopPane1"
"$client.FlatLaf.styleClass": "flatlaf-preview-desktoppane"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -664,6 +718,7 @@ new FormModel {
"maximizable": true
"iconifiable": true
"resizable": true
"$client.FlatLaf.styleClass": "flatlaf-preview-internalframe"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -679,6 +734,7 @@ new FormModel {
"maximizable": true
"resizable": true
"title": "Inactive"
"$client.FlatLaf.styleClass": "flatlaf-preview-internalframe"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
@@ -691,7 +747,7 @@ new FormModel {
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 400, 1070 )
"size": new java.awt.Dimension( 430, 1070 )
} )
add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
name: "buttonGroup1"

View File

@@ -591,6 +591,11 @@ class FlatThemePreviewSwitches
buttonGroup1.add(zoom2xButton);
buttonGroup1.add(zoom3xButton);
buttonGroup1.add(zoom4xButton);
//---- buttonGroup2 ----
ButtonGroup buttonGroup2 = new ButtonGroup();
buttonGroup2.add(radioButton1);
buttonGroup2.add(radioButton2);
// JFormDesigner - End of component initialization //GEN-END:initComponents
}

View File

@@ -510,12 +510,14 @@ new FormModel {
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) {
name: "radioButton1"
"$buttonGroup": new FormReference( "buttonGroup2" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 16"
} )
add( new FormComponent( "com.formdev.flatlaf.themeeditor.FlatThemePreviewSwitches$ZoomRadioButton" ) {
name: "radioButton2"
"selected": true
"$buttonGroup": new FormReference( "buttonGroup2" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 16"
} )
@@ -528,5 +530,10 @@ new FormModel {
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 580 )
} )
add( new FormNonVisual( "javax.swing.ButtonGroup" ) {
name: "buttonGroup2"
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 634 )
} )
}
}