예제 #1
0
파일: ListMerger.java 프로젝트: kuny/josm
 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;
 }
예제 #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;
  }