Changeset 10001 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2016-03-17T01:50:12+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r10000 r10001 418 418 name = tr("relation"); 419 419 } 420 String admin _level = relation.get("admin_level");421 if (admin _level != null) {422 name += '['+admin _level+']';420 String adminLevel = relation.get("admin_level"); 421 if (adminLevel != null) { 422 name += '['+adminLevel+']'; 423 423 } 424 424 -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r9983 r10001 320 320 321 321 for (int i = 0; i < bTexts.length; i++) { 322 final int final _i= i;322 final int finalI = i; 323 323 Action action = new AbstractAction(bTexts[i]) { 324 324 @Override 325 325 public void actionPerformed(ActionEvent evt) { 326 buttonAction(final _i, evt);326 buttonAction(finalI, evt); 327 327 } 328 328 }; -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r9976 r10001 553 553 LatLon ll2 = getLatLon(width / 2 + 50, height / 2); 554 554 if (ll1.isValid() && ll2.isValid() && b.contains(ll1) && b.contains(ll2)) { 555 double d _m = ll1.greatCircleDistance(ll2);556 double d _en = 100 * scale;557 double scaleMin = 0.01 * d _en / d_m / 100;555 double dm = ll1.greatCircleDistance(ll2); 556 double den = 100 * scale; 557 double scaleMin = 0.01 * den / dm / 100; 558 558 if (!Double.isInfinite(scaleMin) && newScale < scaleMin) { 559 559 newScale = scaleMin; … … 1026 1026 } 1027 1027 1028 Point2D A = getPoint2D(lastN);1029 Point2D B = getPoint2D(n);1030 double c = A.distanceSq(B);1031 double a = p.distanceSq( B);1032 double b = p.distanceSq( A);1028 Point2D pA = getPoint2D(lastN); 1029 Point2D pB = getPoint2D(n); 1030 double c = pA.distanceSq(pB); 1031 double a = p.distanceSq(pB); 1032 double b = p.distanceSq(pA); 1033 1033 1034 1034 /* perpendicular distance squared … … 1142 1142 * @param p the point for which to search the nearest segment. 1143 1143 * @param predicate the returned object has to fulfill certain properties. 1144 * @param use _selected whether selected way segments should be preferred.1144 * @param useSelected whether selected way segments should be preferred. 1145 1145 * @param preferredRefs - prefer segments related to these primitives, may be null 1146 1146 * … … 1153 1153 */ 1154 1154 public final WaySegment getNearestWaySegment(Point p, Predicate<OsmPrimitive> predicate, 1155 boolean use _selected, Collection<OsmPrimitive> preferredRefs) {1155 boolean useSelected, Collection<OsmPrimitive> preferredRefs) { 1156 1156 WaySegment wayseg = null, ntsel = null, ntref = null; 1157 1157 if (preferredRefs != null && preferredRefs.isEmpty()) preferredRefs = null; … … 1185 1185 } 1186 1186 } 1187 if (ntsel != null && use _selected)1187 if (ntsel != null && useSelected) 1188 1188 return ntsel; 1189 1189 if (ntref != null) … … 1352 1352 * @param p The point on screen. 1353 1353 * @param predicate the returned object has to fulfill certain properties. 1354 * @param use _selected whether to prefer primitives that are currently selected or referred by selected primitives1354 * @param useSelected whether to prefer primitives that are currently selected or referred by selected primitives 1355 1355 * 1356 1356 * @return A primitive within snap-distance to point p, … … 1359 1359 * @see #getNearestWay(Point, Predicate) 1360 1360 */ 1361 public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean use _selected) {1361 public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean useSelected) { 1362 1362 Collection<OsmPrimitive> sel; 1363 1363 DataSet ds = getCurrentDataSet(); 1364 if (use _selected && ds != null) {1364 if (useSelected && ds != null) { 1365 1365 sel = ds.getSelected(); 1366 1366 } else { 1367 1367 sel = null; 1368 1368 } 1369 OsmPrimitive osm = getNearestNode(p, predicate, use _selected, sel);1370 1371 if (isPrecedenceNode((Node) osm, p, use _selected)) return osm;1369 OsmPrimitive osm = getNearestNode(p, predicate, useSelected, sel); 1370 1371 if (isPrecedenceNode((Node) osm, p, useSelected)) return osm; 1372 1372 WaySegment ws; 1373 if (use _selected) {1374 ws = getNearestWaySegment(p, predicate, use _selected, sel);1373 if (useSelected) { 1374 ws = getNearestWaySegment(p, predicate, useSelected, sel); 1375 1375 } else { 1376 ws = getNearestWaySegment(p, predicate, use _selected);1376 ws = getNearestWaySegment(p, predicate, useSelected); 1377 1377 } 1378 1378 if (ws == null) return osm; 1379 1379 1380 if ((ws.way.isSelected() && use _selected) || osm == null) {1380 if ((ws.way.isSelected() && useSelected) || osm == null) { 1381 1381 // either (no _selected_ nearest node found, if desired) or no nearest node was found 1382 1382 osm = ws.way; -
trunk/src/org/openstreetmap/josm/gui/NotificationManager.java
r9078 r10001 108 108 currentNotificationPanel.validate(); 109 109 110 int MARGIN= 5;110 int margin = 5; 111 111 int x, y; 112 112 JFrame parentWindow = (JFrame) Main.parent; … … 115 115 MapView mv = Main.map.mapView; 116 116 Point mapViewPos = SwingUtilities.convertPoint(mv.getParent(), mv.getX(), mv.getY(), Main.parent); 117 x = mapViewPos.x + MARGIN;118 y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - MARGIN;117 x = mapViewPos.x + margin; 118 y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - margin; 119 119 } else { 120 x = MARGIN;121 y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - MARGIN;120 x = margin; 121 y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - margin; 122 122 } 123 123 parentWindow.getLayeredPane().add(currentNotificationPanel, JLayeredPane.POPUP_LAYER, 0); -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r9983 r10001 240 240 return; 241 241 242 Point p _max = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y));243 Point p _min = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y));244 245 iSelectionRectStart = getPosition(p _min);246 iSelectionRectEnd = getPosition(p _max);242 Point pMax = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y)); 243 Point pMin = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y)); 244 245 iSelectionRectStart = getPosition(pMin); 246 iSelectionRectEnd = getPosition(pMax); 247 247 248 248 Bounds b = new Bounds( -
trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
r9078 r10001 154 154 155 155 // calc the screen coordinates for the new selection rectangle 156 MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon());157 MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon());158 159 156 List<MapMarker> marker = new ArrayList<>(2); 160 marker.add( xmin_ymin);161 marker.add( xmax_ymax);157 marker.add(new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon())); 158 marker.add(new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon())); 162 159 mapViewer.setBoundingBox(bbox); 163 160 mapViewer.setMapMarkerList(marker); … … 704 701 int zoomDiff = MAX_ZOOM - zoom; 705 702 Point tlc = getTopLeftCoordinates(); 706 int x _min = (min.x >> zoomDiff) - tlc.x;707 int y _min = (min.y >> zoomDiff) - tlc.y;708 int x _max = (max.x >> zoomDiff) - tlc.x;709 int y _max = (max.y >> zoomDiff) - tlc.y;710 711 int w = x _max - x_min;712 int h = y _max - y_min;703 int xMin = (min.x >> zoomDiff) - tlc.x; 704 int yMin = (min.y >> zoomDiff) - tlc.y; 705 int xMax = (max.x >> zoomDiff) - tlc.x; 706 int yMax = (max.y >> zoomDiff) - tlc.y; 707 708 int w = xMax - xMin; 709 int h = yMax - yMin; 713 710 g.setColor(new Color(0.9f, 0.7f, 0.7f, 0.6f)); 714 g.fillRect(x _min, y_min, w, h);711 g.fillRect(xMin, yMin, w, h); 715 712 716 713 g.setColor(Color.BLACK); 717 g.drawRect(x _min, y_min, w, h);714 g.drawRect(xMin, yMin, w, h); 718 715 } catch (Exception e) { 719 716 Main.error(e); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r10000 r10001 418 418 abstract static class CopyAction extends AbstractAction implements ListSelectionListener { 419 419 420 protected CopyAction(String icon _name, String action_name, String short_description) {421 ImageIcon icon = ImageProvider.get("dialogs/conflict", icon _name);420 protected CopyAction(String iconName, String actionName, String shortDescription) { 421 ImageIcon icon = ImageProvider.get("dialogs/conflict", iconName); 422 422 putValue(Action.SMALL_ICON, icon); 423 423 if (icon == null) { 424 putValue(Action.NAME, action _name);424 putValue(Action.NAME, actionName); 425 425 } 426 putValue(Action.SHORT_DESCRIPTION, short _description);426 putValue(Action.SHORT_DESCRIPTION, shortDescription); 427 427 setEnabled(false); 428 428 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
r9078 r10001 107 107 public void reconstruct(Action action, ToggleDialog triggeredBy) { 108 108 109 final int N= allDialogs.size();109 final int n = allDialogs.size(); 110 110 111 111 /** … … 126 126 * in the last panel anyway. 127 127 */ 128 JPanel p = panels.get( N-1); // current Panel (start with last one)128 JPanel p = panels.get(n-1); // current Panel (start with last one) 129 129 int k = -1; // indicates that current Panel index is N-1, but no default-view-Dialog has been added to this Panel yet. 130 for (int i = N-1; i >= 0; --i) {130 for (int i = n-1; i >= 0; --i) { 131 131 final ToggleDialog dlg = allDialogs.get(i); 132 132 if (dlg.isDialogInDefaultView()) { 133 133 if (k == -1) { 134 k = N-1;134 k = n-1; 135 135 } else { 136 136 --k; … … 146 146 147 147 if (k == -1) { 148 k = N-1;149 } 150 final int numPanels = N- k;148 k = n-1; 149 } 150 final int numPanels = n - k; 151 151 152 152 /** … … 154 154 */ 155 155 if (action == Action.ELEMENT_SHRINKS) { 156 for (int i = 0; i < N; ++i) {156 for (int i = 0; i < n; ++i) { 157 157 final ToggleDialog dlg = allDialogs.get(i); 158 158 if (dlg.isDialogInDefaultView()) { … … 191 191 192 192 /** total Height */ 193 final int H= mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height;193 final int h = mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height; 194 194 195 195 /** space, that is available for dialogs in default view (after the reconfiguration) */ 196 final int s2 = H- (numPanels - 1) * DIVIDER_SIZE - sumC;197 198 final int hp _trig = triggeredBy.getPreferredHeight();199 if (hp _trig <= 0) throw new IllegalStateException(); // Must be positive196 final int s2 = h - (numPanels - 1) * DIVIDER_SIZE - sumC; 197 198 final int hpTrig = triggeredBy.getPreferredHeight(); 199 if (hpTrig <= 0) throw new IllegalStateException(); // Must be positive 200 200 201 201 /** The new dialog gets a fair share */ 202 final int hn _trig = hp_trig * s2 / (hp_trig + sumP);203 triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hn _trig));202 final int hnTrig = hpTrig * s2 / (hpTrig + sumP); 203 triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hnTrig)); 204 204 205 205 /** This is remainig for the other default view dialogs */ 206 final int R = s2 - hn_trig;206 final int r = s2 - hnTrig; 207 207 208 208 /** 209 209 * Take space only from dialogs that are relatively large 210 210 */ 211 int D_m = 0; // additional space needed by the small dialogs212 int D_p = 0; // available space from the large dialogs213 for (int i = 0; i < N; ++i) {211 int dm = 0; // additional space needed by the small dialogs 212 int dp = 0; // available space from the large dialogs 213 for (int i = 0; i < n; ++i) { 214 214 final ToggleDialog dlg = allDialogs.get(i); 215 215 if (dlg.isDialogInDefaultView() && dlg != triggeredBy) { 216 216 final int ha = dlg.getSize().height; // current 217 final int h0 = ha * R/ sumA; // proportional shrinking218 final int he = dlg.getPreferredHeight() * s2 / (sumP + hp _trig); // fair share217 final int h0 = ha * r / sumA; // proportional shrinking 218 final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig); // fair share 219 219 if (h0 < he) { // dialog is relatively small 220 220 int hn = Math.min(ha, he); // shrink less, but do not grow 221 D_m += hn - h0;221 dm += hn - h0; 222 222 } else { // dialog is relatively large 223 D_p += h0 - he;223 dp += h0 - he; 224 224 } 225 225 } 226 226 } 227 227 /** adjust, without changing the sum */ 228 for (int i = 0; i < N; ++i) {228 for (int i = 0; i < n; ++i) { 229 229 final ToggleDialog dlg = allDialogs.get(i); 230 230 if (dlg.isDialogInDefaultView() && dlg != triggeredBy) { 231 231 final int ha = dlg.getHeight(); 232 final int h0 = ha * R/ sumA;233 final int he = dlg.getPreferredHeight() * s2 / (sumP + hp _trig);232 final int h0 = ha * r / sumA; 233 final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig); 234 234 if (h0 < he) { 235 235 int hn = Math.min(ha, he); … … 238 238 int d; 239 239 try { 240 d = (h0-he) * D_m / D_p;240 d = (h0-he) * dm / dp; 241 241 } catch (ArithmeticException e) { /* D_p may be zero - nothing wrong with that. */ 242 242 d = 0; … … 253 253 final List<Node> ch = new ArrayList<>(); 254 254 255 for (int i = k; i <= N-1; ++i) {255 for (int i = k; i <= n-1; ++i) { 256 256 if (i != k) { 257 257 ch.add(new Divider()); … … 279 279 * Hide the Panel, if there is nothing to show 280 280 */ 281 if (numPanels == 1 && panels.get( N-1).getComponents().length == 0) {281 if (numPanels == 1 && panels.get(n-1).getComponents().length == 0) { 282 282 parent.setDividerSize(0); 283 283 this.setVisible(false); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
r9970 r10001 212 212 } 213 213 214 private Direction determineDirection(int ref _i, Direction ref_direction, int k) {215 return determineDirection(ref _i, ref_direction, k, false);214 private Direction determineDirection(int refI, Direction refDirection, int k) { 215 return determineDirection(refI, refDirection, k, false); 216 216 } 217 217 … … 225 225 * Let the relation be a route of oneway streets, and someone travels them in the given order. 226 226 * Direction is FORWARD if it is legal and BACKWARD if it is illegal to do so for the given way. 227 * @param ref _iway key228 * @param ref _direction direction of ref_i227 * @param refI way key 228 * @param refDirection direction of ref_i 229 229 * @param k successor of ref_i 230 230 * @param reversed if {@code true} determine reverse direction 231 231 * @return direction of way {@code k} 232 232 */ 233 private Direction determineDirection(int ref _i, final Direction ref_direction, int k, boolean reversed) {234 if (ref _i < 0 || k < 0 || ref_i>= members.size() || k >= members.size())233 private Direction determineDirection(int refI, final Direction refDirection, int k, boolean reversed) { 234 if (refI < 0 || k < 0 || refI >= members.size() || k >= members.size()) 235 235 return NONE; 236 if (ref _direction == NONE)236 if (refDirection == NONE) 237 237 return NONE; 238 238 239 final RelationMember m _ref = members.get(ref_i);239 final RelationMember mRef = members.get(refI); 240 240 final RelationMember m = members.get(k); 241 Way way _ref = null;241 Way wayRef = null; 242 242 Way way = null; 243 243 244 if (m _ref.isWay()) {245 way _ref = m_ref.getWay();244 if (mRef.isWay()) { 245 wayRef = mRef.getWay(); 246 246 } 247 247 if (m.isWay()) { … … 249 249 } 250 250 251 if (way _ref == null || way == null)251 if (wayRef == null || way == null) 252 252 return NONE; 253 253 … … 255 255 List<Node> refNodes = new ArrayList<>(); 256 256 257 switch (ref _direction) {257 switch (refDirection) { 258 258 case FORWARD: 259 refNodes.add(way _ref.lastNode());259 refNodes.add(wayRef.lastNode()); 260 260 break; 261 261 case BACKWARD: 262 refNodes.add(way _ref.firstNode());262 refNodes.add(wayRef.firstNode()); 263 263 break; 264 264 case ROUNDABOUT_LEFT: 265 265 case ROUNDABOUT_RIGHT: 266 refNodes = way _ref.getNodes();266 refNodes = wayRef.getNodes(); 267 267 break; 268 268 } -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r9971 r10001 1013 1013 1014 1014 // How many pixels into the 'source' rectangle are we drawing? 1015 int screen _x_offset = target.x - source.x;1016 int screen _y_offset = target.y - source.y;1015 int screenXoffset = target.x - source.x; 1016 int screenYoffset = target.y - source.y; 1017 1017 // And how many pixels into the image itself does that correlate to? 1018 int img _x_offset = (int) (screen_x_offset * imageXScaling + 0.5);1019 int img _y_offset = (int) (screen_y_offset * imageYScaling + 0.5);1018 int imgXoffset = (int) (screenXoffset * imageXScaling + 0.5); 1019 int imgYoffset = (int) (screenYoffset * imageYScaling + 0.5); 1020 1020 // Now calculate the other corner of the image that we need 1021 1021 // by scaling the 'target' rectangle's dimensions. 1022 int img _x_end = img_x_offset + (int) (target.getWidth() * imageXScaling + 0.5);1023 int img _y_end = img_y_offset + (int) (target.getHeight() * imageYScaling + 0.5);1022 int imgXend = imgXoffset + (int) (target.getWidth() * imageXScaling + 0.5); 1023 int imgYend = imgYoffset + (int) (target.getHeight() * imageYScaling + 0.5); 1024 1024 1025 1025 if (Main.isDebugEnabled()) { … … 1029 1029 target.x, target.y, 1030 1030 target.x + target.width, target.y + target.height, 1031 img _x_offset, img_y_offset,1032 img _x_end, img_y_end,1031 imgXoffset, imgYoffset, 1032 imgXend, imgYend, 1033 1033 this); 1034 1034 if (PROP_FADE_AMOUNT.get() != 0) { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r9997 r10001 840 840 return tr("No gpx selected"); 841 841 842 final long offset _ms = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds843 lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offset _ms);842 final long offsetMs = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds 843 lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offsetMs); 844 844 845 845 return trn("<html>Matched <b>{0}</b> of <b>{1}</b> photo to GPX track.</html>", -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r9543 r10001 91 91 Shortcut scPrev = Shortcut.registerShortcut( 92 92 "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT); 93 final String APREVIOUS= "Previous Image";93 final String previousImage = "Previous Image"; 94 94 Main.registerActionShortcut(prevAction, scPrev); 95 btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), APREVIOUS);96 btnPrevious.getActionMap().put( APREVIOUS, prevAction);95 btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), previousImage); 96 btnPrevious.getActionMap().put(previousImage, prevAction); 97 97 btnPrevious.setEnabled(false); 98 98 99 final String DELETE_TEXT= tr("Remove photo from layer");100 ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), DELETE_TEXT);99 final String removePhoto = tr("Remove photo from layer"); 100 ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), removePhoto); 101 101 JButton btnDelete = new JButton(delAction); 102 102 btnDelete.setPreferredSize(buttonDim); … … 104 104 "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT); 105 105 Main.registerActionShortcut(delAction, scDelete); 106 btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), DELETE_TEXT);107 btnDelete.getActionMap().put( DELETE_TEXT, delAction);106 btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), removePhoto); 107 btnDelete.getActionMap().put(removePhoto, delAction); 108 108 109 109 ImageAction delFromDiskAction = new ImageAction(COMMAND_REMOVE_FROM_DISK, … … 113 113 Shortcut scDeleteFromDisk = Shortcut.registerShortcut( 114 114 "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete File from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT); 115 final String ADELFROMDISK= "Delete image file from disk";115 final String deleteImage = "Delete image file from disk"; 116 116 Main.registerActionShortcut(delFromDiskAction, scDeleteFromDisk); 117 btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), ADELFROMDISK);118 btnDeleteFromDisk.getActionMap().put( ADELFROMDISK, delFromDiskAction);117 btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), deleteImage); 118 btnDeleteFromDisk.getActionMap().put(deleteImage, delFromDiskAction); 119 119 120 120 ImageAction copyPathAction = new ImageAction(COMMAND_COPY_PATH, ImageProvider.get("copy"), tr("Copy image path")); … … 123 123 Shortcut scCopyPath = Shortcut.registerShortcut( 124 124 "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.ALT_CTRL_SHIFT); 125 final String ACOPYPATH= "Copy image path";125 final String copyImage = "Copy image path"; 126 126 Main.registerActionShortcut(copyPathAction, scCopyPath); 127 btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), ACOPYPATH);128 btnCopyPath.getActionMap().put( ACOPYPATH, copyPathAction);127 btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), copyImage); 128 btnCopyPath.getActionMap().put(copyImage, copyPathAction); 129 129 130 130 ImageAction nextAction = new ImageAction(COMMAND_NEXT, ImageProvider.get("dialogs", "next"), tr("Next")); … … 133 133 Shortcut scNext = Shortcut.registerShortcut( 134 134 "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.DIRECT); 135 final String ANEXT= "Next Image";135 final String nextImage = "Next Image"; 136 136 Main.registerActionShortcut(nextAction, scNext); 137 btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), ANEXT);138 btnNext.getActionMap().put( ANEXT, nextAction);137 btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), nextImage); 138 btnNext.getActionMap().put(nextImage, nextAction); 139 139 btnNext.setEnabled(false); 140 140 -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java
r9817 r10001 93 93 * and then stop because it has more than 50k nodes. 94 94 */ 95 final double buffer _dist = panel.getDistance();96 final double max _area = panel.getArea() / 10000.0 / scale;97 final double buffer _y = buffer_dist / 100000.0;98 final double buffer _x = buffer_y/ scale;95 final double bufferDist = panel.getDistance(); 96 final double maxArea = panel.getArea() / 10000.0 / scale; 97 final double bufferY = bufferDist / 100000.0; 98 final double bufferX = bufferY / scale; 99 99 final int totalTicks = latcnt; 100 100 // guess if a progress bar might be useful. 101 final boolean displayProgress = totalTicks > 2000 && buffer _y< 0.01;101 final boolean displayProgress = totalTicks > 2000 && bufferY < 0.01; 102 102 103 103 class CalculateDownloadArea extends PleaseWaitRunnable { … … 126 126 return; 127 127 } 128 confirmAndDownloadAreas(a, max _area, panel.isDownloadOsmData(), panel.isDownloadGpxData(),128 confirmAndDownloadAreas(a, maxArea, panel.isDownloadOsmData(), panel.isDownloadGpxData(), 129 129 tr("Download from OSM along this track"), progressMonitor); 130 130 } … … 147 147 tick(); 148 148 LatLon c = p.getCoor(); 149 if (previous == null || c.greatCircleDistance(previous) > buffer _dist) {149 if (previous == null || c.greatCircleDistance(previous) > bufferDist) { 150 150 // we add a buffer around the point. 151 r.setRect(c.lon() - buffer _x, c.lat() - buffer_y, 2 * buffer_x, 2 * buffer_y);151 r.setRect(c.lon() - bufferX, c.lat() - bufferY, 2 * bufferX, 2 * bufferY); 152 152 a.add(new Area(r)); 153 153 return c; -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r9248 r10001 94 94 /* calculate time differences in waypoints */ 95 95 double time = wpt.time; 96 boolean wpt _has_link = wpt.attr.containsKey(GpxConstants.META_LINKS);97 if (firstTime < 0 && wpt _has_link) {96 boolean wptHasLink = wpt.attr.containsKey(GpxConstants.META_LINKS); 97 if (firstTime < 0 && wptHasLink) { 98 98 firstTime = time; 99 99 for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) { … … 102 102 } 103 103 } 104 if (wpt _has_link) {104 if (wptHasLink) { 105 105 for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) { 106 106 String uri = oneLink.uri; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/CSSColors.java
r7509 r10001 9 9 private static final Map<String, Color> CSS_COLORS = new HashMap<>(); 10 10 static { 11 Object[][] CSSCOLORS_INIT =new Object[][] {11 for (Object[] pair : new Object[][] { 12 12 {"aliceblue", 0xf0f8ff}, 13 13 {"antiquewhite", 0xfaebd7}, … … 157 157 {"yellow", 0xffff00}, 158 158 {"yellowgreen", 0x9acd32} 159 }; 160 for (Object[] pair : CSSCOLORS_INIT) { 159 }) { 161 160 CSS_COLORS.put((String) pair[0], new Color((Integer) pair[1])); 162 161 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r9983 r10001 149 149 } 150 150 151 float test _float;151 float testFloat; 152 152 try { 153 test _float = Float.parseFloat(testString);153 testFloat = Float.parseFloat(testString); 154 154 } catch (NumberFormatException e) { 155 155 return false; 156 156 } 157 float prototype _float = Float.parseFloat(prototypeString);157 float prototypeFloat = Float.parseFloat(prototypeString); 158 158 159 159 switch (this) { 160 160 case GREATER_OR_EQUAL: 161 return test _float >= prototype_float;161 return testFloat >= prototypeFloat; 162 162 case GREATER: 163 return test _float > prototype_float;163 return testFloat > prototypeFloat; 164 164 case LESS_OR_EQUAL: 165 return test _float <= prototype_float;165 return testFloat <= prototypeFloat; 166 166 case LESS: 167 return test _float < prototype_float;167 return testFloat < prototypeFloat; 168 168 default: 169 169 throw new AssertionError(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
r9371 r10001 56 56 public final float defaultMajorZIndex; 57 57 58 LineType(String prefix, float default _major_z_index) {58 LineType(String prefix, float defaultMajorZindex) { 59 59 this.prefix = prefix; 60 this.defaultMajorZIndex = default _major_z_index;61 } 62 } 63 64 protected LineElement(Cascade c, float default _major_z_index, BasicStroke line, Color color, BasicStroke dashesLine,60 this.defaultMajorZIndex = defaultMajorZindex; 61 } 62 } 63 64 protected LineElement(Cascade c, float defaultMajorZindex, BasicStroke line, Color color, BasicStroke dashesLine, 65 65 Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows) { 66 super(c, default _major_z_index);66 super(c, defaultMajorZindex); 67 67 this.line = line; 68 68 this.color = color; … … 104 104 private static LineElement createImpl(Environment env, LineType type) { 105 105 Cascade c = env.mc.getCascade(env.layer); 106 Cascade c _def = env.mc.getCascade("default");106 Cascade cDef = env.mc.getCascade("default"); 107 107 Float width; 108 108 switch (type) { 109 109 case NORMAL: 110 width = getWidth(c, WIDTH, getWidth(c _def, WIDTH, null));110 width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null)); 111 111 break; 112 112 case CASING: 113 113 Float casingWidth = c.get(type.prefix + WIDTH, null, Float.class, true); 114 114 if (casingWidth == null) { 115 RelativeFloat rel _casingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);116 if (rel _casingWidth != null) {117 casingWidth = rel _casingWidth.val / 2;115 RelativeFloat relCasingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true); 116 if (relCasingWidth != null) { 117 casingWidth = relCasingWidth.val / 2; 118 118 } 119 119 } 120 120 if (casingWidth == null) 121 121 return null; 122 width = getWidth(c, WIDTH, getWidth(c _def, WIDTH, null));122 width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null)); 123 123 if (width == null) { 124 124 width = 0f; … … 162 162 case LEFT_CASING: 163 163 case RIGHT_CASING: 164 Float baseWidthOnDefault = getWidth(c _def, WIDTH, null);164 Float baseWidthOnDefault = getWidth(cDef, WIDTH, null); 165 165 Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault); 166 166 if (baseWidth == null || baseWidth < 2f) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r9371 r10001 93 93 BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE); 94 94 95 protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float default _major_z_index, RotationAngle rotationAngle) {96 super(c, default _major_z_index);95 protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) { 96 super(c, defaultMajorZindex); 97 97 this.mapImage = mapImage; 98 98 this.symbol = symbol; … … 104 104 } 105 105 106 private static NodeElement create(Environment env, float default _major_z_index, boolean allowDefault) {106 private static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) { 107 107 Cascade c = env.mc.getCascade(env.layer); 108 108 … … 138 138 if (!allowDefault && symbol == null && mapImage == null) return null; 139 139 140 return new NodeElement(c, mapImage, symbol, default _major_z_index, rotationAngle);140 return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle); 141 141 } 142 142 … … 148 148 return null; 149 149 150 Cascade c _def = env.mc.getCascade("default");151 152 Float widthOnDefault = c _def.get(keys[ICON_WIDTH_IDX], null, Float.class);150 Cascade cDef = env.mc.getCascade("default"); 151 152 Float widthOnDefault = cDef.get(keys[ICON_WIDTH_IDX], null, Float.class); 153 153 if (widthOnDefault != null && widthOnDefault <= 0) { 154 154 widthOnDefault = null; … … 156 156 Float widthF = getWidth(c, keys[ICON_WIDTH_IDX], widthOnDefault); 157 157 158 Float heightOnDefault = c _def.get(keys[ICON_HEIGHT_IDX], null, Float.class);158 Float heightOnDefault = cDef.get(keys[ICON_HEIGHT_IDX], null, Float.class); 159 159 if (heightOnDefault != null && heightOnDefault <= 0) { 160 160 heightOnDefault = null; … … 189 189 private static Symbol createSymbol(Environment env) { 190 190 Cascade c = env.mc.getCascade(env.layer); 191 Cascade c _def = env.mc.getCascade("default");191 Cascade cDef = env.mc.getCascade("default"); 192 192 193 193 SymbolShape shape; … … 216 216 return null; 217 217 218 Float sizeOnDefault = c _def.get("symbol-size", null, Float.class);218 Float sizeOnDefault = cDef.get("symbol-size", null, Float.class); 219 219 if (sizeOnDefault != null && sizeOnDefault <= 0) { 220 220 sizeOnDefault = null; … … 229 229 return null; 230 230 231 Float strokeWidthOnDefault = getWidth(c _def, "symbol-stroke-width", null);231 Float strokeWidthOnDefault = getWidth(cDef, "symbol-stroke-width", null); 232 232 Float strokeWidth = getWidth(c, "symbol-stroke-width", strokeWidthOnDefault); 233 233 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
r9371 r10001 35 35 public boolean defaultSelectedHandling; 36 36 37 public StyleElement(float major _z_index, float z_index, float object_z_index, boolean isModifier, boolean defaultSelectedHandling) {38 this.majorZIndex = major _z_index;39 this.zIndex = z _index;40 this.objectZIndex = object _z_index;37 public StyleElement(float majorZindex, float zIndex, float objectZindex, boolean isModifier, boolean defaultSelectedHandling) { 38 this.majorZIndex = majorZindex; 39 this.zIndex = zIndex; 40 this.objectZIndex = objectZindex; 41 41 this.isModifier = isModifier; 42 42 this.defaultSelectedHandling = defaultSelectedHandling; 43 43 } 44 44 45 protected StyleElement(Cascade c, float default _major_z_index) {46 majorZIndex = c.get(MAJOR_Z_INDEX, default _major_z_index, Float.class);45 protected StyleElement(Cascade c, float defaultMajorZindex) { 46 majorZIndex = c.get(MAJOR_Z_INDEX, defaultMajorZindex, Float.class); 47 47 zIndex = c.get(Z_INDEX, 0f, Float.class); 48 48 objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class); … … 86 86 return (float) MapPaintSettings.INSTANCE.getDefaultSegmentWidth(); 87 87 if (relativeTo != null) { 88 RelativeFloat width _rel = c.get(key, null, RelativeFloat.class, true);89 if (width _rel != null)90 return relativeTo + width _rel.val;88 RelativeFloat widthRel = c.get(key, null, RelativeFloat.class, true); 89 if (widthRel != null) 90 return relativeTo + widthRel.val; 91 91 } 92 92 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r9686 r10001 96 96 // fill model with colors: 97 97 Map<String, String> colorKeyList = new TreeMap<>(); 98 Map<String, String> colorKeyList _mappaint = new TreeMap<>();99 Map<String, String> colorKeyList _layer = new TreeMap<>();98 Map<String, String> colorKeyListMappaint = new TreeMap<>(); 99 Map<String, String> colorKeyListLayer = new TreeMap<>(); 100 100 for (String key : colorMap.keySet()) { 101 101 if (key.startsWith("layer ")) { 102 colorKeyList _layer.put(getName(key), key);102 colorKeyListLayer.put(getName(key), key); 103 103 } else if (key.startsWith("mappaint.")) { 104 104 // use getName(key)+key, as getName() may be ambiguous 105 colorKeyList _mappaint.put(getName(key)+key, key);105 colorKeyListMappaint.put(getName(key)+key, key); 106 106 } else { 107 107 colorKeyList.put(getName(key), key); … … 109 109 } 110 110 addColorRows(colorMap, colorKeyList); 111 addColorRows(colorMap, colorKeyList _mappaint);112 addColorRows(colorMap, colorKeyList _layer);111 addColorRows(colorMap, colorKeyListMappaint); 112 addColorRows(colorMap, colorKeyListLayer); 113 113 if (this.colors != null) { 114 114 this.colors.repaint(); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r9840 r10001 78 78 if (Main.isPlatformOsx()) { 79 79 try { 80 Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");81 Object Oquaqua = Cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null);80 Class<?> cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel"); 81 Object oquaqua = cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null); 82 82 // no exception? Then Go! 83 83 lafCombo.addItem( 84 new UIManager.LookAndFeelInfo(((LookAndFeel) Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")84 new UIManager.LookAndFeelInfo(((LookAndFeel) oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel") 85 85 ); 86 86 } catch (Exception ex) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
r9936 r10001 103 103 } 104 104 105 protected static String getLocaleText(String text, String text _context, String defaultText) {105 protected static String getLocaleText(String text, String textContext, String defaultText) { 106 106 if (text == null) { 107 107 return defaultText; 108 } else if (text _context != null) {109 return trc(text _context, fixPresetString(text));108 } else if (textContext != null) { 109 return trc(textContext, fixPresetString(text)); 110 110 } else { 111 111 return tr(fixPresetString(text)); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java
r9665 r10001 52 52 } 53 53 54 public void setMember_expression(String member _expression) throws SAXException {54 public void setMember_expression(String memberExpression) throws SAXException { 55 55 try { 56 56 final SearchAction.SearchSetting searchSetting = new SearchAction.SearchSetting(); 57 searchSetting.text = member _expression;57 searchSetting.text = memberExpression; 58 58 searchSetting.caseSensitive = true; 59 59 searchSetting.regexSearch = true; -
trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
r9590 r10001 99 99 public void setFileFilter(final FileFilter cff) { 100 100 FilenameFilter filter = new FilenameFilter() { 101 public boolean accept(File Directory, String fileName) { 102 return cff.accept(new File(Directory.getAbsolutePath() + fileName)); 101 @Override 102 public boolean accept(File directory, String fileName) { 103 return cff.accept(new File(directory.getAbsolutePath() + fileName)); 103 104 } 104 105 };
Note:
See TracChangeset
for help on using the changeset viewer.