diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f376658..141c8c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ FlatLaf Change Log - Added drop shadows to popup menus, combobox popups, tooltips and internal frames. (issue #94) +- Button and ToggleButton: Support round button style (set client property + `JButton.buttonType` to `roundRect`). - Paint nicely rounded buttons, comboboxes, spinners and text fields when setting `Button.arc`, `Component.arc` or `TextComponent.arc` to a large value (e.g. 1000). diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java index a1dca00d..fdf79c20 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/FlatClientProperties.java @@ -30,7 +30,8 @@ public interface FlatClientProperties *
* Components {@link javax.swing.JButton} and {@link javax.swing.JToggleButton}
* Value type {@link java.lang.String}
- * Allowed Values {@link #BUTTON_TYPE_SQUARE} and {@link #BUTTON_TYPE_HELP}
+ * Allowed Values {@link #BUTTON_TYPE_SQUARE}, {@link #BUTTON_TYPE_ROUND_RECT},
+ * {@link #BUTTON_TYPE_TAB} and {@link #BUTTON_TYPE_HELP}
*/
String BUTTON_TYPE = "JButton.buttonType";
@@ -43,6 +44,15 @@ public interface FlatClientProperties
*/
String BUTTON_TYPE_SQUARE = "square";
+ /**
+ * Paint the button with round edges.
+ *
+ * Components {@link javax.swing.JButton} and {@link javax.swing.JToggleButton} + * + * @see #BUTTON_TYPE + */ + String BUTTON_TYPE_ROUND_RECT = "roundRect"; + /** * Paint the toggle button in tab style. *
@@ -240,4 +250,14 @@ public interface FlatClientProperties Object value = c.getClientProperty( key ); return (value instanceof Color) ? (Color) value : defaultValue; } + + static int clientPropertyChoice( JComponent c, String key, String... choices ) { + Object value = c.getClientProperty( key ); + for( int i = 0; i < choices.length; i++ ) { + if( choices[i].equals( value ) ) + return i; + + } + return -1; + } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java index df8dac7e..e34b5d0b 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonBorder.java @@ -125,7 +125,7 @@ public class FlatButtonBorder @Override protected float getFocusWidth( Component c ) { - return FlatToggleButtonUI.isTabButton( c ) ? 0 : super.getFocusWidth(c ); + return FlatToggleButtonUI.isTabButton( c ) ? 0 : super.getFocusWidth( c ); } @Override @@ -135,6 +135,10 @@ public class FlatButtonBorder @Override protected float getArc( Component c ) { - return FlatButtonUI.isSquareButton( c ) ? 0 : scale( (float) arc ); + switch( FlatButtonUI.getButtonType( c ) ) { + case FlatButtonUI.TYPE_SQUARE: return 0; + case FlatButtonUI.TYPE_ROUND_RECT: return Float.MAX_VALUE; + default: return scale( (float) arc ); + } } } diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java index 5dbcf556..a3001f6e 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java @@ -236,8 +236,15 @@ public class FlatButtonUI (icon == null && text != null && ("...".equals( text ) || text.length() == 1)); } - static boolean isSquareButton( Component c ) { - return c instanceof AbstractButton && clientPropertyEquals( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_SQUARE ); + // same indices as in parameters to clientPropertyChoice() + static final int TYPE_OTHER = -1; + static final int TYPE_SQUARE = 0; + static final int TYPE_ROUND_RECT = 1; + + static int getButtonType( Component c ) { + return (c instanceof AbstractButton) + ? clientPropertyChoice( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_SQUARE, BUTTON_TYPE_ROUND_RECT ) + : TYPE_OTHER; } static boolean isHelpButton( Component c ) { @@ -273,10 +280,20 @@ public class FlatButtonUI FlatUIUtils.setRenderingHints( g2 ); Border border = c.getBorder(); + int buttonType = FlatButtonUI.getButtonType( c ); boolean isToolBarButton = isToolBarButton( c ); float focusWidth = (border instanceof FlatBorder && !isToolBarButton) ? scale( (float) getFocusWidth( c ) ) : 0; - float arc = ((border instanceof FlatButtonBorder && !isSquareButton( c )) || isToolBarButton) - ? scale( (float) this.arc ) : 0; + float arc; + + if( buttonType == TYPE_SQUARE ) + arc = 0; + else if( buttonType == TYPE_ROUND_RECT ) + arc = Float.MAX_VALUE; + else if( border instanceof FlatButtonBorder || isToolBarButton ) + arc = scale( (float) this.arc ); + else + arc = 0; + boolean def = isDefaultButton( c ); int x = 0; @@ -401,7 +418,7 @@ public class FlatButtonUI return new Dimension( helpButtonIcon.getIconWidth(), helpButtonIcon.getIconHeight() ); Dimension prefSize = super.getPreferredSize( c ); - if ( prefSize == null ) + if( prefSize == null ) return null; // make button square if it is a icon-only button diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java index f57becb2..ffefbd6c 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.java @@ -179,9 +179,8 @@ class BasicComponentsPanel add(button5, "cell 3 1"); //---- button6 ---- - button6.setText("square"); - button6.setEnabled(false); - button6.putClientProperty("JButton.buttonType", "square"); + button6.setText("round"); + button6.putClientProperty("JButton.buttonType", "roundRect"); add(button6, "cell 4 1"); //---- button3 ---- diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd index c4ddcfe8..3b057d0d 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/BasicComponentsPanel.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.0.0.194" Java: "13.0.1" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.1.0.272" Java: "13.0.2" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -63,9 +63,8 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button6" - "text": "square" - "enabled": false - "$client.JButton.buttonType": "square" + "text": "round" + "$client.JButton.buttonType": "roundRect" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 4 1" } ) diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java index afe2b1ba..2077bfe4 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.java @@ -71,8 +71,10 @@ public class FlatComponentsTest JLabel buttonLabel = new JLabel(); JButton button1 = new JButton(); JButton button17 = new JButton(); + JButton button22 = new JButton(); JButton button2 = new JButton(); JButton button18 = new JButton(); + JButton button23 = new JButton(); FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton(); JButton button3 = new JButton(); JButton button12 = new JButton(); @@ -81,11 +83,15 @@ public class FlatComponentsTest JButton button15 = new JButton(); JButton button16 = new JButton(); JButton button20 = new JButton(); + JButton button24 = new JButton(); + JButton button25 = new JButton(); JLabel toggleButtonLabel = new JLabel(); JToggleButton toggleButton1 = new JToggleButton(); JToggleButton toggleButton9 = new JToggleButton(); + JToggleButton toggleButton19 = new JToggleButton(); JToggleButton toggleButton2 = new JToggleButton(); JToggleButton toggleButton10 = new JToggleButton(); + JToggleButton toggleButton20 = new JToggleButton(); JToggleButton toggleButton3 = new JToggleButton(); JToggleButton toggleButton4 = new JToggleButton(); JToggleButton toggleButton11 = new JToggleButton(); @@ -93,6 +99,8 @@ public class FlatComponentsTest JToggleButton toggleButton13 = new JToggleButton(); JToggleButton toggleButton14 = new JToggleButton(); JToggleButton toggleButton18 = new JToggleButton(); + JToggleButton toggleButton21 = new JToggleButton(); + JToggleButton toggleButton22 = new JToggleButton(); JLabel checkBoxLabel = new JLabel(); JCheckBox checkBox1 = new JCheckBox(); JCheckBox checkBox2 = new JCheckBox(); @@ -221,6 +229,18 @@ public class FlatComponentsTest JToggleButton toggleButton15 = new JToggleButton(); JToggleButton toggleButton16 = new JToggleButton(); JToggleButton toggleButton17 = new JToggleButton(); + JLabel label3 = new JLabel(); + JToolBar toolBar3 = new JToolBar(); + JButton button26 = new JButton(); + JButton button27 = new JButton(); + JToggleButton toggleButton23 = new JToggleButton(); + JToggleButton toggleButton24 = new JToggleButton(); + JLabel label4 = new JLabel(); + JToolBar toolBar4 = new JToolBar(); + JButton button28 = new JButton(); + JButton button29 = new JButton(); + JToggleButton toggleButton25 = new JToggleButton(); + JToggleButton toggleButton26 = new JToggleButton(); //======== this ======== setLayout(new MigLayout( @@ -285,11 +305,17 @@ public class FlatComponentsTest add(button1, "cell 1 1"); //---- button17 ---- - button17.setText("square"); + button17.setText("sq"); button17.putClientProperty("JButton.buttonType", "square"); button17.putClientProperty("JComponent.minimumWidth", 0); add(button17, "cell 1 1"); + //---- button22 ---- + button22.setText("rd"); + button22.putClientProperty("JButton.buttonType", "roundRect"); + button22.putClientProperty("JComponent.minimumWidth", 0); + add(button22, "cell 1 1"); + //---- button2 ---- button2.setText("disabled"); button2.setDisplayedMnemonicIndex(0); @@ -298,12 +324,19 @@ public class FlatComponentsTest add(button2, "cell 2 1"); //---- button18 ---- - button18.setText("square"); + button18.setText("sq"); button18.putClientProperty("JButton.buttonType", "square"); button18.setEnabled(false); button18.putClientProperty("JComponent.minimumWidth", 0); add(button18, "cell 2 1"); + //---- button23 ---- + button23.setText("rd"); + button23.putClientProperty("JButton.buttonType", "roundRect"); + button23.setEnabled(false); + button23.putClientProperty("JComponent.minimumWidth", 0); + add(button23, "cell 2 1"); + //---- button5 ---- button5.setText("default"); button5.setDisplayedMnemonicIndex(0); @@ -342,6 +375,18 @@ public class FlatComponentsTest button20.setBorder(BorderFactory.createEmptyBorder()); add(button20, "cell 6 1"); + //---- button24 ---- + button24.setText("sq"); + button24.setBorder(BorderFactory.createEmptyBorder()); + button24.putClientProperty("JButton.buttonType", "square"); + add(button24, "cell 6 1"); + + //---- button25 ---- + button25.setText("rd"); + button25.setBorder(new EmptyBorder(0, 10, 0, 10)); + button25.putClientProperty("JButton.buttonType", "roundRect"); + add(button25, "cell 6 1"); + //---- toggleButtonLabel ---- toggleButtonLabel.setText("JToggleButton:"); add(toggleButtonLabel, "cell 0 2"); @@ -351,21 +396,32 @@ public class FlatComponentsTest add(toggleButton1, "cell 1 2"); //---- toggleButton9 ---- - toggleButton9.setText("square"); + toggleButton9.setText("sq"); toggleButton9.putClientProperty("JButton.buttonType", "square"); add(toggleButton9, "cell 1 2"); + //---- toggleButton19 ---- + toggleButton19.setText("rd"); + toggleButton19.putClientProperty("JButton.buttonType", "roundRect"); + add(toggleButton19, "cell 1 2"); + //---- toggleButton2 ---- toggleButton2.setText("disabled"); toggleButton2.setEnabled(false); add(toggleButton2, "cell 2 2"); //---- toggleButton10 ---- - toggleButton10.setText("square"); + toggleButton10.setText("sq"); toggleButton10.putClientProperty("JButton.buttonType", "square"); toggleButton10.setEnabled(false); add(toggleButton10, "cell 2 2"); + //---- toggleButton20 ---- + toggleButton20.setText("rd"); + toggleButton20.putClientProperty("JButton.buttonType", "roundRect"); + toggleButton20.setEnabled(false); + add(toggleButton20, "cell 2 2"); + //---- toggleButton3 ---- toggleButton3.setText("selected"); toggleButton3.setSelected(true); @@ -402,6 +458,18 @@ public class FlatComponentsTest toggleButton18.setBorder(BorderFactory.createEmptyBorder()); add(toggleButton18, "cell 6 2"); + //---- toggleButton21 ---- + toggleButton21.setText("sq"); + toggleButton21.setBorder(BorderFactory.createEmptyBorder()); + toggleButton21.putClientProperty("JButton.buttonType", "square"); + add(toggleButton21, "cell 6 2"); + + //---- toggleButton22 ---- + toggleButton22.setText("rd"); + toggleButton22.setBorder(new EmptyBorder(0, 10, 0, 10)); + toggleButton22.putClientProperty("JButton.buttonType", "roundRect"); + add(toggleButton22, "cell 6 2"); + //---- checkBoxLabel ---- checkBoxLabel.setText("JCheckBox"); add(checkBoxLabel, "cell 0 3"); @@ -1098,13 +1166,75 @@ public class FlatComponentsTest toggleButton17.setSelected(true); toolBar1.add(toggleButton17); } - add(toolBar1, "cell 1 23 3 1,growx"); + add(toolBar1, "cell 1 23 2 1,growx"); + + //---- label3 ---- + label3.setText("Square:"); + add(label3, "cell 3 23 3 1"); + + //======== toolBar3 ======== + { + + //---- button26 ---- + button26.setIcon(UIManager.getIcon("Tree.closedIcon")); + button26.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(button26); + + //---- button27 ---- + button27.setIcon(UIManager.getIcon("Tree.openIcon")); + button27.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(button27); + + //---- toggleButton23 ---- + toggleButton23.setIcon(UIManager.getIcon("FileView.computerIcon")); + toggleButton23.setSelected(true); + toggleButton23.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(toggleButton23); + + //---- toggleButton24 ---- + toggleButton24.setIcon(UIManager.getIcon("FileView.floppyDriveIcon")); + toggleButton24.setSelected(true); + toggleButton24.putClientProperty("JButton.buttonType", "square"); + toolBar3.add(toggleButton24); + } + add(toolBar3, "cell 3 23 3 1"); + + //---- label4 ---- + label4.setText("Round:"); + add(label4, "cell 3 23 3 1"); + + //======== toolBar4 ======== + { + + //---- button28 ---- + button28.setIcon(UIManager.getIcon("Tree.closedIcon")); + button28.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(button28); + + //---- button29 ---- + button29.setIcon(UIManager.getIcon("Tree.openIcon")); + button29.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(button29); + + //---- toggleButton25 ---- + toggleButton25.setIcon(UIManager.getIcon("FileView.computerIcon")); + toggleButton25.setSelected(true); + toggleButton25.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(toggleButton25); + + //---- toggleButton26 ---- + toggleButton26.setIcon(UIManager.getIcon("FileView.floppyDriveIcon")); + toggleButton26.setSelected(true); + toggleButton26.putClientProperty("JButton.buttonType", "roundRect"); + toolBar4.add(toggleButton26); + } + add(toolBar4, "cell 3 23 3 1"); // JFormDesigner - End of component initialization //GEN-END:initComponents -// BasicComboBoxRenderer customaRenderer = new BasicComboBoxRenderer(); -// customaRenderer.setBorder( new LineBorder( Color.red ) ); -// comboBox1.setRenderer( customaRenderer ); -// comboBox3.setRenderer( customaRenderer ); +// BasicComboBoxRenderer customRenderer = new BasicComboBoxRenderer(); +// customRenderer.setBorder( new LineBorder( Color.red ) ); +// comboBox1.setRenderer( customRenderer ); +// comboBox3.setRenderer( customRenderer ); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd index defe66fa..4cfda44b 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatComponentsTest.jfd @@ -49,12 +49,20 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button17" - "text": "square" + "text": "sq" "$client.JButton.buttonType": "square" "$client.JComponent.minimumWidth": 0 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 1" } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button22" + "text": "rd" + "$client.JButton.buttonType": "roundRect" + "$client.JComponent.minimumWidth": 0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button2" "text": "disabled" @@ -66,13 +74,22 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JButton" ) { name: "button18" - "text": "square" + "text": "sq" "$client.JButton.buttonType": "square" "enabled": false "$client.JComponent.minimumWidth": 0 }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 1" } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button23" + "text": "rd" + "$client.JButton.buttonType": "roundRect" + "enabled": false + "$client.JComponent.minimumWidth": 0 + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 1" + } ) add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$TestDefaultButton" ) { name: "button5" "text": "default" @@ -127,6 +144,22 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 6 1" } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button24" + "text": "sq" + "border": #EmptyBorder0 + "$client.JButton.buttonType": "square" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button25" + "text": "rd" + "border": &EmptyBorder1 new javax.swing.border.EmptyBorder( 0, 10, 0, 10 ) + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 1" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "toggleButtonLabel" "text": "JToggleButton:" @@ -141,11 +174,18 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton9" - "text": "square" + "text": "sq" "$client.JButton.buttonType": "square" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 1 2" } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton19" + "text": "rd" + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton2" "text": "disabled" @@ -155,12 +195,20 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton10" - "text": "square" + "text": "sq" "$client.JButton.buttonType": "square" "enabled": false }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 2 2" } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton20" + "text": "rd" + "$client.JButton.buttonType": "roundRect" + "enabled": false + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton3" "text": "selected" @@ -211,6 +259,22 @@ new FormModel { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 6 2" } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton21" + "text": "sq" + "border": #EmptyBorder0 + "$client.JButton.buttonType": "square" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 2" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton22" + "text": "rd" + "border": #EmptyBorder1 + "$client.JButton.buttonType": "roundRect" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 6 2" + } ) add( new FormComponent( "javax.swing.JLabel" ) { name: "checkBoxLabel" "text": "JCheckBox" @@ -1102,12 +1166,12 @@ new FormModel { } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton15" - "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" ) + "icon": &SwingIcon4 new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" ) "selected": true } ) add( new FormComponent( "javax.swing.JToggleButton" ) { name: "toggleButton16" - "icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" ) + "icon": &SwingIcon5 new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" ) "selected": true } ) add( new FormComponent( "javax.swing.JToggleButton" ) { @@ -1116,11 +1180,77 @@ new FormModel { "selected": true } ) }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 23 3 1,growx" + "value": "cell 1 23 2 1,growx" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "Square:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 23 3 1" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "toolBar3" + add( new FormComponent( "javax.swing.JButton" ) { + name: "button26" + "icon": #SwingIcon1 + "$client.JButton.buttonType": "square" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button27" + "icon": #SwingIcon2 + "$client.JButton.buttonType": "square" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton23" + "icon": #SwingIcon4 + "selected": true + "$client.JButton.buttonType": "square" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton24" + "icon": #SwingIcon5 + "selected": true + "$client.JButton.buttonType": "square" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 23 3 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "Round:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 23 3 1" + } ) + add( new FormContainer( "javax.swing.JToolBar", new FormLayoutManager( class javax.swing.JToolBar ) ) { + name: "toolBar4" + add( new FormComponent( "javax.swing.JButton" ) { + name: "button28" + "icon": #SwingIcon1 + "$client.JButton.buttonType": "roundRect" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "button29" + "icon": #SwingIcon2 + "$client.JButton.buttonType": "roundRect" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton25" + "icon": #SwingIcon4 + "selected": true + "$client.JButton.buttonType": "roundRect" + } ) + add( new FormComponent( "javax.swing.JToggleButton" ) { + name: "toggleButton26" + "icon": #SwingIcon5 + "selected": true + "$client.JButton.buttonType": "roundRect" + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 3 23 3 1" } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) - "size": new java.awt.Dimension( 1005, 800 ) + "size": new java.awt.Dimension( 1135, 800 ) } ) } }