• R/O
  • HTTP
  • SSH
  • HTTPS

importpicture: Commit


Commit MetaInfo

Revision62513d450d90eeeea5595dff89dd4b4ed8c66c36 (tree)
Time2020-01-13 09:44:40
Authorhaya4 <hayashi.yuu@gmai...>
Commiterhaya4

Log Message

refactering

Change Summary

Incremental Difference

--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,41 @@
33 <groupId>AdjustTime</groupId>
44 <artifactId>AdjustTime</artifactId>
55 <version>3.1.3-SNAPSHOT</version>
6-
6+
7+ <distributionManagement>
8+ <repository>
9+ <id>hayashi_repository</id>
10+ <url>http://surveyor.mydns.jp/archiva/repository/hayashi_repository/</url>
11+ </repository>
12+ </distributionManagement>
13+
14+ <repositories>
15+ <repository>
16+ <id>hayashi_repository</id>
17+ <name>Hayashi Repository</name>
18+ <url>http://surveyor.mydns.jp/archiva/repository/hayashi_repository/</url>
19+ <releases>
20+ <enabled>true</enabled>
21+ </releases>
22+ <snapshots>
23+ <enabled>false</enabled>
24+ </snapshots>
25+ </repository>
26+ </repositories>
27+ <pluginRepositories>
28+ <pluginRepository>
29+ <id>hayashi_repository</id>
30+ <name>Hayashi Repository</name>
31+ <url>http://surveyor.mydns.jp/archiva/repository/hayashi_repository/</url>
32+ <releases>
33+ <enabled>true</enabled>
34+ </releases>
35+ <snapshots>
36+ <enabled>false</enabled>
37+ </snapshots>
38+ </pluginRepository>
39+ </pluginRepositories>
40+
741 <properties>
842 <!-- configurations -->
943 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
--- a/src/main/java/osm/jp/gpx/Complementation.java
+++ b/src/main/java/osm/jp/gpx/Complementation.java
@@ -4,8 +4,6 @@ import java.text.ParseException;
44
55 public class Complementation {
66 public static final Double R = (6378137D + 6356752.314D)/2D; // 6367444.657m
7- //public static final double dLat = 0.00453D; // 1km距離を表す緯度(差分)
8- //public static final double dLon = 0.005588D; // 1km距離を表す経度(差分)
97
108 public TagTrkpt imaTag = null;
119 public TagTrkpt maeTag = null;
@@ -15,6 +13,7 @@ public class Complementation {
1513 /**
1614 * @param imaE
1715 * @param maeE
16+ * @throws java.text.ParseException
1817 * @code{
1918 * <trkpt lat="34.976635" lon="138.466228">
2019 * <ele>267.291</ele>
--- a/src/main/java/osm/jp/gpx/ElementMapTRKPT.java
+++ b/src/main/java/osm/jp/gpx/ElementMapTRKPT.java
@@ -17,6 +17,8 @@ public class ElementMapTRKPT extends TreeMap<Date, TagTrkpt> {
1717 /**
1818 * 拡張put value:ElementをputするとElement内のtimeを読み取ってkeyとしてthis.put(key,value)する。
1919 * @param tag
20+ * @return
21+ * @throws java.text.ParseException
2022 * @code{
2123 * <trkpt lat="36.4260153752" lon="138.0117778201">
2224 * <ele>614.90</ele>
--- a/src/main/java/osm/jp/gpx/ElementMapTRKSEG.java
+++ b/src/main/java/osm/jp/gpx/ElementMapTRKSEG.java
@@ -37,6 +37,7 @@ public class ElementMapTRKSEG extends TreeMap<Date, ElementMapTRKPT> {
3737
3838 /**
3939 * GPXファイルをパースする
40+ * @param gpxFile
4041 * @code{
4142 * <gpx>
4243 * <trk>
--- a/src/main/java/osm/jp/gpx/YuuLogFormatter.java
+++ b/src/main/java/osm/jp/gpx/YuuLogFormatter.java
@@ -16,7 +16,7 @@ public class YuuLogFormatter extends Formatter {
1616 public String format(final LogRecord argLogRecord) {
1717 final StringBuffer buf = new StringBuffer();
1818
19- buf.append(sdFormat.format(new Date(argLogRecord.getMillis())) +" ");
19+ buf.append(sdFormat.format(new Date(argLogRecord.getMillis()))).append(" ");
2020
2121 if (argLogRecord.getLevel() == Level.FINEST) {
2222 buf.append("[FINEST]");
@@ -40,9 +40,9 @@ public class YuuLogFormatter extends Formatter {
4040 buf.append("[SEVERE]");
4141 }
4242 else {
43- buf.append(Integer.toString(argLogRecord.getLevel().intValue()) +" ");
43+ buf.append(Integer.toString(argLogRecord.getLevel().intValue())).append(" ");
4444 }
45- buf.append(" "+ /* argLogRecord.getLoggerName() +" - "+ */ argLogRecord.getMessage() +"\n");
45+ buf.append(" ").append(argLogRecord.getMessage()).append("\n");
4646 return buf.toString();
4747 }
4848 }
\ No newline at end of file
--- a/src/main/java/osm/jp/gpx/matchtime/gui/Command.java
+++ b/src/main/java/osm/jp/gpx/matchtime/gui/Command.java
@@ -22,7 +22,7 @@ public class Command extends Thread {
2222
2323 /**
2424 * コマンドパラメータの設定
25- * @param folder
25+ * @param args
2626 */
2727 public void setArgs(String[] args) {
2828 this.args = args;
--- a/src/main/java/osm/jp/gpx/matchtime/gui/ImageFileView.java
+++ b/src/main/java/osm/jp/gpx/matchtime/gui/ImageFileView.java
@@ -64,18 +64,18 @@ public class ImageFileView extends FileView {
6464
6565 if (extension != null) {
6666 switch (extension) {
67- case Utils.jpeg:
68- case Utils.jpg:
67+ case Utils.JPEG:
68+ case Utils.JPG:
6969 type = "JPEG Image";
7070 break;
71- case Utils.gif:
71+ case Utils.GIF:
7272 type = "GIF Image";
7373 break;
74- case Utils.tiff:
75- case Utils.tif:
74+ case Utils.TIFF:
75+ case Utils.TIF:
7676 type = "TIFF Image";
7777 break;
78- case Utils.png:
78+ case Utils.PNG:
7979 type = "PNG Image";
8080 break;
8181 default:
@@ -92,18 +92,18 @@ public class ImageFileView extends FileView {
9292
9393 if (extension != null) {
9494 switch (extension) {
95- case Utils.jpeg:
96- case Utils.jpg:
95+ case Utils.JPEG:
96+ case Utils.JPG:
9797 icon = jpgIcon;
9898 break;
99- case Utils.gif:
99+ case Utils.GIF:
100100 icon = gifIcon;
101101 break;
102- case Utils.tiff:
103- case Utils.tif:
102+ case Utils.TIFF:
103+ case Utils.TIF:
104104 icon = tiffIcon;
105105 break;
106- case Utils.png:
106+ case Utils.PNG:
107107 icon = pngIcon;
108108 break;
109109 default:
--- a/src/main/java/osm/jp/gpx/matchtime/gui/ImageFilter.java
+++ b/src/main/java/osm/jp/gpx/matchtime/gui/ImageFilter.java
@@ -46,12 +46,12 @@ public class ImageFilter extends FileFilter {
4646
4747 String extension = Utils.getExtension(f);
4848 if (extension != null) {
49- return extension.equals(Utils.tiff) ||
50- extension.equals(Utils.tif) ||
51- extension.equals(Utils.gif) ||
52- extension.equals(Utils.jpeg) ||
53- extension.equals(Utils.jpg) ||
54- extension.equals(Utils.png);
49+ return extension.equals(Utils.TIFF) ||
50+ extension.equals(Utils.TIF) ||
51+ extension.equals(Utils.GIF) ||
52+ extension.equals(Utils.JPEG) ||
53+ extension.equals(Utils.JPG) ||
54+ extension.equals(Utils.PNG);
5555 }
5656 return false;
5757 }
--- a/src/main/java/osm/jp/gpx/matchtime/gui/ImagePreview.java
+++ b/src/main/java/osm/jp/gpx/matchtime/gui/ImagePreview.java
@@ -61,13 +61,11 @@ public class ImagePreview extends JComponent implements PropertyChangeListener {
6161 //because the image we're trying to load is probably not one
6262 //of this program's own resources.
6363 ImageIcon tmpIcon = new ImageIcon(file.getPath());
64- if (tmpIcon != null) {
65- if (tmpIcon.getIconWidth() > IMAGE_SIZE_X) {
66- thumbnail = new ImageIcon(tmpIcon.getImage().
67- getScaledInstance(IMAGE_SIZE_X, -1, Image.SCALE_DEFAULT));
68- } else { //no need to miniaturize
69- thumbnail = tmpIcon;
70- }
64+ if (tmpIcon.getIconWidth() > IMAGE_SIZE_X) {
65+ thumbnail = new ImageIcon(tmpIcon.getImage().
66+ getScaledInstance(IMAGE_SIZE_X, -1, Image.SCALE_DEFAULT));
67+ } else { //no need to miniaturize
68+ thumbnail = tmpIcon;
7169 }
7270 }
7371
--- a/src/main/java/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java
+++ b/src/main/java/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java
@@ -3,12 +3,15 @@ package osm.jp.gpx.matchtime.gui;
33 import java.awt.Window;
44 import java.awt.event.ActionEvent;
55 import java.io.File;
6+import java.io.IOException;
67 import java.text.DateFormat;
8+import java.text.ParseException;
79 import java.text.SimpleDateFormat;
810 import java.util.Date;
911 import javax.swing.ButtonGroup;
1012 import javax.swing.JButton;
1113 import javax.swing.JRadioButton;
14+import org.apache.commons.imaging.ImageReadException;
1215 import org.apache.commons.imaging.Imaging;
1316 import org.apache.commons.imaging.common.ImageMetadata;
1417 import org.apache.commons.imaging.formats.jpeg.JpegImageMetadata;
@@ -160,7 +163,7 @@ public class ParameterPanelTime extends ParameterPanel {
160163 }
161164 }
162165 }
163- catch (Exception ex) {}
166+ catch (IOException | ParseException | ImageReadException ex) {}
164167 }
165168 else {
166169 long lastModified = timeFile.lastModified();
@@ -182,7 +185,7 @@ public class ParameterPanelTime extends ParameterPanel {
182185 sdf.parse(text);
183186 return true;
184187 }
185- catch (Exception e) {
188+ catch (ParseException e) {
186189 return false;
187190 }
188191 }
--- a/src/main/java/osm/jp/gpx/matchtime/gui/Utils.java
+++ b/src/main/java/osm/jp/gpx/matchtime/gui/Utils.java
@@ -36,12 +36,16 @@ import javax.swing.ImageIcon;
3636
3737 /* Utils.java is used by FileChooserDemo2.java. */
3838 public class Utils {
39- public final static String jpeg = "jpeg";
40- public final static String jpg = "jpg";
41- public final static String gif = "gif";
42- public final static String tiff = "tiff";
43- public final static String tif = "tif";
44- public final static String png = "png";
39+
40+ /**
41+ *
42+ */
43+ public final static String JPEG = "jpeg";
44+ public final static String JPG = "jpg";
45+ public final static String GIF = "gif";
46+ public final static String TIFF = "tiff";
47+ public final static String TIF = "tif";
48+ public final static String PNG = "png";
4549
4650 /*
4751 * Get the extension of a file.
--- a/src/main/java/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
+++ b/src/main/java/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
@@ -1,8 +1,6 @@
11 package osm.jp.gpx.matchtime.gui.restamp;
22 import java.awt.*;
33 import java.io.IOException;
4-import java.util.Observable;
5-import java.util.Observer;
64 import javax.swing.*;
75 import javax.swing.event.DocumentEvent;
86 import osm.jp.gpx.AppParameters;
@@ -15,7 +13,7 @@ import osm.jp.gpx.matchtime.gui.ParameterPanelTime;
1513 import osm.jp.gpx.matchtime.gui.SimpleDocumentListener;
1614
1715 @SuppressWarnings("serial")
18-public class RestampDialog extends JDialog implements Observer
16+public class RestampDialog extends JDialog
1917 {
2018 //{{DECLARE_CONTROLS
2119 java.awt.Button closeButton;
@@ -29,17 +27,6 @@ public class RestampDialog extends JDialog implements Observer
2927 AppParameters params;
3028 //}}
3129
32- /**
33- *
34- * @param arg0
35- * @param arg1
36- */
37- @Override
38- public void update(Observable arg0, Object arg1) {
39- String str = (String) arg1;
40- System.out.println("私はAです。観察対象の通知を検知したよ。" + str);
41- }
42-
4330 class SymWindow extends java.awt.event.WindowAdapter
4431 {
4532 @Override
Show on old repository browser