|
|
|
@ -24,6 +24,9 @@ import java.awt.event.MouseEvent;
|
|
|
|
|
import java.awt.event.MouseListener; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* For input Number. |
|
|
|
|
*/ |
|
|
|
@ -43,16 +46,13 @@ public abstract class UnitInputPane extends BasicPane {
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(""); |
|
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
centerPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 30)); |
|
|
|
|
centerPane.setLayout(new FlowLayout(FlowLayout.LEFT, 20, 30)); |
|
|
|
|
UILabel titleLabel = new UILabel(title + ":"); |
|
|
|
|
centerPane.add(titleLabel); |
|
|
|
|
|
|
|
|
|
// Denny:在对话框中加入JSpinner对象
|
|
|
|
|
numberFieldSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, MAX_NUM, 1)); |
|
|
|
|
GUICoreUtils.setColumnForSpinner(numberFieldSpinner, 24); |
|
|
|
|
numberFieldSpinner.setPreferredSize(new Dimension(60, 20)); |
|
|
|
|
numberFieldSpinner.setMinimumSize(new Dimension(60, 20)); |
|
|
|
|
centerPane.add(numberFieldSpinner); |
|
|
|
|
numberFieldSpinner.addChangeListener(new ChangeListener() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -64,7 +64,7 @@ public abstract class UnitInputPane extends BasicPane {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
unitLabel = new UILabel(""); |
|
|
|
|
centerPane.add(unitLabel); |
|
|
|
|
centerPane.add(row(4, cell(numberFieldSpinner), cell(unitLabel)).getComponent()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setUnitText(String unit) { |
|
|
|
|