mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 14:30:56 +03:00
FlatRangeSliderUI fix change label foreground
This commit is contained in:
@@ -8,6 +8,8 @@ import java.awt.Point;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.geom.Path2D;
|
import java.awt.geom.Path2D;
|
||||||
import java.awt.geom.RoundRectangle2D;
|
import java.awt.geom.RoundRectangle2D;
|
||||||
|
import java.util.Dictionary;
|
||||||
|
import java.util.Enumeration;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.JSlider;
|
import javax.swing.JSlider;
|
||||||
import javax.swing.LookAndFeel;
|
import javax.swing.LookAndFeel;
|
||||||
@@ -39,8 +41,40 @@ public class FlatRangeSliderUI
|
|||||||
return new FlatRangeSliderUI( slider );
|
return new FlatRangeSliderUI( slider );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void installUI( JComponent c ) {
|
||||||
|
super.installUI( c );
|
||||||
|
|
||||||
|
// update label UIs, which is necessary because RangeSlider does not invoke JSlider.updateLabelUIs()
|
||||||
|
updateLabelUIs( c );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uninstallUI( JComponent c ) {
|
||||||
|
// update label UIs also on uninstall to avoid light labels when switching
|
||||||
|
// from dark FlatLaf theme to another Laf
|
||||||
|
updateLabelUIs( c );
|
||||||
|
|
||||||
|
super.uninstallUI( c );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updateLabelUIs( JComponent c ) {
|
||||||
|
Dictionary<?,?> labelTable = ((JSlider)c).getLabelTable();
|
||||||
|
if( labelTable == null )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Enumeration<?> e = labelTable.elements();
|
||||||
|
while( e.hasMoreElements() ) {
|
||||||
|
JComponent label = (JComponent) e.nextElement();
|
||||||
|
label.updateUI();
|
||||||
|
label.setSize( label.getPreferredSize() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paint( Graphics g, JComponent c ) {
|
public void paint( Graphics g, JComponent c ) {
|
||||||
|
FlatUIUtils.setRenderingHints( (Graphics2D) g );
|
||||||
|
|
||||||
second = false;
|
second = false;
|
||||||
super.paint( g, c );
|
super.paint( g, c );
|
||||||
|
|
||||||
|
|||||||
@@ -36,11 +36,3 @@ JideTabbedPane.tabAreaInsets=$TabbedPane.tabAreaInsets
|
|||||||
JideTabbedPane.contentBorderInsets=0,0,0,0
|
JideTabbedPane.contentBorderInsets=0,0,0,0
|
||||||
JideTabbedPane.tabRunOverlay=$TabbedPane.tabRunOverlay
|
JideTabbedPane.tabRunOverlay=$TabbedPane.tabRunOverlay
|
||||||
JideTabbedPane.shadow=$TabbedPane.shadow
|
JideTabbedPane.shadow=$TabbedPane.shadow
|
||||||
|
|
||||||
|
|
||||||
#---- RangeSlider ----
|
|
||||||
|
|
||||||
RangeSliderUI.foreground=@background
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.formdev.flatlaf.testing.jideoss;
|
package com.formdev.flatlaf.testing.jideoss;
|
||||||
|
|
||||||
import com.jgoodies.forms.factories.*;
|
|
||||||
import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER;
|
import static com.formdev.flatlaf.FlatClientProperties.TABBED_PANE_HAS_FULL_BORDER;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
@@ -38,7 +37,7 @@ public class FlatJideOssTest
|
|||||||
{
|
{
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatRangeSliderTest" );
|
FlatTestFrame frame = FlatTestFrame.create( args, "FlatJideOssTest" );
|
||||||
LookAndFeelFactory.installJideExtension();
|
LookAndFeelFactory.installJideExtension();
|
||||||
frame.showFrame( FlatJideOssTest::new );
|
frame.showFrame( FlatJideOssTest::new );
|
||||||
|
|
||||||
@@ -107,238 +106,229 @@ public class FlatJideOssTest
|
|||||||
|
|
||||||
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 panel9 = new JPanel();
|
||||||
JPanel panel9 = new JPanel();
|
JLabel tabbedPaneLabel = new JLabel();
|
||||||
JLabel tabbedPaneLabel = new JLabel();
|
tabbedPane1 = new JideTabbedPane();
|
||||||
tabbedPane1 = new JideTabbedPane();
|
JPanel panel1 = new JPanel();
|
||||||
JPanel panel1 = new JPanel();
|
JLabel label1 = new JLabel();
|
||||||
JLabel label1 = new JLabel();
|
JPanel panel2 = new JPanel();
|
||||||
JPanel panel2 = new JPanel();
|
JLabel label2 = new JLabel();
|
||||||
JLabel label2 = new JLabel();
|
tabbedPane3 = new JideTabbedPane();
|
||||||
tabbedPane3 = new JideTabbedPane();
|
JPanel panel5 = new JPanel();
|
||||||
JPanel panel5 = new JPanel();
|
JLabel label5 = new JLabel();
|
||||||
JLabel label5 = new JLabel();
|
JPanel panel6 = new JPanel();
|
||||||
JPanel panel6 = new JPanel();
|
JLabel label6 = new JLabel();
|
||||||
JLabel label6 = new JLabel();
|
tabbedPane2 = new JideTabbedPane();
|
||||||
tabbedPane2 = new JideTabbedPane();
|
JPanel panel3 = new JPanel();
|
||||||
JPanel panel3 = new JPanel();
|
JLabel label3 = new JLabel();
|
||||||
JLabel label3 = new JLabel();
|
JPanel panel4 = new JPanel();
|
||||||
JPanel panel4 = new JPanel();
|
JLabel label4 = new JLabel();
|
||||||
JLabel label4 = new JLabel();
|
tabbedPane4 = new JideTabbedPane();
|
||||||
tabbedPane4 = new JideTabbedPane();
|
JPanel panel7 = new JPanel();
|
||||||
JPanel panel7 = new JPanel();
|
JLabel label7 = new JLabel();
|
||||||
JLabel label7 = new JLabel();
|
JPanel panel8 = new JPanel();
|
||||||
JPanel panel8 = new JPanel();
|
JLabel label8 = new JLabel();
|
||||||
JLabel label8 = new JLabel();
|
JPanel panel14 = new JPanel();
|
||||||
JPanel panel14 = new JPanel();
|
moreTabsCheckBox = new JCheckBox();
|
||||||
moreTabsCheckBox = new JCheckBox();
|
tabScrollCheckBox = new JCheckBox();
|
||||||
tabScrollCheckBox = new JCheckBox();
|
hasFullBorderCheckBox = new JCheckBox();
|
||||||
hasFullBorderCheckBox = new JCheckBox();
|
JPanel panel10 = new JPanel();
|
||||||
JPanel panel10 = new JPanel();
|
JLabel jidePopupLabel = new JLabel();
|
||||||
JLabel jidePopupLabel = new JLabel();
|
JButton showJidePopupButton = new JButton();
|
||||||
JButton showJidePopupButton = new JButton();
|
CellConstraints cc = new CellConstraints();
|
||||||
|
|
||||||
//======== this ========
|
//======== this ========
|
||||||
setBorder (new javax. swing. border. CompoundBorder( new javax .swing .border .TitledBorder (
|
setLayout(new MigLayout(
|
||||||
new javax. swing. border. EmptyBorder( 0, 0, 0, 0) , "JF\u006frmDes\u0069gner \u0045valua\u0074ion"
|
"insets dialog,hidemode 3",
|
||||||
, javax. swing. border. TitledBorder. CENTER, javax. swing. border. TitledBorder. BOTTOM
|
// columns
|
||||||
, new java .awt .Font ("D\u0069alog" ,java .awt .Font .BOLD ,12 )
|
"[grow,fill]",
|
||||||
, java. awt. Color. red) , getBorder( )) ); addPropertyChangeListener (
|
// rows
|
||||||
new java. beans. PropertyChangeListener( ){ @Override public void propertyChange (java .beans .PropertyChangeEvent e
|
"[grow,fill]"));
|
||||||
) {if ("\u0062order" .equals (e .getPropertyName () )) throw new RuntimeException( )
|
|
||||||
; }} );
|
|
||||||
setLayout(new MigLayout(
|
|
||||||
"insets dialog,hidemode 3",
|
|
||||||
// columns
|
|
||||||
"[grow,fill]",
|
|
||||||
// rows
|
|
||||||
"[grow,fill]"));
|
|
||||||
|
|
||||||
//======== panel9 ========
|
//======== panel9 ========
|
||||||
{
|
{
|
||||||
panel9.setOpaque(false);
|
panel9.setOpaque(false);
|
||||||
panel9.setLayout(new FormLayout(
|
panel9.setLayout(new FormLayout(
|
||||||
"70dlu:grow, $lcgap, 70dlu:grow",
|
"70dlu:grow, $lcgap, 70dlu:grow",
|
||||||
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref, $lgap, default"));
|
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref, $lgap, default"));
|
||||||
|
|
||||||
//---- tabbedPaneLabel ----
|
//---- tabbedPaneLabel ----
|
||||||
tabbedPaneLabel.setText("JideTabbedPane:");
|
tabbedPaneLabel.setText("JideTabbedPane:");
|
||||||
panel9.add(tabbedPaneLabel, CC.xy(1, 1));
|
panel9.add(tabbedPaneLabel, cc.xy(1, 1));
|
||||||
|
|
||||||
//======== tabbedPane1 ========
|
//======== tabbedPane1 ========
|
||||||
{
|
{
|
||||||
|
|
||||||
//======== panel1 ========
|
//======== panel1 ========
|
||||||
{
|
{
|
||||||
panel1.setLayout(new FlowLayout());
|
panel1.setLayout(new FlowLayout());
|
||||||
|
|
||||||
//---- label1 ----
|
//---- label1 ----
|
||||||
label1.setText("TOP");
|
label1.setText("TOP");
|
||||||
panel1.add(label1);
|
panel1.add(label1);
|
||||||
}
|
}
|
||||||
tabbedPane1.addTab("Tab 1", panel1);
|
tabbedPane1.addTab("Tab 1", panel1);
|
||||||
|
|
||||||
//======== panel2 ========
|
//======== panel2 ========
|
||||||
{
|
{
|
||||||
panel2.setBorder(new LineBorder(Color.magenta));
|
panel2.setBorder(new LineBorder(Color.magenta));
|
||||||
panel2.setLayout(new FlowLayout());
|
panel2.setLayout(new FlowLayout());
|
||||||
}
|
}
|
||||||
tabbedPane1.addTab("Tab 2", panel2);
|
tabbedPane1.addTab("Tab 2", panel2);
|
||||||
|
|
||||||
//---- label2 ----
|
//---- label2 ----
|
||||||
label2.setText("text");
|
label2.setText("text");
|
||||||
tabbedPane1.addTab("Tab 3", label2);
|
tabbedPane1.addTab("Tab 3", label2);
|
||||||
}
|
}
|
||||||
panel9.add(tabbedPane1, CC.xy(1, 3));
|
panel9.add(tabbedPane1, cc.xy(1, 3));
|
||||||
|
|
||||||
//======== tabbedPane3 ========
|
//======== tabbedPane3 ========
|
||||||
{
|
{
|
||||||
tabbedPane3.setTabPlacement(SwingConstants.LEFT);
|
tabbedPane3.setTabPlacement(SwingConstants.LEFT);
|
||||||
|
|
||||||
//======== panel5 ========
|
//======== panel5 ========
|
||||||
{
|
{
|
||||||
panel5.setLayout(new FlowLayout());
|
panel5.setLayout(new FlowLayout());
|
||||||
|
|
||||||
//---- label5 ----
|
//---- label5 ----
|
||||||
label5.setText("LEFT");
|
label5.setText("LEFT");
|
||||||
panel5.add(label5);
|
panel5.add(label5);
|
||||||
}
|
}
|
||||||
tabbedPane3.addTab("Tab 1", panel5);
|
tabbedPane3.addTab("Tab 1", panel5);
|
||||||
|
|
||||||
//======== panel6 ========
|
//======== panel6 ========
|
||||||
{
|
{
|
||||||
panel6.setBorder(new LineBorder(Color.magenta));
|
panel6.setBorder(new LineBorder(Color.magenta));
|
||||||
panel6.setLayout(new FlowLayout());
|
panel6.setLayout(new FlowLayout());
|
||||||
}
|
}
|
||||||
tabbedPane3.addTab("Tab 2", panel6);
|
tabbedPane3.addTab("Tab 2", panel6);
|
||||||
|
|
||||||
//---- label6 ----
|
//---- label6 ----
|
||||||
label6.setText("text");
|
label6.setText("text");
|
||||||
tabbedPane3.addTab("Tab 3", label6);
|
tabbedPane3.addTab("Tab 3", label6);
|
||||||
}
|
}
|
||||||
panel9.add(tabbedPane3, CC.xy(3, 3));
|
panel9.add(tabbedPane3, cc.xy(3, 3));
|
||||||
|
|
||||||
//======== tabbedPane2 ========
|
//======== tabbedPane2 ========
|
||||||
{
|
{
|
||||||
tabbedPane2.setTabPlacement(SwingConstants.BOTTOM);
|
tabbedPane2.setTabPlacement(SwingConstants.BOTTOM);
|
||||||
|
|
||||||
//======== panel3 ========
|
//======== panel3 ========
|
||||||
{
|
{
|
||||||
panel3.setLayout(new FlowLayout());
|
panel3.setLayout(new FlowLayout());
|
||||||
|
|
||||||
//---- label3 ----
|
//---- label3 ----
|
||||||
label3.setText("BOTTOM");
|
label3.setText("BOTTOM");
|
||||||
panel3.add(label3);
|
panel3.add(label3);
|
||||||
}
|
}
|
||||||
tabbedPane2.addTab("Tab 1", panel3);
|
tabbedPane2.addTab("Tab 1", panel3);
|
||||||
|
|
||||||
//======== panel4 ========
|
//======== panel4 ========
|
||||||
{
|
{
|
||||||
panel4.setBorder(new LineBorder(Color.magenta));
|
panel4.setBorder(new LineBorder(Color.magenta));
|
||||||
panel4.setLayout(new FlowLayout());
|
panel4.setLayout(new FlowLayout());
|
||||||
}
|
}
|
||||||
tabbedPane2.addTab("Tab 2", panel4);
|
tabbedPane2.addTab("Tab 2", panel4);
|
||||||
tabbedPane2.setEnabledAt(1, false);
|
tabbedPane2.setEnabledAt(1, false);
|
||||||
|
|
||||||
//---- label4 ----
|
//---- label4 ----
|
||||||
label4.setText("text");
|
label4.setText("text");
|
||||||
tabbedPane2.addTab("Tab 3", label4);
|
tabbedPane2.addTab("Tab 3", label4);
|
||||||
}
|
}
|
||||||
panel9.add(tabbedPane2, CC.xy(1, 5));
|
panel9.add(tabbedPane2, cc.xy(1, 5));
|
||||||
|
|
||||||
//======== tabbedPane4 ========
|
//======== tabbedPane4 ========
|
||||||
{
|
{
|
||||||
tabbedPane4.setTabPlacement(SwingConstants.RIGHT);
|
tabbedPane4.setTabPlacement(SwingConstants.RIGHT);
|
||||||
|
|
||||||
//======== panel7 ========
|
//======== panel7 ========
|
||||||
{
|
{
|
||||||
panel7.setLayout(new FlowLayout());
|
panel7.setLayout(new FlowLayout());
|
||||||
|
|
||||||
//---- label7 ----
|
//---- label7 ----
|
||||||
label7.setText("RIGHT");
|
label7.setText("RIGHT");
|
||||||
panel7.add(label7);
|
panel7.add(label7);
|
||||||
}
|
}
|
||||||
tabbedPane4.addTab("Tab 1", panel7);
|
tabbedPane4.addTab("Tab 1", panel7);
|
||||||
|
|
||||||
//======== panel8 ========
|
//======== panel8 ========
|
||||||
{
|
{
|
||||||
panel8.setBorder(new LineBorder(Color.magenta));
|
panel8.setBorder(new LineBorder(Color.magenta));
|
||||||
panel8.setLayout(new FlowLayout());
|
panel8.setLayout(new FlowLayout());
|
||||||
}
|
}
|
||||||
tabbedPane4.addTab("Tab 2", panel8);
|
tabbedPane4.addTab("Tab 2", panel8);
|
||||||
|
|
||||||
//---- label8 ----
|
//---- label8 ----
|
||||||
label8.setText("text");
|
label8.setText("text");
|
||||||
tabbedPane4.addTab("Tab 3", label8);
|
tabbedPane4.addTab("Tab 3", label8);
|
||||||
}
|
}
|
||||||
panel9.add(tabbedPane4, CC.xy(3, 5));
|
panel9.add(tabbedPane4, cc.xy(3, 5));
|
||||||
|
|
||||||
//======== panel14 ========
|
//======== panel14 ========
|
||||||
{
|
{
|
||||||
panel14.setOpaque(false);
|
panel14.setOpaque(false);
|
||||||
panel14.setLayout(new MigLayout(
|
panel14.setLayout(new MigLayout(
|
||||||
"insets 0,hidemode 3",
|
"insets 0,hidemode 3",
|
||||||
// columns
|
// columns
|
||||||
"[]" +
|
"[]" +
|
||||||
"[]" +
|
"[]" +
|
||||||
"[]",
|
"[]",
|
||||||
// rows
|
// rows
|
||||||
"[center]"));
|
"[center]"));
|
||||||
|
|
||||||
//---- moreTabsCheckBox ----
|
//---- moreTabsCheckBox ----
|
||||||
moreTabsCheckBox.setText("more tabs");
|
moreTabsCheckBox.setText("more tabs");
|
||||||
moreTabsCheckBox.setMnemonic('M');
|
moreTabsCheckBox.setMnemonic('M');
|
||||||
moreTabsCheckBox.addActionListener(e -> moreTabsChanged());
|
moreTabsCheckBox.addActionListener(e -> moreTabsChanged());
|
||||||
panel14.add(moreTabsCheckBox, "cell 0 0");
|
panel14.add(moreTabsCheckBox, "cell 0 0");
|
||||||
|
|
||||||
//---- tabScrollCheckBox ----
|
//---- tabScrollCheckBox ----
|
||||||
tabScrollCheckBox.setText("tabLayoutPolicy = SCROLL");
|
tabScrollCheckBox.setText("tabLayoutPolicy = SCROLL");
|
||||||
tabScrollCheckBox.setMnemonic('S');
|
tabScrollCheckBox.setMnemonic('S');
|
||||||
tabScrollCheckBox.setSelected(true);
|
tabScrollCheckBox.setSelected(true);
|
||||||
tabScrollCheckBox.addActionListener(e -> tabScrollChanged());
|
tabScrollCheckBox.addActionListener(e -> tabScrollChanged());
|
||||||
panel14.add(tabScrollCheckBox, "cell 1 0,alignx left,growx 0");
|
panel14.add(tabScrollCheckBox, "cell 1 0,alignx left,growx 0");
|
||||||
|
|
||||||
//---- hasFullBorderCheckBox ----
|
//---- hasFullBorderCheckBox ----
|
||||||
hasFullBorderCheckBox.setText("JTabbedPane.hasFullBorder");
|
hasFullBorderCheckBox.setText("JTabbedPane.hasFullBorder");
|
||||||
hasFullBorderCheckBox.setMnemonic('F');
|
hasFullBorderCheckBox.setMnemonic('F');
|
||||||
hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged());
|
hasFullBorderCheckBox.addActionListener(e -> hasFullBorderChanged());
|
||||||
panel14.add(hasFullBorderCheckBox, "cell 2 0,alignx left,growx 0");
|
panel14.add(hasFullBorderCheckBox, "cell 2 0,alignx left,growx 0");
|
||||||
}
|
}
|
||||||
panel9.add(panel14, CC.xywh(1, 7, 3, 1));
|
panel9.add(panel14, cc.xywh(1, 7, 3, 1));
|
||||||
|
|
||||||
//======== panel10 ========
|
//======== panel10 ========
|
||||||
{
|
{
|
||||||
panel10.setLayout(new MigLayout(
|
panel10.setLayout(new MigLayout(
|
||||||
"insets 3 0 3 3,hidemode 3",
|
"insets 3 0 3 3,hidemode 3",
|
||||||
// columns
|
// columns
|
||||||
"[fill]" +
|
"[fill]" +
|
||||||
"[fill]",
|
"[fill]",
|
||||||
// rows
|
// rows
|
||||||
"[]"));
|
"[]"));
|
||||||
|
|
||||||
//---- jidePopupLabel ----
|
//---- jidePopupLabel ----
|
||||||
jidePopupLabel.setText("JidePopup:");
|
jidePopupLabel.setText("JidePopup:");
|
||||||
panel10.add(jidePopupLabel, "cell 0 0");
|
panel10.add(jidePopupLabel, "cell 0 0");
|
||||||
|
|
||||||
//---- showJidePopupButton ----
|
//---- showJidePopupButton ----
|
||||||
showJidePopupButton.setText("show JidePopup");
|
showJidePopupButton.setText("show JidePopup");
|
||||||
showJidePopupButton.addActionListener(e -> showJidePopupButtonActionPerformed(e));
|
showJidePopupButton.addActionListener(e -> showJidePopupButtonActionPerformed(e));
|
||||||
panel10.add(showJidePopupButton, "cell 1 0");
|
panel10.add(showJidePopupButton, "cell 1 0");
|
||||||
}
|
}
|
||||||
panel9.add(panel10, CC.xy(1, 9));
|
panel9.add(panel10, cc.xy(1, 9));
|
||||||
}
|
}
|
||||||
add(panel9, "cell 0 0");
|
add(panel9, "cell 0 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
|
||||||
// Generated using JFormDesigner Evaluation license - unknown
|
private JideTabbedPane tabbedPane1;
|
||||||
private JideTabbedPane tabbedPane1;
|
private JideTabbedPane tabbedPane3;
|
||||||
private JideTabbedPane tabbedPane3;
|
private JideTabbedPane tabbedPane2;
|
||||||
private JideTabbedPane tabbedPane2;
|
private JideTabbedPane tabbedPane4;
|
||||||
private JideTabbedPane tabbedPane4;
|
private JCheckBox moreTabsCheckBox;
|
||||||
private JCheckBox moreTabsCheckBox;
|
private JCheckBox tabScrollCheckBox;
|
||||||
private JCheckBox tabScrollCheckBox;
|
private JCheckBox hasFullBorderCheckBox;
|
||||||
private JCheckBox hasFullBorderCheckBox;
|
|
||||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package com.formdev.flatlaf.testing.jideoss;
|
package com.formdev.flatlaf.testing.jideoss;
|
||||||
|
|
||||||
import java.awt.event.*;
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JPanel;
|
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 javax.swing.event.*;
|
|
||||||
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.factories.CC;
|
||||||
@@ -20,9 +18,6 @@ public class FlatRangeSliderTest
|
|||||||
extends FlatTestPanel
|
extends FlatTestPanel
|
||||||
{
|
{
|
||||||
|
|
||||||
private RangeSlider horizontalRangeSlider;
|
|
||||||
private RangeSlider verticalRangeSlider;
|
|
||||||
|
|
||||||
public static void main( String[] args ) {
|
public static void main( String[] args ) {
|
||||||
SwingUtilities.invokeLater( () -> {
|
SwingUtilities.invokeLater( () -> {
|
||||||
FlatTestFrame frame = FlatTestFrame.create( args, "FlatRangeSliderTest" );
|
FlatTestFrame frame = FlatTestFrame.create( args, "FlatRangeSliderTest" );
|
||||||
@@ -54,22 +49,24 @@ 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
|
// Generated using JFormDesigner Evaluation license - unknown
|
||||||
JPanel panel9 = new JPanel();
|
JPanel mainPanel = new JPanel();
|
||||||
JLabel tabbedPaneLabel = new JLabel();
|
JLabel tabbedPaneLabel = new JLabel();
|
||||||
JLabel label1 = new JLabel();
|
JLabel horizontalLabel = new JLabel();
|
||||||
horizontalRangeSlider = new RangeSlider();
|
horizontalRangeSlider = new RangeSlider();
|
||||||
JLabel label2 = new JLabel();
|
JLabel verticalLabel = new JLabel();
|
||||||
verticalRangeSlider = new RangeSlider();
|
verticalRangeSlider = new RangeSlider();
|
||||||
JPanel panel14 = new JPanel();
|
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
|
setBorder (new javax. swing. border. CompoundBorder( new javax .swing .border .TitledBorder (new javax
|
||||||
,0,0,0), "JF\u006frm\u0044es\u0069gn\u0065r \u0045va\u006cua\u0074io\u006e",javax.swing.border.TitledBorder.CENTER,javax.swing.border.TitledBorder.BOTTOM
|
. swing. border. EmptyBorder( 0, 0, 0, 0) , "JF\u006frmD\u0065sig\u006eer \u0045val\u0075ati\u006fn", javax. swing
|
||||||
,new java.awt.Font("D\u0069al\u006fg",java.awt.Font.BOLD,12),java.awt.Color.red),
|
. border. TitledBorder. CENTER, javax. swing. border. TitledBorder. BOTTOM, new java .awt .
|
||||||
getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener(){@Override public void propertyChange(java.beans.PropertyChangeEvent e
|
Font ("Dia\u006cog" ,java .awt .Font .BOLD ,12 ), java. awt. Color. red
|
||||||
){if("\u0062or\u0064er".equals(e.getPropertyName()))throw new RuntimeException();}});
|
) , 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
|
||||||
@@ -77,31 +74,31 @@ public class FlatRangeSliderTest
|
|||||||
// rows
|
// rows
|
||||||
"[grow,fill]"));
|
"[grow,fill]"));
|
||||||
|
|
||||||
//======== panel9 ========
|
//======== mainPanel ========
|
||||||
{
|
{
|
||||||
panel9.setOpaque(false);
|
mainPanel.setOpaque(false);
|
||||||
panel9.setLayout(new FormLayout(
|
mainPanel.setLayout(new FormLayout(
|
||||||
"70dlu:grow, $lcgap, 70dlu:grow",
|
"70dlu:grow, $lcgap, 70dlu:grow",
|
||||||
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref"));
|
"pref, 2*($lgap, fill:70dlu:grow), $lgap, pref"));
|
||||||
|
|
||||||
//---- tabbedPaneLabel ----
|
//---- tabbedPaneLabel ----
|
||||||
tabbedPaneLabel.setText("RangeSlider:");
|
tabbedPaneLabel.setText("RangeSlider:");
|
||||||
panel9.add(tabbedPaneLabel, CC.xy(1, 1));
|
mainPanel.add(tabbedPaneLabel, CC.xy(1, 1));
|
||||||
|
|
||||||
//---- label1 ----
|
//---- horizontalLabel ----
|
||||||
label1.setText("Horizontal");
|
horizontalLabel.setText("Horizontal");
|
||||||
panel9.add(label1, CC.xy(1, 3));
|
mainPanel.add(horizontalLabel, CC.xy(1, 3));
|
||||||
panel9.add(horizontalRangeSlider, CC.xy(3, 3));
|
mainPanel.add(horizontalRangeSlider, CC.xy(3, 3));
|
||||||
|
|
||||||
//---- label2 ----
|
//---- verticalLabel ----
|
||||||
label2.setText("Vertical");
|
verticalLabel.setText("Vertical");
|
||||||
panel9.add(label2, CC.xy(1, 5));
|
mainPanel.add(verticalLabel, CC.xy(1, 5));
|
||||||
panel9.add(verticalRangeSlider, CC.xy(3, 5));
|
mainPanel.add(verticalRangeSlider, CC.xy(3, 5));
|
||||||
|
|
||||||
//======== panel14 ========
|
//======== configurationPanel ========
|
||||||
{
|
{
|
||||||
panel14.setOpaque(false);
|
configurationPanel.setOpaque(false);
|
||||||
panel14.setLayout(new MigLayout(
|
configurationPanel.setLayout(new MigLayout(
|
||||||
"insets 0,hidemode 3",
|
"insets 0,hidemode 3",
|
||||||
// columns
|
// columns
|
||||||
"[]" +
|
"[]" +
|
||||||
@@ -112,19 +109,21 @@ public class FlatRangeSliderTest
|
|||||||
|
|
||||||
//---- paintTick ----
|
//---- paintTick ----
|
||||||
paintTick.setText("PaintTicks");
|
paintTick.setText("PaintTicks");
|
||||||
paintTick.setMnemonic('M');
|
paintTick.setMnemonic('T');
|
||||||
|
paintTick.setSelected(true);
|
||||||
paintTick.addActionListener(e -> paintTicks());
|
paintTick.addActionListener(e -> paintTicks());
|
||||||
panel14.add(paintTick, "cell 0 0");
|
configurationPanel.add(paintTick, "cell 0 0");
|
||||||
|
|
||||||
//---- paintLabel ----
|
//---- paintLabel ----
|
||||||
paintLabel.setText("PaintLabels");
|
paintLabel.setText("PaintLabels");
|
||||||
paintLabel.setMnemonic('F');
|
paintLabel.setMnemonic('L');
|
||||||
|
paintLabel.setSelected(true);
|
||||||
paintLabel.addActionListener(e -> paintLabels());
|
paintLabel.addActionListener(e -> paintLabels());
|
||||||
panel14.add(paintLabel, "cell 2 0,alignx left,growx 0");
|
configurationPanel.add(paintLabel, "cell 2 0,alignx left,growx 0");
|
||||||
}
|
}
|
||||||
panel9.add(panel14, CC.xywh(1, 7, 3, 1));
|
mainPanel.add(configurationPanel, CC.xywh(1, 7, 3, 1));
|
||||||
}
|
}
|
||||||
add(panel9, "cell 0 0");
|
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 );
|
||||||
@@ -152,6 +151,8 @@ 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
|
// Generated using JFormDesigner Evaluation license - unknown
|
||||||
|
private RangeSlider horizontalRangeSlider;
|
||||||
|
private RangeSlider verticalRangeSlider;
|
||||||
private JCheckBox paintTick;
|
private JCheckBox paintTick;
|
||||||
private JCheckBox paintLabel;
|
private JCheckBox paintLabel;
|
||||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ new FormModel {
|
|||||||
"$columnSpecs": "70dlu:grow, labelcompgap, 70dlu:grow"
|
"$columnSpecs": "70dlu:grow, labelcompgap, 70dlu:grow"
|
||||||
"$rowSpecs": "pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref"
|
"$rowSpecs": "pref, linegap, fill:70dlu:grow, linegap, fill:70dlu:grow, linegap, pref"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel9"
|
name: "mainPanel"
|
||||||
"opaque": false
|
"opaque": false
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "tabbedPaneLabel"
|
name: "tabbedPaneLabel"
|
||||||
@@ -25,7 +25,7 @@ new FormModel {
|
|||||||
"gridX": 1
|
"gridX": 1
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "label1"
|
name: "horizontalLabel"
|
||||||
"text": "Horizontal"
|
"text": "Horizontal"
|
||||||
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
||||||
"gridX": 1
|
"gridX": 1
|
||||||
@@ -33,12 +33,15 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) {
|
add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) {
|
||||||
name: "horizontalRangeSlider"
|
name: "horizontalRangeSlider"
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
||||||
"gridX": 3
|
"gridX": 3
|
||||||
"gridY": 3
|
"gridY": 3
|
||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JLabel" ) {
|
add( new FormComponent( "javax.swing.JLabel" ) {
|
||||||
name: "label2"
|
name: "verticalLabel"
|
||||||
"text": "Vertical"
|
"text": "Vertical"
|
||||||
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
||||||
"gridX": 1
|
"gridX": 1
|
||||||
@@ -46,6 +49,9 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) {
|
add( new FormComponent( "com.jidesoft.swing.RangeSlider" ) {
|
||||||
name: "verticalRangeSlider"
|
name: "verticalRangeSlider"
|
||||||
|
auxiliary() {
|
||||||
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
}
|
||||||
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
}, new FormLayoutConstraints( class com.jgoodies.forms.layout.CellConstraints ) {
|
||||||
"gridY": 5
|
"gridY": 5
|
||||||
"gridX": 3
|
"gridX": 3
|
||||||
@@ -55,12 +61,13 @@ new FormModel {
|
|||||||
"$columnConstraints": "[][][]"
|
"$columnConstraints": "[][][]"
|
||||||
"$rowConstraints": "[center]"
|
"$rowConstraints": "[center]"
|
||||||
} ) {
|
} ) {
|
||||||
name: "panel14"
|
name: "configurationPanel"
|
||||||
"opaque": false
|
"opaque": false
|
||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "paintTick"
|
name: "paintTick"
|
||||||
"text": "PaintTicks"
|
"text": "PaintTicks"
|
||||||
"mnemonic": 77
|
"mnemonic": 84
|
||||||
|
"selected": true
|
||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
@@ -71,7 +78,8 @@ new FormModel {
|
|||||||
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
add( new FormComponent( "javax.swing.JCheckBox" ) {
|
||||||
name: "paintLabel"
|
name: "paintLabel"
|
||||||
"text": "PaintLabels"
|
"text": "PaintLabels"
|
||||||
"mnemonic": 70
|
"mnemonic": 76
|
||||||
|
"selected": true
|
||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user