Changeset 7017 in josm


Ignore:
Timestamp:
2014-04-28T00:27:06+02:00 (5 years ago)
Author:
Don-vip
Message:

see #8465 - fix easy compilation warnings

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/josm.jnlp

    r6955 r7017  
    2020    </security>
    2121    <resources>
    22         <j2se version="1.6+"/>
     22        <j2se version="1.7+"/>
    2323        <jar href="josm-tested.jar"/>
    2424        <property name="java.util.Arrays.useLegacyMergeSort" value="true"/>
  • trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    r7001 r7017  
    5858
    5959    protected Layer askTargetLayer(List<Layer> targetLayers) {
    60         JosmComboBox layerList = new JosmComboBox(targetLayers.toArray());
     60        JosmComboBox<Layer> layerList = new JosmComboBox<>(targetLayers.toArray(new Layer[0]));
    6161        layerList.setRenderer(new LayerListCellRenderer());
    6262        layerList.setSelectedIndex(0);
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r6930 r7017  
    102102            final WMSLayerTree tree = new WMSLayerTree();
    103103            tree.updateTree(wms);
    104             final JComboBox formats = new JComboBox(wms.getFormats().toArray());
     104            final JComboBox<String> formats = new JComboBox<>(wms.getFormats().toArray(new String[0]));
    105105            formats.setSelectedItem(wms.getPreferredFormats());
    106106            formats.setToolTipText(tr("Select image format for WMS layer"));
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java

    r7005 r7017  
    826826    }
    827827
    828     public class ComparePairListModel extends AbstractListModel implements ComboBoxModel {
     828    public class ComparePairListModel extends AbstractListModel<ComparePairType> implements ComboBoxModel<ComparePairType> {
    829829
    830830        private int selectedIdx;
     
    843843
    844844        @Override
    845         public Object getElementAt(int index) {
     845        public ComparePairType getElementAt(int index) {
    846846            if (index < compareModes.size())
    847847                return compareModes.get(index);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r6890 r7017  
    240240        p.setLayout(new FlowLayout(FlowLayout.LEFT));
    241241        p.add(new JLabel(tr("Compare ")));
    242         JosmComboBox cbComparePair = new JosmComboBox(model.getComparePairListModel());
     242        JosmComboBox<ComparePairType> cbComparePair = new JosmComboBox<>(model.getComparePairListModel());
    243243        cbComparePair.setRenderer(new ComparePairListCellRenderer());
    244244        p.add(cbComparePair);
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellRenderer.java

    r6623 r7017  
    2727    private ImageIcon iconDecided;
    2828    private ImageIcon iconUndecided;
    29     private DefaultComboBoxModel model;
    30     private JosmComboBox cbDecisionRenderer;
     29    private DefaultComboBoxModel<Object> model;
     30    private JosmComboBox<Object> cbDecisionRenderer;
    3131
    3232    /**
     
    3737        iconDecided = ImageProvider.get("dialogs/conflict", "tagconflictresolved");
    3838        iconUndecided = ImageProvider.get("dialogs/conflict", "tagconflictunresolved");
    39         cbDecisionRenderer = new JosmComboBox(model = new DefaultComboBoxModel());
     39        model = new DefaultComboBoxModel<>();
     40        cbDecisionRenderer = new JosmComboBox<>(model);
    4041    }
    4142
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionRenderer.java

    r7001 r7017  
    1616public class RelationMemberConflictDecisionRenderer extends JLabel implements TableCellRenderer, ListCellRenderer<RelationMemberConflictDecisionType> {
    1717
    18     private JosmComboBox cbDecisionTypes;
     18    private JosmComboBox<RelationMemberConflictDecisionType> cbDecisionTypes;
    1919
    2020    protected void resetTableRenderer() {
     
    3636     */
    3737    public RelationMemberConflictDecisionRenderer() {
    38         cbDecisionTypes = new JosmComboBox(RelationMemberConflictDecisionType.values());
     38        cbDecisionTypes = new JosmComboBox<>(RelationMemberConflictDecisionType.values());
    3939        cbDecisionTypes.setRenderer(this);
    4040    }
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r7005 r7017  
    7373        new Server("Nominatim","https://nominatim.openstreetmap.org/search?format=xml&q=",tr("Class Type"),tr("Bounds"))
    7474    };
    75     private final JosmComboBox server = new JosmComboBox(SERVERS);
     75    private final JosmComboBox<Server> server = new JosmComboBox<>(SERVERS);
    7676
    7777    private static class Server {
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetManagementPanel.java

    r6889 r7017  
    5353    private JRadioButton rbUseNew;
    5454    private JRadioButton rbExisting;
    55     private JosmComboBox cbOpenChangesets;
     55    private JosmComboBox<Changeset> cbOpenChangesets;
    5656    private JCheckBox cbCloseAfterUpload;
    5757    private OpenChangesetComboBoxModel model;
     
    105105        model = new OpenChangesetComboBoxModel();
    106106        ChangesetCache.getInstance().addChangesetCacheListener(model);
    107         cbOpenChangesets = new JosmComboBox(model);
     107        cbOpenChangesets = new JosmComboBox<>(model);
    108108        cbOpenChangesets.setToolTipText(tr("Select an open changeset"));
    109109        cbOpenChangesets.setRenderer(new ChangesetCellRenderer());
     
    208208
    209209    /**
    210      * Replies true if the user has chosen to close the changeset after the
    211      * next upload
    212      *
     210     * Determines if the user has chosen to close the changeset after the next upload.
     211     * @return {@code true} if the user has chosen to close the changeset after the next upload
    213212     */
    214213    public boolean isCloseChangesetAfterUpload() {
  • trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java

    r7005 r7017  
    4747    private boolean canceled;
    4848    /** the list model */
    49     private DefaultListModel model;
     49    private DefaultListModel<Changeset> model;
    5050
    5151    private SideButton btnCloseChangesets;
     
    6262        JPanel pnl = new JPanel();
    6363        pnl.setLayout(new BorderLayout());
    64         model = new DefaultListModel();
    65         pnl.add(new JScrollPane(lstOpenChangesets = new JList(model)), BorderLayout.CENTER);
     64        model = new DefaultListModel<>();
     65        pnl.add(new JScrollPane(lstOpenChangesets = new JList<>(model)), BorderLayout.CENTER);
    6666        lstOpenChangesets.setCellRenderer(new ChangesetCellRenderer());
    6767        return pnl;
     
    110110    }
    111111
     112    /**
     113     * Constructs a new {@code CloseChangesetDialog}.
     114     */
    112115    public CloseChangesetDialog() {
    113116        super(JOptionPane.getFrameForComponent(Main.parent), ModalityType.DOCUMENT_MODAL);
     
    130133
    131134        protected void refreshEnabledState() {
    132             List list = lstOpenChangesets.getSelectedValuesList();
     135            List<Changeset> list = lstOpenChangesets.getSelectedValuesList();
    133136            setEnabled(list != null && !list.isEmpty());
    134137        }
  • trunk/src/org/openstreetmap/josm/gui/io/OpenChangesetComboBoxModel.java

    r7005 r7017  
    1717 *
    1818 */
    19 public class OpenChangesetComboBoxModel extends DefaultComboBoxModel implements ChangesetCacheListener {
     19public class OpenChangesetComboBoxModel extends DefaultComboBoxModel<Changeset> implements ChangesetCacheListener {
    2020    private List<Changeset> changesets;
    2121    private Changeset selectedChangeset = null;
     
    2828    }
    2929
     30    /**
     31     * Constructs a new {@code OpenChangesetComboBoxModel}.
     32     */
    3033    public OpenChangesetComboBoxModel() {
    3134        this.changesets = new ArrayList<>();
     
    7174    /* ------------------------------------------------------------------------------------ */
    7275    @Override
    73     public Object getElementAt(int index) {
     76    public Changeset getElementAt(int index) {
    7477        return changesets.get(index);
    7578    }
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java

    r7001 r7017  
    161161    private static class  LayerListWarningMessagePanel extends JPanel {
    162162        private JLabel lblMessage;
    163         private JList lstLayers;
     163        private JList<SaveLayerInfo> lstLayers;
    164164
    165165        protected void build() {
     
    173173            add(lblMessage = new JLabel(), gc);
    174174            lblMessage.setHorizontalAlignment(JLabel.LEFT);
    175             lstLayers = new JList<SaveLayerInfo>();
     175            lstLayers = new JList<>();
    176176            lstLayers.setCellRenderer(
    177177                    new DefaultListCellRenderer() {
     
    197197            build();
    198198            lblMessage.setText(msg);
    199             lstLayers.setListData(infos.toArray());
     199            lstLayers.setListData(infos.toArray(new SaveLayerInfo[0]));
    200200        }
    201201    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r7005 r7017  
    119119    List<GpxDataWrapper> gpxLst = new ArrayList<>();
    120120    JPanel outerPanel;
    121     JosmComboBox cbGpx;
     121    JosmComboBox<GpxDataWrapper> cbGpx;
    122122    JosmTextField tfTimezone;
    123123    JosmTextField tfOffset;
     
    227227        JLabel lbExifTime;
    228228        JosmTextField tfGpsTime;
    229         JosmComboBox cbTimezones;
     229        JosmComboBox<String> cbTimezones;
    230230        ImageDisplay imgDisp;
    231231        JList<String> imgList;
     
    306306            Collections.sort(vtTimezones);
    307307
    308             cbTimezones = new JosmComboBox(vtTimezones.toArray());
     308            cbTimezones = new JosmComboBox<>(vtTimezones.toArray(new String[0]));
    309309
    310310            String tzId = Main.pref.get("geoimage.timezoneid", "");
     
    376376
    377377                @Override
    378                 public void actionPerformed(ActionEvent arg0) {
     378                public void actionPerformed(ActionEvent ae) {
    379379                    JFileChooser fc = DiskAccessAction.createAndOpenFileChooser(true, false, null, JpegFileFilter.getInstance(), JFileChooser.FILES_ONLY, "geoimage.lastdirectory");
    380380                    if (fc == null)
     
    480480        panelCb.add(new JLabel(tr("GPX track: ")));
    481481
    482         cbGpx = new JosmComboBox(gpxLst.toArray());
     482        cbGpx = new JosmComboBox<>(gpxLst.toArray(new GpxDataWrapper[0]));
    483483        if (defaultItem != null) {
    484484            cbGpx.setSelectedItem(defaultItem);
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java

    r7005 r7017  
    7070                            try {
    7171                                wait(200);
    72                             } catch (InterruptedException e) {
     72                            } catch (InterruptedException ex) {
    7373                                Main.warn("InterruptedException in "+getClass().getSimpleName()+" while precaching WMS");
    7474                            }
     
    101101            return null;
    102102        }
    103         JosmComboBox layerList = new JosmComboBox(targetLayers.toArray());
     103        JosmComboBox<WMSLayer> layerList = new JosmComboBox<>(targetLayers.toArray(new WMSLayer[0]));
    104104        layerList.setRenderer(new LayerListCellRenderer());
    105105        layerList.setSelectedIndex(0);
     
    120120        JOptionPane.showMessageDialog(Main.parent, tr("There are no imagery layers."), tr("No imagery layers"), JOptionPane.WARNING_MESSAGE);
    121121    }
    122 
    123122}
Note: See TracChangeset for help on using the changeset viewer.