Changeset 9215 in josm


Ignore:
Timestamp:
2015-12-29T21:01:48+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #12250 - Error when loading session containing layer converted from .gpx

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r8987 r9215  
    9292        /**
    9393         * Converts a {@link MarkerLayer} to a {@link OsmDataLayer}.
     94         * @param layer marker layer
    9495         */
    9596        public FromMarkerLayer(MarkerLayer layer) {
  • trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java

    r9078 r9215  
    4444
    4545    private final GpxLayer layer;
    46     private JRadioButton link, include;
     46    private JRadioButton link;
     47    private JRadioButton include;
    4748    private JCheckBox export;
    4849
     50    /**
     51     * Constructs a new {@code GpxTracksSessionExporter}.
     52     * @param layer GPX layer to export
     53     */
    4954    public GpxTracksSessionExporter(GpxLayer layer) {
    5055        this.layer = layer;
     
    7883        JPanel cardLink = new JPanel(new GridBagLayout());
    7984        final File file = layer.getAssociatedFile();
    80         if (file != null) {
     85        if (file != null && file.exists()) {
    8186            JosmTextField tf = new JosmTextField();
    8287            tf.setText(file.getPath());
     
    97102        cards.add(cardInclude, "include");
    98103
    99         if (file != null) {
     104        if (file != null && file.exists()) {
    100105            link.setSelected(true);
    101106        } else {
     
    136141                } else {
    137142                    GuiHelper.setEnabledRec(p, true);
    138                     link.setEnabled(file != null);
     143                    link.setEnabled(file != null && file.exists());
    139144                }
    140145            }
  • trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java

    r9078 r9215  
    4949
    5050    private final OsmDataLayer layer;
    51     private JRadioButton link, include;
     51    private JRadioButton link;
     52    private JRadioButton include;
    5253    private JCheckBox export;
    5354
     55    /**
     56     * Constructs a new {@code OsmDataSessionExporter}.
     57     * @param layer Data layer to export
     58     */
    5459    public OsmDataSessionExporter(OsmDataLayer layer) {
    5560        this.layer = layer;
     
    6267
    6368    private class LayerSaveAction extends AbstractAction {
     69        /**
     70         * Constructs a new {@code LayerSaveAction}.
     71         */
    6472        LayerSaveAction() {
    6573            putValue(SMALL_ICON, new ImageProvider("save").setWidth(16).get());
     
    105113        final LayerSaveAction saveAction = new LayerSaveAction();
    106114        final JButton save = new JButton(saveAction);
    107         if (file != null) {
     115        if (file != null && file.exists()) {
    108116            JosmTextField tf = new JosmTextField();
    109117            tf.setText(file.getPath());
     
    126134        cards.add(cardInclude, "include");
    127135
    128         if (file != null) {
     136        if (file != null && file.exists()) {
    129137            link.setSelected(true);
    130138        } else {
     
    166174                    GuiHelper.setEnabledRec(p, true);
    167175                    save.setEnabled(saveAction.isEnabled());
    168                     link.setEnabled(file != null);
     176                    link.setEnabled(file != null && file.exists());
    169177                }
    170178            }
Note: See TracChangeset for help on using the changeset viewer.