From 896e808db4e772bdcd7d2c8a845dbded9a1a326f Mon Sep 17 00:00:00 2001 From: Karl Tauber Date: Mon, 16 Nov 2020 22:19:09 +0100 Subject: [PATCH] JIDE: RangeSlider: removed nested panel from FlatRangeSliderTest --- .../testing/jideoss/FlatRangeSliderTest.java | 140 ++++++++--------- .../testing/jideoss/FlatRangeSliderTest.jfd | 141 ++++++++---------- 2 files changed, 122 insertions(+), 159 deletions(-) diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.java b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.java index 896ba05b..1b54b8ef 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.java +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.java @@ -1,15 +1,28 @@ +/* + * Copyright 2020 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 + * + * https://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 javax.swing.JCheckBox; import javax.swing.JLabel; -import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.UIManager; import com.formdev.flatlaf.testing.FlatTestFrame; import com.formdev.flatlaf.testing.FlatTestPanel; -import com.jgoodies.forms.factories.CC; -import com.jgoodies.forms.layout.FormLayout; import com.jidesoft.plaf.LookAndFeelFactory; import com.jidesoft.swing.RangeSlider; import net.miginfocom.swing.MigLayout; @@ -48,82 +61,56 @@ public class FlatRangeSliderTest private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents - // Generated using JFormDesigner Evaluation license - unknown - JPanel mainPanel = new JPanel(); - JLabel tabbedPaneLabel = new JLabel(); - JLabel horizontalLabel = new JLabel(); - horizontalRangeSlider = new RangeSlider(); - JLabel verticalLabel = new JLabel(); - verticalRangeSlider = new RangeSlider(); - JPanel configurationPanel = new JPanel(); - paintTick = new JCheckBox(); - paintLabel = new JCheckBox(); + JLabel tabbedPaneLabel = new JLabel(); + JLabel horizontalLabel = new JLabel(); + horizontalRangeSlider = new RangeSlider(); + JLabel verticalLabel = new JLabel(); + verticalRangeSlider = new RangeSlider(); + paintTick = new JCheckBox(); + paintLabel = new JCheckBox(); - //======== this ======== - setBorder (new javax. swing. border. CompoundBorder( new javax .swing .border .TitledBorder (new javax - . swing. border. EmptyBorder( 0, 0, 0, 0) , "JF\u006frmD\u0065sig\u006eer \u0045val\u0075ati\u006fn", javax. swing - . border. TitledBorder. CENTER, javax. swing. border. TitledBorder. BOTTOM, new java .awt . - Font ("Dia\u006cog" ,java .awt .Font .BOLD ,12 ), java. awt. Color. red - ) , getBorder( )) ); addPropertyChangeListener (new java. beans. PropertyChangeListener( ){ @Override - public void propertyChange (java .beans .PropertyChangeEvent e) {if ("\u0062ord\u0065r" .equals (e .getPropertyName ( - ) )) throw new RuntimeException( ); }} ); - setLayout(new MigLayout( - "insets dialog,hidemode 3", - // columns - "[grow,fill]", - // rows - "[grow,fill]")); + //======== this ======== + setLayout(new MigLayout( + "insets dialog,hidemode 3", + // columns + "[left]" + + "[fill]", + // rows + "[fill]" + + "[center]" + + "[grow,fill]" + + "[]")); - //======== mainPanel ======== - { - mainPanel.setOpaque(false); - mainPanel.setLayout(new FormLayout( - "70dlu:grow, $lcgap, 70dlu:grow", - "pref, 2*($lgap, fill:70dlu:grow), $lgap, pref")); + //---- tabbedPaneLabel ---- + tabbedPaneLabel.setText("RangeSlider:"); + add(tabbedPaneLabel, "cell 0 0"); - //---- tabbedPaneLabel ---- - tabbedPaneLabel.setText("RangeSlider:"); - mainPanel.add(tabbedPaneLabel, CC.xy(1, 1)); + //---- horizontalLabel ---- + horizontalLabel.setText("Horizontal"); + add(horizontalLabel, "cell 0 1"); + add(horizontalRangeSlider, "cell 1 1"); - //---- horizontalLabel ---- - horizontalLabel.setText("Horizontal"); - mainPanel.add(horizontalLabel, CC.xy(1, 3)); - mainPanel.add(horizontalRangeSlider, CC.xy(3, 3)); + //---- verticalLabel ---- + verticalLabel.setText("Vertical"); + add(verticalLabel, "cell 0 2,aligny top,growy 0"); - //---- verticalLabel ---- - verticalLabel.setText("Vertical"); - mainPanel.add(verticalLabel, CC.xy(1, 5)); - mainPanel.add(verticalRangeSlider, CC.xy(3, 5)); + //---- verticalRangeSlider ---- + verticalRangeSlider.setOrientation(SwingConstants.VERTICAL); + add(verticalRangeSlider, "cell 1 2,alignx left,growx 0"); - //======== configurationPanel ======== - { - configurationPanel.setOpaque(false); - configurationPanel.setLayout(new MigLayout( - "insets 0,hidemode 3", - // columns - "[]" + - "[]" + - "[]", - // rows - "[center]")); + //---- paintTick ---- + paintTick.setText("PaintTicks"); + paintTick.setMnemonic('T'); + paintTick.setSelected(true); + paintTick.addActionListener(e -> paintTicks()); + add(paintTick, "cell 0 3 2 1"); - //---- paintTick ---- - paintTick.setText("PaintTicks"); - paintTick.setMnemonic('T'); - paintTick.setSelected(true); - paintTick.addActionListener(e -> paintTicks()); - configurationPanel.add(paintTick, "cell 0 0"); - - //---- paintLabel ---- - paintLabel.setText("PaintLabels"); - paintLabel.setMnemonic('L'); - paintLabel.setSelected(true); - paintLabel.addActionListener(e -> paintLabels()); - configurationPanel.add(paintLabel, "cell 2 0,alignx left,growx 0"); - } - mainPanel.add(configurationPanel, CC.xywh(1, 7, 3, 1)); - } - add(mainPanel, "cell 0 0"); + //---- paintLabel ---- + paintLabel.setText("PaintLabels"); + paintLabel.setMnemonic('L'); + paintLabel.setSelected(true); + paintLabel.addActionListener(e -> paintLabels()); + add(paintLabel, "cell 0 3 2 1"); // JFormDesigner - End of component initialization //GEN-END:initComponents horizontalRangeSlider.setOrientation( SwingConstants.HORIZONTAL ); @@ -150,10 +137,9 @@ public class FlatRangeSliderTest } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables - // Generated using JFormDesigner Evaluation license - unknown - private RangeSlider horizontalRangeSlider; - private RangeSlider verticalRangeSlider; - private JCheckBox paintTick; - private JCheckBox paintLabel; + private RangeSlider horizontalRangeSlider; + private RangeSlider verticalRangeSlider; + private JCheckBox paintTick; + private JCheckBox paintLabel; // JFormDesigner - End of variables declaration //GEN-END:variables } diff --git a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.jfd b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.jfd index 58fe9188..2cef9f84 100644 --- a/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.jfd +++ b/flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/jideoss/FlatRangeSliderTest.jfd @@ -1,4 +1,4 @@ -JFDML JFormDesigner: "7.0.2.6.321" Java: "11.0.8" encoding: "UTF-8" +JFDML JFormDesigner: "7.0.2.0.298" Java: "15" encoding: "UTF-8" new FormModel { contentType: "form/swing" @@ -8,92 +8,69 @@ 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": "[left][fill]" + "$rowConstraints": "[fill][center][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: "mainPanel" - "opaque": false - add( new FormComponent( "javax.swing.JLabel" ) { - name: "tabbedPaneLabel" - "text": "RangeSlider:" - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 1 - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "horizontalLabel" - "text": "Horizontal" - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 1 - "gridY": 3 - } ) - add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) { - name: "horizontalRangeSlider" - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 3 - "gridY": 3 - } ) - add( new FormComponent( "javax.swing.JLabel" ) { - name: "verticalLabel" - "text": "Vertical" - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridX": 1 - "gridY": 5 - } ) - add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) { - name: "verticalRangeSlider" - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - }, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { - "gridY": 5 - "gridX": 3 - } ) - add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { - "$layoutConstraints": "insets 0,hidemode 3" - "$columnConstraints": "[][][]" - "$rowConstraints": "[center]" - } ) { - name: "configurationPanel" - "opaque": false - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "paintTick" - "text": "PaintTicks" - "mnemonic": 84 - "selected": true - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintTicks", false ) ) - }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { - "value": "cell 0 0" - } ) - add( new FormComponent( "javax.swing.JCheckBox" ) { - name: "paintLabel" - "text": "PaintLabels" - "mnemonic": 76 - "selected": true - auxiliary() { - "JavaCodeGenerator.variableLocal": false - } - addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintLabels", 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 FormComponent( "javax.swing.JLabel" ) { + name: "tabbedPaneLabel" + "text": "RangeSlider:" }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { "value": "cell 0 0" } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "horizontalLabel" + "text": "Horizontal" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 1" + } ) + add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) { + name: "horizontalRangeSlider" + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 1" + } ) + add( new FormComponent( "javax.swing.JLabel" ) { + name: "verticalLabel" + "text": "Vertical" + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 2,aligny top,growy 0" + } ) + add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) { + name: "verticalRangeSlider" + "orientation": 1 + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 1 2,alignx left,growx 0" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "paintTick" + "text": "PaintTicks" + "mnemonic": 84 + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintTicks", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3 2 1" + } ) + add( new FormComponent( "javax.swing.JCheckBox" ) { + name: "paintLabel" + "text": "PaintLabels" + "mnemonic": 76 + "selected": true + auxiliary() { + "JavaCodeGenerator.variableLocal": false + } + addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintLabels", false ) ) + }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { + "value": "cell 0 3 2 1" + } ) }, new FormLayoutConstraints( null ) { "location": new java.awt.Point( 0, 0 ) "size": new java.awt.Dimension( 550, 500 )