mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-13 07:17:13 -06:00
Button and ToggleButton: support round button style (set client property JButton.buttonType to roundRect)
This commit is contained in:
@@ -5,6 +5,8 @@ FlatLaf Change Log
|
|||||||
|
|
||||||
- Added drop shadows to popup menus, combobox popups, tooltips and internal
|
- Added drop shadows to popup menus, combobox popups, tooltips and internal
|
||||||
frames. (issue #94)
|
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
|
- Paint nicely rounded buttons, comboboxes, spinners and text fields when
|
||||||
setting `Button.arc`, `Component.arc` or `TextComponent.arc` to a large value
|
setting `Button.arc`, `Component.arc` or `TextComponent.arc` to a large value
|
||||||
(e.g. 1000).
|
(e.g. 1000).
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ public interface FlatClientProperties
|
|||||||
* <p>
|
* <p>
|
||||||
* <strong>Components</strong> {@link javax.swing.JButton} and {@link javax.swing.JToggleButton}<br>
|
* <strong>Components</strong> {@link javax.swing.JButton} and {@link javax.swing.JToggleButton}<br>
|
||||||
* <strong>Value type</strong> {@link java.lang.String}<br>
|
* <strong>Value type</strong> {@link java.lang.String}<br>
|
||||||
* <strong>Allowed Values</strong> {@link #BUTTON_TYPE_SQUARE} and {@link #BUTTON_TYPE_HELP}
|
* <strong>Allowed Values</strong> {@link #BUTTON_TYPE_SQUARE}, {@link #BUTTON_TYPE_ROUND_RECT},
|
||||||
|
* {@link #BUTTON_TYPE_TAB} and {@link #BUTTON_TYPE_HELP}
|
||||||
*/
|
*/
|
||||||
String BUTTON_TYPE = "JButton.buttonType";
|
String BUTTON_TYPE = "JButton.buttonType";
|
||||||
|
|
||||||
@@ -43,6 +44,15 @@ public interface FlatClientProperties
|
|||||||
*/
|
*/
|
||||||
String BUTTON_TYPE_SQUARE = "square";
|
String BUTTON_TYPE_SQUARE = "square";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paint the button with round edges.
|
||||||
|
* <p>
|
||||||
|
* <strong>Components</strong> {@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.
|
* Paint the toggle button in tab style.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -240,4 +250,14 @@ public interface FlatClientProperties
|
|||||||
Object value = c.getClientProperty( key );
|
Object value = c.getClientProperty( key );
|
||||||
return (value instanceof Color) ? (Color) value : defaultValue;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class FlatButtonBorder
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getFocusWidth( Component c ) {
|
protected float getFocusWidth( Component c ) {
|
||||||
return FlatToggleButtonUI.isTabButton( c ) ? 0 : super.getFocusWidth(c );
|
return FlatToggleButtonUI.isTabButton( c ) ? 0 : super.getFocusWidth( c );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -135,6 +135,10 @@ public class FlatButtonBorder
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getArc( Component c ) {
|
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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,8 +236,15 @@ public class FlatButtonUI
|
|||||||
(icon == null && text != null && ("...".equals( text ) || text.length() == 1));
|
(icon == null && text != null && ("...".equals( text ) || text.length() == 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean isSquareButton( Component c ) {
|
// same indices as in parameters to clientPropertyChoice()
|
||||||
return c instanceof AbstractButton && clientPropertyEquals( (AbstractButton) c, BUTTON_TYPE, BUTTON_TYPE_SQUARE );
|
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 ) {
|
static boolean isHelpButton( Component c ) {
|
||||||
@@ -273,10 +280,20 @@ public class FlatButtonUI
|
|||||||
FlatUIUtils.setRenderingHints( g2 );
|
FlatUIUtils.setRenderingHints( g2 );
|
||||||
|
|
||||||
Border border = c.getBorder();
|
Border border = c.getBorder();
|
||||||
|
int buttonType = FlatButtonUI.getButtonType( c );
|
||||||
boolean isToolBarButton = isToolBarButton( c );
|
boolean isToolBarButton = isToolBarButton( c );
|
||||||
float focusWidth = (border instanceof FlatBorder && !isToolBarButton) ? scale( (float) getFocusWidth( c ) ) : 0;
|
float focusWidth = (border instanceof FlatBorder && !isToolBarButton) ? scale( (float) getFocusWidth( c ) ) : 0;
|
||||||
float arc = ((border instanceof FlatButtonBorder && !isSquareButton( c )) || isToolBarButton)
|
float arc;
|
||||||
? scale( (float) this.arc ) : 0;
|
|
||||||
|
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 );
|
boolean def = isDefaultButton( c );
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
@@ -401,7 +418,7 @@ public class FlatButtonUI
|
|||||||
return new Dimension( helpButtonIcon.getIconWidth(), helpButtonIcon.getIconHeight() );
|
return new Dimension( helpButtonIcon.getIconWidth(), helpButtonIcon.getIconHeight() );
|
||||||
|
|
||||||
Dimension prefSize = super.getPreferredSize( c );
|
Dimension prefSize = super.getPreferredSize( c );
|
||||||
if ( prefSize == null )
|
if( prefSize == null )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// make button square if it is a icon-only button
|
// make button square if it is a icon-only button
|
||||||
|
|||||||
@@ -179,9 +179,8 @@ class BasicComponentsPanel
|
|||||||
add(button5, "cell 3 1");
|
add(button5, "cell 3 1");
|
||||||
|
|
||||||
//---- button6 ----
|
//---- button6 ----
|
||||||
button6.setText("square");
|
button6.setText("round");
|
||||||
button6.setEnabled(false);
|
button6.putClientProperty("JButton.buttonType", "roundRect");
|
||||||
button6.putClientProperty("JButton.buttonType", "square");
|
|
||||||
add(button6, "cell 4 1");
|
add(button6, "cell 4 1");
|
||||||
|
|
||||||
//---- button3 ----
|
//---- button3 ----
|
||||||
|
|||||||
@@ -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 {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -63,9 +63,8 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "button6"
|
name: "button6"
|
||||||
"text": "square"
|
"text": "round"
|
||||||
"enabled": false
|
"$client.JButton.buttonType": "roundRect"
|
||||||
"$client.JButton.buttonType": "square"
|
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 1"
|
"value": "cell 4 1"
|
||||||
} )
|
} )
|
||||||
|
|||||||
@@ -71,8 +71,10 @@ public class FlatComponentsTest
|
|||||||
JLabel buttonLabel = new JLabel();
|
JLabel buttonLabel = new JLabel();
|
||||||
JButton button1 = new JButton();
|
JButton button1 = new JButton();
|
||||||
JButton button17 = new JButton();
|
JButton button17 = new JButton();
|
||||||
|
JButton button22 = new JButton();
|
||||||
JButton button2 = new JButton();
|
JButton button2 = new JButton();
|
||||||
JButton button18 = new JButton();
|
JButton button18 = new JButton();
|
||||||
|
JButton button23 = new JButton();
|
||||||
FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton();
|
FlatComponentsTest.TestDefaultButton button5 = new FlatComponentsTest.TestDefaultButton();
|
||||||
JButton button3 = new JButton();
|
JButton button3 = new JButton();
|
||||||
JButton button12 = new JButton();
|
JButton button12 = new JButton();
|
||||||
@@ -81,11 +83,15 @@ public class FlatComponentsTest
|
|||||||
JButton button15 = new JButton();
|
JButton button15 = new JButton();
|
||||||
JButton button16 = new JButton();
|
JButton button16 = new JButton();
|
||||||
JButton button20 = new JButton();
|
JButton button20 = new JButton();
|
||||||
|
JButton button24 = new JButton();
|
||||||
|
JButton button25 = new JButton();
|
||||||
JLabel toggleButtonLabel = new JLabel();
|
JLabel toggleButtonLabel = new JLabel();
|
||||||
JToggleButton toggleButton1 = new JToggleButton();
|
JToggleButton toggleButton1 = new JToggleButton();
|
||||||
JToggleButton toggleButton9 = new JToggleButton();
|
JToggleButton toggleButton9 = new JToggleButton();
|
||||||
|
JToggleButton toggleButton19 = new JToggleButton();
|
||||||
JToggleButton toggleButton2 = new JToggleButton();
|
JToggleButton toggleButton2 = new JToggleButton();
|
||||||
JToggleButton toggleButton10 = new JToggleButton();
|
JToggleButton toggleButton10 = new JToggleButton();
|
||||||
|
JToggleButton toggleButton20 = new JToggleButton();
|
||||||
JToggleButton toggleButton3 = new JToggleButton();
|
JToggleButton toggleButton3 = new JToggleButton();
|
||||||
JToggleButton toggleButton4 = new JToggleButton();
|
JToggleButton toggleButton4 = new JToggleButton();
|
||||||
JToggleButton toggleButton11 = new JToggleButton();
|
JToggleButton toggleButton11 = new JToggleButton();
|
||||||
@@ -93,6 +99,8 @@ public class FlatComponentsTest
|
|||||||
JToggleButton toggleButton13 = new JToggleButton();
|
JToggleButton toggleButton13 = new JToggleButton();
|
||||||
JToggleButton toggleButton14 = new JToggleButton();
|
JToggleButton toggleButton14 = new JToggleButton();
|
||||||
JToggleButton toggleButton18 = new JToggleButton();
|
JToggleButton toggleButton18 = new JToggleButton();
|
||||||
|
JToggleButton toggleButton21 = new JToggleButton();
|
||||||
|
JToggleButton toggleButton22 = new JToggleButton();
|
||||||
JLabel checkBoxLabel = new JLabel();
|
JLabel checkBoxLabel = new JLabel();
|
||||||
JCheckBox checkBox1 = new JCheckBox();
|
JCheckBox checkBox1 = new JCheckBox();
|
||||||
JCheckBox checkBox2 = new JCheckBox();
|
JCheckBox checkBox2 = new JCheckBox();
|
||||||
@@ -221,6 +229,18 @@ public class FlatComponentsTest
|
|||||||
JToggleButton toggleButton15 = new JToggleButton();
|
JToggleButton toggleButton15 = new JToggleButton();
|
||||||
JToggleButton toggleButton16 = new JToggleButton();
|
JToggleButton toggleButton16 = new JToggleButton();
|
||||||
JToggleButton toggleButton17 = 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 ========
|
//======== this ========
|
||||||
setLayout(new MigLayout(
|
setLayout(new MigLayout(
|
||||||
@@ -285,11 +305,17 @@ public class FlatComponentsTest
|
|||||||
add(button1, "cell 1 1");
|
add(button1, "cell 1 1");
|
||||||
|
|
||||||
//---- button17 ----
|
//---- button17 ----
|
||||||
button17.setText("square");
|
button17.setText("sq");
|
||||||
button17.putClientProperty("JButton.buttonType", "square");
|
button17.putClientProperty("JButton.buttonType", "square");
|
||||||
button17.putClientProperty("JComponent.minimumWidth", 0);
|
button17.putClientProperty("JComponent.minimumWidth", 0);
|
||||||
add(button17, "cell 1 1");
|
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 ----
|
||||||
button2.setText("disabled");
|
button2.setText("disabled");
|
||||||
button2.setDisplayedMnemonicIndex(0);
|
button2.setDisplayedMnemonicIndex(0);
|
||||||
@@ -298,12 +324,19 @@ public class FlatComponentsTest
|
|||||||
add(button2, "cell 2 1");
|
add(button2, "cell 2 1");
|
||||||
|
|
||||||
//---- button18 ----
|
//---- button18 ----
|
||||||
button18.setText("square");
|
button18.setText("sq");
|
||||||
button18.putClientProperty("JButton.buttonType", "square");
|
button18.putClientProperty("JButton.buttonType", "square");
|
||||||
button18.setEnabled(false);
|
button18.setEnabled(false);
|
||||||
button18.putClientProperty("JComponent.minimumWidth", 0);
|
button18.putClientProperty("JComponent.minimumWidth", 0);
|
||||||
add(button18, "cell 2 1");
|
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 ----
|
||||||
button5.setText("default");
|
button5.setText("default");
|
||||||
button5.setDisplayedMnemonicIndex(0);
|
button5.setDisplayedMnemonicIndex(0);
|
||||||
@@ -342,6 +375,18 @@ public class FlatComponentsTest
|
|||||||
button20.setBorder(BorderFactory.createEmptyBorder());
|
button20.setBorder(BorderFactory.createEmptyBorder());
|
||||||
add(button20, "cell 6 1");
|
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 ----
|
||||||
toggleButtonLabel.setText("JToggleButton:");
|
toggleButtonLabel.setText("JToggleButton:");
|
||||||
add(toggleButtonLabel, "cell 0 2");
|
add(toggleButtonLabel, "cell 0 2");
|
||||||
@@ -351,21 +396,32 @@ public class FlatComponentsTest
|
|||||||
add(toggleButton1, "cell 1 2");
|
add(toggleButton1, "cell 1 2");
|
||||||
|
|
||||||
//---- toggleButton9 ----
|
//---- toggleButton9 ----
|
||||||
toggleButton9.setText("square");
|
toggleButton9.setText("sq");
|
||||||
toggleButton9.putClientProperty("JButton.buttonType", "square");
|
toggleButton9.putClientProperty("JButton.buttonType", "square");
|
||||||
add(toggleButton9, "cell 1 2");
|
add(toggleButton9, "cell 1 2");
|
||||||
|
|
||||||
|
//---- toggleButton19 ----
|
||||||
|
toggleButton19.setText("rd");
|
||||||
|
toggleButton19.putClientProperty("JButton.buttonType", "roundRect");
|
||||||
|
add(toggleButton19, "cell 1 2");
|
||||||
|
|
||||||
//---- toggleButton2 ----
|
//---- toggleButton2 ----
|
||||||
toggleButton2.setText("disabled");
|
toggleButton2.setText("disabled");
|
||||||
toggleButton2.setEnabled(false);
|
toggleButton2.setEnabled(false);
|
||||||
add(toggleButton2, "cell 2 2");
|
add(toggleButton2, "cell 2 2");
|
||||||
|
|
||||||
//---- toggleButton10 ----
|
//---- toggleButton10 ----
|
||||||
toggleButton10.setText("square");
|
toggleButton10.setText("sq");
|
||||||
toggleButton10.putClientProperty("JButton.buttonType", "square");
|
toggleButton10.putClientProperty("JButton.buttonType", "square");
|
||||||
toggleButton10.setEnabled(false);
|
toggleButton10.setEnabled(false);
|
||||||
add(toggleButton10, "cell 2 2");
|
add(toggleButton10, "cell 2 2");
|
||||||
|
|
||||||
|
//---- toggleButton20 ----
|
||||||
|
toggleButton20.setText("rd");
|
||||||
|
toggleButton20.putClientProperty("JButton.buttonType", "roundRect");
|
||||||
|
toggleButton20.setEnabled(false);
|
||||||
|
add(toggleButton20, "cell 2 2");
|
||||||
|
|
||||||
//---- toggleButton3 ----
|
//---- toggleButton3 ----
|
||||||
toggleButton3.setText("selected");
|
toggleButton3.setText("selected");
|
||||||
toggleButton3.setSelected(true);
|
toggleButton3.setSelected(true);
|
||||||
@@ -402,6 +458,18 @@ public class FlatComponentsTest
|
|||||||
toggleButton18.setBorder(BorderFactory.createEmptyBorder());
|
toggleButton18.setBorder(BorderFactory.createEmptyBorder());
|
||||||
add(toggleButton18, "cell 6 2");
|
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 ----
|
||||||
checkBoxLabel.setText("JCheckBox");
|
checkBoxLabel.setText("JCheckBox");
|
||||||
add(checkBoxLabel, "cell 0 3");
|
add(checkBoxLabel, "cell 0 3");
|
||||||
@@ -1098,13 +1166,75 @@ public class FlatComponentsTest
|
|||||||
toggleButton17.setSelected(true);
|
toggleButton17.setSelected(true);
|
||||||
toolBar1.add(toggleButton17);
|
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
|
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||||
|
|
||||||
// BasicComboBoxRenderer customaRenderer = new BasicComboBoxRenderer();
|
// BasicComboBoxRenderer customRenderer = new BasicComboBoxRenderer();
|
||||||
// customaRenderer.setBorder( new LineBorder( Color.red ) );
|
// customRenderer.setBorder( new LineBorder( Color.red ) );
|
||||||
// comboBox1.setRenderer( customaRenderer );
|
// comboBox1.setRenderer( customRenderer );
|
||||||
// comboBox3.setRenderer( customaRenderer );
|
// comboBox3.setRenderer( customRenderer );
|
||||||
}
|
}
|
||||||
|
|
||||||
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
|
||||||
|
|||||||
@@ -49,12 +49,20 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "button17"
|
name: "button17"
|
||||||
"text": "square"
|
"text": "sq"
|
||||||
"$client.JButton.buttonType": "square"
|
"$client.JButton.buttonType": "square"
|
||||||
"$client.JComponent.minimumWidth": 0
|
"$client.JComponent.minimumWidth": 0
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 1"
|
"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" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "button2"
|
name: "button2"
|
||||||
"text": "disabled"
|
"text": "disabled"
|
||||||
@@ -66,13 +74,22 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "button18"
|
name: "button18"
|
||||||
"text": "square"
|
"text": "sq"
|
||||||
"$client.JButton.buttonType": "square"
|
"$client.JButton.buttonType": "square"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
"$client.JComponent.minimumWidth": 0
|
"$client.JComponent.minimumWidth": 0
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 1"
|
"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" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$TestDefaultButton" ) {
|
||||||
name: "button5"
|
name: "button5"
|
||||||
"text": "default"
|
"text": "default"
|
||||||
@@ -127,6 +144,22 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 6 1"
|
"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" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "toggleButtonLabel"
|
name: "toggleButtonLabel"
|
||||||
"text": "JToggleButton:"
|
"text": "JToggleButton:"
|
||||||
@@ -141,11 +174,18 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "toggleButton9"
|
name: "toggleButton9"
|
||||||
"text": "square"
|
"text": "sq"
|
||||||
"$client.JButton.buttonType": "square"
|
"$client.JButton.buttonType": "square"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 2"
|
"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" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "toggleButton2"
|
name: "toggleButton2"
|
||||||
"text": "disabled"
|
"text": "disabled"
|
||||||
@@ -155,12 +195,20 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "toggleButton10"
|
name: "toggleButton10"
|
||||||
"text": "square"
|
"text": "sq"
|
||||||
"$client.JButton.buttonType": "square"
|
"$client.JButton.buttonType": "square"
|
||||||
"enabled": false
|
"enabled": false
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 2 2"
|
"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" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "toggleButton3"
|
name: "toggleButton3"
|
||||||
"text": "selected"
|
"text": "selected"
|
||||||
@@ -211,6 +259,22 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 6 2"
|
"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" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "checkBoxLabel"
|
name: "checkBoxLabel"
|
||||||
"text": "JCheckBox"
|
"text": "JCheckBox"
|
||||||
@@ -1102,12 +1166,12 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "toggleButton15"
|
name: "toggleButton15"
|
||||||
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" )
|
"icon": &SwingIcon4 new com.jformdesigner.model.SwingIcon( 2, "FileView.computerIcon" )
|
||||||
"selected": true
|
"selected": true
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
name: "toggleButton16"
|
name: "toggleButton16"
|
||||||
"icon": new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" )
|
"icon": &SwingIcon5 new com.jformdesigner.model.SwingIcon( 2, "FileView.floppyDriveIcon" )
|
||||||
"selected": true
|
"selected": true
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
add( new FormComponent( "javax.swing.JToggleButton" ) {
|
||||||
@@ -1116,11 +1180,77 @@ new FormModel {
|
|||||||
"selected": true
|
"selected": true
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, 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 ) {
|
}, new FormLayoutConstraints( null ) {
|
||||||
"location": new java.awt.Point( 0, 0 )
|
"location": new java.awt.Point( 0, 0 )
|
||||||
"size": new java.awt.Dimension( 1005, 800 )
|
"size": new java.awt.Dimension( 1135, 800 )
|
||||||
} )
|
} )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user