OSDN Git Service

チェックボックス: "入力ファイルに上書きする"
authorhaya4 <hayashi.yuu@gmail.com>
Sun, 26 Jan 2020 09:41:26 +0000 (18:41 +0900)
committerhaya4 <hayashi.yuu@gmail.com>
Sun, 26 Jan 2020 09:41:26 +0000 (18:41 +0900)
src/main/java/osm/surveyor/matchtime/gui/ParameterPanelOutput.java
src/main/java/osm/surveyor/matchtime/gui/ReStamp.java
src/main/java/osm/surveyor/matchtime/gui/restamp/CardPerformFile.java

index ed3a72b..fd5875e 100644 (file)
@@ -6,7 +6,8 @@ import javax.swing.JFileChooser;
 @SuppressWarnings("serial")
 public class ParameterPanelOutput extends ParameterPanelFolder
 {
-    JCheckBox outputOverwite;  // GPX_OVERWRITE_TO_SOURCE
+    public JCheckBox outputOverwite;   // _OVERWRITE_TO_SOURCE
+    ParameterPanelFolder srcPanelFolder;
     
     /**
      * コンストラクタ
@@ -20,14 +21,14 @@ public class ParameterPanelOutput extends ParameterPanelFolder
 
     /**
      * チェックボックス "入力ファイルに上書きする"
-     * @param label
+     * @param srcPanelFolder    // 
      */
-    public void addCheckOverwriteToSource(String label) {
+    public void addCheckOverwriteToSource(ParameterPanelFolder srcPanelFolder) {
+        this.srcPanelFolder = srcPanelFolder;
         boolean selected = false;
-        outputOverwite = new JCheckBox(label, selected);
+        outputOverwite = new JCheckBox(i18n.getString("label.580"), selected);
         outputOverwite.setEnabled(true);
         outputOverwite.addActionListener(new ChangeOverwriteAction());
-        this.add(outputOverwite);
     }
 
     /**
@@ -41,7 +42,10 @@ public class ParameterPanelOutput extends ParameterPanelFolder
         public void actionPerformed(java.awt.event.ActionEvent event) {
             Object object = event.getSource();
             if (object == outputOverwite) {
-                //setEnabled(outputIMG.isEnabled());
+                if (outputOverwite.isSelected()) {
+                    String text = srcPanelFolder.argField.getText();
+                    argField.setText(text);
+                }
             }
         }
     }
index 735d9fe..f1a4075 100644 (file)
@@ -194,10 +194,11 @@ public class ReStamp extends JFrame
         // 4. "出力フォルダ: "
         {
             arg4_output = new ParameterPanelOutput(
-                i18n.getString("label.530") + ": ", 
-                params.getProperty(AppParameters.IMG_OUTPUT_FOLDER)
+                    i18n.getString("label.530") + ": ", ""
             );
-            arg4_output.addCheckOverwriteToSource(i18n.getString("label.110"));
+            
+            // チェックボックス: "入力ファイルに上書きする"
+            arg4_output.addCheckOverwriteToSource(arg1_srcFolder);
             arg4_output.argField.getDocument().addDocumentListener(
                 new SimpleDocumentListener() {
                     @Override
index 17e8a4f..3f3236d 100644 (file)
@@ -65,6 +65,7 @@ public class CardPerformFile extends Card  implements PanelAction {
         );
         argsPanel.add(packLine(label5, new JPanel()));
         argsPanel.add(arg_output);
+        argsPanel.add(arg_output.outputOverwite);
 
         // [処理実行]ボタン
         doButton = new JButton(