JIDE: RangeSlider: removed nested panel from FlatRangeSliderTest

This commit is contained in:
Karl Tauber
2020-11-16 22:19:09 +01:00
parent 6fe6d1ffa0
commit 896e808db4
2 changed files with 122 additions and 159 deletions

View File

@@ -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();
//======== 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]",
"[left]" +
"[fill]",
// rows
"[grow,fill]"));
//======== mainPanel ========
{
mainPanel.setOpaque(false);
mainPanel.setLayout(new FormLayout(
"70dlu:grow, $lcgap, 70dlu:grow",
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref"));
"[fill]" +
"[center]" +
"[grow,fill]" +
"[]"));
//---- tabbedPaneLabel ----
tabbedPaneLabel.setText("RangeSlider:");
mainPanel.add(tabbedPaneLabel, CC.xy(1, 1));
add(tabbedPaneLabel, "cell 0 0");
//---- horizontalLabel ----
horizontalLabel.setText("Horizontal");
mainPanel.add(horizontalLabel, CC.xy(1, 3));
mainPanel.add(horizontalRangeSlider, CC.xy(3, 3));
add(horizontalLabel, "cell 0 1");
add(horizontalRangeSlider, "cell 1 1");
//---- verticalLabel ----
verticalLabel.setText("Vertical");
mainPanel.add(verticalLabel, CC.xy(1, 5));
mainPanel.add(verticalRangeSlider, CC.xy(3, 5));
add(verticalLabel, "cell 0 2,aligny top,growy 0");
//======== configurationPanel ========
{
configurationPanel.setOpaque(false);
configurationPanel.setLayout(new MigLayout(
"insets 0,hidemode 3",
// columns
"[]" +
"[]" +
"[]",
// rows
"[center]"));
//---- verticalRangeSlider ----
verticalRangeSlider.setOrientation(SwingConstants.VERTICAL);
add(verticalRangeSlider, "cell 1 2,alignx left,growx 0");
//---- paintTick ----
paintTick.setText("PaintTicks");
paintTick.setMnemonic('T');
paintTick.setSelected(true);
paintTick.addActionListener(e -> paintTicks());
configurationPanel.add(paintTick, "cell 0 0");
add(paintTick, "cell 0 3 2 1");
//---- 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");
add(paintLabel, "cell 0 3 2 1");
// JFormDesigner - End of component initialization //GEN-END:initComponents
horizontalRangeSlider.setOrientation( SwingConstants.HORIZONTAL );
@@ -150,7 +137,6 @@ 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;

View File

@@ -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,61 +8,45 @@ 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
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "horizontalLabel"
"text": "Horizontal"
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
"gridX": 1
"gridY": 3
}, 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 com.jgoodies.forms.layout.CellConstraints ) {
"gridX": 3
"gridY": 3
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "verticalLabel"
"text": "Vertical"
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
"gridX": 1
"gridY": 5
}, 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 com.jgoodies.forms.layout.CellConstraints ) {
"gridY": 5
"gridX": 3
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2,alignx left,growx 0"
} )
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"
@@ -73,7 +57,7 @@ new FormModel {
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintTicks", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
"value": "cell 0 3 2 1"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "paintLabel"
@@ -85,14 +69,7 @@ new FormModel {
}
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
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
"value": "cell 0 3 2 1"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )