Пример #1
0
  final void doImport() {
    // ok, let's commit to the current settings, and retrieve the
    // current frequency
    _theFreq = (long) (FrequencyCombo.getValue() * 1000);

    // let the parent do the import
    super.doImport();
  }
Пример #2
0
  ///////////////////////////////////
  // member functions
  //////////////////////////////////
  protected final void initForm() {
    thisPanel = new JPanel();
    thisPanel.setName("Import Range Data");
    thisPanel.setLayout(new java.awt.BorderLayout());

    _thePanel.add(thisPanel);

    _theWarning = new JTextArea();
    _theWarning.setEditable(false);
    String theMessage = "Warning, data imported through this panel has";
    theMessage += " speed and course calculated as over the ground.";
    theMessage += System.getProperties().getProperty("line.separator");
    theMessage += "Debrief recognises PC Argos (RAO) and PMRF (PRN) files.";
    theMessage += System.getProperties().getProperty("line.separator");
    theMessage += "See Debrief Help File for file format and details.";

    _theWarning.setText(theMessage);
    _theWarning.setLineWrap(true);
    _theWarning.setBorder(BorderFactory.createLoweredBevelBorder());
    _theWarning.setWrapStyleWord(true);
    thisPanel.add("North", _theWarning);
    ////////////////////////////////////////////
    // auto generated stuff
    ////////////////////////////////////////////

    ButtonPanel = new javax.swing.JPanel();
    importBtn = new javax.swing.JButton();
    closeBtn = new javax.swing.JButton();
    PropertiesList = new javax.swing.JPanel();
    FilenamePanel = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    FilenameLabel = new javax.swing.JLabel();
    selectFileBtn = new javax.swing.JButton();
    FrequencyPanel = new javax.swing.JPanel();
    FrequencyLabel = new javax.swing.JLabel();
    FrequencyCombo = new TimeFrequencyCombo();
    OriginPanel = new javax.swing.JPanel();
    jLabel7 = new javax.swing.JLabel();
    OriginLabel = new javax.swing.JLabel();
    selectOriginBtn = new javax.swing.JButton();
    DTGPanel = new javax.swing.JPanel();
    jLabel9 = new javax.swing.JLabel();
    _theDate = new javax.swing.JTextField("2001/01/30");

    /////////////////////////////////////////////////
    // button panel first
    //////////////////////////////////////////////////

    importBtn.setText("Import");
    ButtonPanel.add(importBtn);
    closeBtn.setText("Close");
    ButtonPanel.add(closeBtn);
    thisPanel.add(ButtonPanel, java.awt.BorderLayout.SOUTH);
    closeBtn.addActionListener(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            doClose();
          }
        });
    importBtn.addActionListener(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            doImport();
          }
        });

    ///////////////////////////////////////////////////
    // now the properties panel
    ///////////////////////////////////////////////////

    PropertiesList.setLayout(new java.awt.GridLayout(0, 1));

    jLabel3.setText("Filename:");
    FilenamePanel.add(jLabel3);
    FilenameLabel.setText("    blank    ");
    FilenamePanel.add(FilenameLabel);
    selectFileBtn.setPreferredSize(new java.awt.Dimension(33, 27));
    selectFileBtn.setToolTipText("Select file");
    selectFileBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    selectFileBtn.setText("...");
    selectFileBtn.addActionListener(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            doEditFilename();
          }
        });
    FilenamePanel.add(selectFileBtn);
    PropertiesList.add(FilenamePanel);

    FrequencyLabel.setText("Frequency:");
    FrequencyPanel.add(FrequencyLabel);
    FrequencyCombo.setPreferredSize(new java.awt.Dimension(100, 25));
    FrequencyPanel.add(FrequencyCombo);
    PropertiesList.add(FrequencyPanel);

    jLabel7.setText("Origin:");
    OriginPanel.add(jLabel7);
    OriginLabel.setText("    blank    ");
    OriginPanel.add(OriginLabel);
    selectOriginBtn.setPreferredSize(new java.awt.Dimension(33, 27));
    selectOriginBtn.setToolTipText("Select file");
    selectOriginBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    selectOriginBtn.setText("...");
    selectOriginBtn.addActionListener(
        new ActionListener() {
          public void actionPerformed(final ActionEvent e) {
            editOrigin();
          }
        });
    OriginPanel.add(selectOriginBtn);
    PropertiesList.add(OriginPanel);

    //////////////////////////////////////////////////////
    // DTG
    /////////////////////////////////////////////////////

    jLabel9.setText("DTG (yyyy/mm/dd):");
    _theDate.setText("2001/01/30");
    _theDate.addFocusListener(
        new FocusAdapter() {
          public void focusLost(final FocusEvent e) {
            checkDTG();
          }
        });
    DTGPanel.add(jLabel9);
    DTGPanel.add(_theDate);
    PropertiesList.add(DTGPanel);

    final JPanel jp = new JPanel();
    jp.setLayout(new FlowLayout());
    jp.add(PropertiesList);

    thisPanel.add(jp, java.awt.BorderLayout.CENTER);
  }