|
|
|
@ -3,17 +3,13 @@ package com.fr.design.mainframe;
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
|
import com.formdev.flatlaf.FlatDarculaLaf; |
|
|
|
|
import com.formdev.flatlaf.ui.FlatUIUtils; |
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.islider.UISlider; |
|
|
|
|
import com.fr.design.gui.itextfield.UINumberField; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JFrame; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
@ -25,7 +21,6 @@ import java.awt.EventQueue;
|
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
|
import java.awt.Graphics; |
|
|
|
|
import java.awt.Graphics2D; |
|
|
|
|
import java.awt.Image; |
|
|
|
|
import java.awt.Point; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
@ -37,13 +32,14 @@ import java.awt.event.MouseEvent;
|
|
|
|
|
import java.awt.geom.Path2D; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
|
|
import static com.fine.theme.utils.FineClientProperties.setStyle; |
|
|
|
|
import static com.fine.theme.utils.FineUIStyle.LIGHT_GREY; |
|
|
|
|
import static com.fine.theme.utils.FineUIStyle.setStyle; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Created by MoMeak on 2017/7/13. |
|
|
|
|
*/ |
|
|
|
|
public class JFormSliderPane extends JPanel { |
|
|
|
|
public static final Image APPFIT_V0 = BaseUtils.readImage("com/fr/design/images/control/icon_thumb_normal.png"); |
|
|
|
|
|
|
|
|
|
private static final double ONEPOINTEIGHT = 1.8; |
|
|
|
|
private static final int SIX = 6; |
|
|
|
@ -68,7 +64,7 @@ public class JFormSliderPane extends JPanel {
|
|
|
|
|
|
|
|
|
|
public JFormSliderPane() { |
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
setStyle(this, "LightGreyPanel"); |
|
|
|
|
setStyle(this, LIGHT_GREY); |
|
|
|
|
initSlider(); |
|
|
|
|
initDownUpButton(); |
|
|
|
|
initShowValField(); |
|
|
|
@ -294,22 +290,5 @@ public class JFormSliderPane extends JPanel {
|
|
|
|
|
public void addValueChangeListener(ChangeListener changeListener){ |
|
|
|
|
this.slider.addChangeListener(changeListener); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
try { |
|
|
|
|
UIManager.setLookAndFeel( new FlatDarculaLaf() ); |
|
|
|
|
} catch( Exception ex ) { |
|
|
|
|
System.err.println( "Failed to initialize LaF" ); |
|
|
|
|
} |
|
|
|
|
JFrame jf = new JFrame("test"); |
|
|
|
|
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
|
|
|
|
JPanel content = (JPanel) jf.getContentPane(); |
|
|
|
|
content.setLayout(new BorderLayout()); |
|
|
|
|
content.add(JFormSliderPane.getInstance(), BorderLayout.CENTER); |
|
|
|
|
GUICoreUtils.centerWindow(jf); |
|
|
|
|
jf.setSize(400, 80); |
|
|
|
|
jf.setVisible(true); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|