diff --git a/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java b/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java deleted file mode 100644 index cf2dcf5..0000000 --- a/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java +++ /dev/null @@ -1,25 +0,0 @@ -package osm.jp.gpx.matchtime.gui.restamp; - -import java.awt.Dialog; -import javax.swing.JTabbedPane; -import osm.jp.gpx.matchtime.gui.ParameterPanelTime; - -/** - * [基準画像(開始)]選択パネル - * @author yuu - */ -public class CardFirstFile extends CardImageFile { - /** - * コンストラクタ - * @param tabbe parent panel - * @param arg_basetime // 開始画像の基準時刻: - * @param owner - */ - public CardFirstFile( - JTabbedPane tabbe, - ParameterPanelTime arg_basetime, - Dialog owner - ) { - super(tabbe, arg_basetime, owner, true); - } -} diff --git a/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java b/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java index 39ffe29..3b19e8a 100644 --- a/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java +++ b/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java @@ -1,19 +1,12 @@ package osm.jp.gpx.matchtime.gui.restamp; import java.awt.*; -import java.awt.event.ActionEvent; -import java.io.File; import java.io.IOException; -import java.util.Date; import java.util.Observable; import java.util.Observer; import javax.swing.*; import javax.swing.event.DocumentEvent; import osm.jp.gpx.AppParameters; -import osm.jp.gpx.matchtime.gui.AdjustTime; import osm.jp.gpx.matchtime.gui.Card; -import osm.jp.gpx.matchtime.gui.ImageFileView; -import osm.jp.gpx.matchtime.gui.ImageFilter; -import osm.jp.gpx.matchtime.gui.ImagePreview; import osm.jp.gpx.matchtime.gui.ParameterPanelFolder; import osm.jp.gpx.matchtime.gui.ParameterPanelImageFile; import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n; @@ -24,12 +17,8 @@ public class RestampDialog extends Dialog implements Observer { //{{DECLARE_CONTROLS - java.awt.Label label1; java.awt.Button closeButton; - java.awt.Label label2; - JLabel imageLabel; // 開始画像の基準時刻画像表示 JTabbedPane cardPanel; // ウィザード形式パネル(タブ型) - JScrollPane imageSPane; // スクロールパネル Card[] cards; ParameterPanelFolder arg1_srcFolder; // 対象フォルダ ParameterPanelImageFile arg2_baseTimeImg; // 開始画像ファイルパス @@ -39,9 +28,6 @@ AppParameters params; //}} - // Used for addNotify redundency check. - boolean fComponentsAdjusted = false; - /** * * @param arg0 @@ -72,13 +58,6 @@ if (object == closeButton) { dispose(); } - else if (object == arg2_baseTimeImg.argField) { - imageView_Action(event); - } - else if (object == arg2_baseTimeImg.openButton) { - selectImage_Action(event); - imageView_Action(event); - } } } @@ -241,10 +220,12 @@ setTitle(title); } + // Used for addNotify redundency check. + boolean fComponentsAdjusted = false; + @Override public void addNotify() { // Record the size of the window prior to calling parents addNotify. - super.addNotify(); // Only do this once. @@ -280,55 +261,4 @@ } super.setVisible(b); } - - ImageIcon refImage; - - /** - * 選択された画像ファイルを表示する - * 基準画像ボタンがクリックされた時に、基準時刻フィールドに基準画像の作成日時を設定する。 - * @param ev - */ - @SuppressWarnings("UseSpecificCatch") - public void imageView_Action(ActionEvent ev) { - String path = (new File(arg1_srcFolder.getText(), arg2_baseTimeImg.getText())).getPath(); - - File timeFile = new File(path); - long lastModifyTime = timeFile.lastModified(); - arg2_basetime.argField.setText(AdjustTime.dfjp.format(new Date(lastModifyTime))); - - int size_x = imageSPane.getWidth() - 8; - ImageIcon tmpIcon = new ImageIcon(path); - refImage = tmpIcon; - if (tmpIcon.getIconWidth() > size_x) { - refImage = new ImageIcon(tmpIcon.getImage().getScaledInstance(size_x, -1, Image.SCALE_DEFAULT)); - } - imageLabel.setIcon(refImage); - repaint(); - } - - public void selectImage_Action(ActionEvent ev) { - JFileChooser fc; - - File sdir = new File(arg1_srcFolder.getText()); - System.out.println(sdir.getPath()); - if (sdir.isDirectory()) { - fc = new JFileChooser(sdir); - } - else { - fc = new JFileChooser(); - } - - fc.addChoosableFileFilter(new ImageFilter()); - fc.setAcceptAllFileFilterUsed(false); - fc.setFileView(new ImageFileView()); - fc.setAccessory(new ImagePreview(fc)); - - //Show it. "選択" - int returnVal = fc.showDialog(this, i18n.getString("dialog.select")); - if (returnVal == JFileChooser.APPROVE_OPTION) { - File file = fc.getSelectedFile(); - arg2_baseTimeImg.argField.setText(file.getName()); - } - fc.setSelectedFile(null); - } }