Exemple #1
0
 protected JPanel buildComparePairSelectionPanel() {
   JPanel p = new JPanel();
   p.setLayout(new FlowLayout(FlowLayout.LEFT));
   p.add(new JLabel(tr("Compare ")));
   JosmComboBox cbComparePair = new JosmComboBox(model.getComparePairListModel());
   cbComparePair.setRenderer(new ComparePairListCellRenderer());
   p.add(cbComparePair);
   return p;
 }
Exemple #2
0
  protected Layer askTargetLayer(List<Layer> targetLayers) {
    JosmComboBox layerList = new JosmComboBox(targetLayers.toArray());
    layerList.setRenderer(new LayerListCellRenderer());
    layerList.setSelectedIndex(0);

    JPanel pnl = new JPanel(new GridBagLayout());
    pnl.add(new JLabel(tr("Please select the target layer.")), GBC.eol());
    pnl.add(layerList, GBC.eol());

    ExtendedDialog ed =
        new ExtendedDialog(
            Main.parent, tr("Select target layer"), new String[] {tr("Merge"), tr("Cancel")});
    ed.setButtonIcons(new String[] {"dialogs/mergedown", "cancel"});
    ed.setContent(pnl);
    ed.showDialog();
    if (ed.getValue() != 1) return null;

    Layer targetLayer = (Layer) layerList.getSelectedItem();
    return targetLayer;
  }