Ticket #18523: 18523.1.patch

File 18523.1.patch, 2.6 KB (added by taylor.smock, 4 years ago)

Switch from BorderLayout to GridBagLayout

  • src/org/openstreetmap/josm/gui/io/BasicUploadSettingsPanel.java

     
    33
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.BorderLayout;
    76import java.awt.GridBagLayout;
    87import java.awt.event.ActionEvent;
    98import java.awt.event.ActionListener;
     
    6261    /** the history combo box for the upload comment */
    6362    private final HistoryComboBox hcbUploadComment = new HistoryComboBox();
    6463    private final HistoryComboBox hcbUploadSource = new HistoryComboBox();
     64    private final transient JCheckBox obtainSourceAutomatically = new JCheckBox(
     65            tr("Automatically obtain source from current layers"));
    6566    /** the panel with a summary of the upload parameters */
    6667    private final UploadParameterSummaryPanel pnlUploadParameterSummary = new UploadParameterSummaryPanel();
    6768    /** the checkbox to request feedback from other users */
     
    9394                automaticallyAddSource();
    9495            }
    9596        });
    96         JCheckBox obtainSourceAutomatically = new JCheckBox(tr("Automatically obtain source from current layers"));
    9797        obtainSourceAutomatically.setSelected(Config.getPref().getBoolean("upload.source.obtainautomatically", false));
    9898        obtainSourceAutomatically.addActionListener(e -> {
    9999            if (obtainSourceAutomatically.isSelected())
     
    176176    }
    177177
    178178    protected void build() {
    179         setLayout(new BorderLayout());
     179        setLayout(new GridBagLayout());
    180180        setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
    181         add(buildUploadCommentPanel(), BorderLayout.NORTH);
    182         add(pnlUploadParameterSummary, BorderLayout.CENTER);
    183         add(cbRequestReview, BorderLayout.SOUTH);
     181        add(buildUploadCommentPanel(), GBC.eol().fill(GBC.BOTH));
     182        add(pnlUploadParameterSummary, GBC.eol().fill(GBC.HORIZONTAL));
     183        add(cbRequestReview, GBC.eol().fill(GBC.HORIZONTAL));
    184184        cbRequestReview.addItemListener(e -> changesetReviewModel.setReviewRequested(e.getStateChange() == ItemEvent.SELECTED));
    185185    }
    186186
     
    227227        // store the history of sources
    228228        hcbUploadSource.addCurrentItemToHistory();
    229229        Config.getPref().putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
     230
     231        // store current value of obtaining source automatically
     232        Config.getPref().putBoolean("upload.source.obtainautomatically", obtainSourceAutomatically.isSelected());
    230233    }
    231234
    232235    /**