mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +03:00
Testing: added "background" checkbox to test apps
This commit is contained in:
@@ -23,7 +23,7 @@ import net.miginfocom.swing.*;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatChooserTest
|
public class FlatChooserTest
|
||||||
extends JPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.defaultVariableLocal": true
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
}
|
}
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
||||||
"$columnConstraints": "[][]"
|
"$columnConstraints": "[][]"
|
||||||
"$rowConstraints": "[top][top][]"
|
"$rowConstraints": "[top][top][]"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import net.miginfocom.swing.*;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatComponents2Test
|
public class FlatComponents2Test
|
||||||
extends JPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.defaultVariableLocal": true
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
}
|
}
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
||||||
"$columnConstraints": "[][200][200]"
|
"$columnConstraints": "[][200][200]"
|
||||||
"$rowConstraints": "[][][][::200][::150]"
|
"$rowConstraints": "[][][][::200][::150]"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import net.miginfocom.swing.*;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatComponentsTest
|
public class FlatComponentsTest
|
||||||
extends JPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
@@ -758,6 +758,7 @@ public class FlatComponentsTest
|
|||||||
|
|
||||||
//======== panel3 ========
|
//======== panel3 ========
|
||||||
{
|
{
|
||||||
|
panel3.setOpaque(false);
|
||||||
panel3.setLayout(new MigLayout(
|
panel3.setLayout(new MigLayout(
|
||||||
"insets 0,hidemode 3,gap 5 5,ltr",
|
"insets 0,hidemode 3,gap 5 5,ltr",
|
||||||
// columns
|
// columns
|
||||||
@@ -801,6 +802,7 @@ public class FlatComponentsTest
|
|||||||
//======== panel2 ========
|
//======== panel2 ========
|
||||||
{
|
{
|
||||||
panel2.setBorder(new TitledBorder("TitledBorder"));
|
panel2.setBorder(new TitledBorder("TitledBorder"));
|
||||||
|
panel2.setOpaque(false);
|
||||||
panel2.setLayout(new FlowLayout());
|
panel2.setLayout(new FlowLayout());
|
||||||
}
|
}
|
||||||
add(panel2, "cell 3 16,grow");
|
add(panel2, "cell 3 16,grow");
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.defaultVariableLocal": true
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
}
|
}
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
||||||
"$columnConstraints": "[][][][][][]"
|
"$columnConstraints": "[][][][][][]"
|
||||||
"$rowConstraints": "[][][][][][][][][][][][][][][][][][][][][][]"
|
"$rowConstraints": "[][][][][][][][][][][][][][][][][][][][][][]"
|
||||||
@@ -56,7 +56,7 @@ new FormModel {
|
|||||||
}, 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( "com.formdev.flatlaf.FlatComponentsTest$TestDefaultButton" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatComponentsTest$TestDefaultButton" ) {
|
||||||
name: "button5"
|
name: "button5"
|
||||||
"text": "default"
|
"text": "default"
|
||||||
"displayedMnemonicIndex": 0
|
"displayedMnemonicIndex": 0
|
||||||
@@ -716,6 +716,7 @@ new FormModel {
|
|||||||
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel3"
|
name: "panel3"
|
||||||
|
"opaque": false
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "label3"
|
name: "label3"
|
||||||
"text": "<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u></html>"
|
"text": "<html>JLabel HTML<br>Sample <b>content</b><br> <u>text</u></html>"
|
||||||
@@ -759,6 +760,7 @@ new FormModel {
|
|||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) {
|
||||||
name: "panel2"
|
name: "panel2"
|
||||||
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
|
"border": new javax.swing.border.TitledBorder( "TitledBorder" )
|
||||||
|
"opaque": false
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 3 16,grow"
|
"value": "cell 3 16,grow"
|
||||||
} )
|
} )
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import net.miginfocom.swing.*;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatContainerTest
|
public class FlatContainerTest
|
||||||
extends JPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
@@ -112,6 +112,7 @@ public class FlatContainerTest
|
|||||||
|
|
||||||
//======== panel9 ========
|
//======== panel9 ========
|
||||||
{
|
{
|
||||||
|
panel9.setOpaque(false);
|
||||||
panel9.setLayout(new FormLayout(
|
panel9.setLayout(new FormLayout(
|
||||||
"70dlu:grow, $lcgap, 70dlu:grow",
|
"70dlu:grow, $lcgap, 70dlu:grow",
|
||||||
"default, $lgap, fill:70dlu, $lgap, pref, 2*($lgap, fill:70dlu:grow), $lgap, pref"));
|
"default, $lgap, fill:70dlu, $lgap, pref, 2*($lgap, fill:70dlu:grow), $lgap, pref"));
|
||||||
@@ -283,6 +284,7 @@ public class FlatContainerTest
|
|||||||
|
|
||||||
//======== panel14 ========
|
//======== panel14 ========
|
||||||
{
|
{
|
||||||
|
panel14.setOpaque(false);
|
||||||
panel14.setLayout(new MigLayout(
|
panel14.setLayout(new MigLayout(
|
||||||
"insets 0,hidemode 3",
|
"insets 0,hidemode 3",
|
||||||
// columns
|
// columns
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.defaultVariableLocal": true
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
}
|
}
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets 0,hidemode 3"
|
"$layoutConstraints": "insets 0,hidemode 3"
|
||||||
"$columnConstraints": "[grow,fill]"
|
"$columnConstraints": "[grow,fill]"
|
||||||
"$rowConstraints": "[grow,fill]"
|
"$rowConstraints": "[grow,fill]"
|
||||||
@@ -17,6 +17,7 @@ new FormModel {
|
|||||||
"$rowSpecs": "default, linegap, fill:70dlu, linegap, pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref"
|
"$rowSpecs": "default, linegap, fill:70dlu, linegap, pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel9"
|
name: "panel9"
|
||||||
|
"opaque": false
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "splitPaneLabel"
|
name: "splitPaneLabel"
|
||||||
"text": "JSplitPane:"
|
"text": "JSplitPane:"
|
||||||
@@ -203,6 +204,7 @@ new FormModel {
|
|||||||
"$rowConstraints": "[center]"
|
"$rowConstraints": "[center]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel14"
|
name: "panel14"
|
||||||
|
"opaque": false
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "moreTabsCheckBox"
|
name: "moreTabsCheckBox"
|
||||||
"text": "more tabs"
|
"text": "more tabs"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import net.miginfocom.swing.*;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatMenusTest
|
public class FlatMenusTest
|
||||||
extends JPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
@@ -155,6 +155,7 @@ public class FlatMenusTest
|
|||||||
|
|
||||||
//======== panel1 ========
|
//======== panel1 ========
|
||||||
{
|
{
|
||||||
|
panel1.setOpaque(false);
|
||||||
panel1.setLayout(new MigLayout(
|
panel1.setLayout(new MigLayout(
|
||||||
"insets 0,hidemode 3,gap 5 5,ltr",
|
"insets 0,hidemode 3,gap 5 5,ltr",
|
||||||
// columns
|
// columns
|
||||||
@@ -213,6 +214,7 @@ public class FlatMenusTest
|
|||||||
|
|
||||||
//======== panel2 ========
|
//======== panel2 ========
|
||||||
{
|
{
|
||||||
|
panel2.setOpaque(false);
|
||||||
panel2.setLayout(new MigLayout(
|
panel2.setLayout(new MigLayout(
|
||||||
"insets 0,gap 5 5",
|
"insets 0,gap 5 5",
|
||||||
// columns
|
// columns
|
||||||
@@ -253,6 +255,7 @@ public class FlatMenusTest
|
|||||||
|
|
||||||
//======== panel3 ========
|
//======== panel3 ========
|
||||||
{
|
{
|
||||||
|
panel3.setOpaque(false);
|
||||||
panel3.setLayout(new MigLayout(
|
panel3.setLayout(new MigLayout(
|
||||||
"insets 0,gap 5 5",
|
"insets 0,gap 5 5",
|
||||||
// columns
|
// columns
|
||||||
@@ -292,6 +295,7 @@ public class FlatMenusTest
|
|||||||
|
|
||||||
//======== panel4 ========
|
//======== panel4 ========
|
||||||
{
|
{
|
||||||
|
panel4.setOpaque(false);
|
||||||
panel4.setLayout(new MigLayout(
|
panel4.setLayout(new MigLayout(
|
||||||
"insets 0,gap 5 5",
|
"insets 0,gap 5 5",
|
||||||
// columns
|
// columns
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.defaultVariableLocal": true
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
}
|
}
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
||||||
"$columnConstraints": "[125][][][][]"
|
"$columnConstraints": "[125][][][][]"
|
||||||
"$rowConstraints": "[][top][][]"
|
"$rowConstraints": "[][top][][]"
|
||||||
@@ -53,6 +53,7 @@ new FormModel {
|
|||||||
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
"$layoutConstraints": "insets 0,hidemode 3,gap 5 5,ltr"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel1"
|
name: "panel1"
|
||||||
|
"opaque": false
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "menuLabel"
|
name: "menuLabel"
|
||||||
"text": "JMenu:"
|
"text": "JMenu:"
|
||||||
@@ -124,6 +125,7 @@ new FormModel {
|
|||||||
"$layoutConstraints": "insets 0,gap 5 5"
|
"$layoutConstraints": "insets 0,gap 5 5"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel2"
|
name: "panel2"
|
||||||
|
"opaque": false
|
||||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||||
name: "menu2"
|
name: "menu2"
|
||||||
"text": "disabled"
|
"text": "disabled"
|
||||||
@@ -164,6 +166,7 @@ new FormModel {
|
|||||||
"$layoutConstraints": "insets 0,gap 5 5"
|
"$layoutConstraints": "insets 0,gap 5 5"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel3"
|
name: "panel3"
|
||||||
|
"opaque": false
|
||||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||||
name: "menu3"
|
name: "menu3"
|
||||||
"text": "text"
|
"text": "text"
|
||||||
@@ -204,6 +207,7 @@ new FormModel {
|
|||||||
"$layoutConstraints": "insets 0,gap 5 5"
|
"$layoutConstraints": "insets 0,gap 5 5"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel4"
|
name: "panel4"
|
||||||
|
"opaque": false
|
||||||
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {
|
||||||
name: "menu4"
|
name: "menu4"
|
||||||
"text": "text"
|
"text": "text"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import net.miginfocom.swing.*;
|
|||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatOptionPaneTest
|
public class FlatOptionPaneTest
|
||||||
extends JPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.defaultVariableLocal": true
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
}
|
}
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "flowy,ltr,insets 0,hidemode 3,gap 5 5"
|
"$layoutConstraints": "flowy,ltr,insets 0,hidemode 3,gap 5 5"
|
||||||
"$columnConstraints": "[][][fill]"
|
"$columnConstraints": "[][][fill]"
|
||||||
"$rowConstraints": "[top][top][top][top][top][top][top][top]"
|
"$rowConstraints": "[top][top][top][top][top][top][top][top]"
|
||||||
@@ -30,7 +30,7 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 0"
|
"value": "cell 1 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "plainShowDialogLabel"
|
name: "plainShowDialogLabel"
|
||||||
"optionPane": new FormReference( "plainOptionPane" )
|
"optionPane": new FormReference( "plainOptionPane" )
|
||||||
"titleLabel": new FormReference( "plainLabel" )
|
"titleLabel": new FormReference( "plainLabel" )
|
||||||
@@ -60,7 +60,7 @@ new FormModel {
|
|||||||
}, 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( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "errorShowDialogLabel"
|
name: "errorShowDialogLabel"
|
||||||
"titleLabel": new FormReference( "errorLabel" )
|
"titleLabel": new FormReference( "errorLabel" )
|
||||||
"optionPane": new FormReference( "errorOptionPane" )
|
"optionPane": new FormReference( "errorOptionPane" )
|
||||||
@@ -90,7 +90,7 @@ new FormModel {
|
|||||||
}, 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( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "informationShowDialogLabel"
|
name: "informationShowDialogLabel"
|
||||||
"optionPane": new FormReference( "informationOptionPane" )
|
"optionPane": new FormReference( "informationOptionPane" )
|
||||||
"titleLabel": new FormReference( "informationLabel" )
|
"titleLabel": new FormReference( "informationLabel" )
|
||||||
@@ -120,7 +120,7 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 3"
|
"value": "cell 1 3"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "questionShowDialogLabel"
|
name: "questionShowDialogLabel"
|
||||||
"optionPane": new FormReference( "questionOptionPane" )
|
"optionPane": new FormReference( "questionOptionPane" )
|
||||||
"titleLabel": new FormReference( "questionLabel" )
|
"titleLabel": new FormReference( "questionLabel" )
|
||||||
@@ -147,7 +147,7 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 4"
|
"value": "cell 1 4"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "warningShowDialogLabel"
|
name: "warningShowDialogLabel"
|
||||||
"optionPane": new FormReference( "warningOptionPane" )
|
"optionPane": new FormReference( "warningOptionPane" )
|
||||||
"titleLabel": new FormReference( "warningLabel" )
|
"titleLabel": new FormReference( "warningLabel" )
|
||||||
@@ -174,7 +174,7 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 5"
|
"value": "cell 1 5"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "inputShowDialogLabel"
|
name: "inputShowDialogLabel"
|
||||||
"optionPane": new FormReference( "inputOptionPane" )
|
"optionPane": new FormReference( "inputOptionPane" )
|
||||||
"titleLabel": new FormReference( "inputLabel" )
|
"titleLabel": new FormReference( "inputLabel" )
|
||||||
@@ -202,7 +202,7 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 6"
|
"value": "cell 1 6"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "inputIconShowDialogLabel"
|
name: "inputIconShowDialogLabel"
|
||||||
"titleLabel": new FormReference( "inputIconLabel" )
|
"titleLabel": new FormReference( "inputIconLabel" )
|
||||||
"optionPane": new FormReference( "inputIconOptionPane" )
|
"optionPane": new FormReference( "inputIconOptionPane" )
|
||||||
@@ -230,7 +230,7 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 7"
|
"value": "cell 1 7"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
add( new FormComponent( "com.formdev.flatlaf.testing.FlatOptionPaneTest$ShowDialogLinkLabel" ) {
|
||||||
name: "customShowDialogLabel"
|
name: "customShowDialogLabel"
|
||||||
"optionPane": new FormReference( "customOptionPane" )
|
"optionPane": new FormReference( "customOptionPane" )
|
||||||
"titleLabel": new FormReference( "customLabel" )
|
"titleLabel": new FormReference( "customLabel" )
|
||||||
|
|||||||
@@ -313,6 +313,14 @@ public class FlatTestFrame
|
|||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void backgroundChanged() {
|
||||||
|
contentPanel.repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isPaintBackgroundPattern() {
|
||||||
|
return backgroundCheckBox.isSelected();
|
||||||
|
}
|
||||||
|
|
||||||
private void rightToLeftChanged() {
|
private void rightToLeftChanged() {
|
||||||
ComponentOrientation orientation = rightToLeftCheckBox.isSelected()
|
ComponentOrientation orientation = rightToLeftCheckBox.isSelected()
|
||||||
? ComponentOrientation.RIGHT_TO_LEFT
|
? ComponentOrientation.RIGHT_TO_LEFT
|
||||||
@@ -401,11 +409,12 @@ public class FlatTestFrame
|
|||||||
contentPanel = new JRootPane();
|
contentPanel = new JRootPane();
|
||||||
buttonBar = new JPanel();
|
buttonBar = new JPanel();
|
||||||
lookAndFeelComboBox = new JComboBox<>();
|
lookAndFeelComboBox = new JComboBox<>();
|
||||||
explicitColorsCheckBox = new JCheckBox();
|
scaleFactorComboBox = new JComboBox<>();
|
||||||
rightToLeftCheckBox = new JCheckBox();
|
rightToLeftCheckBox = new JCheckBox();
|
||||||
enabledCheckBox = new JCheckBox();
|
enabledCheckBox = new JCheckBox();
|
||||||
inspectCheckBox = new JCheckBox();
|
inspectCheckBox = new JCheckBox();
|
||||||
scaleFactorComboBox = new JComboBox<>();
|
explicitColorsCheckBox = new JCheckBox();
|
||||||
|
backgroundCheckBox = new JCheckBox();
|
||||||
closeButton = new JButton();
|
closeButton = new JButton();
|
||||||
|
|
||||||
//======== this ========
|
//======== this ========
|
||||||
@@ -440,6 +449,7 @@ public class FlatTestFrame
|
|||||||
"[fill]" +
|
"[fill]" +
|
||||||
"[fill]" +
|
"[fill]" +
|
||||||
"[fill]" +
|
"[fill]" +
|
||||||
|
"[fill]" +
|
||||||
"[grow,fill]" +
|
"[grow,fill]" +
|
||||||
"[button,fill]",
|
"[button,fill]",
|
||||||
// rows
|
// rows
|
||||||
@@ -449,11 +459,23 @@ public class FlatTestFrame
|
|||||||
lookAndFeelComboBox.addActionListener(e -> lookAndFeelChanged());
|
lookAndFeelComboBox.addActionListener(e -> lookAndFeelChanged());
|
||||||
buttonBar.add(lookAndFeelComboBox, "cell 0 0");
|
buttonBar.add(lookAndFeelComboBox, "cell 0 0");
|
||||||
|
|
||||||
//---- explicitColorsCheckBox ----
|
//---- scaleFactorComboBox ----
|
||||||
explicitColorsCheckBox.setText("explicit colors");
|
scaleFactorComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
|
||||||
explicitColorsCheckBox.setMnemonic('X');
|
"default",
|
||||||
explicitColorsCheckBox.addActionListener(e -> explicitColorsChanged());
|
"1",
|
||||||
buttonBar.add(explicitColorsCheckBox, "cell 1 0");
|
"1.25",
|
||||||
|
"1.5",
|
||||||
|
"1.75",
|
||||||
|
"2.0",
|
||||||
|
"2.25",
|
||||||
|
"2.5",
|
||||||
|
"3",
|
||||||
|
"3.5",
|
||||||
|
"4"
|
||||||
|
}));
|
||||||
|
scaleFactorComboBox.setMaximumRowCount(20);
|
||||||
|
scaleFactorComboBox.addActionListener(e -> scaleFactorChanged());
|
||||||
|
buttonBar.add(scaleFactorComboBox, "cell 1 0");
|
||||||
|
|
||||||
//---- rightToLeftCheckBox ----
|
//---- rightToLeftCheckBox ----
|
||||||
rightToLeftCheckBox.setText("right-to-left");
|
rightToLeftCheckBox.setText("right-to-left");
|
||||||
@@ -474,27 +496,21 @@ public class FlatTestFrame
|
|||||||
inspectCheckBox.addActionListener(e -> inspectChanged());
|
inspectCheckBox.addActionListener(e -> inspectChanged());
|
||||||
buttonBar.add(inspectCheckBox, "cell 4 0");
|
buttonBar.add(inspectCheckBox, "cell 4 0");
|
||||||
|
|
||||||
//---- scaleFactorComboBox ----
|
//---- explicitColorsCheckBox ----
|
||||||
scaleFactorComboBox.setModel(new DefaultComboBoxModel<>(new String[] {
|
explicitColorsCheckBox.setText("explicit colors");
|
||||||
"default",
|
explicitColorsCheckBox.setMnemonic('X');
|
||||||
"1",
|
explicitColorsCheckBox.addActionListener(e -> explicitColorsChanged());
|
||||||
"1.25",
|
buttonBar.add(explicitColorsCheckBox, "cell 5 0");
|
||||||
"1.5",
|
|
||||||
"1.75",
|
//---- backgroundCheckBox ----
|
||||||
"2.0",
|
backgroundCheckBox.setText("background");
|
||||||
"2.25",
|
backgroundCheckBox.setMnemonic('B');
|
||||||
"2.5",
|
backgroundCheckBox.addActionListener(e -> backgroundChanged());
|
||||||
"3",
|
buttonBar.add(backgroundCheckBox, "cell 6 0");
|
||||||
"3.5",
|
|
||||||
"4"
|
|
||||||
}));
|
|
||||||
scaleFactorComboBox.setMaximumRowCount(20);
|
|
||||||
scaleFactorComboBox.addActionListener(e -> scaleFactorChanged());
|
|
||||||
buttonBar.add(scaleFactorComboBox, "cell 5 0");
|
|
||||||
|
|
||||||
//---- closeButton ----
|
//---- closeButton ----
|
||||||
closeButton.setText("Close");
|
closeButton.setText("Close");
|
||||||
buttonBar.add(closeButton, "cell 7 0");
|
buttonBar.add(closeButton, "cell 8 0");
|
||||||
}
|
}
|
||||||
dialogPane.add(buttonBar, BorderLayout.SOUTH);
|
dialogPane.add(buttonBar, BorderLayout.SOUTH);
|
||||||
}
|
}
|
||||||
@@ -507,11 +523,12 @@ public class FlatTestFrame
|
|||||||
private JRootPane contentPanel;
|
private JRootPane contentPanel;
|
||||||
private JPanel buttonBar;
|
private JPanel buttonBar;
|
||||||
private JComboBox<LafInfo> lookAndFeelComboBox;
|
private JComboBox<LafInfo> lookAndFeelComboBox;
|
||||||
private JCheckBox explicitColorsCheckBox;
|
private JComboBox<String> scaleFactorComboBox;
|
||||||
private JCheckBox rightToLeftCheckBox;
|
private JCheckBox rightToLeftCheckBox;
|
||||||
private JCheckBox enabledCheckBox;
|
private JCheckBox enabledCheckBox;
|
||||||
private JCheckBox inspectCheckBox;
|
private JCheckBox inspectCheckBox;
|
||||||
private JComboBox<String> scaleFactorComboBox;
|
private JCheckBox explicitColorsCheckBox;
|
||||||
|
private JCheckBox backgroundCheckBox;
|
||||||
private JButton closeButton;
|
private JButton closeButton;
|
||||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "insets dialog"
|
"$layoutConstraints": "insets dialog"
|
||||||
"$columnConstraints": "[fill][fill][fill][fill][fill][fill][grow,fill][button,fill]"
|
"$columnConstraints": "[fill][fill][fill][fill][fill][fill][fill][grow,fill][button,fill]"
|
||||||
"$rowSpecs": "[fill]"
|
"$rowSpecs": "[fill]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "buttonBar"
|
name: "buttonBar"
|
||||||
@@ -34,11 +34,27 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 0 0"
|
"value": "cell 0 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JComboBox" ) {
|
||||||
name: "explicitColorsCheckBox"
|
name: "scaleFactorComboBox"
|
||||||
"text": "explicit colors"
|
"model": new javax.swing.DefaultComboBoxModel {
|
||||||
"mnemonic": 88
|
selectedItem: "default"
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "explicitColorsChanged", false ) )
|
addElement( "default" )
|
||||||
|
addElement( "1" )
|
||||||
|
addElement( "1.25" )
|
||||||
|
addElement( "1.5" )
|
||||||
|
addElement( "1.75" )
|
||||||
|
addElement( "2.0" )
|
||||||
|
addElement( "2.25" )
|
||||||
|
addElement( "2.5" )
|
||||||
|
addElement( "3" )
|
||||||
|
addElement( "3.5" )
|
||||||
|
addElement( "4" )
|
||||||
|
}
|
||||||
|
"maximumRowCount": 20
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.typeParameters": "String"
|
||||||
|
}
|
||||||
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "scaleFactorChanged", false ) )
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 0"
|
"value": "cell 1 0"
|
||||||
} )
|
} )
|
||||||
@@ -67,35 +83,27 @@ new FormModel {
|
|||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 4 0"
|
"value": "cell 4 0"
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JComboBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "scaleFactorComboBox"
|
name: "explicitColorsCheckBox"
|
||||||
"model": new javax.swing.DefaultComboBoxModel {
|
"text": "explicit colors"
|
||||||
selectedItem: "default"
|
"mnemonic": 88
|
||||||
addElement( "default" )
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "explicitColorsChanged", false ) )
|
||||||
addElement( "1" )
|
|
||||||
addElement( "1.25" )
|
|
||||||
addElement( "1.5" )
|
|
||||||
addElement( "1.75" )
|
|
||||||
addElement( "2.0" )
|
|
||||||
addElement( "2.25" )
|
|
||||||
addElement( "2.5" )
|
|
||||||
addElement( "3" )
|
|
||||||
addElement( "3.5" )
|
|
||||||
addElement( "4" )
|
|
||||||
}
|
|
||||||
"maximumRowCount": 20
|
|
||||||
auxiliary() {
|
|
||||||
"JavaCodeGenerator.typeParameters": "String"
|
|
||||||
}
|
|
||||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "scaleFactorChanged", false ) )
|
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 5 0"
|
"value": "cell 5 0"
|
||||||
} )
|
} )
|
||||||
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
|
name: "backgroundCheckBox"
|
||||||
|
"text": "background"
|
||||||
|
"mnemonic": 66
|
||||||
|
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "backgroundChanged", false ) )
|
||||||
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
|
"value": "cell 6 0"
|
||||||
|
} )
|
||||||
add( new FormComponent( "javax.swing.JButton" ) {
|
add( new FormComponent( "javax.swing.JButton" ) {
|
||||||
name: "closeButton"
|
name: "closeButton"
|
||||||
"text": "Close"
|
"text": "Close"
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 7 0"
|
"value": "cell 8 0"
|
||||||
} )
|
} )
|
||||||
}, new FormLayoutConstraints( class java.lang.String ) {
|
}, new FormLayoutConstraints( class java.lang.String ) {
|
||||||
"value": "South"
|
"value": "South"
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019 FormDev Software GmbH
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.formdev.flatlaf.testing;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Karl Tauber
|
||||||
|
*/
|
||||||
|
public class FlatTestPanel
|
||||||
|
extends JPanel
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected void paintComponent( Graphics g ) {
|
||||||
|
super.paintComponent( g );
|
||||||
|
|
||||||
|
FlatTestFrame frame = (FlatTestFrame) SwingUtilities.getAncestorOfClass( FlatTestFrame.class, this );
|
||||||
|
if( frame != null && frame.isPaintBackgroundPattern() ) {
|
||||||
|
g.setColor( Color.magenta );
|
||||||
|
int width = getWidth();
|
||||||
|
int height = getHeight();
|
||||||
|
for( int y = 0; y < height; y += 2 )
|
||||||
|
g.drawLine( 0, y, width - 1, y );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,12 +23,13 @@ import javax.swing.*;
|
|||||||
import net.miginfocom.swing.*;
|
import net.miginfocom.swing.*;
|
||||||
import org.jdesktop.swingx.*;
|
import org.jdesktop.swingx.*;
|
||||||
import com.formdev.flatlaf.testing.FlatTestFrame;
|
import com.formdev.flatlaf.testing.FlatTestFrame;
|
||||||
|
import com.formdev.flatlaf.testing.FlatTestPanel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Karl Tauber
|
* @author Karl Tauber
|
||||||
*/
|
*/
|
||||||
public class FlatSwingXTest
|
public class FlatSwingXTest
|
||||||
extends JPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
@@ -199,7 +200,7 @@ public class FlatSwingXTest
|
|||||||
|
|
||||||
//---- busyCheckBox ----
|
//---- busyCheckBox ----
|
||||||
busyCheckBox.setText("busy");
|
busyCheckBox.setText("busy");
|
||||||
busyCheckBox.setMnemonic('B');
|
busyCheckBox.setMnemonic('Y');
|
||||||
busyCheckBox.addActionListener(e -> busyChanged());
|
busyCheckBox.addActionListener(e -> busyChanged());
|
||||||
add(busyCheckBox, "cell 2 6");
|
add(busyCheckBox, "cell 2 6");
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ new FormModel {
|
|||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.defaultVariableLocal": true
|
"JavaCodeGenerator.defaultVariableLocal": true
|
||||||
}
|
}
|
||||||
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
|
||||||
"$layoutConstraints": "hidemode 3,ltr"
|
"$layoutConstraints": "hidemode 3,ltr"
|
||||||
"$columnConstraints": "[left][][][fill]"
|
"$columnConstraints": "[left][][][fill]"
|
||||||
"$rowConstraints": "[]0[][]0[][][][][]"
|
"$rowConstraints": "[]0[][]0[][][][][]"
|
||||||
@@ -144,7 +144,7 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "busyCheckBox"
|
name: "busyCheckBox"
|
||||||
"text": "busy"
|
"text": "busy"
|
||||||
"mnemonic": 66
|
"mnemonic": 89
|
||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user