Changeset 31809 in osm for applications/editors/josm


Ignore:
Timestamp:
2015-12-10T22:12:06+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Improve layout of mapillary preferences which fixes #12089

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java

    r31808 r31809  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.mapillary.gui;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import java.awt.FlowLayout;
     
    4442public class MapillaryPreferenceSetting implements SubPreferenceSetting, MapillaryLoginListener {
    4543
    46   private JCheckBox reverseButtons = new JCheckBox(
    47       tr("Reverse buttons position when displaying images."));
     44  private JCheckBox reverseButtons = new JCheckBox(I18n.tr("Reverse buttons position when displaying images."));
    4845  private JComboBox<String> downloadMode = new JComboBox<>(new String[]{
    4946      MapillaryDownloader.MODES.Automatic.toString(),
     
    5148      MapillaryDownloader.MODES.Manual.toString()
    5249  });
    53   private JCheckBox displayHour = new JCheckBox(
    54       tr("Display hour when the picture was taken"));
    55   private JCheckBox format24 = new JCheckBox(tr("Use 24 hour format"));
    56   private JCheckBox moveTo = new JCheckBox(
    57       tr("Move to picture''s location with next/previous buttons"));
    58   private JButton login;
     50  private JCheckBox displayHour = new JCheckBox(I18n.tr("Display hour when the picture was taken"));
     51  private JCheckBox format24 = new JCheckBox(I18n.tr("Use 24 hour format"));
     52  private JCheckBox moveTo = new JCheckBox(I18n.tr("Move to picture''s location with next/previous buttons"));
    5953
    6054  private JButton loginButton = new JButton(new LoginAction(this));
     
    7165  public void addGui(PreferenceTabbedPane gui) {
    7266    JPanel panel = new JPanel();
    73     this.reverseButtons.setSelected(Main.pref
    74         .getBoolean("mapillary.reverse-buttons"));
    75     this.displayHour.setSelected(Main.pref.getBoolean("mapillary.display-hour",
    76         true));
     67    this.reverseButtons.setSelected(Main.pref.getBoolean("mapillary.reverse-buttons"));
     68    this.displayHour.setSelected(Main.pref.getBoolean("mapillary.display-hour", true));
    7769    this.format24.setSelected(Main.pref.getBoolean("mapillary.format-24"));
    78     this.moveTo.setSelected(Main.pref.getBoolean("mapillary.move-to-picture",
    79         true));
    80     panel.setLayout(new FlowLayout(FlowLayout.LEFT));
    81     panel.add(this.reverseButtons);
     70    this.moveTo.setSelected(Main.pref.getBoolean("mapillary.move-to-picture", true));
     71
     72    panel.setLayout(new GridBagLayout());
     73    panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
     74
     75    panel.add(this.reverseButtons, GBC.eol());
    8276    // Sets the value of the ComboBox.
    8377    if (Main.pref.get("mapillary.download-mode").equals(MapillaryDownloader.MODES.Automatic.toString())
     
    8781    }
    8882    JPanel downloadModePanel = new JPanel();
    89     downloadModePanel.add(new JLabel(tr("Download mode: ")));
     83    downloadModePanel.add(new JLabel(I18n.tr("Download mode")));
    9084    downloadModePanel.add(this.downloadMode);
    91     panel.add(downloadModePanel);
    92     panel.add(this.displayHour);
    93     panel.add(this.format24);
    94     panel.add(this.moveTo);
     85    panel.add(downloadModePanel, GBC.eol());
     86    panel.add(displayHour, GBC.eol());
     87    panel.add(format24, GBC.eol());
     88    panel.add(moveTo, GBC.eol());
    9589
    9690    loginPanel.setLayout(new FlowLayout(FlowLayout.LEADING));
     
    10195    panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
    10296
    103     gui.getDisplayPreference().addSubTab(this, "Mapillary", panel);
     97    gui.getDisplayPreference().addSubTab(this, "Mapillary", new JScrollPane(panel));
    10498
    10599    new Thread(new Runnable() {
     
    144138  public boolean ok() {
    145139    boolean mod = false;
    146     Main.pref
    147         .put("mapillary.reverse-buttons", this.reverseButtons.isSelected());
     140    Main.pref.put("mapillary.reverse-buttons", this.reverseButtons.isSelected());
    148141
    149142    MapillaryPlugin.setMenuEnabled(MapillaryPlugin.getDownloadViewMenu(), false);
Note: See TracChangeset for help on using the changeset viewer.