Newer
Older
restamp-gui / src / main / java / osm / surveyor / matchtime / gui / CardGpxFile.java
@haya4 haya4 on 23 Nov 2020 2 KB maven
  1. package osm.surveyor.matchtime.gui;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Dimension;
  5. import javax.swing.BoxLayout;
  6. import javax.swing.JLabel;
  7. import javax.swing.JPanel;
  8. import javax.swing.JTabbedPane;
  9. import static osm.surveyor.matchtime.gui.ReStamp.i18n;
  10.  
  11. /**
  12. * [GPXファイル]選択パネル
  13. * @author yuu
  14. */
  15. public class CardGpxFile extends Card implements PanelAction {
  16. private static final long serialVersionUID = -8899524266392178269L;
  17. ParameterPanelGpx arg_gpxFile;
  18. /**
  19. * コンストラクタ
  20. * @param tabbe parent panel
  21. * @param arg_gpxFile // 開始画像の基準時刻:
  22. * @param text
  23. * @param pre
  24. * @param next
  25. */
  26. public CardGpxFile(
  27. JTabbedPane tabbe,
  28. ParameterPanelGpx arg_gpxFile,
  29. String text,
  30. int pre, int next
  31. ) {
  32. super(tabbe, text, pre, next);
  33. this.arg_gpxFile = arg_gpxFile;
  34. // 4. ヒモ付を行うGPXファイルを選択してください。
  35. // - フォルダを指定すると、フォルダ内のすべてのGPXファイルを対象とします。
  36. JPanel argsPanel = new JPanel();
  37. argsPanel.setLayout(new BoxLayout(argsPanel, BoxLayout.PAGE_AXIS));
  38. argsPanel.add(packLine(new JLabel(i18n.getString("label.400")), new JPanel()));
  39. argsPanel.add(arg_gpxFile);
  40. // "セグメント'trkseg'の最初の1ノードは無視する。"
  41. if (arg_gpxFile.noFirstNode != null) {
  42. argsPanel.add(arg_gpxFile.noFirstNode);
  43. }
  44.  
  45. // "生成されたGPXファイル(ファイル名が'_.gpx'で終わるもの)も変換の対象にする"
  46. if (arg_gpxFile.gpxReuse != null) {
  47. argsPanel.add(arg_gpxFile.gpxReuse);
  48. }
  49. JPanel space = new JPanel();
  50. space.setMinimumSize(new Dimension(40, 20));
  51. space.setMaximumSize(new Dimension(40, Short.MAX_VALUE));
  52. argsPanel.add(space);
  53. this.mainPanel.add(argsPanel, BorderLayout.CENTER);
  54. }
  55.  
  56. /**
  57. * 入力条件が満たされているかどうか
  58. * @return
  59. */
  60. @Override
  61. public boolean isEnable() {
  62. return (arg_gpxFile.isEnable());
  63. }
  64. @Override
  65. public void openAction() {
  66. ; // 何もしない
  67. }
  68. }