lblStrategies = new HashMap<>();
lblNumRequests = new HashMap<>();
for (UploadStrategy strategy: UploadStrategy.values()) {
rbStrategy.put(strategy, new JRadioButton());
lblNumRequests.put(strategy, new JLabel());
lblStrategies.put(strategy, new JMultilineLabel(""));
bgStrategies.add(rbStrategy.get(strategy));
}
// -- headline
GridBagConstraints gc = new GridBagConstraints();
gc.gridx = 0;
gc.gridy = 0;
gc.weightx = 1.0;
gc.weighty = 0.0;
gc.gridwidth = 4;
gc.fill = GridBagConstraints.HORIZONTAL;
gc.insets = new Insets(0,0,3,0);
gc.anchor = GridBagConstraints.FIRST_LINE_START;
pnl.add(new JMultilineLabel(tr("Please select the upload strategy:")), gc);
// -- single request strategy
gc.gridx = 0;
gc.gridy = 1;
gc.weightx = 0.0;
gc.weighty = 0.0;
gc.gridwidth = 1;
gc.anchor = GridBagConstraints.FIRST_LINE_START;
pnl.add(rbStrategy.get(UploadStrategy.SINGLE_REQUEST_STRATEGY), gc);
gc.gridx = 1;
gc.gridy = 1;
gc.weightx = 0.0;
gc.weighty = 0.0;
gc.gridwidth = 2;
JMultilineLabel lbl = lblStrategies.get(UploadStrategy.SINGLE_REQUEST_STRATEGY);
lbl.setText(tr("Upload data in one request"));
pnl.add(lbl, gc);
gc.gridx = 3;
gc.gridy = 1;
gc.weightx = 1.0;
gc.weighty = 0.0;
gc.gridwidth = 1;
pnl.add(lblNumRequests.get(UploadStrategy.SINGLE_REQUEST_STRATEGY), gc);
// -- chunked dataset strategy
gc.gridx = 0;
gc.gridy = 2;
gc.weightx = 0.0;
gc.weighty = 0.0;
pnl.add(rbStrategy.get(UploadStrategy.CHUNKED_DATASET_STRATEGY), gc);
gc.gridx = 1;
gc.gridy = 2;
gc.weightx = 0.0;
gc.weighty = 0.0;
gc.gridwidth = 1;
lbl = lblStrategies.get(UploadStrategy.CHUNKED_DATASET_STRATEGY);
lbl.setText(tr("Upload data in chunks of objects. Chunk size: "));
pnl.add(lbl, gc);
gc.gridx = 2;
gc.gridy = 2;
gc.weightx = 0.0;
gc.weighty = 0.0;
gc.gridwidth = 1;
pnl.add(tfChunkSize = new JosmTextField(4), gc);
gc.gridx = 3;
gc.gridy = 2;
gc.weightx = 1.0;
gc.weighty = 0.0;
gc.gridwidth = 1;
pnl.add(lblNumRequests.get(UploadStrategy.CHUNKED_DATASET_STRATEGY), gc);
// -- single request strategy
gc.gridx = 0;
gc.gridy = 3;
gc.weightx = 0.0;
gc.weighty = 0.0;
pnl.add(rbStrategy.get(UploadStrategy.INDIVIDUAL_OBJECTS_STRATEGY), gc);
gc.gridx = 1;
gc.gridy = 3;
gc.weightx = 0.0;
gc.weighty = 0.0;
gc.gridwidth = 2;
lbl = lblStrategies.get(UploadStrategy.INDIVIDUAL_OBJECTS_STRATEGY);
lbl.setText(tr("Upload each object individually"));
pnl.add(lbl, gc);
gc.gridx = 3;
gc.gridy = 3;
gc.weightx = 1.0;
gc.weighty = 0.0;