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