Ignore:
Timestamp:
2014-07-14T04:18:06+02:00 (11 years ago)
Author:
donvip
Message:

[josm_plugins] fix compilation warnings

Location:
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploaderException.java

    r25591 r30532  
    3636 */
    3737public class MapdustActionUploaderException extends Exception {
    38 
    39     /** Serial version UID */
    40     private static final long serialVersionUID = -6128820229665805478L;
    4138
    4239    /**
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/DisplayMenu.java

    r25591 r30532  
    3131import java.awt.event.MouseAdapter;
    3232import java.awt.event.MouseEvent;
     33
    3334import javax.swing.JList;
    3435import javax.swing.JPopupMenu;
     36
     37import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
    3538
    3639
     
    4851
    4952    /** The list of bugs */
    50     private JList listBugs;
     53    private JList<MapdustBug> listBugs;
    5154
    5255    /**
     
    6164     * @param menu The <code>JPopupMenu</code> object
    6265     */
    63     public DisplayMenu(JList listBugs, JPopupMenu menu) {
     66    public DisplayMenu(JList<MapdustBug> listBugs, JPopupMenu menu) {
    6467        this.listBugs = listBugs;
    6568        this.menu = menu;
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/WindowClose.java

    r25591 r30532  
    4545 */
    4646public class WindowClose extends WindowAdapter {
    47 
    48     /** Serial version UID */
    4947
    5048    /** A <code>AbstractDialog</code> object */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java

    r25591 r30532  
    5555public class ExecuteActionList extends MapdustExecuteAction implements
    5656        MapdustUpdateObservable {
    57 
    58     /** Serial version UID */
    59     private static final long serialVersionUID = -7487830542214611774L;
    6057
    6158    /** List of MapdustRefreshObserver objects */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java

    r25828 r30532  
    6464public class ExecuteCloseBug extends MapdustExecuteAction implements
    6565        MapdustBugObservable, MapdustActionObservable {
    66 
    67     /** Serial version UID */
    68     private static final long serialVersionUID = 3468827127588061014L;
    6966
    7067    /** The list of Mapdust bug observers */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/MapdustExecuteAction.java

    r25828 r30532  
    4444 */
    4545public abstract class MapdustExecuteAction extends AbstractAction {
    46 
    47     /** Serial version UID */
    48     private static final long serialVersionUID = 4318259806647818543L;
    4946
    5047    /** The abstract dialog object */
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CreateBugDialog.java

    r25828 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog;
    2929
    30 
    3130import java.awt.Color;
    3231import java.awt.Font;
     
    3433import java.awt.Point;
    3534import java.awt.Rectangle;
     35
    3636import javax.swing.JButton;
    3737import javax.swing.JComboBox;
     
    4141import javax.swing.JTextField;
    4242import javax.swing.WindowConstants;
     43
    4344import org.openstreetmap.josm.Main;
    4445import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
     
    4950import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.ComboBoxRenderer;
    5051import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
     52import org.openstreetmap.josm.plugins.mapdust.service.value.BugType;
    5153import org.openstreetmap.josm.tools.ImageProvider;
    52 
    5354
    5455/**
     
    7172
    7273    /** The combo-box for the bug types */
    73     private JComboBox cbbType;
     74    private JComboBox<BugType> cbbType;
    7475
    7576    /** The nickname label */
     
    248249     * @return the cbbType
    249250     */
    250     public JComboBox getCbbType() {
     251    public JComboBox<BugType> getCbbType() {
    251252        return cbbType;
    252253    }
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/ActionListModel.java

    r25591 r30532  
    4040 * @version $Revision$
    4141 */
    42 public class ActionListModel extends AbstractListModel {
     42public class ActionListModel extends AbstractListModel<MapdustAction> {
    4343
    4444    /** The serial version UID */
     
    7373     */
    7474    @Override
    75     public Object getElementAt(int index) {
     75    public MapdustAction getElementAt(int index) {
    7676        if (index >= 0 && index < list.size()) {
    7777            return list.get(index);
     
    8989        return (list != null ? list.size() : 0);
    9090    }
    91 
    9291}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java

    r25591 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
    2929
    30 
    3130import java.util.List;
    3231import javax.swing.AbstractListModel;
    3332import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
    34 
    3533
    3634/**
     
    4038 *
    4139 */
    42 public class BugsListModel extends AbstractListModel {
     40public class BugsListModel extends AbstractListModel<MapdustBug> {
    4341
    4442    /** The serial version UID */
     
    7169     */
    7270    @Override
    73     public Object getElementAt(int index) {
     71    public MapdustBug getElementAt(int index) {
    7472        if (index >= 0 && index < bugs.size()) {
    7573            return bugs.get(index);
     
    9492        this.fireContentsChanged(this, 0, bugs.size() - 1);
    9593    }
    96 
    9794}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/CommentListModel.java

    r25591 r30532  
    4040 *
    4141 */
    42 public class CommentListModel implements ListModel {
     42public class CommentListModel implements ListModel<MapdustComment> {
    4343
    4444    /** The list of <code>MapdustBug</code> objects */
     
    6868     */
    6969    @Override
    70     public Object getElementAt(int index) {
     70    public MapdustComment getElementAt(int index) {
    7171        if (index > 0 && index < comments.length) {
    7272            return comments[index];
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/TypesListModel.java

    r27874 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.model;
    2929
    30 
    3130import javax.swing.AbstractListModel;
    3231import javax.swing.ComboBoxModel;
    3332import org.openstreetmap.josm.plugins.mapdust.service.value.BugType;
    34 
    3533
    3634/**
     
    4038 * @version $Revision$
    4139 */
    42 public class TypesListModel extends AbstractListModel implements ComboBoxModel {
     40public class TypesListModel extends AbstractListModel<BugType> implements ComboBoxModel<BugType> {
    4341
    4442    /** The serial version UID */
     
    6563     */
    6664    @Override
    67     public Object getElementAt(int index) {
     65    public BugType getElementAt(int index) {
    6866        return types[index];
    6967    }
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustActionPanel.java

    r25591 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.panel;
    2929
     30import static org.openstreetmap.josm.tools.I18n.tr;
    3031
    31 import static org.openstreetmap.josm.tools.I18n.tr;
    3232import java.awt.BorderLayout;
    3333import java.util.List;
     34
    3435import javax.swing.AbstractAction;
    3536import javax.swing.JList;
     
    3738import javax.swing.JScrollPane;
    3839import javax.swing.JToggleButton;
     40
    3941import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin;
    4042import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteActionList;
     
    4244import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil;
    4345import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
    44 
    4546
    4647/**
     
    5253public class MapdustActionPanel extends JPanel {
    5354
    54     /** The serial version UID */
    55     private static final long serialVersionUID = -6648507056357610823L;
    56 
    5755    /** The scroll pane */
    5856    private JScrollPane cmpActionList;
    5957
    6058    /** The JList containing the MapDust action objects */
    61     private JList actionJList;
     59    private JList<MapdustAction> actionJList;
    6260
    6361    /** The list of <code>MapdustAction</code> objects */
     
    113111        cmpActionList.getViewport().setView(actionJList);
    114112        cmpActionList.invalidate();
    115 
    116113    }
    117114
     
    133130        this.actionList = actionList;
    134131    }
    135 
    136132}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugListPanel.java

    r25839 r30532  
    7979
    8080    /** The list of bugs */
    81     private JList mapdustBugsJList;
     81    private JList<MapdustBug> mapdustBugsJList;
    8282
    8383    /** The scroll pane for the <code>MapdustBug</code>s */
     
    163163            String text = " No bugs in the current view for the selected";
    164164            text += " filters!";
    165             JList textJList = new JList(new String[] { text });
     165            JList<String> textJList = new JList<>(new String[] { text });
    166166            textJList.setBorder(new LineBorder(Color.black, 1, false));
    167167            textJList.setCellRenderer(new BugListCellRenderer());
     
    192192            String text = " No bugs in the current view for the selected";
    193193            text += " filters!";
    194             JList textJList = new JList(new String[] { text });
     194            JList<String> textJList = new JList<>(new String[] { text });
    195195            textJList.setBorder(new LineBorder(Color.black, 1, false));
    196196            textJList.setCellRenderer(new BugListCellRenderer());
     
    198198        } else {
    199199            if (mapdustBugsJList == null) {
    200                 mapdustBugsJList = ComponentUtil.createJList(mapdustBugsList,
    201                         menu);
     200                mapdustBugsJList = ComponentUtil.createJList(mapdustBugsList, menu);
    202201                mapdustBugsJList.addListSelectionListener(this);
    203202                DisplayMenu adapter = new DisplayMenu(mapdustBugsJList, menu);
     
    349348     * @return the listBugs
    350349     */
    351     public JList getMapdustBugsJList() {
     350    public JList<MapdustBug> getMapdustBugsJList() {
    352351        return mapdustBugsJList;
    353352    }
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ActionListCellRenderer.java

    r25591 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
    2929
    30 
    3130import java.awt.Component;
    3231import java.awt.Font;
     
    3938import org.openstreetmap.josm.tools.ImageProvider;
    4039
    41 
    4240/**
    4341 * Cell renderer for the <code>MapdustAction</code> objects.
     
    4745 */
    4846public class ActionListCellRenderer extends DefaultListCellRenderer {
    49 
    50     /** The serial version UID */
    51     private static final long serialVersionUID = 7552949107018269769L;
    5247
    5348    /**
     
    6156     */
    6257    @Override
    63     public Component getListCellRendererComponent(JList list, Object value,
     58    public Component getListCellRendererComponent(JList<?> list, Object value,
    6459            int index, boolean isSelected, boolean hasFocus) {
    6560        JLabel label = (JLabel) super.getListCellRendererComponent(list, value,
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/BugListCellRenderer.java

    r25591 r30532  
    6161     */
    6262    @Override
    63     public Component getListCellRendererComponent(JList list, Object value,
     63    public Component getListCellRendererComponent(JList<?> list, Object value,
    6464            int index, boolean isSelected, boolean hasFocus) {
    6565        JLabel label =(JLabel) super.getListCellRendererComponent(list, value,
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ComboBoxRenderer.java

    r27874 r30532  
    2828package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer;
    2929
    30 
    3130import java.awt.Component;
    3231import java.awt.Font;
     
    3938import org.openstreetmap.josm.tools.ImageProvider;
    4039
    41 
    4240/**
    4341 * Cell renderer for the <code>MapdustBug</code> types.
     
    4543 * @author Bea
    4644 */
    47 public class ComboBoxRenderer implements ListCellRenderer {
     45public class ComboBoxRenderer implements ListCellRenderer<BugType> {
    4846
    4947    /** The default renderer */
     
    6159     */
    6260    @Override
    63     public Component getListCellRendererComponent(JList list, Object value,
     61    public Component getListCellRendererComponent(JList<? extends BugType> list, BugType type,
    6462            int index, boolean isSelected, boolean cellHasFocus) {
    6563        JLabel label = (JLabel) defaultRenderer.getListCellRendererComponent(
    66                 list, value, index, isSelected, cellHasFocus);
    67         if (value instanceof BugType) {
    68             BugType type = (BugType) value;
    69             String iconPath = "bugs/normal/open_" + type.getKey() + ".png";
    70             String text = type.getValue();
    71             ImageIcon icon = ImageProvider.get(iconPath);
    72             label.setIcon(icon);
    73             label.setText(text);
    74             label.setFont( new Font("Times New Roman", Font.BOLD, 12));
    75         }
     64                list, type, index, isSelected, cellHasFocus);
     65        String iconPath = "bugs/normal/open_" + type.getKey() + ".png";
     66        String text = type.getValue();
     67        ImageIcon icon = ImageProvider.get(iconPath);
     68        label.setIcon(icon);
     69        label.setText(text);
     70        label.setFont( new Font("Times New Roman", Font.BOLD, 12));
    7671        return label;
    7772    }
    78 
    7973}
  • applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/ComponentUtil.java

    r25828 r30532  
    3030
    3131import static org.openstreetmap.josm.tools.I18n.tr;
     32
    3233import java.awt.Color;
    3334import java.awt.Component;
     
    3536import java.awt.Rectangle;
    3637import java.util.List;
     38
    3739import javax.swing.AbstractAction;
    3840import javax.swing.Action;
     
    5254import javax.swing.SwingConstants;
    5355import javax.swing.border.LineBorder;
     56
    5457import org.openstreetmap.josm.plugins.mapdust.gui.component.model.ActionListModel;
    5558import org.openstreetmap.josm.plugins.mapdust.gui.component.model.BugsListModel;
     
    5861import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.BugListCellRenderer;
    5962import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction;
     63import org.openstreetmap.josm.plugins.mapdust.service.value.BugType;
    6064import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug;
    6165import org.openstreetmap.josm.tools.ImageProvider;
     
    211215     * @return A <code>JScrollPane</code> object
    212216     */
    213     public static JScrollPane createJScrollPane(JList list) {
     217    public static JScrollPane createJScrollPane(JList<?> list) {
    214218        JScrollPane jScrollPane = new JScrollPane();
    215219        jScrollPane.setViewportView(list);
     
    224228     * @return A <code>JList</code> object
    225229     */
    226     public static JList createJList(List<MapdustAction> list) {
    227         final JList jList = new JList(new ActionListModel(list));
     230    public static JList<MapdustAction> createJList(List<MapdustAction> list) {
     231        final JList<MapdustAction> jList = new JList<>(new ActionListModel(list));
    228232        jList.setBorder(new LineBorder(Color.black, 1, false));
    229233        jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    240244     * @return A <code>JList</code>
    241245     */
    242     public static JList createJList(List<MapdustBug> bugsList,
    243             final JPopupMenu menu) {
    244         final JList jList = new JList(new BugsListModel(bugsList));
     246    public static JList<MapdustBug> createJList(List<MapdustBug> bugsList, final JPopupMenu menu) {
     247        final JList<MapdustBug> jList = new JList<>(new BugsListModel(bugsList));
    245248        jList.setBorder(new LineBorder(Color.black, 1, false));
    246249        jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    296299     * @return A <code>JComboBox</code> object
    297300     */
    298     public static JComboBox createJComboBox(Rectangle bounds,
    299             ListCellRenderer renderer, Color backgroundColor) {
    300         JComboBox jComboBox = new JComboBox(new TypesListModel());
     301    public static JComboBox<BugType> createJComboBox(Rectangle bounds,
     302            ListCellRenderer<BugType> renderer, Color backgroundColor) {
     303        JComboBox<BugType> jComboBox = new JComboBox<>(new TypesListModel());
    301304        jComboBox.setSelectedIndex(0);
    302305        jComboBox.setBackground(backgroundColor);
Note: See TracChangeset for help on using the changeset viewer.