moved testing applications from src/test to new project flatlaf-testing (part 1)

This commit is contained in:
Karl Tauber
2019-10-23 16:00:40 +02:00
parent 6438e890bb
commit 62895a602f
20 changed files with 0 additions and 0 deletions

View File

@@ -1,324 +0,0 @@
/*
* 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.swingx;
import java.awt.*;
import java.util.Calendar;
import java.util.Date;
import javax.swing.*;
import net.miginfocom.swing.*;
import org.jdesktop.swingx.*;
import com.formdev.flatlaf.FlatTestFrame;
/**
* @author Karl Tauber
*/
public class FlatSwingXTest
extends JPanel
{
public static void main( String[] args ) {
SwingUtilities.invokeLater( () -> {
FlatTestFrame frame = FlatTestFrame.create( args, "FlatSwingXTest" );
frame.useApplyComponentOrientation = true;
frame.showFrame( new FlatSwingXTest() );
} );
}
FlatSwingXTest() {
initComponents();
Calendar calendar = Calendar.getInstance();
calendar.set( Calendar.DAY_OF_MONTH, 2 );
monthView1.setSelectionDate( calendar.getTime() );
calendar.set( Calendar.DAY_OF_MONTH, 9 );
monthView1.setFlaggedDates( calendar.getTime() );
calendar.set( Calendar.DAY_OF_MONTH, 16 );
monthView1.setUnselectableDates( calendar.getTime() );
}
private void busyChanged() {
boolean busy = busyCheckBox.isSelected();
xBusyLabel1.setBusy( busy );
xBusyLabel2.setBusy( busy );
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
JLabel label1 = new JLabel();
JLabel label3 = new JLabel();
JLabel datePickerLabel = new JLabel();
JXDatePicker xDatePicker1 = new JXDatePicker();
JXDatePicker xDatePicker2 = new JXDatePicker();
JLabel label4 = new JLabel();
JLabel label5 = new JLabel();
JXDatePicker xDatePicker3 = new JXDatePicker();
JXDatePicker xDatePicker4 = new JXDatePicker();
JLabel monthViewLabel = new JLabel();
monthView1 = new JXMonthView();
monthView2 = new JXMonthView();
JLabel hyperlinkLabel = new JLabel();
JXHyperlink xHyperlink1 = new JXHyperlink();
JXHyperlink xHyperlink2 = new JXHyperlink();
JLabel label2 = new JLabel();
xBusyLabel1 = new JXBusyLabel();
xBusyLabel2 = new JXBusyLabel();
busyCheckBox = new JCheckBox();
JPanel panel2 = new JPanel();
JLabel taskPaneContainerLabel = new JLabel();
JLabel taskPaneLabel = new JLabel();
JScrollPane scrollPane1 = new JScrollPane();
JXTaskPaneContainer xTaskPaneContainer1 = new JXTaskPaneContainer();
JXTaskPane xTaskPane3 = new JXTaskPane();
JXHyperlink xHyperlink3 = new JXHyperlink();
JXHyperlink xHyperlink4 = new JXHyperlink();
JXHyperlink xHyperlink5 = new JXHyperlink();
JXTaskPane xTaskPane4 = new JXTaskPane();
JXHyperlink xHyperlink6 = new JXHyperlink();
JXHyperlink xHyperlink7 = new JXHyperlink();
JXTaskPane xTaskPane5 = new JXTaskPane();
JXHyperlink xHyperlink8 = new JXHyperlink();
JXTaskPane xTaskPane6 = new JXTaskPane();
JXHyperlink xHyperlink9 = new JXHyperlink();
JXHyperlink xHyperlink10 = new JXHyperlink();
JLabel headerLabel = new JLabel();
JXHeader xHeader1 = new JXHeader();
//======== this ========
setLayout(new MigLayout(
"hidemode 3,ltr",
// columns
"[left]" +
"[]" +
"[]" +
"[fill]",
// rows
"[]0" +
"[]" +
"[]0" +
"[]" +
"[]" +
"[]" +
"[]" +
"[]"));
//---- label1 ----
label1.setText("enabled");
add(label1, "cell 1 0");
//---- label3 ----
label3.setText("disabled");
add(label3, "cell 2 0");
//---- datePickerLabel ----
datePickerLabel.setText("JXDatePicker:");
add(datePickerLabel, "cell 0 1");
add(xDatePicker1, "cell 1 1");
//---- xDatePicker2 ----
xDatePicker2.setEnabled(false);
add(xDatePicker2, "cell 2 1");
//---- label4 ----
label4.setText("not editable");
add(label4, "cell 1 2");
//---- label5 ----
label5.setText("not editable disabled");
add(label5, "cell 2 2");
//---- xDatePicker3 ----
xDatePicker3.setEditable(false);
add(xDatePicker3, "cell 1 3");
//---- xDatePicker4 ----
xDatePicker4.setEnabled(false);
xDatePicker4.setEditable(false);
add(xDatePicker4, "cell 2 3");
//---- monthViewLabel ----
monthViewLabel.setText("JXMonthView:");
add(monthViewLabel, "cell 0 4,aligny top,growy 0");
//---- monthView1 ----
monthView1.setTraversable(true);
monthView1.setShowingLeadingDays(true);
monthView1.setShowingTrailingDays(true);
monthView1.setShowingWeekNumber(true);
add(monthView1, "cell 1 4");
//---- monthView2 ----
monthView2.setTraversable(true);
monthView2.setShowingLeadingDays(true);
monthView2.setShowingTrailingDays(true);
monthView2.setShowingWeekNumber(true);
monthView2.setEnabled(false);
add(monthView2, "cell 2 4");
//---- hyperlinkLabel ----
hyperlinkLabel.setText("JXHyperlink:");
add(hyperlinkLabel, "cell 0 5");
//---- xHyperlink1 ----
xHyperlink1.setText("enabled");
add(xHyperlink1, "cell 1 5");
//---- xHyperlink2 ----
xHyperlink2.setText("disabled");
xHyperlink2.setEnabled(false);
add(xHyperlink2, "cell 2 5");
//---- label2 ----
label2.setText("JXBusyLabel:");
add(label2, "cell 0 6");
//---- xBusyLabel1 ----
xBusyLabel1.setText("enabled");
add(xBusyLabel1, "cell 1 6");
//---- xBusyLabel2 ----
xBusyLabel2.setText("disabled");
xBusyLabel2.setEnabled(false);
add(xBusyLabel2, "cell 2 6,growx");
//---- busyCheckBox ----
busyCheckBox.setText("busy");
busyCheckBox.setMnemonic('B');
busyCheckBox.addActionListener(e -> busyChanged());
add(busyCheckBox, "cell 2 6");
//======== panel2 ========
{
panel2.setLayout(new MigLayout(
"ltr,insets 0,hidemode 3",
// columns
"[fill]",
// rows
"[]" +
"[]" +
"[]"));
//---- taskPaneContainerLabel ----
taskPaneContainerLabel.setText("JXTaskPaneContainer:");
panel2.add(taskPaneContainerLabel, "cell 0 0");
//---- taskPaneLabel ----
taskPaneLabel.setText("JXTaskPane:");
panel2.add(taskPaneLabel, "cell 0 1");
//======== scrollPane1 ========
{
//======== xTaskPaneContainer1 ========
{
//======== xTaskPane3 ========
{
xTaskPane3.setTitle("Basic Tasks");
Container xTaskPane3ContentPane = xTaskPane3.getContentPane();
//---- xHyperlink3 ----
xHyperlink3.setText("New");
xTaskPane3ContentPane.add(xHyperlink3);
//---- xHyperlink4 ----
xHyperlink4.setText("Open");
xTaskPane3ContentPane.add(xHyperlink4);
//---- xHyperlink5 ----
xHyperlink5.setText("Save");
xTaskPane3ContentPane.add(xHyperlink5);
}
xTaskPaneContainer1.add(xTaskPane3);
//======== xTaskPane4 ========
{
xTaskPane4.setTitle("Other Tasks");
xTaskPane4.setIcon(UIManager.getIcon("Tree.closedIcon"));
Container xTaskPane4ContentPane = xTaskPane4.getContentPane();
//---- xHyperlink6 ----
xHyperlink6.setText("Duplicate");
xTaskPane4ContentPane.add(xHyperlink6);
//---- xHyperlink7 ----
xHyperlink7.setText("Delete");
xTaskPane4ContentPane.add(xHyperlink7);
}
xTaskPaneContainer1.add(xTaskPane4);
//======== xTaskPane5 ========
{
xTaskPane5.setTitle("Special Tasks");
xTaskPane5.setSpecial(true);
Container xTaskPane5ContentPane = xTaskPane5.getContentPane();
//---- xHyperlink8 ----
xHyperlink8.setText("Go to space");
xTaskPane5ContentPane.add(xHyperlink8);
}
xTaskPaneContainer1.add(xTaskPane5);
//======== xTaskPane6 ========
{
xTaskPane6.setTitle("Collapsed");
xTaskPane6.setCollapsed(true);
Container xTaskPane6ContentPane = xTaskPane6.getContentPane();
//---- xHyperlink9 ----
xHyperlink9.setText("text");
xTaskPane6ContentPane.add(xHyperlink9);
//---- xHyperlink10 ----
xHyperlink10.setText("text");
xTaskPane6ContentPane.add(xHyperlink10);
}
xTaskPaneContainer1.add(xTaskPane6);
}
scrollPane1.setViewportView(xTaskPaneContainer1);
}
panel2.add(scrollPane1, "cell 0 2,width 150,height 350");
}
add(panel2, "cell 3 0 1 8,aligny top,growy 0");
//---- headerLabel ----
headerLabel.setText("JXHeader:");
add(headerLabel, "cell 0 7,aligny top,growy 0");
//---- xHeader1 ----
xHeader1.setTitle("Title");
xHeader1.setDescription("Description\nMore description");
xHeader1.setIcon(new ImageIcon(getClass().getResource("/org/jdesktop/swingx/plaf/windows/resources/tipoftheday.png")));
add(xHeader1, "cell 1 7 2 1,width 200");
// JFormDesigner - End of component initialization //GEN-END:initComponents
xDatePicker1.setDate( new Date() );
xDatePicker2.setDate( new Date() );
xDatePicker3.setDate( new Date() );
xDatePicker4.setDate( new Date() );
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JXMonthView monthView1;
private JXMonthView monthView2;
private JXBusyLabel xBusyLabel1;
private JXBusyLabel xBusyLabel2;
private JCheckBox busyCheckBox;
// JFormDesigner - End of variables declaration //GEN-END:variables
}

View File

@@ -1,254 +0,0 @@
JFDML JFormDesigner: "7.0.0.0.194" Java: "11.0.2" encoding: "UTF-8"
new FormModel {
contentType: "form/swing"
root: new FormRoot {
auxiliary() {
"JavaCodeGenerator.defaultVariableLocal": true
}
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "hidemode 3,ltr"
"$columnConstraints": "[left][][][fill]"
"$rowConstraints": "[]0[][]0[][][][][]"
} ) {
name: "this"
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1"
"text": "enabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label3"
"text": "disabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "datePickerLabel"
"text": "JXDatePicker:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
add( new FormComponent( "org.jdesktop.swingx.JXDatePicker" ) {
name: "xDatePicker1"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1"
} )
add( new FormComponent( "org.jdesktop.swingx.JXDatePicker" ) {
name: "xDatePicker2"
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 1"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label4"
"text": "not editable"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label5"
"text": "not editable disabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 2"
} )
add( new FormComponent( "org.jdesktop.swingx.JXDatePicker" ) {
name: "xDatePicker3"
"editable": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 3"
} )
add( new FormComponent( "org.jdesktop.swingx.JXDatePicker" ) {
name: "xDatePicker4"
"enabled": false
"editable": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 3"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "monthViewLabel"
"text": "JXMonthView:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4,aligny top,growy 0"
} )
add( new FormComponent( "org.jdesktop.swingx.JXMonthView" ) {
name: "monthView1"
"traversable": true
"showingLeadingDays": true
"showingTrailingDays": true
"showingWeekNumber": true
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 4"
} )
add( new FormComponent( "org.jdesktop.swingx.JXMonthView" ) {
name: "monthView2"
"traversable": true
"showingLeadingDays": true
"showingTrailingDays": true
"showingWeekNumber": true
"enabled": false
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 4"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "hyperlinkLabel"
"text": "JXHyperlink:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 5"
} )
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink1"
"text": "enabled"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 5"
} )
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink2"
"text": "disabled"
"enabled": false
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 5"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label2"
"text": "JXBusyLabel:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 6"
} )
add( new FormComponent( "org.jdesktop.swingx.JXBusyLabel" ) {
name: "xBusyLabel1"
"text": "enabled"
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 6"
} )
add( new FormComponent( "org.jdesktop.swingx.JXBusyLabel" ) {
name: "xBusyLabel2"
"text": "disabled"
"enabled": false
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 6,growx"
} )
add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "busyCheckBox"
"text": "busy"
"mnemonic": 66
auxiliary() {
"JavaCodeGenerator.variableLocal": false
}
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "busyChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 6"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$columnConstraints": "[fill]"
"$rowConstraints": "[][][]"
"$layoutConstraints": "ltr,insets 0,hidemode 3"
} ) {
name: "panel2"
add( new FormComponent( "javax.swing.JLabel" ) {
name: "taskPaneContainerLabel"
"text": "JXTaskPaneContainer:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "taskPaneLabel"
"text": "JXTaskPane:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} )
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane1"
add( new FormContainer( "org.jdesktop.swingx.JXTaskPaneContainer", new FormLayoutManager( class com.jformdesigner.runtime.GenericIndexLayout ) ) {
name: "xTaskPaneContainer1"
add( new FormContainer( "org.jdesktop.swingx.JXTaskPane", new FormLayoutManager( class com.jformdesigner.runtime.GenericIndexLayout ) ) {
name: "xTaskPane3"
"title": "Basic Tasks"
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink3"
"text": "New"
} )
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink4"
"text": "Open"
} )
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink5"
"text": "Save"
} )
} )
add( new FormContainer( "org.jdesktop.swingx.JXTaskPane", new FormLayoutManager( class com.jformdesigner.runtime.GenericIndexLayout ) ) {
name: "xTaskPane4"
"title": "Other Tasks"
"icon": new com.jformdesigner.model.SwingIcon( 2, "Tree.closedIcon" )
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink6"
"text": "Duplicate"
} )
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink7"
"text": "Delete"
} )
} )
add( new FormContainer( "org.jdesktop.swingx.JXTaskPane", new FormLayoutManager( class com.jformdesigner.runtime.GenericIndexLayout ) ) {
name: "xTaskPane5"
"title": "Special Tasks"
"special": true
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink8"
"text": "Go to space"
} )
} )
add( new FormContainer( "org.jdesktop.swingx.JXTaskPane", new FormLayoutManager( class com.jformdesigner.runtime.GenericIndexLayout ) ) {
name: "xTaskPane6"
"title": "Collapsed"
"collapsed": true
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink9"
"text": "text"
} )
add( new FormComponent( "org.jdesktop.swingx.JXHyperlink" ) {
name: "xHyperlink10"
"text": "text"
} )
} )
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2,width 150,height 350"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 0 1 8,aligny top,growy 0"
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "headerLabel"
"text": "JXHeader:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 7,aligny top,growy 0"
} )
add( new FormComponent( "org.jdesktop.swingx.JXHeader" ) {
name: "xHeader1"
"title": "Title"
"description": "Description\nMore description"
"icon": new com.jformdesigner.model.SwingIcon( 0, "/org/jdesktop/swingx/plaf/windows/resources/tipoftheday.png" )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 7 2 1,width 200"
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 700, 600 )
} )
}
}

View File

@@ -1,71 +0,0 @@
#
# 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.
#
#---- BusyLabel ----
JXBusyLabel.baseColor=00ff00
JXBusyLabel.highlightColor=ff0000
#---- Header ----
JXHeader.background=ff8888
JXHeader.startBackground=ffcccc
JXHeader.titleForeground=0000ff
JXHeader.descriptionForeground=ff0000
#---- Hyperlink ----
Hyperlink.linkColor=ff0000
Hyperlink.visitedColor=0000ff
Hyperlink.disabledText=000088
#---- MonthView ----
JXMonthView.background=@textComponentBackground
JXMonthView.monthStringBackground=00ff00
JXMonthView.monthStringForeground=0000ff
JXMonthView.daysOfTheWeekForeground=00ff00
JXMonthView.weekOfTheYearForeground=0000ff
JXMonthView.unselectableDayForeground=0000ff
JXMonthView.selectedBackground=aaffaa
JXMonthView.flaggedDayForeground=00ffff
JXMonthView.leadingDayForeground=c0c0c0
JXMonthView.trailingDayForeground=c0c0c0
JXMonthView.arrowColor=0000ff
JXMonthView.disabledArrowColor=ABABAB
#---- TaskPaneContainer ----
TaskPaneContainer.background=ff8888
TaskPaneContainer.border=10,10,10,10
#---- TaskPane ----
TaskPane.background=00ff00
TaskPane.borderColor=0000ff
TaskPane.contentInsets=10,10,10,10
TaskPane.titleBackgroundGradientStart=ffff00
TaskPane.titleForeground=ff00ff
TaskPane.titleOver=0000aa
TaskPane.specialTitleBackground=00ffff
TaskPane.specialTitleForeground=444444
TaskPane.specialTitleOver=dd0000