Changeset 1415 in josm
- Timestamp:
- 2009-02-16T15:14:34+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AddNodeAction.java
r1232 r1415 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.tools.I18n.trn;6 5 7 import java.awt.BorderLayout;8 6 import java.awt.GridBagLayout; 9 7 import java.awt.event.ActionEvent; 10 import java.awt.event.FocusAdapter;11 import java.awt.event.FocusEvent;12 8 import java.awt.event.KeyEvent; 13 import java.util.ArrayList;14 import java.util.Collection;15 import java.util.HashMap;16 import java.util.LinkedList;17 import java.util.List;18 import java.util.TreeMap;19 import java.util.TreeSet;20 9 21 10 import javax.swing.JLabel; … … 26 15 import org.openstreetmap.josm.Main; 27 16 import org.openstreetmap.josm.command.AddCommand; 28 import org.openstreetmap.josm.command.Command;29 import org.openstreetmap.josm.command.SequenceCommand;30 import org.openstreetmap.josm.data.osm.DataSet;31 import org.openstreetmap.josm.data.osm.Relation;32 17 import org.openstreetmap.josm.data.osm.Node; 33 import org.openstreetmap.josm.data.osm.OsmPrimitive;34 import org.openstreetmap.josm.data.osm.RelationMember;35 import org.openstreetmap.josm.data.osm.Way;36 import org.openstreetmap.josm.data.coor.EastNorth;37 18 import org.openstreetmap.josm.data.coor.LatLon; 38 import org.openstreetmap.josm.tools.AutoCompleteComboBox;39 19 import org.openstreetmap.josm.tools.GBC; 40 20 import org.openstreetmap.josm.tools.Shortcut; -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r1169 r1415 60 60 } 61 61 } 62 result += mat[0][i] * Math.pow(-1, (double)i) * determinant(temp);62 result += mat[0][i] * Math.pow(-1, i) * determinant(temp); 63 63 } 64 64 return result; … … 136 136 Collection<Way> ways = new LinkedList<Way>(); 137 137 Node center = null; 138 Node node = null;139 138 double radius = 0; 140 139 boolean regular = false; … … 161 160 // distance between two nodes. 162 161 if (nodes.size() > 0) { 163 if (nodes.size() == 1 && way.nodes.contains((Node) nodes.toArray()[0])) { 164 node = (Node) nodes.toArray()[0]; 162 if (nodes.size() == 1 && way.nodes.contains(nodes.toArray()[0])) { 165 163 regular = true; 166 164 } else { 167 165 168 center = (Node) nodes.toArray()[way.nodes.contains( (Node)nodes.toArray()[0]) ? 1 : 0];166 center = (Node) nodes.toArray()[way.nodes.contains(nodes.toArray()[0]) ? 1 : 0]; 169 167 if (nodes.size() == 2) 170 168 radius = distance(((Node) nodes.toArray()[0]).eastNorth, ((Node) nodes.toArray()[1]).eastNorth); -
trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
r1397 r1415 7 7 8 8 import javax.swing.JFileChooser; 9 import javax.swing.JOptionPane;10 11 9 import org.openstreetmap.josm.Main; 12 10 import org.openstreetmap.josm.gui.ExtendedDialog; -
trunk/src/org/openstreetmap/josm/actions/DuplicateAction.java
r1351 r1415 9 9 import java.util.Collection; 10 10 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.actions.CopyAction; 13 12 import org.openstreetmap.josm.actions.PasteAction; -
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r1335 r1415 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.event.InputEvent;7 8 6 import javax.swing.AbstractAction; 9 7 import javax.swing.JComponent; 10 import javax.swing.KeyStroke;11 8 12 9 import org.openstreetmap.josm.Main; -
trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
r1397 r1415 7 7 import java.awt.event.ActionEvent; 8 8 import java.awt.event.KeyEvent; 9 import java.io.InputStream;10 import java.io.File;11 import java.io.FileInputStream;12 import java.io.FileNotFoundException;13 import java.io.IOException;14 import java.util.zip.GZIPInputStream;15 9 16 10 import javax.swing.JCheckBox; 17 import javax.swing.JFileChooser;18 11 import javax.swing.JLabel; 19 import javax.swing.JOptionPane;20 12 import javax.swing.JPanel; 21 13 import javax.swing.JTextField; … … 23 15 import org.openstreetmap.josm.Main; 24 16 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask; 25 import org.openstreetmap.josm.data.osm.DataSet;26 17 import org.openstreetmap.josm.gui.ExtendedDialog; 27 import org.openstreetmap.josm.gui.layer.GpxLayer;28 import org.openstreetmap.josm.gui.layer.OsmDataLayer;29 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;30 import org.openstreetmap.josm.io.GpxReader;31 import org.openstreetmap.josm.io.NmeaReader;32 import org.openstreetmap.josm.io.OsmReader;33 import org.openstreetmap.josm.io.OsmServerLocationReader;34 import org.xml.sax.SAXException;35 18 import org.openstreetmap.josm.tools.GBC; 36 19 import org.openstreetmap.josm.tools.Shortcut; -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r1280 r1415 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 6 7 import java.awt.List;8 7 import java.awt.event.ActionEvent; 9 8 import java.awt.event.KeyEvent; … … 15 14 16 15 import org.openstreetmap.josm.Main; 17 import org.openstreetmap.josm.command.AddCommand;18 16 import org.openstreetmap.josm.command.Command; 19 17 import org.openstreetmap.josm.command.MoveCommand; -
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r1252 r1415 123 123 if (entry.getValue().equals(selectedNodes.size())) { 124 124 if (selectedWay != null) { 125 JOptionPane.showMessageDialog(Main.parent, tr("There is more than one way using the node(s) you selected. Please select the way also.")); 125 JOptionPane.showMessageDialog(Main.parent, 126 trn("There is more than one way using the node you selected. Please select the way also.", 127 "There is more than one way using the nodes you selected. Please select the way also.", 128 selectedNodes.size())); 126 129 return; 127 130 } … … 131 134 132 135 if (selectedWay == null) { 133 JOptionPane.showMessageDialog(Main.parent, tr("The selected nodes do not share the same way.")); 136 JOptionPane.showMessageDialog(Main.parent, 137 tr("The selected nodes do not share the same way.")); 134 138 return; 135 139 } … … 144 148 if (!nds.isEmpty()) { 145 149 JOptionPane.showMessageDialog(Main.parent, 146 trn("The selected way does not contain the selected node.", 147 "The selected way does not contain all the selected nodes.", selectedNodes.size())); 150 trn("The selected way does not contain the selected node.", 151 "The selected way does not contain all the selected nodes.", 152 selectedNodes.size())); 148 153 return; 149 154 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r1396 r1415 15 15 import org.openstreetmap.josm.gui.layer.GpxLayer; 16 16 import org.openstreetmap.josm.data.gpx.GpxData; 17 import org.openstreetmap.josm.data.Bounds;18 17 import org.openstreetmap.josm.io.BoundingBoxDownloader; 19 18 import org.xml.sax.SAXException; … … 39 38 if (rawData == null) 40 39 return; 41 rawData.recalculateBounds(); 42 Bounds b = rawData.bounds; 43 String name = tr("Downloaded GPX Data"); 44 GpxLayer layer = new GpxLayer(rawData, name); 40 rawData.recalculateBounds(); 41 String name = tr("Downloaded GPX Data"); 42 GpxLayer layer = new GpxLayer(rawData, name); 45 43 Layer x = findMergeLayer(); 46 44 if (newLayer || x == null) -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r1379 r1415 25 25 * The user can click on an object, which gets deleted if possible. When Ctrl is 26 26 * pressed when releasing the button, the objects and all its references are 27 * deleted. The exact definition of "all its references" are in 28 * {@link #deleteWithReferences deleteWithReferences}. 27 * deleted. 29 28 * 30 29 * If the user did not press Ctrl and the object has any references, the user -
trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
r1397 r1415 129 129 } 130 130 131 /**132 * Try to delete all given primitives.133 *134 * If a node is used by a way, it's removed from that way. If a node or a way is used by a135 * relation, inform the user and do not delete.136 *137 * If this would cause ways with less than 2 nodes to be created, delete these ways instead. If138 * they are part of a relation, inform the user and do not delete.139 *140 * @param selection The objects to delete.141 * @param alsoDeleteNodesInWay <code>true</code> if nodes should be deleted as well142 * @return command A command to perform the deletions, or null of there is nothing to delete.143 */144 131 private static int testRelation(Relation ref, OsmPrimitive osm) { 145 132 NameVisitor n = new NameVisitor(); … … 175 162 } 176 163 164 /** 165 * Try to delete all given primitives. 166 * 167 * If a node is used by a way, it's removed from that way. If a node or a way is used by a 168 * relation, inform the user and do not delete. 169 * 170 * If this would cause ways with less than 2 nodes to be created, delete these ways instead. If 171 * they are part of a relation, inform the user and do not delete. 172 * 173 * @param selection The objects to delete. 174 * @param alsoDeleteNodesInWay <code>true</code> if nodes should be deleted as well 175 * @return command A command to perform the deletions, or null of there is nothing to delete. 176 */ 177 177 public static Command delete(Collection<? extends OsmPrimitive> selection, boolean alsoDeleteNodesInWay) { 178 178 if (selection.isEmpty()) -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r1398 r1415 5 5 import java.util.Arrays; 6 6 import java.util.Collection; 7 import java.util.Collections;8 7 import java.util.Comparator; 9 8 import java.util.HashSet; -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r1200 r1415 3 3 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 import java.text.DecimalFormat;6 import java.text.NumberFormat;7 5 8 6 import org.openstreetmap.josm.Main; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r1226 r1415 65 65 * If the bounding box has not been set (<code>min</code> or <code>max</code> 66 66 * equal <code>null</code>) this method does not do anything. 67 *68 * @param enlargeDegree69 67 */ 70 68 public void enlargeBoundingBox() { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1411 r1415 1 / / License: GPL. Copyright 2007 by Immanuel Scholz and others1 /* License: GPL. Copyright 2007 by Immanuel Scholz and others */ 2 2 package org.openstreetmap.josm.data.osm.visitor; 3 4 /* To enable debugging or profiling remove the double / signs */ 3 5 4 6 import static org.openstreetmap.josm.tools.I18n.marktr; … … 47 49 protected boolean drawRestriction; 48 50 protected boolean leftHandTraffic; 49 protected boolean restrictionDebug;51 //protected boolean restrictionDebug; 50 52 protected int showNames; 51 53 protected int showIcons; … … 70 72 private EastNorth maxEN; 71 73 72 protected int profilerVisibleNodes;73 protected int profilerVisibleWays;74 protected int profilerVisibleAreas;75 protected int profilerSegments;76 protected int profilerVisibleSegments;77 protected boolean profilerOmitDraw;74 //protected int profilerVisibleNodes; 75 //protected int profilerVisibleWays; 76 //protected int profilerVisibleAreas; 77 //protected int profilerSegments; 78 //protected int profilerVisibleSegments; 79 //protected boolean profilerOmitDraw; 78 80 79 81 protected boolean isZoomOk(ElemStyle e) { … … 84 86 return (circum < 1500); 85 87 86 / /formula to calculate a map scale: natural size / map size = scale87 //example: 876000mm (876m as displayed) / 22mm (roughly estimated screen size of legend bar) = 3981888 // 89 //so the exact "correcting value" below depends only on the screen size and resolution90 // XXX - do we need a Preference setting for this (if things vary widely)?88 /* formula to calculate a map scale: natural size / map size = scale 89 example: 876000mm (876m as displayed) / 22mm (roughly estimated screen size of legend bar) = 39818 90 91 so the exact "correcting value" below depends only on the screen size and resolution 92 XXX - do we need a Preference setting for this (if things vary widely)? */ 91 93 return !(circum >= e.maxScale / 22 || circum < e.minScale / 22); 92 94 } … … 132 134 */ 133 135 public void visit(Node n) { 134 / / check, if the node is visible at all136 /* check, if the node is visible at all */ 135 137 if((n.eastNorth.east() > maxEN.east() ) || 136 138 (n.eastNorth.north() > maxEN.north()) || … … 145 147 IconElemStyle nodeStyle = (IconElemStyle)getPrimitiveStyle(n); 146 148 147 if(profilerOmitDraw)148 return;149 //if(profilerOmitDraw) 150 // return; 149 151 150 152 if (nodeStyle != null && isZoomOk(nodeStyle) && showIcons > dist) … … 171 173 } 172 174 173 / / check, if the way is visible at all175 /* check, if the way is visible at all */ 174 176 double minx = 10000; 175 177 double maxx = -10000; … … 208 210 if(wayStyle==null) 209 211 { 210 / / way without style211 profilerVisibleWays++;212 if(!profilerOmitDraw)213 212 /* way without style */ 213 //profilerVisibleWays++; 214 //if(!profilerOmitDraw) 215 drawWay(w, null, untaggedColor, w.selected); 214 216 } 215 217 else if(wayStyle instanceof LineElemStyle) 216 218 { 217 / / way with line style218 profilerVisibleWays++;219 if(!profilerOmitDraw)220 219 /* way with line style */ 220 //profilerVisibleWays++; 221 //if(!profilerOmitDraw) 222 drawWay(w, (LineElemStyle)wayStyle, untaggedColor, w.selected); 221 223 } 222 224 else if (wayStyle instanceof AreaElemStyle) 223 225 { 224 / / way with area style225 if(!profilerOmitDraw)226 {227 228 229 230 231 232 233 234 235 }226 /* way with area style */ 227 //if(!profilerOmitDraw) 228 //{ 229 if (fillAreas > dist) 230 { 231 // profilerVisibleAreas++; 232 drawArea(w, w.selected ? selectedColor : ((AreaElemStyle)wayStyle).color); 233 if(!w.isClosed()) 234 w.putError(tr("Area style way is not closed."), true); 235 } 236 drawWay(w, ((AreaElemStyle)wayStyle).line, ((AreaElemStyle)wayStyle).color, w.selected); 237 //} 236 238 } 237 239 } 238 240 239 241 public void drawWay(Way w, LineElemStyle l, Color color, Boolean selected) { 240 / /show direction arrows, if draw.segment.relevant_directions_only is not set,241 //the way is tagged with a direction key242 // (even if the tag is negated as in oneway=false) or the way is selected242 /* show direction arrows, if draw.segment.relevant_directions_only is not set, 243 the way is tagged with a direction key 244 (even if the tag is negated as in oneway=false) or the way is selected */ 243 245 boolean showDirection = w.selected || ((!useRealWidth) && (showDirectionArrow 244 246 && (!showRelevantDirectionsOnly || w.hasDirectionKeys))); 245 / /head only takes over control if the option is true,246 // the direction should be shown at all and not only because it's selected247 /* head only takes over control if the option is true, 248 the direction should be shown at all and not only because it's selected */ 247 249 boolean showOnlyHeadArrowOnly = showDirection && !w.selected && showHeadArrowOnly; 248 250 int width = defaultSegmentWidth; 249 int realWidth = 0; / /the real width of the element in meters251 int realWidth = 0; /* the real width of the element in meters */ 250 252 int dashed = 0; 251 253 Color dashedColor = null; … … 273 275 color = selectedColor; 274 276 275 / / draw overlays under the way277 /* draw overlays under the way */ 276 278 if(l != null && l.overlays != null) 277 279 { … … 294 296 } 295 297 296 / / draw the way298 /* draw the way */ 297 299 lastN = null; 298 300 Iterator<Node> it = w.nodes.iterator(); … … 306 308 } 307 309 308 / / draw overlays above the way310 /* draw overlays above the way */ 309 311 if(l != null && l.overlays != null) 310 312 { … … 392 394 if(c.selected) selected = true; 393 395 --left; 394 if(n == null) n = new ArrayList (w.nodes);396 if(n == null) n = new ArrayList<Node>(w.nodes); 395 397 n.remove((mode == 21 || mode == 22) ? nl : 0); 396 398 if(mode == 21) … … 466 468 r.mappaintVisibleCode = 0; 467 469 468 / / TODO: is it possible to do this like the nodes/ways code?469 if(profilerOmitDraw)470 return;470 /* TODO: is it possible to do this like the nodes/ways code? */ 471 //if(profilerOmitDraw) 472 // return; 471 473 472 474 if(selectedCall) … … 506 508 } 507 509 508 / /this current experimental implementation will only work for standard restrictions:509 // from(Way) / via(Node) / to(Way)510 /* this current experimental implementation will only work for standard restrictions: 511 from(Way) / via(Node) / to(Way) */ 510 512 public void drawRestriction(Relation r) { 511 if(restrictionDebug)512 System.out.println("Restriction: " + r.keys.get("name") + " restriction " + r.keys.get("restriction"));513 //if(restrictionDebug) 514 // System.out.println("Restriction: " + r.keys.get("name") + " restriction " + r.keys.get("restriction")); 513 515 514 516 r.clearErrors(); … … 518 520 Node via = null; 519 521 520 / / find the "from", "via" and "to" elements522 /* find the "from", "via" and "to" elements */ 521 523 for (RelationMember m : r.members) 522 524 { 523 if(restrictionDebug)524 System.out.println("member " + m.member + " selected " + r.selected);525 //if(restrictionDebug) 526 // System.out.println("member " + m.member + " selected " + r.selected); 525 527 526 528 if(m.member == null) … … 538 540 { 539 541 Way w = (Way) m.member; 540 ElemStyle style = getPrimitiveStyle(w);541 //if(r.selected) {542 // drawWay(w, null /*(LineElemStyle)style*/, selectedColor, true);543 // w.mappaintDrawnCode = paintid;544 //}545 542 if(w.nodes.size() < 2) 546 543 { … … 594 591 } 595 592 596 / / check if "from" way starts or ends at via593 /* check if "from" way starts or ends at via */ 597 594 if(fromWay.nodes.get(0) != via && fromWay.nodes.get(fromWay.nodes.size()-1) != via) { 598 595 r.putError(tr("The \"from\" way doesn't start or end at a \"via\" node."), true); 599 596 return; 600 597 } 601 / / check if "to" way starts or ends at via598 /* check if "to" way starts or ends at via */ 602 599 /*if(toWay.nodes.get(0) != via && toWay.nodes.get(toWay.nodes.size()-1) != via) { 603 600 r.putError(tr("to way doesn't start or end at a via node"), true); 604 //return;601 return; 605 602 }*/ 606 603 607 / / find the "direct" nodes before the via node604 /* find the "direct" nodes before the via node */ 608 605 Node fromNode = null; 609 606 try … … 620 617 } 621 618 622 / / find the "direct" node after the via node619 /* find the "direct" node after the via node */ 623 620 Node toNode = null; 624 621 try 625 622 { 626 623 if(toWay.nodes.get(0) == via) { 627 if(restrictionDebug)628 System.out.println("To way heading away from via");624 //if(restrictionDebug) 625 // System.out.println("To way heading away from via"); 629 626 toNode = toWay.nodes.get(1); 630 627 } else { 631 if(restrictionDebug)632 System.out.println("To way heading towards via");628 //if(restrictionDebug) 629 // System.out.println("To way heading towards via"); 633 630 toNode = toWay.nodes.get(toWay.nodes.size()-2); 634 631 } … … 640 637 Point pVia = nc.getPoint(via.eastNorth); 641 638 642 if(restrictionDebug) { 643 Point pTo = nc.getPoint(toNode.eastNorth); 644 645 // debug output of interesting nodes 646 System.out.println("From: " + fromNode); 647 drawNode(fromNode, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 648 System.out.println("Via: " + via); 649 drawNode(via, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 650 System.out.println("To: " + toNode); 651 drawNode(toNode, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 652 System.out.println("From X: " + pFrom.x + " Y " + pFrom.y); 653 System.out.println("Via X: " + pVia.x + " Y " + pVia.y); 654 System.out.println("To X: " + pTo.x + " Y " + pTo.y); 655 } 656 657 // starting from via, go back the "from" way a few pixels 658 // (calculate the vector vx/vy with the specified length and the direction away from the "via" node along the first segment of the "from" way) 639 //if(restrictionDebug) { 640 // Point pTo = nc.getPoint(toNode.eastNorth); 641 642 // /* debug output of interesting nodes */ 643 // System.out.println("From: " + fromNode); 644 // drawNode(fromNode, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 645 // System.out.println("Via: " + via); 646 // drawNode(via, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 647 // System.out.println("To: " + toNode); 648 // drawNode(toNode, selectedColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); 649 // System.out.println("From X: " + pFrom.x + " Y " + pFrom.y); 650 // System.out.println("Via X: " + pVia.x + " Y " + pVia.y); 651 // System.out.println("To X: " + pTo.x + " Y " + pTo.y); 652 //} 653 654 /* starting from via, go back the "from" way a few pixels 655 (calculate the vector vx/vy with the specified length and the direction 656 away from the "via" node along the first segment of the "from" way) 657 */ 659 658 double distanceFromVia=14; 660 659 double dx = (pFrom.x >= pVia.x) ? (pFrom.x - pVia.x) : (pVia.x - pFrom.x); … … 675 674 if(pFrom.y < pVia.y) vy = -vy; 676 675 677 if(restrictionDebug) 678 System.out.println("vx " + vx + " vy " + vy); 679 680 // go a few pixels away from the way (in a right angle) 681 // (calculate the vx2/vy2 vector with the specified length and the direction 90degrees away from the first segment of the "from" way) 676 //if(restrictionDebug) 677 // System.out.println("vx " + vx + " vy " + vy); 678 679 /* go a few pixels away from the way (in a right angle) 680 (calculate the vx2/vy2 vector with the specified length and the direction 681 90degrees away from the first segment of the "from" way) 682 */ 682 683 double distanceFromWay=8; 683 684 double vx2 = 0; … … 733 734 } 734 735 735 / / rotate icon with direction last node in from to736 if(restrictionDebug)737 System.out.println("Deg1 " + fromAngleDeg + " Deg2 " + (fromAngleDeg + 180) + " Icon " + iconAngle);736 /* rotate icon with direction last node in from to */ 737 //if(restrictionDebug) 738 // System.out.println("Deg1 " + fromAngleDeg + " Deg2 " + (fromAngleDeg + 180) + " Icon " + iconAngle); 738 739 ImageIcon rotatedIcon = ImageProvider.createRotatedImage(null /*icon2*/, nodeStyle.icon, iconAngle); 739 740 740 / / scale down icon to 16*16 pixels741 /* scale down icon to 16*16 pixels */ 741 742 ImageIcon smallIcon = new ImageIcon(rotatedIcon.getImage().getScaledInstance(16 , 16, Image.SCALE_SMOOTH)); 742 743 int w = smallIcon.getIconWidth(), h=smallIcon.getIconHeight(); … … 1041 1042 Polygon polygon = getPolygon(w); 1042 1043 1043 / / set the opacity (alpha) level of the filled polygon1044 /* set the opacity (alpha) level of the filled polygon */ 1044 1045 g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha)); 1045 1046 g.fillPolygon(polygon); … … 1048 1049 protected void drawAreaPolygon(Polygon polygon, Color color) 1049 1050 { 1050 / / set the opacity (alpha) level of the filled polygon1051 /* set the opacity (alpha) level of the filled polygon */ 1051 1052 g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha)); 1052 1053 g.fillPolygon(polygon); … … 1057 1058 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return; 1058 1059 1059 profilerVisibleNodes++;1060 //profilerVisibleNodes++; 1060 1061 1061 1062 int w = icon.getIconWidth(), h=icon.getIconHeight(); … … 1092 1093 1093 1094 private void drawSeg(Node n1, Node n2, Color col, boolean showDirection, int width, int dashed, Color dashedColor) { 1094 profilerSegments++;1095 //profilerSegments++; 1095 1096 if (col != currentColor || width != currentWidth || dashed != currentDashed || dashedColor != currentDashedColor) { 1096 1097 displaySegments(col, width, dashed, dashedColor); … … 1102 1103 return; 1103 1104 } 1104 profilerVisibleSegments++;1105 //profilerVisibleSegments++; 1105 1106 currentPath.moveTo(p1.x, p1.y); 1106 1107 currentPath.lineTo(p2.x, p2.y); … … 1166 1167 return; 1167 1168 1168 profilerVisibleNodes++;1169 //profilerVisibleNodes++; 1169 1170 1170 1171 g.setColor(color); … … 1197 1198 } 1198 1199 1199 / / Shows areas before non-areas1200 /* Shows areas before non-areas */ 1200 1201 public void visitAll(DataSet data, Boolean virtual) { 1201 1202 1202 boolean profiler = Main.pref.getBoolean("mappaint.profiler",false);1203 profilerOmitDraw = Main.pref.getBoolean("mappaint.profiler.omitdraw",false);1203 //boolean profiler = Main.pref.getBoolean("mappaint.profiler",false); 1204 //profilerOmitDraw = Main.pref.getBoolean("mappaint.profiler.omitdraw",false); 1204 1205 1205 1206 useStyleCache = Main.pref.getBoolean("mappaint.cache",true); … … 1213 1214 dist = ll1.greatCircleDistance(ll2); 1214 1215 1215 long profilerStart = java.lang.System.currentTimeMillis();1216 long profilerLast = profilerStart;1217 int profilerN;1218 if(profiler)1219 System.out.println("Mappaint Profiler (" +1220 (useStyleCache ? "cache=true, " : "cache=false, ") +1221 "fillareas " + fillAreas + ", " +1222 "fillalpha=" + fillAlpha + "%, " +1223 "dist=" + (int)dist + "m)");1216 //long profilerStart = java.lang.System.currentTimeMillis(); 1217 //long profilerLast = profilerStart; 1218 //int profilerN; 1219 //if(profiler) 1220 // System.out.println("Mappaint Profiler (" + 1221 // (useStyleCache ? "cache=true, " : "cache=false, ") + 1222 // "fillareas " + fillAreas + ", " + 1223 // "fillalpha=" + fillAlpha + "%, " + 1224 // "dist=" + (int)dist + "m)"); 1224 1225 1225 1226 getSettings(virtual); 1226 1227 useRealWidth = Main.pref.getBoolean("mappaint.useRealWidth",false); 1227 1228 zoomLevelDisplay = Main.pref.getBoolean("mappaint.zoomLevelDisplay",false); 1228 circum = Main.map.mapView.getScale()*100*Main.proj.scaleFactor()*40041455; / / circumference of the earth in meter1229 circum = Main.map.mapView.getScale()*100*Main.proj.scaleFactor()*40041455; /* circumference of the earth in meter */ 1229 1230 styles = MapPaintStyles.getStyles().getStyleSet(); 1230 1231 drawMultipolygon = Main.pref.getBoolean("mappaint.multipolygon",true); 1231 1232 drawRestriction = Main.pref.getBoolean("mappaint.restriction",true); 1232 restrictionDebug = Main.pref.getBoolean("mappaint.restriction.debug",false);1233 //restrictionDebug = Main.pref.getBoolean("mappaint.restriction.debug",false); 1233 1234 leftHandTraffic = Main.pref.getBoolean("mappaint.lefthandtraffic",false); 1234 1235 orderFont = new Font(Main.pref.get("mappaint.font","Helvetica"), Font.PLAIN, Main.pref.getInteger("mappaint.fontsize", 8)); … … 1243 1244 viewid = nc.getViewID(); 1244 1245 1245 profilerVisibleNodes = 0;1246 profilerVisibleWays = 0;1247 profilerVisibleAreas = 0;1248 profilerSegments = 0;1249 profilerVisibleSegments = 0;1250 1251 if(profiler)1252 {1253 System.out.format("Prepare : %5dms\n", (java.lang.System.currentTimeMillis()-profilerLast));1254 profilerLast = java.lang.System.currentTimeMillis();1255 }1246 //profilerVisibleNodes = 0; 1247 //profilerVisibleWays = 0; 1248 //profilerVisibleAreas = 0; 1249 //profilerSegments = 0; 1250 //profilerVisibleSegments = 0; 1251 1252 //if(profiler) 1253 //{ 1254 // System.out.format("Prepare : %5dms\n", (java.lang.System.currentTimeMillis()-profilerLast)); 1255 // profilerLast = java.lang.System.currentTimeMillis(); 1256 //} 1256 1257 1257 1258 if (fillAreas > dist && styles != null && styles.hasAreas()) { … … 1259 1260 1260 1261 /*** RELATIONS ***/ 1261 profilerN = 0;1262 // profilerN = 0; 1262 1263 for (final Relation osm : data.relations) 1263 1264 { … … 1265 1266 { 1266 1267 osm.visit(this); 1267 profilerN++;1268 } 1269 } 1270 1271 if(profiler)1272 {1273 System.out.format("Relations: %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);1274 profilerLast = java.lang.System.currentTimeMillis();1275 }1268 // profilerN++; 1269 } 1270 } 1271 1272 // if(profiler) 1273 // { 1274 // System.out.format("Relations: %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 1275 // profilerLast = java.lang.System.currentTimeMillis(); 1276 // } 1276 1277 1277 1278 /*** AREAS ***/ 1278 profilerN = 0;1279 // profilerN = 0; 1279 1280 for (final Way osm : data.ways) 1280 1281 { … … 1285 1286 { 1286 1287 osm.visit(this); 1287 profilerN++;1288 // profilerN++; 1288 1289 } else 1289 noAreaWays.add( (Way)osm);1290 } 1291 } 1292 1293 if(profiler)1294 {1295 System.out.format("Areas : %5dms, calls=%7d, visible=%d\n",1296 (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleAreas);1297 profilerLast = java.lang.System.currentTimeMillis();1298 }1290 noAreaWays.add(osm); 1291 } 1292 } 1293 1294 // if(profiler) 1295 // { 1296 // System.out.format("Areas : %5dms, calls=%7d, visible=%d\n", 1297 // (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleAreas); 1298 // profilerLast = java.lang.System.currentTimeMillis(); 1299 // } 1299 1300 1300 1301 /*** WAYS ***/ 1301 profilerN = 0;1302 // profilerN = 0; 1302 1303 fillAreas = 0; 1303 1304 for (final OsmPrimitive osm : noAreaWays) 1304 1305 { 1305 1306 osm.visit(this); 1306 profilerN++;1307 } 1308 1309 if(profiler)1310 {1311 System.out.format("Ways : %5dms, calls=%7d, visible=%d\n",1312 (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays);1313 profilerLast = java.lang.System.currentTimeMillis();1314 }1307 // profilerN++; 1308 } 1309 1310 // if(profiler) 1311 // { 1312 // System.out.format("Ways : %5dms, calls=%7d, visible=%d\n", 1313 // (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays); 1314 // profilerLast = java.lang.System.currentTimeMillis(); 1315 // } 1315 1316 } 1316 1317 else 1317 1318 { 1318 1319 /*** WAYS (filling disabled) ***/ 1319 profilerN = 0;1320 // profilerN = 0; 1320 1321 for (final OsmPrimitive osm : data.ways) 1321 1322 if (!osm.incomplete && !osm.deleted && !osm.selected … … 1323 1324 { 1324 1325 osm.visit(this); 1325 profilerN++;1326 } 1327 1328 if(profiler)1329 {1330 System.out.format("Ways : %5dms, calls=%7d, visible=%d\n",1331 (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays);1332 profilerLast = java.lang.System.currentTimeMillis();1333 }1326 // profilerN++; 1327 } 1328 1329 // if(profiler) 1330 // { 1331 // System.out.format("Ways : %5dms, calls=%7d, visible=%d\n", 1332 // (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleWays); 1333 // profilerLast = java.lang.System.currentTimeMillis(); 1334 // } 1334 1335 } 1335 1336 1336 1337 /*** SELECTED ***/ 1337 1338 selectedCall = true; 1338 profilerN = 0;1339 //profilerN = 0; 1339 1340 for (final OsmPrimitive osm : data.getSelected()) { 1340 1341 if (!osm.incomplete && !osm.deleted && !(osm instanceof Node) … … 1342 1343 { 1343 1344 osm.visit(this); 1344 profilerN++;1345 } 1346 } 1347 1348 if(profiler)1349 {1350 System.out.format("Selected : %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);1351 profilerLast = java.lang.System.currentTimeMillis();1352 }1345 // profilerN++; 1346 } 1347 } 1348 1349 //if(profiler) 1350 //{ 1351 // System.out.format("Selected : %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 1352 // profilerLast = java.lang.System.currentTimeMillis(); 1353 //} 1353 1354 1354 1355 /*** DISPLAY CACHED SEGMENTS (WAYS) NOW ***/ … … 1356 1357 1357 1358 /*** NODES ***/ 1358 profilerN = 0;1359 //profilerN = 0; 1359 1360 for (final OsmPrimitive osm : data.nodes) 1360 1361 if (!osm.incomplete && !osm.deleted … … 1362 1363 { 1363 1364 osm.visit(this); 1364 profilerN++;1365 } 1366 1367 if(profiler)1368 {1369 System.out.format("Nodes : %5dms, calls=%7d, visible=%d\n",1370 (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleNodes);1371 profilerLast = java.lang.System.currentTimeMillis();1372 }1365 // profilerN++; 1366 } 1367 1368 //if(profiler) 1369 //{ 1370 // System.out.format("Nodes : %5dms, calls=%7d, visible=%d\n", 1371 // (java.lang.System.currentTimeMillis()-profilerLast), profilerN, profilerVisibleNodes); 1372 // profilerLast = java.lang.System.currentTimeMillis(); 1373 //} 1373 1374 1374 1375 /*** VIRTUAL ***/ 1375 1376 if (virtualNodeSize != 0) 1376 1377 { 1377 profilerN = 0;1378 // profilerN = 0; 1378 1379 currentColor = nodeColor; 1379 1380 for (final OsmPrimitive osm : data.ways) … … 1381 1382 && osm.mappaintVisibleCode != viewid ) 1382 1383 { 1383 / / TODO: move this into the SimplePaint code?1384 if(!profilerOmitDraw)1384 /* TODO: move this into the SimplePaint code? */ 1385 // if(!profilerOmitDraw) 1385 1386 visitVirtual((Way)osm); 1386 profilerN++;1387 } 1388 1389 if(profiler)1390 {1391 System.out.format("Virtual : %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);1392 profilerLast = java.lang.System.currentTimeMillis();1393 }1387 // profilerN++; 1388 } 1389 1390 // if(profiler) 1391 // { 1392 // System.out.format("Virtual : %5dms, calls=%7d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 1393 // profilerLast = java.lang.System.currentTimeMillis(); 1394 // } 1394 1395 1395 1396 displaySegments(null); 1396 1397 } 1397 1398 1398 if(profiler)1399 {1400 System.out.format("Segments : calls=%7d, visible=%d\n", profilerSegments, profilerVisibleSegments);1401 System.out.format("All : %5dms\n", (profilerLast-profilerStart));1402 }1399 //if(profiler) 1400 //{ 1401 // System.out.format("Segments : calls=%7d, visible=%d\n", profilerSegments, profilerVisibleSegments); 1402 // System.out.format("All : %5dms\n", (profilerLast-profilerStart)); 1403 //} 1403 1404 } 1404 1405 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1409 r1415 1 / / License: GPL. Copyright 2007 by Immanuel Scholz and others1 /* License: GPL. Copyright 2007 by Immanuel Scholz and others */ 2 2 package org.openstreetmap.josm.data.osm.visitor; 3 4 /* To enable debugging or profiling remove the double / signs */ 3 5 4 6 import static org.openstreetmap.josm.tools.I18n.marktr; … … 127 129 128 130 public void visitAll(DataSet data, Boolean virtual) { 129 boolean profiler = Main.pref.getBoolean("simplepaint.profiler",false);130 long profilerStart = java.lang.System.currentTimeMillis();131 long profilerLast = profilerStart;132 int profilerN = 0;133 if(profiler)134 System.out.println("Simplepaint Profiler");131 //boolean profiler = Main.pref.getBoolean("simplepaint.profiler",false); 132 //long profilerStart = java.lang.System.currentTimeMillis(); 133 //long profilerLast = profilerStart; 134 //int profilerN = 0; 135 //if(profiler) 136 // System.out.println("Simplepaint Profiler"); 135 137 136 138 getSettings(virtual); 137 139 138 if(profiler)139 {140 System.out.format("Prepare : %4dms\n", (java.lang.System.currentTimeMillis()-profilerLast));141 profilerLast = java.lang.System.currentTimeMillis();142 }143 144 / /draw tagged ways first, then untagged ways. takes145 //time to iterate through list twice, OTOH does not146 // require changing the colour while painting...147 profilerN = 0;140 //if(profiler) 141 //{ 142 // System.out.format("Prepare : %4dms\n", (java.lang.System.currentTimeMillis()-profilerLast)); 143 // profilerLast = java.lang.System.currentTimeMillis(); 144 //} 145 146 /* draw tagged ways first, then untagged ways. takes 147 time to iterate through list twice, OTOH does not 148 require changing the colour while painting... */ 149 //profilerN = 0; 148 150 for (final OsmPrimitive osm : data.relations) 149 151 if (!osm.deleted && !osm.selected) 150 152 { 151 153 osm.visit(this); 152 profilerN++;153 } 154 155 if(profiler)156 {157 System.out.format("Relations: %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);158 profilerLast = java.lang.System.currentTimeMillis();159 }160 161 profilerN = 0;154 // profilerN++; 155 } 156 157 //if(profiler) 158 //{ 159 // System.out.format("Relations: %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 160 // profilerLast = java.lang.System.currentTimeMillis(); 161 //} 162 163 //profilerN = 0; 162 164 for (final OsmPrimitive osm : data.ways) 163 165 if (!osm.deleted && !osm.selected && osm.tagged) 164 166 { 165 167 osm.visit(this); 166 profilerN++;168 // profilerN++; 167 169 } 168 170 displaySegments(); … … 172 174 { 173 175 osm.visit(this); 174 profilerN++;176 // profilerN++; 175 177 } 176 178 displaySegments(); 177 179 178 if(profiler)179 {180 System.out.format("Ways : %4dms, n=%5d\n",181 (java.lang.System.currentTimeMillis()-profilerLast), profilerN);182 profilerLast = java.lang.System.currentTimeMillis();183 }184 185 profilerN = 0;180 //if(profiler) 181 //{ 182 // System.out.format("Ways : %4dms, n=%5d\n", 183 // (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 184 // profilerLast = java.lang.System.currentTimeMillis(); 185 //} 186 187 //profilerN = 0; 186 188 for (final OsmPrimitive osm : data.getSelected()) 187 189 if (!osm.deleted) 188 190 { 189 191 osm.visit(this); 190 profilerN++;192 // profilerN++; 191 193 } 192 194 displaySegments(); 193 195 194 if(profiler)195 {196 System.out.format("Selected : %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);197 profilerLast = java.lang.System.currentTimeMillis();198 }199 200 profilerN = 0;196 //if(profiler) 197 //{ 198 // System.out.format("Selected : %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 199 // profilerLast = java.lang.System.currentTimeMillis(); 200 //} 201 202 //profilerN = 0; 201 203 for (final OsmPrimitive osm : data.nodes) 202 204 if (!osm.deleted && !osm.selected) 203 205 { 204 206 osm.visit(this); 205 profilerN++; 206 } 207 if(profiler) 208 { 209 System.out.format("Nodes : %4dms, n=%5d\n", 210 (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 211 profilerLast = java.lang.System.currentTimeMillis(); 212 } 207 // profilerN++; 208 } 209 210 //if(profiler) 211 //{ 212 // System.out.format("Nodes : %4dms, n=%5d\n", 213 // (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 214 // profilerLast = java.lang.System.currentTimeMillis(); 215 //} 213 216 214 217 if(virtualNodeSize != 0) 215 218 { 216 profilerN = 0;219 // profilerN = 0; 217 220 currentColor = nodeColor; 218 221 for (final OsmPrimitive osm : data.ways) … … 220 223 { 221 224 visitVirtual((Way)osm); 222 profilerN++;225 // profilerN++; 223 226 } 224 227 displaySegments(); 225 228 226 if(profiler)227 {228 System.out.format("Virtual : %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN);229 profilerLast = java.lang.System.currentTimeMillis();230 }231 } 232 233 if(profiler)234 {235 System.out.format("All : %4dms\n", (profilerLast-profilerStart));236 }229 // if(profiler) 230 // { 231 // System.out.format("Virtual : %4dms, n=%5d\n", (java.lang.System.currentTimeMillis()-profilerLast), profilerN); 232 // profilerLast = java.lang.System.currentTimeMillis(); 233 // } 234 } 235 236 //if(profiler) 237 //{ 238 // System.out.format("All : %4dms\n", (profilerLast-profilerStart)); 239 //} 237 240 } 238 241 … … 294 297 return; 295 298 296 / /show direction arrows, if draw.segment.relevant_directions_only is not set, the way is tagged with a direction key297 // (even if the tag is negated as in oneway=false) or the way is selected299 /* show direction arrows, if draw.segment.relevant_directions_only is not set, the way is tagged with a direction key 300 (even if the tag is negated as in oneway=false) or the way is selected */ 298 301 299 302 boolean showThisDirectionArrow = w.selected 300 303 || (showDirectionArrow && (!showRelevantDirectionsOnly || w.hasDirectionKeys)); 301 / /head only takes over control if the option is true,302 // the direction should be shown at all and not only because it's selected304 /* head only takes over control if the option is true, 305 the direction should be shown at all and not only because it's selected */ 303 306 boolean showOnlyHeadArrowOnly = showThisDirectionArrow && !w.selected && showHeadArrowOnly; 304 307 Color wayColor; … … 390 393 } 391 394 392 displaySegments(); / / draw nodes on top!395 displaySegments(); /* draw nodes on top! */ 393 396 Color c = g.getColor(); 394 397 g.setColor(backgroundColor); -
trunk/src/org/openstreetmap/josm/data/projection/Lambert.java
r1309 r1415 206 206 * reference ellipsoid used by Lambert is Clark 207 207 * 208 * @param coordprojected coordinates pair in meters209 * @param Xs false east (coordinate system origin) in meters210 * @param Ys false north (coordinate system origin) in meters211 * @param c projection constant212 * @param n projection exponent208 * @param eastNorth projected coordinates pair in meters 209 * @param Xs false east (coordinate system origin) in meters 210 * @param Ys false north (coordinate system origin) in meters 211 * @param c projection constant 212 * @param n projection exponent 213 213 * @return LatLon in radian 214 214 */ … … 236 236 * Translate latitude/longitude in WGS84, (ellipsoid GRS80) to Lambert 237 237 * geographic, (ellipsoid Clark) 238 *239 * @param wgs240 * @return241 238 */ 242 239 private LatLon GRS802Clark(LatLon wgs) { … … 256 253 } 257 254 258 /**259 * @param lambert260 * @return261 */262 255 private LatLon Clark2GRS80(LatLon lambert) { 263 256 double lat = lambert.lat(); // in radian -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r1397 r1415 4 4 import java.awt.Dimension; 5 5 import java.awt.event.ActionEvent; 6 import java.awt.event.ComponentEvent;7 import java.awt.event.ComponentListener;8 6 import java.awt.GridBagLayout; 9 7 import java.awt.Toolkit; … … 11 9 import javax.swing.AbstractAction; 12 10 import javax.swing.Action; 13 import javax.swing.BorderFactory;14 import javax.swing.BoundedRangeModel;15 import javax.swing.InputMap;16 11 import javax.swing.JButton; 17 12 import javax.swing.JComponent; … … 19 14 import javax.swing.JOptionPane; 20 15 import javax.swing.JPanel; 21 import javax.swing.JRootPane;22 16 import javax.swing.JScrollBar; 23 17 import javax.swing.JScrollPane; 24 18 import javax.swing.KeyStroke; 25 19 26 import org.openstreetmap.josm.Main;27 20 import org.openstreetmap.josm.gui.JMultilineLabel; 28 21 import org.openstreetmap.josm.tools.GBC; 29 import org.openstreetmap.josm.tools.I18n;30 22 import org.openstreetmap.josm.tools.ImageProvider; 31 23 … … 37 29 /** 38 30 * Sets up the dialog. The first button is always the default. 39 * @param Component The parent element that will be used for position and maximum size40 * @param StringThe text that will be shown in the window titlebar41 * @param Component Any component that should be show above the buttons (e.g. JLabel)42 * @param String[]The labels that will be displayed on the buttons43 * @param String[]The path to the icons that will be displayed on the buttons. Path is relative to JOSM's image directory. File extensions need to be included. If a button should not have an icon pass null.31 * @param parent The parent element that will be used for position and maximum size 32 * @param title The text that will be shown in the window titlebar 33 * @param content Any component that should be show above the buttons (e.g. JLabel) 34 * @param buttonTexts The labels that will be displayed on the buttons 35 * @param buttonIcons The path to the icons that will be displayed on the buttons. Path is relative to JOSM's image directory. File extensions need to be included. If a button should not have an icon pass null. 44 36 */ 45 37 public ExtendedDialog(Component parent, String title, Component content, String[] buttonTexts, String[] buttonIcons) { -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r1370 r1415 15 15 16 16 import java.awt.BorderLayout; 17 import java.awt.Component;18 17 import java.awt.EventQueue; 19 18 … … 142 141 ArrayList<Future<String>> linkContent = new ArrayList<Future<String>>(); 143 142 for(int i=0; i < links.size(); i++) { 144 String[] obj = (String[])links.get(i);143 String[] obj = links.get(i); 145 144 int targetVersion = Integer.parseInt(obj[1]); 146 145 String condition = obj[0]; -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r1356 r1415 11 11 import java.awt.event.WindowAdapter; 12 12 import java.awt.event.WindowEvent; 13 import java.io.File;14 import java.io.IOException;15 13 import java.util.Arrays; 16 14 import java.util.Collection; -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r1380 r1415 63 63 import org.openstreetmap.josm.actions.search.SearchAction; 64 64 import org.openstreetmap.josm.actions.ToggleGPXLinesAction; 65 import org.openstreetmap.josm.data.DataSetChecker;66 65 import org.openstreetmap.josm.tools.Shortcut; 67 66 -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r1405 r1415 179 179 public void addMapMode(IconToggleButton b) { 180 180 toolBarActions.add(b); 181 toolGroup.add( (AbstractButton)b);181 toolGroup.add(b); 182 182 } 183 183 -
trunk/src/org/openstreetmap/josm/gui/MapSlider.java
r1337 r1415 31 31 double sizey = this.mv.scale * this.mv.getHeight(); 32 32 for (int zoom = 0; zoom <= 150; zoom++, sizex *= 1.1, sizey *= 1.1) { 33 if (sizex > this.mv.world.east() || sizey > this.mv.world.north()) {33 if (sizex > MapView.world.east() || sizey > MapView.world.north()) { 34 34 preventChange=true; 35 35 setValue(zoom); -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r1350 r1415 24 24 import java.awt.event.MouseListener; 25 25 import java.lang.reflect.InvocationTargetException; 26 import java.text.DecimalFormat;27 26 import java.util.Collection; 28 27 import java.util.ConcurrentModificationException; -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r1379 r1415 365 365 * that I switch layers and actions at the same time and it was annoying to mind the 366 366 * order. This way it works as visual clue for new users */ 367 for (Enumeration e = Main.map.toolGroup.getElements() ; e.hasMoreElements() ;) {368 AbstractButton x= (AbstractButton)e.nextElement();367 for (Enumeration<AbstractButton> e = Main.map.toolGroup.getElements() ; e.hasMoreElements() ;) { 368 AbstractButton x=e.nextElement(); 369 369 x.setEnabled(((MapMode)x.getAction()).layerIsSupported(layer)); 370 370 } … … 400 400 * 401 401 * @return <code>true</code> if a zoom operation has been performed 402 * @author Jan Peter Stotz403 402 */ 404 403 public boolean zoomToEditLayerBoundingBox() { -
trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
r1372 r1415 3 3 4 4 import java.awt.Component; 5 import java.awt.Dimension;6 5 import java.awt.GridBagLayout; 7 6 import java.awt.event.ComponentEvent; -
trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r1414 r1415 32 32 33 33 import javax.swing.Box; 34 import javax.swing.DefaultComboBoxModel;35 34 import javax.swing.DefaultListCellRenderer; 36 35 import javax.swing.JComboBox; … … 259 258 } 260 259 261 Main.ds.fireSelectionChanged(sel);260 DataSet.fireSelectionChanged(sel); 262 261 selectionChanged(sel); // update whole table 263 262 Main.parent.repaint(); // repaint all - drawing could have been changed … … 342 341 return; 343 342 Main.main.undoRedo.add(new ChangePropertyCommand(sel, key, value)); 344 Main.ds.fireSelectionChanged(sel);343 DataSet.fireSelectionChanged(sel); 345 344 selectionChanged(sel); // update table 346 345 Main.parent.repaint(); // repaint all - drawing could have been changed … … 366 365 } 367 366 private String objKey; 368 /** 369 * @return 370 */ 367 371 368 private TreeMap<String, TreeSet<String>> createAutoCompletionInfo( 372 369 boolean edit) { … … 399 396 Collection<OsmPrimitive> sel = Main.ds.getSelected(); 400 397 Main.main.undoRedo.add(new ChangePropertyCommand(sel, key, null)); 401 Main.ds.fireSelectionChanged(sel);398 DataSet.fireSelectionChanged(sel); 402 399 selectionChanged(sel); // update table 403 400 … … 582 579 } 583 580 Main.main.undoRedo.add(new ChangeCommand(cur, rel)); 584 Main.ds.fireSelectionChanged(sel);581 DataSet.fireSelectionChanged(sel); 585 582 selectionChanged(sel); // update whole table 586 583 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java
r1378 r1415 6 6 import java.awt.BorderLayout; 7 7 import java.awt.Dimension; 8 import java.awt.FlowLayout;9 8 import java.awt.GridBagLayout; 10 9 import java.awt.GridLayout; … … 110 109 private final JTable memberTable = new JTable(memberData); 111 110 112 // =================== FIXME FIXME FIXME=====================111 // =================== FIXME ===================== 113 112 // As soon as API 0.5 is dead, drop all the collation stuff from here ... 114 113 … … 208 207 this.relation = relation; 209 208 210 ordered = Main.pref.get("osm-server.version", "0.5").equals("0.6");209 ordered = !Main.pref.get("osm-server.version", "0.5").equals("0.5"); 211 210 212 211 if (relation == null) { … … 248 247 }); 249 248 250 /* I don't like this text any more. Let's just get on with doing the specialist251 * editors instead of talking about it.252 JLabel help = new JLabel("<html><em>"+253 tr("This is the basic relation editor which allows you to change the relation's tags " +254 "as well as the members. In addition to this we should have a smart editor that " +255 "detects the type of relationship and limits your choices in a sensible way.")+"</em></html>");256 getContentPane().add(help, BorderLayout.NORTH);257 */258 249 try { setAlwaysOnTop(true); } catch (SecurityException sx) {} 259 250 … … 326 317 bothTables.add(new JScrollPane(propertyTable), GBC.eop().fill(GBC.BOTH)); 327 318 bothTables.add(status = new JLabel(tr("Members")), GBC.eol().fill(GBC.HORIZONTAL)); 319 // this is not exactly pretty but the four buttons simply don't fit in one line. 320 // we should have smaller buttons for situations like this. 321 JPanel buttonPanel = new JPanel(new GridLayout(2,ordered ? 3 : 2)); 322 328 323 if (ordered) { 329 JPanel upDownPanel = new JPanel(); 330 upDownPanel.setLayout(new BoxLayout(upDownPanel, BoxLayout.Y_AXIS)); 331 332 upDownPanel.add(createButton(null, "moveup", tr("Move the currently selected members up"), 333 KeyEvent.VK_U, new ActionListener() { 324 buttonPanel.add(createButton(null, "moveup", tr("Move the currently selected members up"), KeyEvent.VK_U, new ActionListener() { 334 325 public void actionPerformed(ActionEvent e) { 335 326 moveMembers(-1); 336 327 } 337 328 })); 338 upDownPanel.add(createButton(null, "movedown", tr("Move the currently selected members down"), 339 KeyEvent.VK_N, new ActionListener() { 340 public void actionPerformed(ActionEvent e) { 341 moveMembers(1); 342 } 343 })); 344 345 346 bothTables.add(new JScrollPane(memberTable), GBC.std().fill(GBC.BOTH)); 347 bothTables.add(upDownPanel, GBC.eol().fill(GBC.VERTICAL)); 348 } else { 349 bothTables.add(new JScrollPane(memberTable), GBC.eol().fill(GBC.BOTH)); 350 } 351 352 // this is not exactly pretty but the four buttons simply don't fit in one line. 353 // we should have smaller buttons for situations like this. 354 JPanel buttonPanel = new JPanel(new GridLayout(2,2)); 329 } 330 bothTables.add(new JScrollPane(memberTable), GBC.eol().fill(GBC.BOTH)); 355 331 356 332 buttonPanel.add(createButton(marktr("Add Selected"),"addselected", … … 367 343 } 368 344 })); 345 346 if(ordered) { 347 buttonPanel.add(createButton(null, "movedown", tr("Move the currently selected members down"), KeyEvent.VK_N, new ActionListener() { 348 public void actionPerformed(ActionEvent e) { 349 moveMembers(1); 350 } 351 })); 352 } 369 353 370 354 buttonPanel.add(createButton(marktr("Remove"),"remove", … … 382 366 })); 383 367 384 /*buttonPanel.add(createButton(marktr("Select"),"select",385 tr("Highlight the member from the current table row as JOSM's selection"), KeyEvent.VK_S, new ActionListener() {386 public void actionPerformed(ActionEvent e) {387 ArrayList<OsmPrimitive> sel;388 int cnt = memberTable.getSelectedRowCount();389 if(cnt > 0)390 {391 sel = new ArrayList<OsmPrimitive>(cnt);392 for (int i : memberTable.getSelectedRows())393 sel.add((OsmPrimitive)memberTable.getValueAt(i, 1));394 }395 else396 {397 cnt = memberTable.getRowCount();398 sel = new ArrayList<OsmPrimitive>(cnt);399 for (int i = 0; i < cnt; ++i)400 sel.add((OsmPrimitive)memberTable.getValueAt(i, 1));401 }402 Main.ds.setSelected(sel);403 }404 }));*/405 368 buttonPanel.add(createButton(marktr("Download Members"),"downloadincomplete", 406 369 tr("Download all incomplete ways and nodes in relation"), KeyEvent.VK_L, new ActionListener() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r1331 r1415 19 19 import javax.swing.ListSelectionModel; 20 20 import javax.swing.event.ListSelectionListener; 21 import javax.swing.event.ListSelectionEvent;22 23 21 import org.openstreetmap.josm.Main; 24 import org.openstreetmap.josm.actions.AutoScaleAction;25 22 import org.openstreetmap.josm.command.DeleteCommand; 26 23 import org.openstreetmap.josm.data.osm.DataSet; -
trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
r1345 r1415 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Color;7 6 import java.awt.Dimension; 8 7 import java.awt.GridBagLayout; … … 12 11 import java.awt.event.KeyEvent; 13 12 import java.awt.event.KeyListener; 14 import java.awt.event.MouseAdapter;15 import java.util.HashMap;16 13 17 14 import javax.swing.JLabel; … … 24 21 25 22 import org.openstreetmap.josm.data.Bounds; 26 import org.openstreetmap.josm.data.coor.LatLon;27 23 import org.openstreetmap.josm.tools.GBC; 28 24 import org.openstreetmap.josm.tools.OsmUrlToBounds; … … 87 83 public void keyPressed(KeyEvent keyEvent) {} 88 84 public void keyReleased(KeyEvent keyEvent) { 89 if (keyEvent.getKeyCode() == keyEvent.VK_ENTER && parseURL(gui))85 if (keyEvent.getKeyCode() == KeyEvent.VK_ENTER && parseURL(gui)) 90 86 gui.closeDownloadDialog(true); 91 87 } -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r1353 r1415 41 41 import org.openstreetmap.josm.actions.SaveAction; 42 42 import org.openstreetmap.josm.actions.SaveAsAction; 43 import org.openstreetmap.josm.command.Command;44 43 import org.openstreetmap.josm.data.coor.EastNorth; 45 44 import org.openstreetmap.josm.data.coor.LatLon; … … 222 221 @Override public void mergeFrom(final Layer from) { 223 222 final MergeVisitor visitor = new MergeVisitor(data,((OsmDataLayer)from).data); 224 // int i=0;225 int max = ((OsmDataLayer)from).data.allPrimitives().size();226 227 // System.out.format("Add/Merge data:");228 229 223 for (final OsmPrimitive osm : ((OsmDataLayer)from).data.allPrimitives()) { 230 224 // i++; -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
r1245 r1415 129 129 130 130 /** 131 * Find the closest track point within the pixelTolerance of the screen point pNear132 * @param pNear : the point in screen coordinates near which to find a track point133 * @param pixelTolerance : only accept the point if within this number of pixels of en134 * @return the nearest trackpoint or null if nothing nearby135 *136 * XXX seems unused, F.R. 2008-03-15137 private WayPoint getClosestTrackPoint(Point pNear, double pixelTolerance) {138 WayPoint cw = null;139 AudioMarker recentlyPlayedMarker = AudioMarker.recentlyPlayedMarker();140 if (recentlyPlayedMarker != null) {141 // Find the track point closest to letting go of the play head142 double minDistance = pixelTolerance;143 GpxLayer trackLayer = recentlyPlayedMarker.parentLayer.fromLayer;144 if (trackLayer.data.tracks == null)145 return null;146 147 for (GpxTrack track : trackLayer.data.tracks) {148 if (track.trackSegs == null)149 continue;150 151 for (Collection<WayPoint> trackseg : track.trackSegs) {152 for (WayPoint w : trackseg) {153 Point p = Main.map.mapView.getPoint(w.eastNorth);154 double distance = p.distance(pNear);155 if (distance <= minDistance) {156 cw = w;157 minDistance = distance;158 }159 }160 }161 }162 }163 return cw;164 }165 */166 167 /**168 131 * reposition the play head at the point on the track nearest position given, 169 132 * providing we are within reasonable distance from the track; otherwise reset to the -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r1313 r1415 11 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 12 import org.openstreetmap.josm.data.osm.OsmUtils; 13 import org.openstreetmap.josm.data.osm.Relation;14 import org.openstreetmap.josm.data.osm.Way;15 13 import org.openstreetmap.josm.Main; 16 14 -
trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
r1243 r1415 2 2 package org.openstreetmap.josm.gui.preferences; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr;5 4 import static org.openstreetmap.josm.tools.I18n.tr; 6 5 … … 13 12 import java.util.regex.Matcher; 14 13 import java.util.regex.Pattern; 15 import java.util.ArrayList;16 import java.util.Collections;17 14 import java.util.HashMap; 18 import java.util.List;19 15 import java.util.Map; 20 16 import java.util.Map.Entry; … … 33 29 import javax.swing.table.TableCellRenderer; 34 30 import javax.swing.BorderFactory; 35 import javax.swing.Box;36 31 37 32 import org.openstreetmap.josm.Main; 38 33 import org.openstreetmap.josm.data.osm.visitor.MapPaintVisitor; 39 34 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 40 import org.openstreetmap.josm.gui.layer.GpxLayer;41 import org.openstreetmap.josm.gui.layer.OsmDataLayer;42 35 import org.openstreetmap.josm.gui.MapScaler; 43 36 import org.openstreetmap.josm.gui.dialogs.ConflictDialog; … … 77 70 colorKeyList.put(getName(key), key); 78 71 } 79 for (Entry k : colorKeyList.entrySet()) {72 for (Entry<String, String> k : colorKeyList.entrySet()) { 80 73 Vector<Object> row = new Vector<Object>(2); 81 74 row.add(k.getValue()); … … 83 76 tableModel.addRow(row); 84 77 } 85 for (Entry k : colorKeyList_mappaint.entrySet()) {78 for (Entry<String, String> k : colorKeyList_mappaint.entrySet()) { 86 79 Vector<Object> row = new Vector<Object>(2); 87 80 row.add(k.getValue()); -
trunk/src/org/openstreetmap/josm/gui/preferences/LanguagePreference.java
r1180 r1415 55 55 56 56 JPanel panel = null; 57 for(PreferenceSetting s : gui.settings)57 for(PreferenceSetting s : PreferenceDialog.settings) 58 58 { 59 59 if(s instanceof LafPreference) -
trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
r1326 r1415 22 22 import javax.swing.Scrollable; 23 23 24 import org.openstreetmap.josm.Main;25 24 import org.openstreetmap.josm.plugins.PluginDownloader; 26 25 import org.openstreetmap.josm.plugins.PluginSelection; -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r1326 r1415 7 7 import java.awt.GridBagLayout; 8 8 import java.awt.ScrollPane; 9 import java.awt.event.ActionEvent;10 import java.awt.event.ActionListener;11 9 import java.util.Collection; 12 10 import java.util.Iterator; … … 56 54 */ 57 55 public JPanel createPreferenceTab(String icon, String title, String desc) { 58 return createPreferenceTab(icon, title, desc, true);56 return createPreferenceTab(icon, title, desc, false); 59 57 } 60 58 -
trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java
r1399 r1415 11 11 import java.util.Collection; 12 12 import java.util.HashMap; 13 import java.util.StringTokenizer;14 13 15 14 import javax.swing.BorderFactory; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r1360 r1415 9 9 import java.awt.Image; 10 10 import java.awt.event.ActionEvent; 11 import java.awt.event.ActionListener;12 11 import java.io.BufferedReader; 13 12 import java.io.InputStreamReader; … … 27 26 import javax.swing.Action; 28 27 import javax.swing.ImageIcon; 29 import javax.swing.JButton;30 28 import javax.swing.JComboBox; 31 29 import javax.swing.JComponent; … … 50 48 import org.openstreetmap.josm.tools.GBC; 51 49 import org.openstreetmap.josm.tools.ImageProvider; 52 import org.openstreetmap.josm.tools.OpenBrowser;53 50 import org.openstreetmap.josm.tools.UrlLabel; 54 51 import org.openstreetmap.josm.tools.XmlObjectParser; -
trunk/src/org/openstreetmap/josm/io/DiffResultReader.java
r1195 r1415 7 7 import java.io.InputStream; 8 8 import java.io.InputStreamReader; 9 import java.util.ArrayList;10 import java.util.Arrays;11 9 import java.util.Collection; 12 10 import java.util.HashMap; 13 import java.util.HashSet;14 import java.util.LinkedList;15 11 import java.util.Map; 16 import java.util.Map.Entry;17 12 18 13 import javax.xml.parsers.ParserConfigurationException; 19 14 import javax.xml.parsers.SAXParserFactory; 20 15 21 import org.openstreetmap.josm.Main;22 import org.openstreetmap.josm.data.Bounds;23 import org.openstreetmap.josm.data.coor.LatLon;24 import org.openstreetmap.josm.data.osm.DataSet;25 import org.openstreetmap.josm.data.osm.DataSource;26 16 import org.openstreetmap.josm.data.osm.Node; 27 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 28 18 import org.openstreetmap.josm.data.osm.Relation; 29 import org.openstreetmap.josm.data.osm.RelationMember;30 import org.openstreetmap.josm.data.osm.User;31 19 import org.openstreetmap.josm.data.osm.Way; 32 import org.openstreetmap.josm.data.osm.visitor.AddVisitor;33 20 import org.openstreetmap.josm.data.osm.visitor.Visitor; 34 21 import org.openstreetmap.josm.gui.PleaseWaitDialog; … … 77 64 /** 78 65 * Parse the given input source and return the dataset. 79 * @param ref The dataset that is search in for references first. If80 * the Reference is not found here, Main.ds is searched and a copy of the81 * elemet found there is returned.82 66 */ 83 67 public static void parseDiffResult(InputStream source, Collection<OsmPrimitive> osm, Collection<OsmPrimitive> processed, Map<OsmPrimitive,Long> newIdMap, PleaseWaitDialog pleaseWaitDlg) -
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r1388 r1415 11 11 import java.text.SimpleDateFormat; 12 12 import java.util.ArrayList; 13 import java.util.Arrays;14 13 import java.util.Collection; 15 14 import java.util.Date; … … 202 201 } 203 202 rd.close(); 204 Object[] wparr = ps.waypoints.toArray();205 203 currentTrack.trackSegs.add(ps.waypoints); 206 204 data.recalculateBounds(); -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r1353 r1415 7 7 import java.io.InputStream; 8 8 import java.io.InputStreamReader; 9 import java.io.FileInputStream;10 import java.nio.channels.FileChannel;11 9 import java.util.ArrayList; 12 10 import java.util.Arrays; … … 436 434 437 435 // Cache the ways here for much better search performance 438 HashMap hm = new HashMap(10000);436 HashMap<Long, Way> hm = new HashMap<Long, Way>(10000); 439 437 for (Way wy : ds.ways) 440 438 hm.put(wy.id, wy); … … 454 452 } 455 453 } else if (emd.type.equals("way")) { 456 em.member = (OsmPrimitive)hm.get(emd.id);454 em.member = hm.get(emd.id); 457 455 if (em.member == null) 458 456 em.member = findWay(emd.id); -
trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java
r1169 r1415 28 28 /** 29 29 * Method to download single objects from OSM server. ways, relations, nodes 30 * @param id Object ID31 * @param type way node relation32 * @param full download with or without child objects33 30 * @return the data requested 34 31 * @throws SAXException -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r1395 r1415 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.BufferedOutputStream;7 6 import java.io.BufferedReader; 8 7 import java.io.ByteArrayOutputStream; … … 13 12 import java.io.OutputStreamWriter; 14 13 import java.io.PrintWriter; 15 import java.io.StringWriter;16 14 import java.io.UnsupportedEncodingException; 17 15 import java.lang.Math; -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r1397 r1415 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Dimension;7 6 import java.awt.Font; 8 7 import java.awt.GridBagLayout; -
trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
r1397 r1415 6 6 7 7 import java.awt.GridBagConstraints; 8 import java.awt.GridBagLayout;9 8 import java.awt.Insets; 10 9 import java.awt.event.ActionEvent; … … 27 26 import java.util.Map.Entry; 28 27 29 import javax.swing.AbstractAction;30 28 import javax.swing.BorderFactory; 31 29 import javax.swing.JCheckBox; -
trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r1326 r1415 10 10 import java.awt.datatransfer.StringSelection; 11 11 import java.awt.datatransfer.Transferable; 12 import java.io.BufferedReader;13 import java.io.File;14 import java.io.InputStreamReader;15 12 import java.io.PrintWriter; 16 13 import java.io.StringWriter; 17 import java.net.URL;18 import java.text.DateFormat;19 import java.text.SimpleDateFormat;20 import java.util.Arrays;21 import java.util.Date;22 import java.util.LinkedList;23 14 24 15 import javax.swing.JLabel; -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r1195 r1415 45 45 //System.out.println("Going to handle method "+method+" (short: "+method.getName()+") with event "+args[0]); 46 46 if (method.getName().equals("handleQuit")) { 47 handled = !Main. main.breakBecauseUnsavedChanges();47 handled = !Main.breakBecauseUnsavedChanges(); 48 48 } else if (method.getName().equals("handleAbout")) { 49 49 Main.main.menu.about.actionPerformed(null); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r1169 r1415 2 2 package org.openstreetmap.josm.tools; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 4 import org.openstreetmap.josm.tools.Shortcut; 6 5 import org.openstreetmap.josm.tools.PlatformHookUnixoid; -
trunk/src/org/openstreetmap/josm/tools/PresetTextComparator.java
r1402 r1415 5 5 import javax.swing.JMenuItem; 6 6 7 public class PresetTextComparator implements Comparator {7 public class PresetTextComparator implements Comparator<JMenuItem> { 8 8 //TODO add error checking and stuff 9 public int compare( Object arg0, Objectarg1) {10 return ((JMenuItem)arg0).getText().compareTo(((JMenuItem)arg1).getText());9 public int compare(JMenuItem arg0, JMenuItem arg1) { 10 return arg0.getText().compareTo(arg1.getText()); 11 11 } 12 12 -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r1182 r1415 260 260 public static final int GROUPS_ALT2 = GROUP__MAX * 2; 261 261 262 // safely read a shortcut from the preferences263 private static String[] getConfigStringArray(String key) {264 String s = Main.pref.get(key, null);265 if (s == null || s.equals("null") || s.equals(""))266 return null;267 return s.split(";");268 }269 270 262 // bootstrap 271 263 private static boolean initdone = false;
Note:
See TracChangeset
for help on using the changeset viewer.