Demo: added insets to ControlBar to avoid clipping of outline focus border

This commit is contained in:
Karl Tauber
2019-09-15 11:32:45 +02:00
parent f939654309
commit 87e20375f0
4 changed files with 16 additions and 17 deletions

View File

@@ -240,7 +240,7 @@ class ControlBar
//======== this ======== //======== this ========
setLayout(new MigLayout( setLayout(new MigLayout(
"insets 0", "insets dialog",
// columns // columns
"[fill]" + "[fill]" +
"[fill]" + "[fill]" +
@@ -248,7 +248,7 @@ class ControlBar
"[grow,fill]" + "[grow,fill]" +
"[button,fill]", "[button,fill]",
// rows // rows
"[20,bottom]" + "[bottom]" +
"[]")); "[]"));
add(separator1, "cell 0 0 5 1"); add(separator1, "cell 0 0 5 1");

View File

@@ -4,10 +4,10 @@ new FormModel {
contentType: "form/swing" contentType: "form/swing"
root: new FormRoot { root: new FormRoot {
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 0" "$layoutConstraints": "insets dialog"
"$columnConstraints": "[fill][fill][fill][grow,fill][button,fill]" "$columnConstraints": "[fill][fill][fill][grow,fill][button,fill]"
"$rowSpecs": "[fill]" "$rowSpecs": "[fill]"
"$rowConstraints": "[20,bottom][]" "$rowConstraints": "[bottom][]"
} ) { } ) {
name: "this" name: "this"
add( new FormComponent( "javax.swing.JSeparator" ) { add( new FormComponent( "javax.swing.JSeparator" ) {
@@ -56,7 +56,7 @@ new FormModel {
} ) } )
}, 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( 398, 45 ) "size": new java.awt.Dimension( 398, 95 )
} ) } )
} }
} }

View File

@@ -228,8 +228,7 @@ class DemoFrame
// columns // columns
"[grow,fill]", "[grow,fill]",
// rows // rows
"[grow,fill]" + "[grow,fill]"));
"[]"));
//======== tabbedPane ======== //======== tabbedPane ========
{ {
@@ -241,9 +240,9 @@ class DemoFrame
tabbedPane.addTab("Option Pane", optionPanePanel); tabbedPane.addTab("Option Pane", optionPanePanel);
} }
contentPanel.add(tabbedPane, "cell 0 0"); contentPanel.add(tabbedPane, "cell 0 0");
contentPanel.add(controlBar, "cell 0 1");
} }
contentPane.add(contentPanel, BorderLayout.CENTER); contentPane.add(contentPanel, BorderLayout.CENTER);
contentPane.add(controlBar, BorderLayout.SOUTH);
//---- buttonGroup1 ---- //---- buttonGroup1 ----
ButtonGroup buttonGroup1 = new ButtonGroup(); ButtonGroup buttonGroup1 = new ButtonGroup();

View File

@@ -52,7 +52,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,hidemode 3" "$layoutConstraints": "insets dialog,hidemode 3"
"$columnConstraints": "[grow,fill]" "$columnConstraints": "[grow,fill]"
"$rowConstraints": "[grow,fill][]" "$rowConstraints": "[grow,fill]"
} ) { } ) {
name: "contentPanel" name: "contentPanel"
add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { add( new FormContainer( "javax.swing.JTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) {
@@ -89,17 +89,17 @@ 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( "com.formdev.flatlaf.demo.ControlBar" ) {
name: "controlBar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
}, new FormLayoutConstraints( class java.lang.String ) { }, new FormLayoutConstraints( class java.lang.String ) {
"value": "Center" "value": "Center"
} ) } )
add( new FormComponent( "com.formdev.flatlaf.demo.ControlBar" ) {
name: "controlBar"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class java.lang.String ) {
"value": "South"
} )
menuBar: new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) { menuBar: new FormContainer( "javax.swing.JMenuBar", new FormLayoutManager( class javax.swing.JMenuBar ) ) {
name: "menuBar1" name: "menuBar1"
add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) { add( new FormContainer( "javax.swing.JMenu", new FormLayoutManager( class javax.swing.JMenu ) ) {