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; package com.formdev.flatlaf.testing.jideoss;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import com.formdev.flatlaf.testing.FlatTestFrame; import com.formdev.flatlaf.testing.FlatTestFrame;
import com.formdev.flatlaf.testing.FlatTestPanel; 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.plaf.LookAndFeelFactory;
import com.jidesoft.swing.RangeSlider; import com.jidesoft.swing.RangeSlider;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
@@ -48,82 +61,56 @@ public class FlatRangeSliderTest
private void initComponents() { private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN: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 tabbedPaneLabel = new JLabel();
JLabel horizontalLabel = new JLabel(); JLabel horizontalLabel = new JLabel();
horizontalRangeSlider = new RangeSlider(); horizontalRangeSlider = new RangeSlider();
JLabel verticalLabel = new JLabel(); JLabel verticalLabel = new JLabel();
verticalRangeSlider = new RangeSlider(); verticalRangeSlider = new RangeSlider();
JPanel configurationPanel = new JPanel();
paintTick = new JCheckBox(); paintTick = new JCheckBox();
paintLabel = new JCheckBox(); paintLabel = new JCheckBox();
//======== this ======== //======== 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( setLayout(new MigLayout(
"insets dialog,hidemode 3", "insets dialog,hidemode 3",
// columns // columns
"[grow,fill]", "[left]" +
"[fill]",
// rows // rows
"[grow,fill]")); "[fill]" +
"[center]" +
//======== mainPanel ======== "[grow,fill]" +
{ "[]"));
mainPanel.setOpaque(false);
mainPanel.setLayout(new FormLayout(
"70dlu:grow, $lcgap, 70dlu:grow",
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref"));
//---- tabbedPaneLabel ---- //---- tabbedPaneLabel ----
tabbedPaneLabel.setText("RangeSlider:"); tabbedPaneLabel.setText("RangeSlider:");
mainPanel.add(tabbedPaneLabel, CC.xy(1, 1)); add(tabbedPaneLabel, "cell 0 0");
//---- horizontalLabel ---- //---- horizontalLabel ----
horizontalLabel.setText("Horizontal"); horizontalLabel.setText("Horizontal");
mainPanel.add(horizontalLabel, CC.xy(1, 3)); add(horizontalLabel, "cell 0 1");
mainPanel.add(horizontalRangeSlider, CC.xy(3, 3)); add(horizontalRangeSlider, "cell 1 1");
//---- verticalLabel ---- //---- verticalLabel ----
verticalLabel.setText("Vertical"); verticalLabel.setText("Vertical");
mainPanel.add(verticalLabel, CC.xy(1, 5)); add(verticalLabel, "cell 0 2,aligny top,growy 0");
mainPanel.add(verticalRangeSlider, CC.xy(3, 5));
//======== configurationPanel ======== //---- verticalRangeSlider ----
{ verticalRangeSlider.setOrientation(SwingConstants.VERTICAL);
configurationPanel.setOpaque(false); add(verticalRangeSlider, "cell 1 2,alignx left,growx 0");
configurationPanel.setLayout(new MigLayout(
"insets 0,hidemode 3",
// columns
"[]" +
"[]" +
"[]",
// rows
"[center]"));
//---- paintTick ---- //---- paintTick ----
paintTick.setText("PaintTicks"); paintTick.setText("PaintTicks");
paintTick.setMnemonic('T'); paintTick.setMnemonic('T');
paintTick.setSelected(true); paintTick.setSelected(true);
paintTick.addActionListener(e -> paintTicks()); paintTick.addActionListener(e -> paintTicks());
configurationPanel.add(paintTick, "cell 0 0"); add(paintTick, "cell 0 3 2 1");
//---- paintLabel ---- //---- paintLabel ----
paintLabel.setText("PaintLabels"); paintLabel.setText("PaintLabels");
paintLabel.setMnemonic('L'); paintLabel.setMnemonic('L');
paintLabel.setSelected(true); paintLabel.setSelected(true);
paintLabel.addActionListener(e -> paintLabels()); paintLabel.addActionListener(e -> paintLabels());
configurationPanel.add(paintLabel, "cell 2 0,alignx left,growx 0"); add(paintLabel, "cell 0 3 2 1");
}
mainPanel.add(configurationPanel, CC.xywh(1, 7, 3, 1));
}
add(mainPanel, "cell 0 0");
// JFormDesigner - End of component initialization //GEN-END:initComponents // JFormDesigner - End of component initialization //GEN-END:initComponents
horizontalRangeSlider.setOrientation( SwingConstants.HORIZONTAL ); horizontalRangeSlider.setOrientation( SwingConstants.HORIZONTAL );
@@ -150,7 +137,6 @@ public class FlatRangeSliderTest
} }
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
// Generated using JFormDesigner Evaluation license - unknown
private RangeSlider horizontalRangeSlider; private RangeSlider horizontalRangeSlider;
private RangeSlider verticalRangeSlider; private RangeSlider verticalRangeSlider;
private JCheckBox paintTick; 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 { new FormModel {
contentType: "form/swing" contentType: "form/swing"
@@ -8,61 +8,45 @@ new FormModel {
} }
add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatTestPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets dialog,hidemode 3" "$layoutConstraints": "insets dialog,hidemode 3"
"$columnConstraints": "[grow,fill]" "$columnConstraints": "[left][fill]"
"$rowConstraints": "[grow,fill]" "$rowConstraints": "[fill][center][grow,fill][]"
} ) { } ) {
name: "this" 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" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "tabbedPaneLabel" name: "tabbedPaneLabel"
"text": "RangeSlider:" "text": "RangeSlider:"
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"gridX": 1 "value": "cell 0 0"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "horizontalLabel" name: "horizontalLabel"
"text": "Horizontal" "text": "Horizontal"
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"gridX": 1 "value": "cell 0 1"
"gridY": 3
} ) } )
add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) { add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) {
name: "horizontalRangeSlider" name: "horizontalRangeSlider"
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"gridX": 3 "value": "cell 1 1"
"gridY": 3
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "verticalLabel" name: "verticalLabel"
"text": "Vertical" "text": "Vertical"
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"gridX": 1 "value": "cell 0 2,aligny top,growy 0"
"gridY": 5
} ) } )
add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) { add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) {
name: "verticalRangeSlider" name: "verticalRangeSlider"
"orientation": 1
auxiliary() { auxiliary() {
"JavaCodeGenerator.variableLocal": false "JavaCodeGenerator.variableLocal": false
} }
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"gridY": 5 "value": "cell 1 2,alignx left,growx 0"
"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" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "paintTick" name: "paintTick"
"text": "PaintTicks" "text": "PaintTicks"
@@ -73,7 +57,7 @@ new FormModel {
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintTicks", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintTicks", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0" "value": "cell 0 3 2 1"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "paintLabel" name: "paintLabel"
@@ -85,14 +69,7 @@ new FormModel {
} }
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintLabels", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "paintLabels", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 0,alignx left,growx 0" "value": "cell 0 3 2 1"
} )
}, 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 ) { }, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 ) "location": new java.awt.Point( 0, 0 )