Ignore:
Timestamp:
2011-06-18T14:56:15+02:00 (13 years ago)
Author:
stoecker
Message:

fix last checkin

Location:
applications/editors/josm/plugins/public_transport/src/public_transport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterAction.java

    r26144 r26147  
    7474  {
    7575    super(tr("Create Stops from GTFS ..."), null,
    76       tr("Create Stops from a GTFS file"), null, true);
     76      tr("Create Stops from a GTFS file"), null, false);
    7777      putValue("toolbar", "publictransport/gtfsimporter");
     78      Main.toolbar.register(this);
    7879  }
    7980
  • applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java

    r26144 r26147  
    416416  public RoutePatternAction() {
    417417    super(tr("Route patterns ..."), null,
    418       tr("Edit Route patterns for public transport"), null, true);
     418      tr("Edit Route patterns for public transport"), null, false);
    419419    putValue("toolbar", "publictransport/routepattern");
     420    Main.toolbar.register(this);
    420421  }
    421422
  • applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java

    r26144 r26147  
    7373  {
    7474    super(tr("Create Stops from GPX ..."), null,
    75       tr("Create Stops from a GPX file"), null, true);
     75      tr("Create Stops from a GPX file"), null, false);
    7676    putValue("toolbar", "publictransport/stopimporter");
     77    Main.toolbar.register(this);
    7778  }
    7879
     
    113114      if (curDir.equals(""))
    114115      {
    115     curDir = ".";
     116        curDir = ".";
    116117      }
    117118      JFileChooser fc = new JFileChooser(new File(curDir));
     
    121122      int answer = fc.showOpenDialog(Main.parent);
    122123      if (answer != JFileChooser.APPROVE_OPTION)
    123     return;
     124        return;
    124125
    125126      if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir))
    126     Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
     127        Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
    127128
    128129      importData(fc.getSelectedFile());
     
    133134    {
    134135      if ((!inEvent) && (dialog.gpsTimeStartValid()) && (currentTrack != null))
    135     Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
     136      Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
    136137    }
    137138    else if ("stopImporter.settingsStopwatchStart".equals(event.getActionCommand()))
    138139    {
    139140      if ((!inEvent) && (dialog.stopwatchStartValid()) && (currentTrack != null))
    140     Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
     141      Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
    141142    }
    142143    else if ("stopImporter.settingsTimeWindow".equals(event.getActionCommand()))
    143144    {
    144145      if (currentTrack != null)
    145     currentTrack.timeWindow = dialog.getTimeWindow();
     146      currentTrack.timeWindow = dialog.getTimeWindow();
    146147    }
    147148    else if ("stopImporter.settingsThreshold".equals(event.getActionCommand()))
    148149    {
    149150      if (currentTrack != null)
    150     currentTrack.threshold = dialog.getThreshold();
     151        currentTrack.threshold = dialog.getThreshold();
    151152    }
    152153    else if ("stopImporter.settingsSuggestStops".equals(event.getActionCommand()))
     
    194195      InputStream is;
    195196      if (file.getName().endsWith(".gpx.gz"))
    196     is = new GZIPInputStream(new FileInputStream(file));
     197        is = new GZIPInputStream(new FileInputStream(file));
    197198      else
    198     is = new FileInputStream(file);
     199        is = new FileInputStream(file);
    199200      // Workaround for SAX BOM bug
    200201      // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206835
    201202      if (!((is.read() == 0xef) && (is.read() == 0xbb) && (is.read() == 0xbf)))
    202203      {
    203     is.close();
    204     if (file.getName().endsWith(".gpx.gz"))
    205       is = new GZIPInputStream(new FileInputStream(file));
    206     else
    207       is = new FileInputStream(file);
     204        is.close();
     205        if (file.getName().endsWith(".gpx.gz"))
     206          is = new GZIPInputStream(new FileInputStream(file));
     207        else
     208          is = new FileInputStream(file);
    208209      }
    209210      final GpxReader r = new GpxReader(is);
     
    213214      if (!parsedProperly)
    214215      {
    215     JOptionPane.showMessageDialog(null, tr("Error occured while parsing gpx file {0}. Only part of the file will be available", file.getName()));
     216        JOptionPane.showMessageDialog(null, tr("Error occured while parsing gpx file {0}. Only part of the file will be available", file.getName()));
    216217      }
    217218    }
     
    242243      while (trackIter.hasNext())
    243244      {
    244     GpxTrack track = trackIter.next();
    245     trackRefs.add(new TrackReference(track, this));
     245        GpxTrack track = trackIter.next();
     246        trackRefs.add(new TrackReference(track, this));
    246247      }
    247248
     
    250251      Iterator< TrackReference > iter = trackRefs.iterator();
    251252      while (iter.hasNext())
    252     tracksListModel.addElement(iter.next());
     253        tracksListModel.addElement(iter.next());
    253254
    254255      waypointTM = new WaypointTableModel(this);
     
    256257      while (waypointIter.hasNext())
    257258      {
    258     WayPoint waypoint = waypointIter.next();
    259     waypointTM.addRow(waypoint);
     259        WayPoint waypoint = waypointIter.next();
     260        waypointTM.addRow(waypoint);
    260261      }
    261262      dialog.setWaypointsTableModel(waypointTM);
     
    435436      public void actionPerformed(ActionEvent e)
    436437      {
    437     JTable table = dialog.getWaypointsTable();
    438     int row = table.getEditingRow();
    439     if (row < 0)
    440       return;
    441     table.clearSelection();
    442     table.addRowSelectionInterval(row, row);
    443     Main.main.undoRedo.add
     438        JTable table = dialog.getWaypointsTable();
     439        int row = table.getEditingRow();
     440        if (row < 0)
     441          return;
     442        table.clearSelection();
     443        table.addRowSelectionInterval(row, row);
     444        Main.main.undoRedo.add
    444445        (new WaypointsDisableCommand(StopImporterAction.this));
    445446      }
     
    484485      int row = table.getEditingRow();
    485486      if (row < 0)
    486     row = 0;
     487        row = 0;
    487488      waypointTM.inEvent = true;
    488489      if (table.getCellEditor() != null)
    489490      {
    490     if (!table.getCellEditor().stopCellEditing())
    491       table.getCellEditor().cancelCellEditing();
     491        if (!table.getCellEditor().stopCellEditing())
     492          table.getCellEditor().cancelCellEditing();
    492493      }
    493494      table.editCellAt(row, 1);
     
    514515      int row = table.getEditingRow();
    515516      if (row < 0)
    516     row = 0;
     517        row = 0;
    517518      waypointTM.inEvent = true;
    518519      if (table.getCellEditor() != null)
    519520      {
    520     if (!table.getCellEditor().stopCellEditing())
    521       table.getCellEditor().cancelCellEditing();
     521        if (!table.getCellEditor().stopCellEditing())
     522          table.getCellEditor().cancelCellEditing();
    522523      }
    523524      table.editCellAt(row, 2);
     
    537538      int row = table.getEditingRow();
    538539      if (row < 0)
    539     row = 0;
     540        row = 0;
    540541      currentTrack.inEvent = true;
    541542      if (table.getCellEditor() != null)
    542543      {
    543     if (!table.getCellEditor().stopCellEditing())
    544       table.getCellEditor().cancelCellEditing();
     544        if (!table.getCellEditor().stopCellEditing())
     545          table.getCellEditor().cancelCellEditing();
    545546      }
    546547      table.editCellAt(row, 1);
     
    567568      int row = table.getEditingRow();
    568569      if (row < 0)
    569     row = 0;
     570        row = 0;
    570571      currentTrack.inEvent = true;
    571572      if (table.getCellEditor() != null)
    572573      {
    573     if (!table.getCellEditor().stopCellEditing())
    574       table.getCellEditor().cancelCellEditing();
     574        if (!table.getCellEditor().stopCellEditing())
     575          table.getCellEditor().cancelCellEditing();
    575576      }
    576577      table.editCellAt(row, 2);
Note: See TracChangeset for help on using the changeset viewer.