|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.fr.design.mainframe; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
import com.fine.theme.utils.FineUIStyle; |
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
|
import com.formdev.flatlaf.ui.FlatUIUtils; |
|
|
|
@ -12,7 +11,6 @@ import com.fr.design.gui.itextfield.UINumberField;
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
@ -69,7 +67,7 @@ public class JFormSliderPane extends JPanel {
|
|
|
|
|
initSlider(); |
|
|
|
|
initDownUpButton(); |
|
|
|
|
initShowValField(); |
|
|
|
|
JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); |
|
|
|
|
JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 2)); |
|
|
|
|
panel.add(downButton); |
|
|
|
|
panel.add(slider); |
|
|
|
|
panel.add(upButton); |
|
|
|
@ -123,10 +121,15 @@ public class JFormSliderPane extends JPanel {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initShowValField() { |
|
|
|
|
showValField = new UINumberField(); |
|
|
|
|
showValField = new UINumberField() { |
|
|
|
|
@Override |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
int width = FineUIUtils.getAndScaleInt("FormSliderPane.showValueWidth", 40); |
|
|
|
|
int height = FineUIUtils.getAndScaleInt("FormSliderPane.showValueHeight", 20); |
|
|
|
|
return new Dimension(width, height); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
showValField.setValue(showValue); |
|
|
|
|
Dimension dimension = new Dimension(UIManager.getInt("FormSliderPane.showValueWidth"), UIManager.getInt("FormSliderPane.showValueHeight")); |
|
|
|
|
showValField.setPreferredSize(FineUIScale.scale(dimension)); |
|
|
|
|
showValField.addKeyListener(new KeyListener() { |
|
|
|
|
@Override |
|
|
|
|
public void keyTyped(KeyEvent e) { |
|
|
|
@ -293,5 +296,11 @@ public class JFormSliderPane extends JPanel {
|
|
|
|
|
public void addValueChangeListener(ChangeListener changeListener){ |
|
|
|
|
this.slider.addChangeListener(changeListener); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Dimension getPreferredSize() { |
|
|
|
|
Dimension size = super.getPreferredSize(); |
|
|
|
|
return new Dimension(size.width, FineUIUtils.getAndScaleInt("Component.defaultHeight", 24)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|