Ignore:
Timestamp:
2015-12-16T17:17:03+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Make GUI components of MapillaryUploadDialog private and add Getters for them

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryUploadAction.java

    r31812 r31839  
    5555    if (pane.getValue() != null
    5656        && (int) pane.getValue() == JOptionPane.OK_OPTION
    57         && dialog.delete != null
    58         && dialog.sequence.isSelected()) {
     57        && dialog.getDelete() != null
     58        && dialog.getSequence().isSelected()) {
    5959      UploadUtils.uploadSequence(
    6060          MapillaryLayer.getInstance().getData().getSelectedImage().getSequence(),
    61           dialog.delete.isSelected()
     61          dialog.getDelete().isSelected()
    6262      );
    6363    }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryUploadDialog.java

    r31787 r31839  
    2626  private static final long serialVersionUID = 2517368588113991767L;
    2727
    28   /** Button group for upload options. */
    29   public ButtonGroup group;
    3028  /** Upload the whole sequence. */
    31   public JRadioButton sequence;
     29  private JRadioButton sequence;
    3230  /** Whether the images must be deleted after upload or not */
    33   public JCheckBox delete;
     31  private JCheckBox delete;
    3432
    3533  /**
     
    3937    setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
    4038    if (MapillaryUser.getUsername() != null) {
    41       this.group = new ButtonGroup();
     39      ButtonGroup group = new ButtonGroup();
    4240      this.sequence = new JRadioButton(tr("Upload selected sequence"));
    43       if (MapillaryLayer.getInstance().getData().getSelectedImage() == null
    44           || !(MapillaryLayer.getInstance().getData().getSelectedImage() instanceof MapillaryImportedImage))
     41      if (!(MapillaryLayer.getInstance().getData().getSelectedImage() instanceof MapillaryImportedImage)) {
    4542        this.sequence.setEnabled(false);
    46       this.group.add(this.sequence);
     43      }
     44      group.add(this.sequence);
    4745      add(this.sequence);
    48       this.group.setSelected(this.sequence.getModel(), true);
     46      group.setSelected(this.sequence.getModel(), true);
    4947      this.delete = new JCheckBox(tr("Delete after upload"));
    50       this.delete.setSelected(Main.pref.getBoolean(
    51           "mapillary.delete-after-upload", true));
     48      this.delete.setSelected(Main.pref.getBoolean("mapillary.delete-after-upload", true));
    5249      add(this.delete);
    53     } else
    54       this.add(new JLabel(
    55           "Go to setting and log in to Mapillary before uploading."));
     50    } else {
     51      this.add(new JLabel(tr("Go to setting and log in to Mapillary before uploading.")));
     52    }
     53  }
     54
     55  /**
     56   * @return the delete checkbox of the dialog
     57   */
     58  public JCheckBox getDelete() {
     59    return delete;
     60  }
     61
     62  /**
     63   * @return the sequence radio button of the dialog
     64   */
     65  public JRadioButton getSequence() {
     66    return sequence;
    5667  }
    5768}
Note: See TracChangeset for help on using the changeset viewer.