From 5a896feba79ca738753710c957517479df967f39 Mon Sep 17 00:00:00 2001 From: yukihane Date: Fri, 2 Sep 2011 21:46:14 +0900 Subject: [PATCH] =?utf8?q?=E3=82=B9=E3=83=AC=E3=83=83=E3=83=89=E6=95=B0?= =?utf8?q?=E3=81=AE=E5=85=A5=E5=8A=9B=E9=83=A8=E3=82=92=E3=82=B9=E3=83=94?= =?utf8?q?=E3=83=8A=E3=83=BC=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/yukihane/inqubus/gui/ConfigDialog.java | 33 ++++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/frontend/src/yukihane/inqubus/gui/ConfigDialog.java b/frontend/src/yukihane/inqubus/gui/ConfigDialog.java index cae59a3..b7e83d4 100644 --- a/frontend/src/yukihane/inqubus/gui/ConfigDialog.java +++ b/frontend/src/yukihane/inqubus/gui/ConfigDialog.java @@ -27,9 +27,11 @@ import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JSpinner; import javax.swing.JTabbedPane; import javax.swing.JTextField; import javax.swing.LayoutStyle.ComponentPlacement; +import javax.swing.SpinnerNumberModel; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.WindowConstants; @@ -662,6 +664,13 @@ public class ConfigDialog extends JDialog { btnSystemTempDir.addActionListener( new FileChooseAction(ConfigDialog.this, JFileChooser.DIRECTORIES_ONLY, fldSystemTempDir)); + mdlSystemThreadDownload.setMinimum(1); + final JSpinner fldSystemThreadDownload = new JSpinner(mdlSystemThreadDownload); + mdlSystemWaitDownload.setMinimum(0); + final JSpinner fldSystemWaitDownload = new JSpinner(mdlSystemWaitDownload); + mdlSystemThreadConvert.setMinimum(1); + final JSpinner fldSystemThreadConvert = new JSpinner(mdlSystemThreadConvert); + final JPanel pnlSystemGeneral = new JPanel(); pnlSystemGeneral.setBorder(BorderFactory.createTitledBorder("システム")); final GroupLayout glSystemGenegal = new GroupLayout(pnlSystemGeneral); @@ -676,9 +685,9 @@ public class ConfigDialog extends JDialog { .addComponent(lblSystemWaitDownload) .addComponent(lblSystemThreadConvert)) .addGroup(glSystemGenegal.createParallelGroup() - .addComponent(fldSystemThreadDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE) - .addComponent(fldSystemWaitDownload, PREFERRED_SIZE, 40, PREFERRED_SIZE) - .addComponent(fldSystemThreadConvert, PREFERRED_SIZE, 40, PREFERRED_SIZE) + .addComponent(fldSystemThreadDownload, PREFERRED_SIZE, 50, PREFERRED_SIZE) + .addComponent(fldSystemWaitDownload, PREFERRED_SIZE, 55, PREFERRED_SIZE) + .addComponent(fldSystemThreadConvert, PREFERRED_SIZE, 50, PREFERRED_SIZE) ) ) .addGroup(glSystemGenegal.createSequentialGroup() @@ -809,9 +818,9 @@ public class ConfigDialog extends JDialog { // 検索 - コメント検索対象フォルダ private final DirectoryRegisterPanel pnlSearchComment = new DirectoryRegisterPanel(); // システム - private final JTextField fldSystemThreadDownload = new JTextField(); - private final JTextField fldSystemWaitDownload = new JTextField(); - private final JTextField fldSystemThreadConvert = new JTextField(); + private final SpinnerNumberModel mdlSystemThreadDownload = new SpinnerNumberModel(); + private final SpinnerNumberModel mdlSystemWaitDownload = new SpinnerNumberModel(); + private final SpinnerNumberModel mdlSystemThreadConvert = new SpinnerNumberModel(); private final JTextField fldSystemTempDir = new JTextField(); @@ -909,9 +918,9 @@ public class ConfigDialog extends JDialog { /* * システム */ - fldSystemThreadDownload.setText(Integer.toString(p.getSystemDownloadThread())); - fldSystemWaitDownload.setText(Integer.toString(p.getSystemDownloadWait())); - fldSystemThreadConvert.setText(Integer.toString(p.getSystemConvertThread())); + mdlSystemThreadDownload.setValue(p.getSystemDownloadThread()); + mdlSystemWaitDownload.setValue(p.getSystemDownloadWait()); + mdlSystemThreadConvert.setValue(p.getSystemConvertThread()); fldSystemTempDir.setText(p.getSystemTempDir()); } @@ -1016,9 +1025,9 @@ public class ConfigDialog extends JDialog { /* * システム */ - p.setSystemDownloadThread(Integer.parseInt(fldSystemThreadDownload.getText())); - p.setSystemDownloadWait(Integer.parseInt(fldSystemWaitDownload.getText())); - p.setSystemConvertThread(Integer.parseInt(fldSystemThreadConvert.getText())); + p.setSystemDownloadThread(mdlSystemThreadDownload.getNumber().intValue()); + p.setSystemDownloadWait(mdlSystemWaitDownload.getNumber().intValue()); + p.setSystemConvertThread(mdlSystemThreadConvert.getNumber().intValue()); p.setSystemTempDir(fldSystemTempDir.getText()); try { -- 2.11.0