Changeset 30454 in osm
- Timestamp:
- 2014-05-19T01:14:55+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java
r29854 r30454 3 3 import java.awt.datatransfer.DataFlavor; 4 4 import java.awt.datatransfer.Transferable; 5 import java.util.logging.Logger;6 5 7 6 import javax.swing.JComponent; … … 21 20 */ 22 21 public class PrimitiveIdListTransferHandler extends TransferHandler { 23 static private final Logger logger = Logger.getLogger(PrimitiveIdListTransferHandler.class.getName());22 //static private final Logger logger = Logger.getLogger(PrimitiveIdListTransferHandler.class.getName()); 24 23 private PrimitiveIdListProvider provider; 25 24 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AdvancedEditorPanel.java
r29854 r30454 26 26 private TurnRestrictionEditorModel model; 27 27 private TagEditorPanel pnlTagEditor; 28 private JPanel pnlRelationMemberEditor;29 28 private JTable tblRelationMemberEditor; 30 29 private JSplitPane spEditors; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java
r30365 r30454 34 34 * 35 35 */ 36 public class JosmSelectionListModel extends AbstractListModel implements EditLayerChangeListener, SelectionChangedListener, DataSetListener, PrimitiveIdListProvider{36 public class JosmSelectionListModel extends AbstractListModel<OsmPrimitive> implements EditLayerChangeListener, SelectionChangedListener, DataSetListener, PrimitiveIdListProvider{ 37 37 //static private final Logger logger = Logger.getLogger(JosmSelectionListModel.class.getName()); 38 38 … … 54 54 } 55 55 56 public O bjectgetElementAt(int index) {56 public OsmPrimitive getElementAt(int index) { 57 57 return selection.get(index); 58 58 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java
r29854 r30454 21 21 import javax.swing.TransferHandler; 22 22 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 24 import org.openstreetmap.josm.data.osm.event.DatasetEventManager; 24 25 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; … … 41 42 public class JosmSelectionPanel extends JPanel { 42 43 /** the list view */ 43 private JList lstSelection;44 private JList<OsmPrimitive> lstSelection; 44 45 /** the model managing the selection */ 45 46 private JosmSelectionListModel model; … … 53 54 protected void build(OsmDataLayer layer) { 54 55 setLayout(new BorderLayout()); 55 lstSelection = new JList (model);56 lstSelection = new JList<>(model); 56 57 lstSelection.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 57 58 lstSelection.setSelectionModel(model.getListSelectionModel()); … … 136 137 @Override 137 138 public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) { 138 // the JOSM selection list is read-only. Don't allow to drop or paste 139 // data on it 139 // the JOSM selection list is read-only. Don't allow to drop or paste data on it 140 140 return false; 141 141 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java
r29854 r30454 8 8 * A combo box for selecting a turn restriction type. 9 9 */ 10 public class TurnRestrictionComboBox extends JComboBox {10 public class TurnRestrictionComboBox extends JComboBox<Object> { 11 11 12 12 /** -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxModel.java
r29854 r30454 19 19 * 20 20 */ 21 public class TurnRestrictionComboBoxModel implements ComboBoxModel , Observer{21 public class TurnRestrictionComboBoxModel implements ComboBoxModel<Object>, Observer{ 22 22 //static private final Logger logger = Logger.getLogger(TurnRestrictionComboBoxModel.class.getName()); 23 23 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java
r29854 r30454 19 19 20 20 21 public class TurnRestrictionTypeRenderer extends JLabel implements ListCellRenderer {21 public class TurnRestrictionTypeRenderer extends JLabel implements ListCellRenderer<Object> { 22 22 23 23 final private Map<TurnRestrictionType, ImageIcon> icons = new HashMap<TurnRestrictionType, ImageIcon>(); … … 69 69 } 70 70 71 public Component getListCellRendererComponent(JList list, Object value,71 public Component getListCellRendererComponent(JList<? extends Object> list, Object value, 72 72 int index, boolean isSelected, boolean cellHasFocus) { 73 73 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java
r30365 r30454 29 29 import javax.swing.event.ListSelectionListener; 30 30 31 import org.openstreetmap.josm.data.osm.OsmPrimitive; 31 32 import org.openstreetmap.josm.data.osm.PrimitiveId; 32 33 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; … … 45 46 * 46 47 */ 47 public class ViaList extends JList {48 public class ViaList extends JList<OsmPrimitive> { 48 49 49 50 //static private final Logger logger = Logger.getLogger(ViaList.class.getName()); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListModel.java
r29854 r30454 22 22 * 23 23 */ 24 public class ViaListModel extends AbstractListModel implements PrimitiveIdListProvider, Observer{24 public class ViaListModel extends AbstractListModel<OsmPrimitive> implements PrimitiveIdListProvider, Observer{ 25 25 //static private final Logger logger = Logger.getLogger(ViaListModel.class.getName()); 26 26 … … 102 102 } 103 103 104 protected List<Integer> 104 protected List<Integer> moveDown(List<Integer> rows, int targetRow) { 105 105 List<Integer> ret = new ArrayList<Integer>(rows.size()); 106 106 int delta = targetRow - rows.get(0); … … 218 218 } 219 219 220 public O bjectgetElementAt(int index) {220 public OsmPrimitive getElementAt(int index) { 221 221 return vias.get(index); 222 222 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/AbstractTurnRestrictionsListView.java
r23192 r30454 6 6 7 7 import org.openstreetmap.josm.data.Preferences; 8 import org.openstreetmap.josm.data.osm.Relation; 8 9 9 10 /** … … 16 17 abstract class AbstractTurnRestrictionsListView extends JPanel { 17 18 protected TurnRestrictionsListModel model; 18 protected JList lstTurnRestrictions;19 protected JList<Relation> lstTurnRestrictions; 19 20 20 21 public TurnRestrictionsListModel getModel(){ … … 22 23 } 23 24 24 public JList getList() {25 public JList<Relation> getList() { 25 26 return lstTurnRestrictions; 26 27 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java
r30034 r30454 39 39 * 40 40 */ 41 public class TurnRestrictionCellRenderer extends JPanel implements ListCellRenderer , TableCellRenderer{41 public class TurnRestrictionCellRenderer extends JPanel implements ListCellRenderer<Relation>, TableCellRenderer{ 42 42 //static private final Logger logger = Logger.getLogger(TurnRestrictionCellRenderer.class.getName()); 43 43 … … 232 232 /* interface ListCellRenderer */ 233 233 /* ---------------------------------------------------------------------------------- */ 234 public Component getListCellRendererComponent(JList list, Objectvalue,234 public Component getListCellRendererComponent(JList<? extends Relation> list, Relation value, 235 235 int index, boolean isSelected, boolean cellHasFocus) { 236 236 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java
r23192 r30454 18 18 * This is the view for the list of turn restrictions in the current data set. 19 19 */ 20 public class TurnRestrictionsInDatasetView extends AbstractTurnRestrictionsListView {20 public class TurnRestrictionsInDatasetView extends AbstractTurnRestrictionsListView { 21 21 protected void build() { 22 22 DefaultListSelectionModel selectionModel = new DefaultListSelectionModel(); 23 23 model = new TurnRestrictionsInDatasetListModel(selectionModel); 24 lstTurnRestrictions = new JList (model);24 lstTurnRestrictions = new JList<>(model); 25 25 lstTurnRestrictions.setSelectionModel(selectionModel); 26 26 lstTurnRestrictions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java
r29854 r30454 27 27 DefaultListSelectionModel selectionModel = new DefaultListSelectionModel(); 28 28 model = new TurnRestrictionsInSelectionListModel(selectionModel); 29 lstTurnRestrictions = new JList (model);29 lstTurnRestrictions = new JList<>(model); 30 30 lstTurnRestrictions.setSelectionModel(selectionModel); 31 31 lstTurnRestrictions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java
r30145 r30454 399 399 @Override 400 400 public void launch(MouseEvent evt) { 401 JList lst = currentListView.getList();401 JList<Relation> lst = currentListView.getList(); 402 402 if (lst.getSelectedIndices().length == 0) { 403 403 int idx = lst.locationToIndex(evt.getPoint()); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java
r23192 r30454 21 21 * 22 22 */ 23 public class TurnRestrictionsListModel extends AbstractListModel {23 public class TurnRestrictionsListModel extends AbstractListModel<Relation> { 24 24 private final ArrayList<Relation> turnrestrictions = new ArrayList<Relation>(); 25 25 private DefaultListSelectionModel selectionModel; … … 157 157 } 158 158 159 public ObjectgetElementAt(int index) {159 public Relation getElementAt(int index) { 160 160 return turnrestrictions.get(index); 161 161 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssueView.java
r23192 r30454 30 30 private Issue issue; 31 31 private JLabel lblIcon; 32 private StyleSheet styleSheet;33 32 34 33 /** -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/RequiredTagMissingError.java
r23192 r30454 4 4 5 5 import java.awt.event.ActionEvent; 6 import java.util.logging.Logger;7 6 8 7 import javax.swing.AbstractAction; … … 15 14 */ 16 15 public class RequiredTagMissingError extends Issue { 17 static private final Logger logger = Logger.getLogger(RequiredTagMissingError.class.getName());16 //static private final Logger logger = Logger.getLogger(RequiredTagMissingError.class.getName()); 18 17 private String tagKey; 19 18 private String tagValue; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java
r30365 r30454 6 6 import java.util.Arrays; 7 7 import java.util.Collections; 8 import java.util.logging.Logger;9 8 10 9 import javax.swing.AbstractAction; … … 28 27 */ 29 28 public class TurnRestrictionLegSplitRequiredError extends Issue{ 30 static private final Logger logger = Logger.getLogger(TurnRestrictionLegSplitRequiredError.class.getName());29 //static private final Logger logger = Logger.getLogger(TurnRestrictionLegSplitRequiredError.class.getName()); 31 30 32 31 private TurnRestrictionLegRole role; -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java
r29854 r30454 54 54 ); 55 55 break; 56 default: 57 throw new AssertionError("Unexpected type for leg: "+leg.getType()); 56 58 } 57 59 return msg + " " + tr("A way is required instead.");
Note:
See TracChangeset
for help on using the changeset viewer.