Changeset 7021 in josm for trunk/src/org
- Timestamp:
- 2014-04-29T01:18:18+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java
r7001 r7021 45 45 public Component getListCellRendererComponent(JList<? extends OsmPrimitive> list, OsmPrimitive value, int index, boolean isSelected, boolean cellHasFocus) { 46 46 Component def = defaultListCellRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 47 return renderer(def, (OsmPrimitive)value);47 return renderer(def, value); 48 48 } 49 49 -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r7005 r7021 316 316 317 317 protected void setCurrentRelationAsSelection() { 318 Main.main.getCurrentDataSet().setSelected( (Relation)displaylist.getSelectedValue());318 Main.main.getCurrentDataSet().setSelected(displaylist.getSelectedValue()); 319 319 } 320 320 -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r7010 r7021 203 203 OsmDataLayer layer = Main.main.getEditLayer(); 204 204 if (layer == null) return; 205 layer.data.setSelected(Collections.singleton( (OsmPrimitive)model.getElementAt(idx)));205 layer.data.setSelected(Collections.singleton(model.getElementAt(idx))); 206 206 } else if (highlightEnabled && Main.isDisplayingMapView()) { 207 if (helper.highlightOnly( (OsmPrimitive)model.getElementAt(idx))) {207 if (helper.highlightOnly(model.getElementAt(idx))) { 208 208 Main.map.mapView.repaint(); 209 209 } -
trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
r7020 r7021 114 114 @Override 115 115 public void valueChanged(ListSelectionEvent e) { 116 Bookmark b = (Bookmark)bookmarks.getSelectedValue();116 Bookmark b = bookmarks.getSelectedValue(); 117 117 if (b != null) { 118 118 gui.boundingBoxChanged(b.getArea(),BookmarkSelection.this); … … 282 282 if (idx < 0 || idx >= bookmarks.getModel().getSize()) 283 283 return; 284 Bookmark b = (Bookmark)bookmarks.getModel().getElementAt(idx);284 Bookmark b = bookmarks.getModel().getElementAt(idx); 285 285 parent.startDownload(b.getArea()); 286 286 } -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r7017 r7021 1175 1175 // Time between the track point and the previous one, 5 sec if first point, i.e. photos take 1176 1176 // 5 sec before the first track point can be assumed to be take at the starting position 1177 long interval = prevWpTime > 0 ? ( (long)Math.abs(curWpTime - prevWpTime)) : 5*1000;1177 long interval = prevWpTime > 0 ? (Math.abs(curWpTime - prevWpTime)) : 5*1000; 1178 1178 int ret = 0; 1179 1179 -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r7020 r7021 623 623 @Override 624 624 public Component getListCellRendererComponent(JList<? extends ActionDefinition> list, 625 ActionDefinition value, int index, boolean isSelected, boolean cellHasFocus) {625 ActionDefinition action, int index, boolean isSelected, boolean cellHasFocus) { 626 626 String s; 627 627 Icon i; 628 ActionDefinition action = (ActionDefinition)value;629 628 if (!action.isSeparator()) { 630 629 s = action.getDisplayName(); … … 646 645 if (sel) { 647 646 actionsTree.clearSelection(); 648 ActionDefinition action = (ActionDefinition)selected.get(selectedList.getSelectedIndex());647 ActionDefinition action = selected.get(selectedList.getSelectedIndex()); 649 648 actionParametersModel.setCurrentAction(action); 650 649 actionParametersPanel.setVisible(actionParametersModel.getRowCount() > 0); … … 864 863 ActionParser parser = new ActionParser(null); 865 864 for (int i = 0; i < selected.size(); ++i) { 866 ActionDefinition action = (ActionDefinition)selected.get(i);865 ActionDefinition action = selected.get(i); 867 866 if (action.isSeparator()) { 868 867 t.add("|"); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r7020 r7021 78 78 String laf = Main.pref.get("laf", Main.platform.getDefaultStyle()); 79 79 for (int i = 0; i < lafCombo.getItemCount(); ++i) { 80 if ( ((LookAndFeelInfo)lafCombo.getItemAt(i)).getClassName().equals(laf)) {80 if (lafCombo.getItemAt(i).getClassName().equals(laf)) { 81 81 lafCombo.setSelectedIndex(i); 82 82 break; -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r7005 r7021 567 567 List<String> ret = new ArrayList<>(model.getSize()); 568 568 for (int i=0; i< model.getSize();i++){ 569 ret.add( (String)model.get(i));569 ret.add(model.get(i)); 570 570 } 571 571 return ret; -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r7015 r7021 300 300 301 301 for (int i = 0; i < coordinatesCombo.getItemCount(); ++i) { 302 if ( ((CoordinateFormat)coordinatesCombo.getItemAt(i)).name().equals(PROP_COORDINATES.get())) {302 if (coordinatesCombo.getItemAt(i).name().equals(PROP_COORDINATES.get())) { 303 303 coordinatesCombo.setSelectedIndex(i); 304 304 break; … … 445 445 ProjectionChoice pc = null; 446 446 for (int i = 0; i < projectionCombo.getItemCount(); ++i) { 447 ProjectionChoice pc1 = (ProjectionChoice)projectionCombo.getItemAt(i);447 ProjectionChoice pc1 = projectionCombo.getItemAt(i); 448 448 pc1.setPreferences(getSubprojectionPreference(pc1)); 449 449 if (pc1.getId().equals(PROP_PROJECTION.get())) { -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
r7015 r7021 136 136 AutoCompletionListItem bestItem = null; 137 137 for (int i = 0, n = model.getSize(); i < n; i++) { 138 AutoCompletionListItem currentItem = (AutoCompletionListItem)model.getElementAt(i);138 AutoCompletionListItem currentItem = model.getElementAt(i); 139 139 if (currentItem.getValue().equals(pattern)) 140 140 return currentItem; … … 224 224 // find the string in the model or create a new item 225 225 for (int i=0; i< getModel().getSize(); i++) { 226 AutoCompletionListItem acItem = (AutoCompletionListItem)getModel().getElementAt(i);226 AutoCompletionListItem acItem = getModel().getElementAt(i); 227 227 if (s.equals(acItem.getValue())) { 228 228 super.setSelectedItem(acItem); -
trunk/src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java
r7015 r7021 29 29 @Override 30 30 public void addElement(AutoCompletionListItem o) { 31 String newEntry = ((AutoCompletionListItem)o).getValue();31 String newEntry = o.getValue(); 32 32 33 33 // if history contains this object already, delete it, 34 34 // so that it looks like a move to the top 35 35 for (int i = 0; i < getSize(); i++) { 36 String oldEntry = ((AutoCompletionListItem) getElementAt(i)).getValue();36 String oldEntry = getElementAt(i).getValue(); 37 37 if(oldEntry.equals(newEntry)) { 38 38 removeElementAt(i); … … 75 75 public AutoCompletionListItem next() { 76 76 position++; 77 return (AutoCompletionListItem)getElementAt(position);77 return getElementAt(position); 78 78 } 79 79 };
Note:
See TracChangeset
for help on using the changeset viewer.