Newer
Older
adjustgpx-gui / src / main / java / osm / jp / gpx / matchtime / gui / CardGpxFile.java
@haya4 haya4 on 14 Dec 2020 2 KB test
  1. package osm.jp.gpx.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.  
  10. import osm.jp.gpx.matchtime.gui.parameters.PanelAction;
  11. import osm.jp.gpx.matchtime.gui.parameters.ParameterPanelGpx;
  12.  
  13. import static osm.jp.gpx.matchtime.gui.AdjustTerra.i18n;
  14.  
  15. /**
  16. * [GPXファイル]選択パネル
  17. * @author haya4
  18. */
  19. public class CardGpxFile extends Card implements PanelAction {
  20. private static final long serialVersionUID = -6130918418152241845L;
  21. ParameterPanelGpx arg_gpxFile;
  22. /**
  23. * コンストラクタ
  24. * @param tabbe parent panel
  25. * @param arg_gpxFile // 開始画像の基準時刻:
  26. * @param text
  27. * @param pre
  28. * @param next
  29. */
  30. public CardGpxFile(
  31. JTabbedPane tabbe,
  32. ParameterPanelGpx arg_gpxFile,
  33. String text,
  34. int pre, int next
  35. ) {
  36. super(tabbe, text, pre, next);
  37. this.arg_gpxFile = arg_gpxFile;
  38. // 4. ヒモ付を行うGPXファイルを選択してください。
  39. // - フォルダを指定すると、フォルダ内のすべてのGPXファイルを対象とします。
  40. JPanel argsPanel = new JPanel();
  41. argsPanel.setLayout(new BoxLayout(argsPanel, BoxLayout.PAGE_AXIS));
  42. argsPanel.add(packLine(new JLabel(i18n.getString("label.400")), new JPanel()));
  43. argsPanel.add(arg_gpxFile);
  44. // "セグメント'trkseg'の最初の1ノードは無視する。"
  45. if (arg_gpxFile.noFirstNode != null) {
  46. argsPanel.add(arg_gpxFile.noFirstNode);
  47. }
  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. }