diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssContainerTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssContainerTest.java new file mode 100644 index 00000000..97d6e9cd --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssContainerTest.java @@ -0,0 +1,286 @@ +/* + * 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.jideoss; + +import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER; +import java.awt.*; +import javax.swing.*; +import javax.swing.border.*; +import com.formdev.flatlaf.testing.*; +import com.formdev.flatlaf.testing.FlatTestFrame; +import com.jgoodies.forms.layout.*; +import com.jidesoft.swing.*; +import net.miginfocom.swing.*; + +/** + * @author Karl Tauber + */ +public class FlatJideOssContainerTest + extends FlatTestPanel +{ + public static void main( String[] args ) { + SwingUtilities.invokeLater( () -> { + FlatTestFrame frame = FlatTestFrame.create( args, "FlatJideOssContainerTest" ); + frame.showFrame( FlatJideOssContainerTest::new ); + } ); + } + + FlatJideOssContainerTest() { + initComponents(); + } + + private void tabScrollChanged() { + int tabLayoutPolicy = tabScrollCheckBox.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT : JTabbedPane.WRAP_TAB_LAYOUT; + tabbedPane1.setTabLayoutPolicy( tabLayoutPolicy ); + tabbedPane2.setTabLayoutPolicy( tabLayoutPolicy ); + tabbedPane3.setTabLayoutPolicy( tabLayoutPolicy ); + tabbedPane4.setTabLayoutPolicy( tabLayoutPolicy ); + } + + private void hasFullBorderChanged() { + Boolean hasFullBorder = hasFullBorderCheckBox.isSelected() ? true : null; + tabbedPane1.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); + tabbedPane2.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); + tabbedPane3.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); + tabbedPane4.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); + } + + private void moreTabsChanged() { + boolean moreTabs = moreTabsCheckBox.isSelected(); + addRemoveMoreTabs( tabbedPane1, moreTabs ); + addRemoveMoreTabs( tabbedPane2, moreTabs ); + addRemoveMoreTabs( tabbedPane3, moreTabs ); + addRemoveMoreTabs( tabbedPane4, moreTabs ); + } + + private void addRemoveMoreTabs( JTabbedPane tabbedPane, boolean add ) { + if( add ) { + tabbedPane.addTab( "Tab 4", new JLabel( "tab 4" ) ); + tabbedPane.addTab( "Tab 5", new JLabel( "tab 5" ) ); + } else { + int tabCount = tabbedPane.getTabCount(); + if( tabCount > 3 ) { + for( int i = 0; i < 2; i++ ) + tabbedPane.removeTabAt( tabbedPane.getTabCount() - 1 ); + } + } + } + + private void initComponents() { + // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents + JPanel panel9 = new JPanel(); + JLabel tabbedPaneLabel = new JLabel(); + tabbedPane1 = new JideTabbedPane(); + JPanel panel1 = new JPanel(); + JLabel label1 = new JLabel(); + JPanel panel2 = new JPanel(); + JLabel label2 = new JLabel(); + tabbedPane3 = new JideTabbedPane(); + JPanel panel5 = new JPanel(); + JLabel label5 = new JLabel(); + JPanel panel6 = new JPanel(); + JLabel label6 = new JLabel(); + tabbedPane2 = new JideTabbedPane(); + JPanel panel3 = new JPanel(); + JLabel label3 = new JLabel(); + JPanel panel4 = new JPanel(); + JLabel label4 = new JLabel(); + tabbedPane4 = new JideTabbedPane(); + JPanel panel7 = new JPanel(); + JLabel label7 = new JLabel(); + JPanel panel8 = new JPanel(); + JLabel label8 = new JLabel(); + JPanel panel14 = new JPanel(); + moreTabsCheckBox = new JCheckBox(); + tabScrollCheckBox = new JCheckBox(); + hasFullBorderCheckBox = new JCheckBox(); + CellConstraints cc = new CellConstraints(); + + //======== this ======== + setLayout(new MigLayout( + "insets dialog,hidemode 3", + // columns + "[grow,fill]", + // rows + "[grow,fill]")); + + //======== panel9 ======== + { + panel9.setOpaque(false); + panel9.setLayout(new FormLayout( + "70dlu:grow, $lcgap, 70dlu:grow", + "pref, 2*($lgap, fill:70dlu:grow), $lgap, pref")); + + //---- tabbedPaneLabel ---- + tabbedPaneLabel.setText("JideTabbedPane:"); + panel9.add(tabbedPaneLabel, cc.xy(1, 1)); + + //======== tabbedPane1 ======== + { + + //======== panel1 ======== + { + panel1.setLayout(new FlowLayout()); + + //---- label1 ---- + label1.setText("TOP"); + panel1.add(label1); + } + tabbedPane1.addTab("Tab 1", panel1); + + //======== panel2 ======== + { + panel2.setBorder(new LineBorder(Color.magenta)); + panel2.setLayout(new FlowLayout()); + } + tabbedPane1.addTab("Tab 2", panel2); + + //---- label2 ---- + label2.setText("text"); + tabbedPane1.addTab("Tab 3", label2); + } + panel9.add(tabbedPane1, cc.xy(1, 3)); + + //======== tabbedPane3 ======== + { + tabbedPane3.setTabPlacement(SwingConstants.LEFT); + + //======== panel5 ======== + { + panel5.setLayout(new FlowLayout()); + + //---- label5 ---- + label5.setText("LEFT"); + panel5.add(label5); + } + tabbedPane3.addTab("Tab 1", panel5); + + //======== panel6 ======== + { + panel6.setBorder(new LineBorder(Color.magenta)); + panel6.setLayout(new FlowLayout()); + } + tabbedPane3.addTab("Tab 2", panel6); + + //---- label6 ---- + label6.setText("text"); + tabbedPane3.addTab("Tab 3", label6); + } + panel9.add(tabbedPane3, cc.xy(3, 3)); + + //======== tabbedPane2 ======== + { + tabbedPane2.setTabPlacement(SwingConstants.BOTTOM); + + //======== panel3 ======== + { + panel3.setLayout(new FlowLayout()); + + //---- label3 ---- + label3.setText("BOTTOM"); + panel3.add(label3); + } + tabbedPane2.addTab("Tab 1", panel3); + + //======== panel4 ======== + { + panel4.setBorder(new LineBorder(Color.magenta)); + panel4.setLayout(new FlowLayout()); + } + tabbedPane2.addTab("Tab 2", panel4); + tabbedPane2.setEnabledAt(1, false); + + //---- label4 ---- + label4.setText("text"); + tabbedPane2.addTab("Tab 3", label4); + } + panel9.add(tabbedPane2, cc.xy(1, 5)); + + //======== tabbedPane4 ======== + { + tabbedPane4.setTabPlacement(SwingConstants.RIGHT); + + //======== panel7 ======== + { + panel7.setLayout(new FlowLayout()); + + //---- label7 ---- + label7.setText("RIGHT"); + panel7.add(label7); + } + tabbedPane4.addTab("Tab 1", panel7); + + //======== panel8 ======== + { + panel8.setBorder(new LineBorder(Color.magenta)); + panel8.setLayout(new FlowLayout()); + } + tabbedPane4.addTab("Tab 2", panel8); + + //---- label8 ---- + label8.setText("text"); + tabbedPane4.addTab("Tab 3", label8); + } + panel9.add(tabbedPane4, cc.xy(3, 5)); + + //======== panel14 ======== + { + panel14.setOpaque(false); + panel14.setLayout(new MigLayout( + "insets 0,hidemode 3", + // columns + "[]" + + "[]" + + "[]", + // rows + "[center]")); + + //---- moreTabsCheckBox ---- + moreTabsCheckBox.setText("more tabs"); + moreTabsCheckBox.setMnemonic('M'); + moreTabsCheckBox.addActionListener(e -> moreTabsChanged()); + panel14.add(moreTabsCheckBox, "cell 0 0"); + + //---- tabScrollCheckBox ---- + tabScrollCheckBox.setText("tabLayoutPolicy = SCROLL"); + tabScrollCheckBox.setMnemonic('S'); + tabScrollCheckBox.setSelected(true); + tabScrollCheckBox.addActionListener(e -> tabScrollChanged()); + panel14.add(tabScrollCheckBox, "cell 1 0,alignx left,growx 0"); + + //---- hasFullBorderCheckBox ---- + hasFullBorderCheckBox.setText("JTabbedPane.hasFullBorder"); + hasFullBorderCheckBox.setMnemonic('F'); + hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged()); + panel14.add(hasFullBorderCheckBox, "cell 2 0,alignx left,growx 0"); + } + panel9.add(panel14, cc.xywh(1, 7, 3, 1)); + } + add(panel9, "cell 0 0"); + // JFormDesigner - End of component initialization //GEN-END:initComponents + } + + // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables + private JideTabbedPane tabbedPane1; + private JideTabbedPane tabbedPane3; + private JideTabbedPane tabbedPane2; + private JideTabbedPane tabbedPane4; + private JCheckBox moreTabsCheckBox; + private JCheckBox tabScrollCheckBox; + private JCheckBox hasFullBorderCheckBox; + // JFormDesigner - End of variables declaration //GEN-END:variables +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssContainerTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssContainerTest.jfd new file mode 100644 index 00000000..7b73a58a --- /dev/null +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssContainerTest.jfd @@ -0,0 +1,203 @@ +JFDML JFormDesigner: "7.0.3.1.342" Java: "15" encoding: "UTF-8" + +new FormModel { + contentType: "form/swing" + root: new FormRoot { + auxiliary() { + "JavaCodeGenerator.defaultVariableLocal": true + } + add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets dialog,hidemode 3" + "$columnConstraints": "[grow,fill]" + "$rowConstraints": "[grow,fill]" + } ) { + name: "this" + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class com.jgoodies.forms.layout.FormLayout ) { + "$columnSpecs": "70dlu:grow, labelcompgap, 70dlu:grow" + "$rowSpecs": "pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref" + } ) { + name: "panel9" + "opaque": false + add( new FormComponent( "javax.swing.JLabel" ) { + name: "tabbedPaneLabel" + "text": "JideTabbedPane:" + }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { + "gridX": 1 + } ) + add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "tabbedPane1" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel1" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label1" + "text": "TOP" + } ) + }, new FormLayoutConstraints( null ) { + "title": "Tab 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel2" + "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color magenta, 1, false ) + }, new FormLayoutConstraints( null ) { + "title": "Tab 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label2" + "text": "text" + }, new FormLayoutConstraints( null ) { + "title": "Tab 3" + } ) + }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { + "gridX": 1 + "gridY": 3 + } ) + add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "tabbedPane3" + "tabPlacement": 2 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel5" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label5" + "text": "LEFT" + } ) + }, new FormLayoutConstraints( null ) { + "title": "Tab 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel6" + "border": #LineBorder0 + }, new FormLayoutConstraints( null ) { + "title": "Tab 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label6" + "text": "text" + }, new FormLayoutConstraints( null ) { + "title": "Tab 3" + } ) + }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { + "gridX": 3 + "gridY": 3 + } ) + add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "tabbedPane2" + "tabPlacement": 3 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel3" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label3" + "text": "BOTTOM" + } ) + }, new FormLayoutConstraints( null ) { + "title": "Tab 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel4" + "border": #LineBorder0 + }, new FormLayoutConstraints( null ) { + "title": "Tab 2" + "enabled": false + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label4" + "text": "text" + }, new FormLayoutConstraints( null ) { + "title": "Tab 3" + } ) + }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { + "gridY": 5 + } ) + add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { + name: "tabbedPane4" + "tabPlacement": 4 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel7" + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label7" + "text": "RIGHT" + } ) + }, new FormLayoutConstraints( null ) { + "title": "Tab 1" + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { + name: "panel8" + "border": #LineBorder0 + }, new FormLayoutConstraints( null ) { + "title": "Tab 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label8" + "text": "text" + }, new FormLayoutConstraints( null ) { + "title": "Tab 3" + } ) + }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { + "gridX": 3 + "gridY": 5 + } ) + add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { + "$layoutConstraints": "insets 0,hidemode 3" + "$columnConstraints": "[][][]" + "$rowConstraints": "[center]" + } ) { + name: "panel14" + "opaque": false + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "moreTabsCheckBox" + "text": "more tabs" + "mnemonic": 77 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "moreTabsChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "tabScrollCheckBox" + "text": "tabLayoutPolicy = SCROLL" + "mnemonic": 83 + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabScrollChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0,alignx left,growx 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "hasFullBorderCheckBox" + "text": "JTabbedPane.hasFullBorder" + "mnemonic": 70 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "hasFullBorderChanged", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 0,alignx left,growx 0" + } ) + }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { + "gridY": 7 + "gridWidth": 3 + } ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 0" + } ) + }, new FormLayoutConstraints( null ) { + "location": new java.awt.Point( 0, 0 ) + "size": new java.awt.Dimension( 500, 500 ) + } ) + } +} diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.java index 953f4ff4..c94b0d46 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.java @@ -16,14 +16,11 @@ package com.formdev.flatlaf.testing.jideoss; -import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.border.*; import com.formdev.flatlaf.testing.*; import com.formdev.flatlaf.testing.FlatTestFrame; -import com.jgoodies.forms.layout.*; import com.jidesoft.popup.JidePopup; import com.jidesoft.swing.*; import net.miginfocom.swing.*; @@ -47,43 +44,6 @@ public class FlatJideOssTest tristateCheckBox1Changed(); } - private void tabScrollChanged() { - int tabLayoutPolicy = tabScrollCheckBox.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT : JTabbedPane.WRAP_TAB_LAYOUT; - tabbedPane1.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane2.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane3.setTabLayoutPolicy( tabLayoutPolicy ); - tabbedPane4.setTabLayoutPolicy( tabLayoutPolicy ); - } - - private void hasFullBorderChanged() { - Boolean hasFullBorder = hasFullBorderCheckBox.isSelected() ? true : null; - tabbedPane1.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane2.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane3.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - tabbedPane4.putClientProperty( TABBED_PANE_HAS_FULL_BORDER, hasFullBorder ); - } - - private void moreTabsChanged() { - boolean moreTabs = moreTabsCheckBox.isSelected(); - addRemoveMoreTabs( tabbedPane1, moreTabs ); - addRemoveMoreTabs( tabbedPane2, moreTabs ); - addRemoveMoreTabs( tabbedPane3, moreTabs ); - addRemoveMoreTabs( tabbedPane4, moreTabs ); - } - - private void addRemoveMoreTabs( JTabbedPane tabbedPane, boolean add ) { - if( add ) { - tabbedPane.addTab( "Tab 4", new JLabel( "tab 4" ) ); - tabbedPane.addTab( "Tab 5", new JLabel( "tab 5" ) ); - } else { - int tabCount = tabbedPane.getTabCount(); - if( tabCount > 3 ) { - for( int i = 0; i < 2; i++ ) - tabbedPane.removeTabAt( tabbedPane.getTabCount() - 1 ); - } - } - } - private void showJidePopup( ActionEvent e ) { Component invoker = (Component) e.getSource(); @@ -119,33 +79,6 @@ public class FlatJideOssTest private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents - JPanel panel9 = new JPanel(); - JLabel tabbedPaneLabel = new JLabel(); - tabbedPane1 = new JideTabbedPane(); - JPanel panel1 = new JPanel(); - JLabel label1 = new JLabel(); - JPanel panel2 = new JPanel(); - JLabel label2 = new JLabel(); - tabbedPane3 = new JideTabbedPane(); - JPanel panel5 = new JPanel(); - JLabel label5 = new JLabel(); - JPanel panel6 = new JPanel(); - JLabel label6 = new JLabel(); - tabbedPane2 = new JideTabbedPane(); - JPanel panel3 = new JPanel(); - JLabel label3 = new JLabel(); - JPanel panel4 = new JPanel(); - JLabel label4 = new JLabel(); - tabbedPane4 = new JideTabbedPane(); - JPanel panel7 = new JPanel(); - JLabel label7 = new JLabel(); - JPanel panel8 = new JPanel(); - JLabel label8 = new JLabel(); - JPanel panel14 = new JPanel(); - moreTabsCheckBox = new JCheckBox(); - tabScrollCheckBox = new JCheckBox(); - hasFullBorderCheckBox = new JCheckBox(); - JPanel panel10 = new JPanel(); JLabel jidePopupLabel = new JLabel(); JButton showJidePopupButton = new JButton(); JLabel jidePopupMenuLabel = new JLabel(); @@ -153,227 +86,54 @@ public class FlatJideOssTest JLabel label9 = new JLabel(); tristateCheckBox1 = new TristateCheckBox(); triStateLabel1 = new JLabel(); - CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new MigLayout( "insets dialog,hidemode 3", // columns - "[grow,fill]", + "[]" + + "[fill]" + + "[fill]", // rows - "[grow,fill]")); + "[]" + + "[]" + + "[]")); - //======== panel9 ======== - { - panel9.setOpaque(false); - panel9.setLayout(new FormLayout( - "70dlu:grow, $lcgap, 70dlu:grow", - "pref, 2*($lgap, fill:70dlu:grow), $lgap, pref, $lgap, default")); + //---- jidePopupLabel ---- + jidePopupLabel.setText("JidePopup:"); + add(jidePopupLabel, "cell 0 0"); - //---- tabbedPaneLabel ---- - tabbedPaneLabel.setText("JideTabbedPane:"); - panel9.add(tabbedPaneLabel, cc.xy(1, 1)); + //---- showJidePopupButton ---- + showJidePopupButton.setText("show JidePopup"); + showJidePopupButton.addActionListener(e -> showJidePopup(e)); + add(showJidePopupButton, "cell 1 0"); - //======== tabbedPane1 ======== - { + //---- jidePopupMenuLabel ---- + jidePopupMenuLabel.setText("JidePopupMenu:"); + add(jidePopupMenuLabel, "cell 0 1"); - //======== panel1 ======== - { - panel1.setLayout(new FlowLayout()); + //---- showJidePopupMenuButton ---- + showJidePopupMenuButton.setText("show JidePopupMenu"); + showJidePopupMenuButton.addActionListener(e -> showJidePopupMenu(e)); + add(showJidePopupMenuButton, "cell 1 1"); - //---- label1 ---- - label1.setText("TOP"); - panel1.add(label1); - } - tabbedPane1.addTab("Tab 1", panel1); + //---- label9 ---- + label9.setText("TristateCheckBox:"); + add(label9, "cell 0 2"); - //======== panel2 ======== - { - panel2.setBorder(new LineBorder(Color.magenta)); - panel2.setLayout(new FlowLayout()); - } - tabbedPane1.addTab("Tab 2", panel2); + //---- tristateCheckBox1 ---- + tristateCheckBox1.setText("three states"); + tristateCheckBox1.addActionListener(e -> tristateCheckBox1Changed()); + add(tristateCheckBox1, "cell 1 2"); - //---- label2 ---- - label2.setText("text"); - tabbedPane1.addTab("Tab 3", label2); - } - panel9.add(tabbedPane1, cc.xy(1, 3)); - - //======== tabbedPane3 ======== - { - tabbedPane3.setTabPlacement(SwingConstants.LEFT); - - //======== panel5 ======== - { - panel5.setLayout(new FlowLayout()); - - //---- label5 ---- - label5.setText("LEFT"); - panel5.add(label5); - } - tabbedPane3.addTab("Tab 1", panel5); - - //======== panel6 ======== - { - panel6.setBorder(new LineBorder(Color.magenta)); - panel6.setLayout(new FlowLayout()); - } - tabbedPane3.addTab("Tab 2", panel6); - - //---- label6 ---- - label6.setText("text"); - tabbedPane3.addTab("Tab 3", label6); - } - panel9.add(tabbedPane3, cc.xy(3, 3)); - - //======== tabbedPane2 ======== - { - tabbedPane2.setTabPlacement(SwingConstants.BOTTOM); - - //======== panel3 ======== - { - panel3.setLayout(new FlowLayout()); - - //---- label3 ---- - label3.setText("BOTTOM"); - panel3.add(label3); - } - tabbedPane2.addTab("Tab 1", panel3); - - //======== panel4 ======== - { - panel4.setBorder(new LineBorder(Color.magenta)); - panel4.setLayout(new FlowLayout()); - } - tabbedPane2.addTab("Tab 2", panel4); - tabbedPane2.setEnabledAt(1, false); - - //---- label4 ---- - label4.setText("text"); - tabbedPane2.addTab("Tab 3", label4); - } - panel9.add(tabbedPane2, cc.xy(1, 5)); - - //======== tabbedPane4 ======== - { - tabbedPane4.setTabPlacement(SwingConstants.RIGHT); - - //======== panel7 ======== - { - panel7.setLayout(new FlowLayout()); - - //---- label7 ---- - label7.setText("RIGHT"); - panel7.add(label7); - } - tabbedPane4.addTab("Tab 1", panel7); - - //======== panel8 ======== - { - panel8.setBorder(new LineBorder(Color.magenta)); - panel8.setLayout(new FlowLayout()); - } - tabbedPane4.addTab("Tab 2", panel8); - - //---- label8 ---- - label8.setText("text"); - tabbedPane4.addTab("Tab 3", label8); - } - panel9.add(tabbedPane4, cc.xy(3, 5)); - - //======== panel14 ======== - { - panel14.setOpaque(false); - panel14.setLayout(new MigLayout( - "insets 0,hidemode 3", - // columns - "[]" + - "[]" + - "[]", - // rows - "[center]")); - - //---- moreTabsCheckBox ---- - moreTabsCheckBox.setText("more tabs"); - moreTabsCheckBox.setMnemonic('M'); - moreTabsCheckBox.addActionListener(e -> moreTabsChanged()); - panel14.add(moreTabsCheckBox, "cell 0 0"); - - //---- tabScrollCheckBox ---- - tabScrollCheckBox.setText("tabLayoutPolicy = SCROLL"); - tabScrollCheckBox.setMnemonic('S'); - tabScrollCheckBox.setSelected(true); - tabScrollCheckBox.addActionListener(e -> tabScrollChanged()); - panel14.add(tabScrollCheckBox, "cell 1 0,alignx left,growx 0"); - - //---- hasFullBorderCheckBox ---- - hasFullBorderCheckBox.setText("JTabbedPane.hasFullBorder"); - hasFullBorderCheckBox.setMnemonic('F'); - hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged()); - panel14.add(hasFullBorderCheckBox, "cell 2 0,alignx left,growx 0"); - } - panel9.add(panel14, cc.xywh(1, 7, 3, 1)); - - //======== panel10 ======== - { - panel10.setLayout(new MigLayout( - "insets 3 0 3 3,hidemode 3", - // columns - "[fill]" + - "[fill]" + - "[fill]", - // rows - "[]" + - "[]" + - "[]")); - - //---- jidePopupLabel ---- - jidePopupLabel.setText("JidePopup:"); - panel10.add(jidePopupLabel, "cell 0 0"); - - //---- showJidePopupButton ---- - showJidePopupButton.setText("show JidePopup"); - showJidePopupButton.addActionListener(e -> showJidePopup(e)); - panel10.add(showJidePopupButton, "cell 1 0"); - - //---- jidePopupMenuLabel ---- - jidePopupMenuLabel.setText("JidePopupMenu:"); - panel10.add(jidePopupMenuLabel, "cell 0 1"); - - //---- showJidePopupMenuButton ---- - showJidePopupMenuButton.setText("show JidePopupMenu"); - showJidePopupMenuButton.addActionListener(e -> showJidePopupMenu(e)); - panel10.add(showJidePopupMenuButton, "cell 1 1"); - - //---- label9 ---- - label9.setText("TristateCheckBox:"); - panel10.add(label9, "cell 0 2"); - - //---- tristateCheckBox1 ---- - tristateCheckBox1.setText("three states"); - tristateCheckBox1.addActionListener(e -> tristateCheckBox1Changed()); - panel10.add(tristateCheckBox1, "cell 1 2"); - - //---- triStateLabel1 ---- - triStateLabel1.setText("text"); - triStateLabel1.setEnabled(false); - panel10.add(triStateLabel1, "cell 2 2"); - } - panel9.add(panel10, cc.xy(1, 9)); - } - add(panel9, "cell 0 0"); + //---- triStateLabel1 ---- + triStateLabel1.setText("text"); + triStateLabel1.setEnabled(false); + add(triStateLabel1, "cell 2 2"); // JFormDesigner - End of component initialization //GEN-END:initComponents } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables - private JideTabbedPane tabbedPane1; - private JideTabbedPane tabbedPane3; - private JideTabbedPane tabbedPane2; - private JideTabbedPane tabbedPane4; - private JCheckBox moreTabsCheckBox; - private JCheckBox tabScrollCheckBox; - private JCheckBox hasFullBorderCheckBox; private TristateCheckBox tristateCheckBox1; private JLabel triStateLabel1; // JFormDesigner - End of variables declaration //GEN-END:variables diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.jfd index 74282ca6..0f835ce4 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatJideOssTest.jfd @@ -8,254 +8,62 @@ new FormModel { } add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { "$layoutConstraints": "insets dialog,hidemode 3" - "$columnConstraints": "[grow,fill]" - "$rowConstraints": "[grow,fill]" + "$columnConstraints": "[][fill][fill]" + "$rowConstraints": "[][][]" } ) { name: "this" - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class com.jgoodies.forms.layout.FormLayout ) { - "$columnSpecs": "70dlu:grow, labelcompgap, 70dlu:grow" - "$rowSpecs": "pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref, linegap, default" - } ) { - name: "panel9" - "opaque": false - add( new FormComponent( "javax.swing.JLabel" ) { - name: "tabbedPaneLabel" - "text": "JideTabbedPane:" - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 1 - } ) - add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane1" - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel1" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label1" - "text": "TOP" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel2" - "border": &LineBorder0 new javax.swing.border.LineBorder( sfield java.awt.Color magenta, 1, false ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label2" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 1 - "gridY": 3 - } ) - add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane3" - "tabPlacement": 2 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel5" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label5" - "text": "LEFT" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel6" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label6" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 3 - "gridY": 3 - } ) - add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane2" - "tabPlacement": 3 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel3" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label3" - "text": "BOTTOM" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel4" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - "enabled": false - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label4" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridY": 5 - } ) - add( new FormContainer( "com.jidesoft.swing.JideTabbedPane", new FormLayoutManager( class javax.swing.JTabbedPane ) ) { - name: "tabbedPane4" - "tabPlacement": 4 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel7" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label7" - "text": "RIGHT" - } ) - }, new FormLayoutConstraints( null ) { - "title": "Tab 1" - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class java.awt.FlowLayout ) ) { - name: "panel8" - "border": #LineBorder0 - }, new FormLayoutConstraints( null ) { - "title": "Tab 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label8" - "text": "text" - }, new FormLayoutConstraints( null ) { - "title": "Tab 3" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 3 - "gridY": 5 - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "insets 0,hidemode 3" - "$columnConstraints": "[][][]" - "$rowConstraints": "[center]" - } ) { - name: "panel14" - "opaque": false - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "moreTabsCheckBox" - "text": "more tabs" - "mnemonic": 77 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "moreTabsChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "tabScrollCheckBox" - "text": "tabLayoutPolicy = SCROLL" - "mnemonic": 83 - "selected": true - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tabScrollChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0,alignx left,growx 0" - } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "hasFullBorderCheckBox" - "text": "JTabbedPane.hasFullBorder" - "mnemonic": 70 - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "hasFullBorderChanged", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 0,alignx left,growx 0" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridY": 7 - "gridWidth": 3 - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "insets 3 0 3 3,hidemode 3" - "$columnConstraints": "[fill][fill][fill]" - "$rowConstraints": "[][][]" - } ) { - name: "panel10" - add( new FormComponent( "javax.swing.JLabel" ) { - name: "jidePopupLabel" - "text": "JidePopup:" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) - add( new FormComponent( "javax.swing.JButton" ) { - name: "showJidePopupButton" - "text": "show JidePopup" - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopup", true ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 0" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "jidePopupMenuLabel" - "text": "JidePopupMenu:" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 1" - } ) - add( new FormComponent( "javax.swing.JButton" ) { - name: "showJidePopupMenuButton" - "text": "show JidePopupMenu" - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopupMenu", true ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 1" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "label9" - "text": "TristateCheckBox:" - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 2" - } ) - add( new FormComponent( "com.jidesoft.swing.TristateCheckBox" ) { - name: "tristateCheckBox1" - "text": "three states" - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tristateCheckBox1Changed", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 1 2" - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "triStateLabel1" - "text": "text" - "enabled": false - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 2 2" - } ) - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridY": 9 - } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "jidePopupLabel" + "text": "JidePopup:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 0" } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "showJidePopupButton" + "text": "show JidePopup" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopup", true ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 0" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "jidePopupMenuLabel" + "text": "JidePopupMenu:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "javax.swing.JButton" ) { + name: "showJidePopupMenuButton" + "text": "show JidePopupMenu" + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showJidePopupMenu", true ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "label9" + "text": "TristateCheckBox:" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2" + } ) + add( new FormComponent( "com.jidesoft.swing.TristateCheckBox" ) { + name: "tristateCheckBox1" + "text": "three states" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "tristateCheckBox1Changed", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "triStateLabel1" + "text": "text" + "enabled": false + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 2 2" + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) "size": new java.awt.Dimension( 500, 500 )