// GPX: 基準時刻 {FILE_UPDATE | EXIF}
public static String GPX_BASETIME = "GPX.BASETIME";
+ File file;
+
public AppParameters() throws FileNotFoundException, IOException {
super();
syncFile();
void syncFile() throws FileNotFoundException, IOException {
boolean update = false;
- File file = new File(FILE_PATH);
+ this.file = new File(FILE_PATH);
if (file.exists()) {
// ファイルが存在すれば、その内容をロードする。
this.load(new FileInputStream(file));
if (update) {
// ・ファイルがなければ新たに作る
// ・項目が足りない時は書き足す。
- this.store(new FileOutputStream(file), "defuilt settings");
+ this.store(new FileOutputStream(this.file), "defuilt settings");
}
}
+
+ public void store() throws FileNotFoundException, IOException {
+ this.store(new FileOutputStream(this.file), "by AdjustTime");
+ }
}
+++ /dev/null
-package osm.jp.gpx;\r
-\r
-import java.io.File;\r
-import java.io.FileInputStream;\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.util.Properties;\r
-\r
-/**\r
- * シンプルなサンプルログフォーマッタ\r
- */\r
-public class Config {\r
- static Properties configuration = null;\r
-\r
- public static Properties getProperties() throws IOException {\r
- if (configuration == null) {\r
- configuration = new Properties();\r
- File f = new File("AdjustTime.ini");\r
- if (f.isFile()) {\r
- InputStream iniStream = new FileInputStream(f);\r
- configuration.load(iniStream);\r
- }\r
- }\r
- return configuration;\r
- }\r
-\r
-}
\ No newline at end of file
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Date;
-import java.util.Properties;
import javax.swing.*;
JScrollPane imageSPane; // スクロールパネル
JLabel imageLabel; // 基準時刻画像表示
JCheckBox exifBase; // EXIF日時を基準にする/ !(ファイル更新日時を基準にする)
+ JCheckBox noFirstNode; // GPX: <trkseg>セグメントの最初の1ノードは無視する。 {ON | OFF}
JTextArea textArea; // 実行結果表示領域
//ImagePreview imagePane; // 基準時刻画像表示
ParameterPanelFolder arg1_srcFolder;
}
}
- Properties config;
+ AppParameters params;
/**
* データベース内のテーブルを一覧で表示するFrame
setSize(getInsets().left + getInsets().right + 960,getInsets().top + getInsets().bottom + 480);
setTitle(AdjustTime.PROGRAM_NAME +" v"+ AdjustTime.PROGRAM_VARSION);
- config = Config.getProperties();
+ params = new AppParameters();
//---------------------------------------------------------------------
cardPanel = new JPanel();
label4.setText("<html><p>ヒモ付を行うGPXファイルを選択してください。</p><ul><li>フォルダを指定すると、フォルダ内にあるすべてのGPXファイルを対象とします。</li><li>カメラの時計が正確ならば、どの画像を選んでも構いません。</li></ul>");
cards[cardNo].add(label4, BorderLayout.NORTH);
- JPanel tmpPanel4 = new JPanel();
- tmpPanel4.setLayout(new BoxLayout(tmpPanel4, BoxLayout.Y_AXIS));
+ JPanel tmpPanel4a = new JPanel();
+ tmpPanel4a.setLayout(new BoxLayout(tmpPanel4a, BoxLayout.Y_AXIS));
File gpxDir = new File(".");
arg4_gpxFolder = new ParameterPanelFolder("GPXフォルダ: ", gpxDir.getAbsolutePath(), false);
- tmpPanel4.add(arg4_gpxFolder);
- cards[cardNo].add(tmpPanel4, BorderLayout.CENTER);
+ tmpPanel4a.add(arg4_gpxFolder);
+ noFirstNode = new JCheckBox("<trkseg>セグメントの最初の1ノードは無視する。", params.getProperty(AppParameters.GPX_NO_FIRST_NODE).equals("ON"));
+ tmpPanel4a.add(noFirstNode);
+ cards[cardNo].add(tmpPanel4a, BorderLayout.CENTER);
//---------------------------------------------------------------------
// 5.EXIF更新設定画面
arg2_baseTimeImg.openButton.addActionListener(lSymAction);
doButton.addActionListener(lSymAction);
exifON.addActionListener(lSymAction);
+ noFirstNode.addActionListener(lSymAction);
//arg1Panel_4.field.addActionListener(lSymAction);
nextButton.addActionListener(lSymAction);
backButton.addActionListener(lSymAction);
/**
* [実行]ボタンをクリックしたときの動作
* @param event
+ * @throws IOException
+ * @throws FileNotFoundException
*/
void doButton_Action(java.awt.event.ActionEvent event) {
doButton.setEnabled(false);
argv[2] = arg3_basetiome.getText();
argv[3] = (exifON.isSelected() ? arg5_outputFolder.getText() : "noEXIF");
argv[4] = arg4_gpxFolder.getText();
+
+ this.params.setProperty(AppParameters.GPX_NO_FIRST_NODE, (noFirstNode.isSelected() ? "ON" : "OFF"));
+ try {
+ this.params.store();
+ }
+ catch(Exception e) {}
(new DoDialog(this, argv)).setVisible(true);