• R/O
  • HTTP
  • SSH
  • HTTPS

importpicture: Commit


Commit MetaInfo

Revisione0bc61d4594ee7925de2d50fed431a6c4ff01da1 (tree)
Time2019-10-14 15:15:18
Authorhaya4 <hayashi.yuu@gmai...>
Commiterhaya4

Log Message

refactor

Change Summary

Incremental Difference

--- a/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java
+++ /dev/null
@@ -1,25 +0,0 @@
1-package osm.jp.gpx.matchtime.gui.restamp;
2-
3-import java.awt.Dialog;
4-import javax.swing.JTabbedPane;
5-import osm.jp.gpx.matchtime.gui.ParameterPanelTime;
6-
7-/**
8- * [基準画像(開始)]選択パネル
9- * @author yuu
10- */
11-public class CardFirstFile extends CardImageFile {
12- /**
13- * コンストラクタ
14- * @param tabbe parent panel
15- * @param arg_basetime // 開始画像の基準時刻:
16- * @param owner
17- */
18- public CardFirstFile(
19- JTabbedPane tabbe,
20- ParameterPanelTime arg_basetime,
21- Dialog owner
22- ) {
23- super(tabbe, arg_basetime, owner, true);
24- }
25-}
--- a/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
+++ b/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
@@ -1,19 +1,12 @@
11 package osm.jp.gpx.matchtime.gui.restamp;
22 import java.awt.*;
3-import java.awt.event.ActionEvent;
4-import java.io.File;
53 import java.io.IOException;
6-import java.util.Date;
74 import java.util.Observable;
85 import java.util.Observer;
96 import javax.swing.*;
107 import javax.swing.event.DocumentEvent;
118 import osm.jp.gpx.AppParameters;
12-import osm.jp.gpx.matchtime.gui.AdjustTime;
139 import osm.jp.gpx.matchtime.gui.Card;
14-import osm.jp.gpx.matchtime.gui.ImageFileView;
15-import osm.jp.gpx.matchtime.gui.ImageFilter;
16-import osm.jp.gpx.matchtime.gui.ImagePreview;
1710 import osm.jp.gpx.matchtime.gui.ParameterPanelFolder;
1811 import osm.jp.gpx.matchtime.gui.ParameterPanelImageFile;
1912 import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n;
@@ -24,12 +17,8 @@ import osm.jp.gpx.matchtime.gui.SimpleDocumentListener;
2417 public class RestampDialog extends Dialog implements Observer
2518 {
2619 //{{DECLARE_CONTROLS
27- java.awt.Label label1;
2820 java.awt.Button closeButton;
29- java.awt.Label label2;
30- JLabel imageLabel; // 開始画像の基準時刻画像表示
3121 JTabbedPane cardPanel; // ウィザード形式パネル(タブ型)
32- JScrollPane imageSPane; // スクロールパネル
3322 Card[] cards;
3423 ParameterPanelFolder arg1_srcFolder; // 対象フォルダ
3524 ParameterPanelImageFile arg2_baseTimeImg; // 開始画像ファイルパス
@@ -39,9 +28,6 @@ public class RestampDialog extends Dialog implements Observer
3928 AppParameters params;
4029 //}}
4130
42- // Used for addNotify redundency check.
43- boolean fComponentsAdjusted = false;
44-
4531 /**
4632 *
4733 * @param arg0
@@ -72,13 +58,6 @@ public class RestampDialog extends Dialog implements Observer
7258 if (object == closeButton) {
7359 dispose();
7460 }
75- else if (object == arg2_baseTimeImg.argField) {
76- imageView_Action(event);
77- }
78- else if (object == arg2_baseTimeImg.openButton) {
79- selectImage_Action(event);
80- imageView_Action(event);
81- }
8261 }
8362 }
8463
@@ -241,10 +220,12 @@ public class RestampDialog extends Dialog implements Observer
241220 setTitle(title);
242221 }
243222
223+ // Used for addNotify redundency check.
224+ boolean fComponentsAdjusted = false;
225+
244226 @Override
245227 public void addNotify() {
246228 // Record the size of the window prior to calling parents addNotify.
247-
248229 super.addNotify();
249230
250231 // Only do this once.
@@ -280,55 +261,4 @@ public class RestampDialog extends Dialog implements Observer
280261 }
281262 super.setVisible(b);
282263 }
283-
284- ImageIcon refImage;
285-
286- /**
287- * 選択された画像ファイルを表示する
288- * 基準画像ボタンがクリックされた時に、基準時刻フィールドに基準画像の作成日時を設定する。
289- * @param ev
290- */
291- @SuppressWarnings("UseSpecificCatch")
292- public void imageView_Action(ActionEvent ev) {
293- String path = (new File(arg1_srcFolder.getText(), arg2_baseTimeImg.getText())).getPath();
294-
295- File timeFile = new File(path);
296- long lastModifyTime = timeFile.lastModified();
297- arg2_basetime.argField.setText(AdjustTime.dfjp.format(new Date(lastModifyTime)));
298-
299- int size_x = imageSPane.getWidth() - 8;
300- ImageIcon tmpIcon = new ImageIcon(path);
301- refImage = tmpIcon;
302- if (tmpIcon.getIconWidth() > size_x) {
303- refImage = new ImageIcon(tmpIcon.getImage().getScaledInstance(size_x, -1, Image.SCALE_DEFAULT));
304- }
305- imageLabel.setIcon(refImage);
306- repaint();
307- }
308-
309- public void selectImage_Action(ActionEvent ev) {
310- JFileChooser fc;
311-
312- File sdir = new File(arg1_srcFolder.getText());
313- System.out.println(sdir.getPath());
314- if (sdir.isDirectory()) {
315- fc = new JFileChooser(sdir);
316- }
317- else {
318- fc = new JFileChooser();
319- }
320-
321- fc.addChoosableFileFilter(new ImageFilter());
322- fc.setAcceptAllFileFilterUsed(false);
323- fc.setFileView(new ImageFileView());
324- fc.setAccessory(new ImagePreview(fc));
325-
326- //Show it. "選択"
327- int returnVal = fc.showDialog(this, i18n.getString("dialog.select"));
328- if (returnVal == JFileChooser.APPROVE_OPTION) {
329- File file = fc.getSelectedFile();
330- arg2_baseTimeImg.argField.setText(file.getName());
331- }
332- fc.setSelectedFile(null);
333- }
334264 }
Show on old repository browser