FlatSmoothScrollingTest:

- added small vertical line to indicate data points in chart
- added split pane to allow changing height of components
- Alt+C clears chart without moving focus to "Clear" button
- separate chart lines for smooth and non-smooth scrolling
This commit is contained in:
Karl Tauber
2023-06-05 23:48:17 +02:00
parent cf70cfb50c
commit e2e3fd31e9
2 changed files with 379 additions and 260 deletions

View File

@@ -70,6 +70,14 @@ public class FlatSmoothScrollingTest
KeyStroke.getKeyStroke( "alt " + (char) smoothScrollingCheckBox.getMnemonic() ), KeyStroke.getKeyStroke( "alt " + (char) smoothScrollingCheckBox.getMnemonic() ),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
// allow clearing chart with Alt+C without moving focus to button
registerKeyboardAction(
e -> {
clearChart();
},
KeyStroke.getKeyStroke( "alt " + (char) clearChartButton.getMnemonic() ),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
listLabel.setIcon( new ColorIcon( Color.red.darker() ) ); listLabel.setIcon( new ColorIcon( Color.red.darker() ) );
treeLabel.setIcon( new ColorIcon( Color.blue.darker() ) ); treeLabel.setIcon( new ColorIcon( Color.blue.darker() ) );
tableLabel.setIcon( new ColorIcon( Color.green.darker() ) ); tableLabel.setIcon( new ColorIcon( Color.green.darker() ) );
@@ -205,6 +213,9 @@ public class FlatSmoothScrollingTest
private void initComponents() { private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
smoothScrollingCheckBox = new JCheckBox(); smoothScrollingCheckBox = new JCheckBox();
splitPane1 = new JSplitPane();
splitPane2 = new JSplitPane();
panel1 = new JPanel();
listLabel = new JLabel(); listLabel = new JLabel();
treeLabel = new JLabel(); treeLabel = new JLabel();
tableLabel = new JLabel(); tableLabel = new JLabel();
@@ -216,6 +227,7 @@ public class FlatSmoothScrollingTest
tree = new JTree(); tree = new JTree();
tableScrollPane = new FlatSmoothScrollingTest.DebugScrollPane(); tableScrollPane = new FlatSmoothScrollingTest.DebugScrollPane();
table = new JTable(); table = new JTable();
panel2 = new JPanel();
textAreaLabel = new JLabel(); textAreaLabel = new JLabel();
textPaneLabel = new JLabel(); textPaneLabel = new JLabel();
editorPaneLabel = new JLabel(); editorPaneLabel = new JLabel();
@@ -228,7 +240,8 @@ public class FlatSmoothScrollingTest
editorPane = new JEditorPane(); editorPane = new JEditorPane();
customScrollPane = new FlatSmoothScrollingTest.DebugScrollPane(); customScrollPane = new FlatSmoothScrollingTest.DebugScrollPane();
button1 = new JButton(); button1 = new JButton();
scrollPane1 = new JScrollPane(); panel3 = new JPanel();
chartScrollPane = new JScrollPane();
lineChartPanel = new FlatSmoothScrollingTest.LineChartPanel(); lineChartPanel = new FlatSmoothScrollingTest.LineChartPanel();
label1 = new JLabel(); label1 = new JLabel();
updateChartDelayedCheckBox = new JCheckBox(); updateChartDelayedCheckBox = new JCheckBox();
@@ -238,17 +251,10 @@ public class FlatSmoothScrollingTest
setLayout(new MigLayout( setLayout(new MigLayout(
"ltr,insets dialog,hidemode 3", "ltr,insets dialog,hidemode 3",
// columns // columns
"[200,fill]" + "[200,grow,fill]",
"[200,fill]" +
"[200,fill]" +
"[200,fill]",
// rows // rows
"[]" + "[]" +
"[]" + "[grow,fill]" +
"[200,grow,fill]" +
"[]" +
"[200,grow,fill]" +
"[300,grow,fill]" +
"[]")); "[]"));
//---- smoothScrollingCheckBox ---- //---- smoothScrollingCheckBox ----
@@ -258,87 +264,125 @@ public class FlatSmoothScrollingTest
smoothScrollingCheckBox.addActionListener(e -> smoothScrollingChanged()); smoothScrollingCheckBox.addActionListener(e -> smoothScrollingChanged());
add(smoothScrollingCheckBox, "cell 0 0,alignx left,growx 0"); add(smoothScrollingCheckBox, "cell 0 0,alignx left,growx 0");
//======== splitPane1 ========
{
splitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitPane1.setResizeWeight(1.0);
//======== splitPane2 ========
{
splitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);
splitPane2.setResizeWeight(0.5);
//======== panel1 ========
{
panel1.setLayout(new MigLayout(
"ltr,insets 3,hidemode 3",
// columns
"[200,grow,fill]" +
"[200,grow,fill]" +
"[200,grow,fill]" +
"[200,grow,fill]",
// rows
"[]0" +
"[200,grow,fill]"));
//---- listLabel ---- //---- listLabel ----
listLabel.setText("JList:"); listLabel.setText("JList:");
listLabel.setHorizontalTextPosition(SwingConstants.LEADING); listLabel.setHorizontalTextPosition(SwingConstants.LEADING);
add(listLabel, "cell 0 1,aligny top,growy 0"); panel1.add(listLabel, "cell 0 0,aligny top,growy 0");
//---- treeLabel ---- //---- treeLabel ----
treeLabel.setText("JTree:"); treeLabel.setText("JTree:");
treeLabel.setHorizontalTextPosition(SwingConstants.LEADING); treeLabel.setHorizontalTextPosition(SwingConstants.LEADING);
add(treeLabel, "cell 1 1"); panel1.add(treeLabel, "cell 1 0");
//---- tableLabel ---- //---- tableLabel ----
tableLabel.setText("JTable:"); tableLabel.setText("JTable:");
tableLabel.setHorizontalTextPosition(SwingConstants.LEADING); tableLabel.setHorizontalTextPosition(SwingConstants.LEADING);
add(tableLabel, "cell 2 1 2 1"); panel1.add(tableLabel, "cell 2 0 2 1");
//---- showTableGridCheckBox ---- //---- showTableGridCheckBox ----
showTableGridCheckBox.setText("Show table grid"); showTableGridCheckBox.setText("Show table grid");
showTableGridCheckBox.setMnemonic('G'); showTableGridCheckBox.setMnemonic('G');
showTableGridCheckBox.addActionListener(e -> showTableGridChanged()); showTableGridCheckBox.addActionListener(e -> showTableGridChanged());
add(showTableGridCheckBox, "cell 2 1 2 1,alignx right,growx 0"); panel1.add(showTableGridCheckBox, "cell 2 0 2 1,alignx right,growx 0");
//---- autoResizeModeCheckBox ---- //---- autoResizeModeCheckBox ----
autoResizeModeCheckBox.setText("Auto-resize mode"); autoResizeModeCheckBox.setText("Auto-resize mode");
autoResizeModeCheckBox.setSelected(true); autoResizeModeCheckBox.setSelected(true);
autoResizeModeCheckBox.addActionListener(e -> autoResizeModeChanged()); autoResizeModeCheckBox.addActionListener(e -> autoResizeModeChanged());
add(autoResizeModeCheckBox, "cell 2 1 2 1,alignx right,growx 0"); panel1.add(autoResizeModeCheckBox, "cell 2 0 2 1,alignx right,growx 0");
//======== listScrollPane ======== //======== listScrollPane ========
{ {
listScrollPane.setViewportView(list); listScrollPane.setViewportView(list);
} }
add(listScrollPane, "cell 0 2,growx"); panel1.add(listScrollPane, "cell 0 1,growx");
//======== treeScrollPane ======== //======== treeScrollPane ========
{ {
treeScrollPane.setViewportView(tree); treeScrollPane.setViewportView(tree);
} }
add(treeScrollPane, "cell 1 2"); panel1.add(treeScrollPane, "cell 1 1");
//======== tableScrollPane ======== //======== tableScrollPane ========
{ {
tableScrollPane.setViewportView(table); tableScrollPane.setViewportView(table);
} }
add(tableScrollPane, "cell 2 2 2 1,width 100,height 100"); panel1.add(tableScrollPane, "cell 2 1 2 1,width 100,height 100");
}
splitPane2.setTopComponent(panel1);
//======== panel2 ========
{
panel2.setLayout(new MigLayout(
"ltr,insets 3,hidemode 3",
// columns
"[200,grow,fill]" +
"[200,grow,fill]" +
"[200,grow,fill]" +
"[200,grow,fill]",
// rows
"[]0" +
"[200,grow,fill]"));
//---- textAreaLabel ---- //---- textAreaLabel ----
textAreaLabel.setText("JTextArea:"); textAreaLabel.setText("JTextArea:");
textAreaLabel.setHorizontalTextPosition(SwingConstants.LEADING); textAreaLabel.setHorizontalTextPosition(SwingConstants.LEADING);
add(textAreaLabel, "cell 0 3"); panel2.add(textAreaLabel, "cell 0 0");
//---- textPaneLabel ---- //---- textPaneLabel ----
textPaneLabel.setText("JTextPane:"); textPaneLabel.setText("JTextPane:");
textPaneLabel.setHorizontalTextPosition(SwingConstants.LEADING); textPaneLabel.setHorizontalTextPosition(SwingConstants.LEADING);
add(textPaneLabel, "cell 1 3"); panel2.add(textPaneLabel, "cell 1 0");
//---- editorPaneLabel ---- //---- editorPaneLabel ----
editorPaneLabel.setText("JEditorPane:"); editorPaneLabel.setText("JEditorPane:");
editorPaneLabel.setHorizontalTextPosition(SwingConstants.LEADING); editorPaneLabel.setHorizontalTextPosition(SwingConstants.LEADING);
add(editorPaneLabel, "cell 2 3"); panel2.add(editorPaneLabel, "cell 2 0");
//---- customLabel ---- //---- customLabel ----
customLabel.setText("Custom:"); customLabel.setText("Custom:");
add(customLabel, "cell 3 3"); panel2.add(customLabel, "cell 3 0");
//======== textAreaScrollPane ======== //======== textAreaScrollPane ========
{ {
textAreaScrollPane.setViewportView(textArea); textAreaScrollPane.setViewportView(textArea);
} }
add(textAreaScrollPane, "cell 0 4"); panel2.add(textAreaScrollPane, "cell 0 1");
//======== textPaneScrollPane ======== //======== textPaneScrollPane ========
{ {
textPaneScrollPane.setViewportView(textPane); textPaneScrollPane.setViewportView(textPane);
} }
add(textPaneScrollPane, "cell 1 4"); panel2.add(textPaneScrollPane, "cell 1 1");
//======== editorPaneScrollPane ======== //======== editorPaneScrollPane ========
{ {
editorPaneScrollPane.setViewportView(editorPane); editorPaneScrollPane.setViewportView(editorPane);
} }
add(editorPaneScrollPane, "cell 2 4"); panel2.add(editorPaneScrollPane, "cell 2 1");
//======== customScrollPane ======== //======== customScrollPane ========
{ {
@@ -350,36 +394,56 @@ public class FlatSmoothScrollingTest
button1.setVerticalAlignment(SwingConstants.TOP); button1.setVerticalAlignment(SwingConstants.TOP);
customScrollPane.setViewportView(button1); customScrollPane.setViewportView(button1);
} }
add(customScrollPane, "cell 3 4"); panel2.add(customScrollPane, "cell 3 1");
//======== scrollPane1 ========
{
scrollPane1.putClientProperty("JScrollPane.smoothScrolling", false);
scrollPane1.setViewportView(lineChartPanel);
} }
add(scrollPane1, "cell 0 5 4 1,width 100"); splitPane2.setBottomComponent(panel2);
}
splitPane1.setTopComponent(splitPane2);
//======== panel3 ========
{
panel3.setLayout(new MigLayout(
"insets 3,hidemode 3",
// columns
"[grow,fill]",
// rows
"[300,grow,fill]"));
//======== chartScrollPane ========
{
chartScrollPane.putClientProperty("JScrollPane.smoothScrolling", false);
chartScrollPane.setViewportView(lineChartPanel);
}
panel3.add(chartScrollPane, "cell 0 0");
}
splitPane1.setBottomComponent(panel3);
}
add(splitPane1, "cell 0 1");
//---- label1 ---- //---- label1 ----
label1.setText("X: time (200ms per line) / Y: scroll bar value (10% per line)"); label1.setText("X: time (200ms per line) / Y: scroll bar value (10% per line)");
add(label1, "cell 0 6 4 1"); add(label1, "cell 0 2");
//---- updateChartDelayedCheckBox ---- //---- updateChartDelayedCheckBox ----
updateChartDelayedCheckBox.setText("Update chart delayed"); updateChartDelayedCheckBox.setText("Update chart delayed");
updateChartDelayedCheckBox.setMnemonic('U'); updateChartDelayedCheckBox.setMnemonic('U');
updateChartDelayedCheckBox.setSelected(true); updateChartDelayedCheckBox.setSelected(true);
updateChartDelayedCheckBox.addActionListener(e -> updateChartDelayedChanged()); updateChartDelayedCheckBox.addActionListener(e -> updateChartDelayedChanged());
add(updateChartDelayedCheckBox, "cell 0 6 4 1,alignx right,growx 0"); add(updateChartDelayedCheckBox, "cell 0 2,alignx right,growx 0");
//---- clearChartButton ---- //---- clearChartButton ----
clearChartButton.setText("Clear Chart"); clearChartButton.setText("Clear Chart");
clearChartButton.setMnemonic('C'); clearChartButton.setMnemonic('C');
clearChartButton.addActionListener(e -> clearChart()); clearChartButton.addActionListener(e -> clearChart());
add(clearChartButton, "cell 0 6 4 1,alignx right,growx 0"); add(clearChartButton, "cell 0 2,alignx right,growx 0");
// JFormDesigner - End of component initialization //GEN-END:initComponents // JFormDesigner - End of component initialization //GEN-END:initComponents
} }
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
private JCheckBox smoothScrollingCheckBox; private JCheckBox smoothScrollingCheckBox;
private JSplitPane splitPane1;
private JSplitPane splitPane2;
private JPanel panel1;
private JLabel listLabel; private JLabel listLabel;
private JLabel treeLabel; private JLabel treeLabel;
private JLabel tableLabel; private JLabel tableLabel;
@@ -391,6 +455,7 @@ public class FlatSmoothScrollingTest
private JTree tree; private JTree tree;
private FlatSmoothScrollingTest.DebugScrollPane tableScrollPane; private FlatSmoothScrollingTest.DebugScrollPane tableScrollPane;
private JTable table; private JTable table;
private JPanel panel2;
private JLabel textAreaLabel; private JLabel textAreaLabel;
private JLabel textPaneLabel; private JLabel textPaneLabel;
private JLabel editorPaneLabel; private JLabel editorPaneLabel;
@@ -403,7 +468,8 @@ public class FlatSmoothScrollingTest
private JEditorPane editorPane; private JEditorPane editorPane;
private FlatSmoothScrollingTest.DebugScrollPane customScrollPane; private FlatSmoothScrollingTest.DebugScrollPane customScrollPane;
private JButton button1; private JButton button1;
private JScrollPane scrollPane1; private JPanel panel3;
private JScrollPane chartScrollPane;
private FlatSmoothScrollingTest.LineChartPanel lineChartPanel; private FlatSmoothScrollingTest.LineChartPanel lineChartPanel;
private JLabel label1; private JLabel label1;
private JCheckBox updateChartDelayedCheckBox; private JCheckBox updateChartDelayedCheckBox;
@@ -416,13 +482,15 @@ public class FlatSmoothScrollingTest
implements ChangeListener implements ChangeListener
{ {
private final String name; private final String name;
private final Color chartColor; private final Color chartColor; // for smooth scrolling
private final Color chartColor2; // for non-smooth scrolling
private int count; private int count;
private long lastTime; private long lastTime;
ScrollBarChangeHandler( DebugScrollPane scrollPane, boolean vertical, String name, Color chartColor ) { ScrollBarChangeHandler( DebugScrollPane scrollPane, boolean vertical, String name, Color chartColor ) {
this.name = name; this.name = name;
this.chartColor = chartColor; this.chartColor = chartColor;
this.chartColor2 = chartColor.brighter();
// add change listener to viewport that is invoked from JViewport.setViewPosition() // add change listener to viewport that is invoked from JViewport.setViewPosition()
scrollPane.getViewport().addChangeListener( e -> { scrollPane.getViewport().addChangeListener( e -> {
@@ -439,8 +507,9 @@ public class FlatSmoothScrollingTest
@Override @Override
public void stateChanged( ChangeEvent e ) { public void stateChanged( ChangeEvent e ) {
DefaultBoundedRangeModel m = (DefaultBoundedRangeModel) e.getSource(); DefaultBoundedRangeModel m = (DefaultBoundedRangeModel) e.getSource();
boolean smoothScrolling = smoothScrollingCheckBox.isSelected();
lineChartPanel.addValue( getChartValue( m ), chartColor ); lineChartPanel.addValue( getChartValue( m ), smoothScrolling ? chartColor : chartColor2 );
long t = System.nanoTime() / 1000000; long t = System.nanoTime() / 1000000;
@@ -643,6 +712,8 @@ public class FlatSmoothScrollingTest
int px = 0; int px = 0;
int py = 0; int py = 0;
int pcount = 0; int pcount = 0;
int s1 = UIScale.scale( 1 );
int s3 = UIScale.scale( 3 );
g.setColor( chartColor ); g.setColor( chartColor );
@@ -656,16 +727,18 @@ public class FlatSmoothScrollingTest
int dotx = px; int dotx = px;
if( i > 0 && data.time > ptime + NEW_SEQUENCE_TIME_LAG ) if( i > 0 && data.time > ptime + NEW_SEQUENCE_TIME_LAG )
dotx += seqGapWidth; dotx += seqGapWidth;
int o = UIScale.scale( 1 ); g.fillRect( dotx - s1, dy - s1, s3, s3 );
int s = UIScale.scale( 3 );
g.fillRect( dotx - o, dy - o, s, s );
continue; continue;
} }
if( data.time > ptime + NEW_SEQUENCE_TIME_LAG ) { if( data.time > ptime + NEW_SEQUENCE_TIME_LAG ) {
if( !first && pcount == 0 ) if( !first && pcount == 0 ) {
g.drawLine( px, py, px + (int) (4 * scaleFactor), py ); g.drawLine( px, py, px + (int) (4 * scaleFactor), py );
// small vertical line to indicate data point
g.drawLine( px, py - s1, px, py + s1 );
}
// start new sequence // start new sequence
seqTime = data.time; seqTime = data.time;
seqX = !first ? px + seqGapWidth : 0; seqX = !first ? px + seqGapWidth : 0;
@@ -680,11 +753,16 @@ public class FlatSmoothScrollingTest
// line in sequence // line in sequence
int dx = (int) (seqX + (((data.time - seqTime) / 1000.) * secondWidth)); int dx = (int) (seqX + (((data.time - seqTime) / 1000.) * secondWidth));
g.drawLine( px, py, dx, dy ); g.drawLine( px, py, dx, dy );
px = dx;
pcount++;
if( isTemporaryValue ) if( isTemporaryValue )
g.setColor( chartColor ); g.setColor( chartColor );
// small vertical lines to indicate data point
g.drawLine( px, py - s1, px, py + s1 );
g.drawLine( dx, dy - s1, dx, dy + s1 );
px = dx;
pcount++;
} }
py = dy; py = dy;

View File

@@ -5,8 +5,8 @@ new FormModel {
root: new FormRoot { root: new FormRoot {
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": "ltr,insets dialog,hidemode 3" "$layoutConstraints": "ltr,insets dialog,hidemode 3"
"$columnConstraints": "[200,fill][200,fill][200,fill][200,fill]" "$columnConstraints": "[200,grow,fill]"
"$rowConstraints": "[][][200,grow,fill][][200,grow,fill][300,grow,fill][]" "$rowConstraints": "[][grow,fill][]"
} ) { } ) {
name: "this" name: "this"
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
@@ -18,26 +18,40 @@ new FormModel {
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 0,alignx left,growx 0" "value": "cell 0 0,alignx left,growx 0"
} ) } )
add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) {
name: "splitPane1"
"orientation": 0
"resizeWeight": 1.0
add( new FormContainer( "javax.swing.JSplitPane", new FormLayoutManager( class javax.swing.JSplitPane ) ) {
name: "splitPane2"
"orientation": 0
"resizeWeight": 0.5
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$columnConstraints": "[200,grow,fill][200,grow,fill][200,grow,fill][200,grow,fill]"
"$rowConstraints": "[]0[200,grow,fill]"
"$layoutConstraints": "ltr,insets 3,hidemode 3"
} ) {
name: "panel1"
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "listLabel" name: "listLabel"
"text": "JList:" "text": "JList:"
"horizontalTextPosition": 10 "horizontalTextPosition": 10
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1,aligny top,growy 0" "value": "cell 0 0,aligny top,growy 0"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "treeLabel" name: "treeLabel"
"text": "JTree:" "text": "JTree:"
"horizontalTextPosition": 10 "horizontalTextPosition": 10
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 1" "value": "cell 1 0"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "tableLabel" name: "tableLabel"
"text": "JTable:" "text": "JTable:"
"horizontalTextPosition": 10 "horizontalTextPosition": 10
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 1 2 1" "value": "cell 2 0 2 1"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "showTableGridCheckBox" name: "showTableGridCheckBox"
@@ -45,7 +59,7 @@ new FormModel {
"mnemonic": 71 "mnemonic": 71
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTableGridChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "showTableGridChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 1 2 1,alignx right,growx 0" "value": "cell 2 0 2 1,alignx right,growx 0"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "autoResizeModeCheckBox" name: "autoResizeModeCheckBox"
@@ -53,7 +67,7 @@ new FormModel {
"selected": true "selected": true
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "autoResizeModeChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "autoResizeModeChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 1 2 1,alignx right,growx 0" "value": "cell 2 0 2 1,alignx right,growx 0"
} ) } )
add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "listScrollPane" name: "listScrollPane"
@@ -65,7 +79,7 @@ new FormModel {
} }
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 2,growx" "value": "cell 0 1,growx"
} ) } )
add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "treeScrollPane" name: "treeScrollPane"
@@ -73,7 +87,7 @@ new FormModel {
name: "tree" name: "tree"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 2" "value": "cell 1 1"
} ) } )
add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "tableScrollPane" name: "tableScrollPane"
@@ -81,34 +95,43 @@ new FormModel {
name: "table" name: "table"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 2 2 1,width 100,height 100" "value": "cell 2 1 2 1,width 100,height 100"
} ) } )
}, new FormLayoutConstraints( class java.lang.String ) {
"value": "left"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$columnConstraints": "[200,grow,fill][200,grow,fill][200,grow,fill][200,grow,fill]"
"$rowConstraints": "[]0[200,grow,fill]"
"$layoutConstraints": "ltr,insets 3,hidemode 3"
} ) {
name: "panel2"
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "textAreaLabel" name: "textAreaLabel"
"text": "JTextArea:" "text": "JTextArea:"
"horizontalTextPosition": 10 "horizontalTextPosition": 10
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 3" "value": "cell 0 0"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "textPaneLabel" name: "textPaneLabel"
"text": "JTextPane:" "text": "JTextPane:"
"horizontalTextPosition": 10 "horizontalTextPosition": 10
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 3" "value": "cell 1 0"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "editorPaneLabel" name: "editorPaneLabel"
"text": "JEditorPane:" "text": "JEditorPane:"
"horizontalTextPosition": 10 "horizontalTextPosition": 10
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 3" "value": "cell 2 0"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "customLabel" name: "customLabel"
"text": "Custom:" "text": "Custom:"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 3" "value": "cell 3 0"
} ) } )
add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "textAreaScrollPane" name: "textAreaScrollPane"
@@ -116,7 +139,7 @@ new FormModel {
name: "textArea" name: "textArea"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 4" "value": "cell 0 1"
} ) } )
add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "textPaneScrollPane" name: "textPaneScrollPane"
@@ -124,7 +147,7 @@ new FormModel {
name: "textPane" name: "textPane"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 1 4" "value": "cell 1 1"
} ) } )
add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "editorPaneScrollPane" name: "editorPaneScrollPane"
@@ -132,7 +155,7 @@ new FormModel {
name: "editorPane" name: "editorPane"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 2 4" "value": "cell 2 1"
} ) } )
add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$DebugScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "customScrollPane" name: "customScrollPane"
@@ -144,22 +167,40 @@ new FormModel {
"verticalAlignment": 1 "verticalAlignment": 1
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 3 4" "value": "cell 3 1"
} ) } )
}, new FormLayoutConstraints( class java.lang.String ) {
"value": "right"
} )
}, new FormLayoutConstraints( class java.lang.String ) {
"value": "left"
} )
add( new FormContainer( "javax.swing.JPanel", new FormLayoutManager( class net.miginfocom.swing.MigLayout ) {
"$layoutConstraints": "insets 3,hidemode 3"
"$columnConstraints": "[grow,fill]"
"$rowConstraints": "[300,grow,fill]"
} ) {
name: "panel3"
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) { add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane1" name: "chartScrollPane"
"$client.JScrollPane.smoothScrolling": false "$client.JScrollPane.smoothScrolling": false
add( new FormComponent( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$LineChartPanel" ) { add( new FormComponent( "com.formdev.flatlaf.testing.FlatSmoothScrollingTest$LineChartPanel" ) {
name: "lineChartPanel" name: "lineChartPanel"
} ) } )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 5 4 1,width 100" "value": "cell 0 0"
} )
}, new FormLayoutConstraints( class java.lang.String ) {
"value": "right"
} )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 1"
} ) } )
add( new FormComponent( "javax.swing.JLabel" ) { add( new FormComponent( "javax.swing.JLabel" ) {
name: "label1" name: "label1"
"text": "X: time (200ms per line) / Y: scroll bar value (10% per line)" "text": "X: time (200ms per line) / Y: scroll bar value (10% per line)"
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 6 4 1" "value": "cell 0 2"
} ) } )
add( new FormComponent( "javax.swing.JCheckBox" ) { add( new FormComponent( "javax.swing.JCheckBox" ) {
name: "updateChartDelayedCheckBox" name: "updateChartDelayedCheckBox"
@@ -168,7 +209,7 @@ new FormModel {
"selected": true "selected": true
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "updateChartDelayedChanged", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "updateChartDelayedChanged", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 6 4 1,alignx right,growx 0" "value": "cell 0 2,alignx right,growx 0"
} ) } )
add( new FormComponent( "javax.swing.JButton" ) { add( new FormComponent( "javax.swing.JButton" ) {
name: "clearChartButton" name: "clearChartButton"
@@ -176,11 +217,11 @@ new FormModel {
"mnemonic": 67 "mnemonic": 67
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "clearChart", false ) ) addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "clearChart", false ) )
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) { }, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
"value": "cell 0 6 4 1,alignx right,growx 0" "value": "cell 0 2,alignx right,growx 0"
} ) } )
}, new FormLayoutConstraints( null ) { }, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 ) "location": new java.awt.Point( 0, 0 )
"size": new java.awt.Dimension( 790, 715 ) "size": new java.awt.Dimension( 875, 715 )
} ) } )
} }
} }