Changeset 340 in josm for branch/0.5/src/org
- Timestamp:
- 2007-10-04T23:41:26+02:00 (17 years ago)
- Location:
- branch/0.5/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branch/0.5/src/org/openstreetmap/josm/actions/HelpAction.java
r298 r340 47 47 48 48 private JFrame helpBrowser = new JFrame("JOSM Online Help"); 49 private String baseurl = Main.pref.get("help.baseurl", "http://josm. eigenheimstrasse.de");49 private String baseurl = Main.pref.get("help.baseurl", "http://josm.openstreetmap.de"); 50 50 private JEditorPane help = new JEditorPane(); 51 51 private WikiReader reader = new WikiReader(baseurl); -
branch/0.5/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r329 r340 4 4 import java.awt.Color; 5 5 import java.awt.Graphics; 6 import java.awt.Graphics2D; 6 7 import java.awt.Point; 7 8 import java.awt.Rectangle; 9 import java.awt.geom.GeneralPath; 8 10 import java.awt.geom.Line2D; 9 11 … … 41 43 42 44 protected static final double PHI = Math.toRadians(20); 45 46 /** 47 * Preferences 48 */ 49 protected Color inactiveColor; 50 protected Color selectedColor; 51 protected Color nodeColor; 52 protected Color dfltWayColor; 53 protected Color incompleteColor; 54 protected Color backgroundColor; 55 protected boolean showDirectionArrow; 56 protected boolean showOrderNumber; 57 58 /** 59 * Draw subsequent segments of same color as one Path 60 */ 61 protected Color currentColor = null; 62 protected GeneralPath currentPath = new GeneralPath(); 43 63 44 64 public void visitAll(DataSet data) { 65 66 inactiveColor = getPreferencesColor("inactive", Color.DARK_GRAY); 67 selectedColor = getPreferencesColor("selected", Color.WHITE); 68 nodeColor = getPreferencesColor("node", Color.RED); 69 dfltWayColor = getPreferencesColor("way", darkblue); 70 incompleteColor = getPreferencesColor("incomplete way", darkerblue); 71 backgroundColor = getPreferencesColor("background", Color.BLACK); 72 showDirectionArrow = Main.pref.getBoolean("draw.segment.direction"); 73 showOrderNumber = Main.pref.getBoolean("draw.segment.order_number"); 74 45 75 for (final OsmPrimitive osm : data.ways) 46 76 if (!osm.deleted && !osm.selected) 47 77 osm.visit(this); 78 displaySegments(null); 48 79 for (final OsmPrimitive osm : data.nodes) 49 80 if (!osm.deleted && !osm.selected) … … 52 83 if (!osm.deleted) 53 84 osm.visit(this); 85 displaySegments(null); 54 86 } 55 87 … … 63 95 Color color = null; 64 96 if (inactive) 65 color = getPreferencesColor("inactive", Color.DARK_GRAY);97 color = inactiveColor; 66 98 else if (n.selected) 67 color = getPreferencesColor("selected", Color.WHITE);99 color = selectedColor; 68 100 else 69 color = getPreferencesColor("node", Color.RED);101 color = nodeColor; 70 102 drawNode(n, color); 71 103 } … … 78 110 Color wayColor; 79 111 if (inactive) 80 wayColor = getPreferencesColor("inactive", Color.DARK_GRAY);112 wayColor = inactiveColor; 81 113 else { 82 wayColor = getPreferencesColor("way", darkblue); 83 } 84 85 boolean showDirectionArrow = Main.pref.getBoolean("draw.segment.direction"); 86 boolean showOrderNumber = Main.pref.getBoolean("draw.segment.order_number"); 114 wayColor = dfltWayColor; 115 } 116 87 117 int orderNumber = 0; 88 118 Node lastN = null; … … 93 123 } 94 124 orderNumber++; 95 drawSegment(lastN, n, w.selected && !inactive ? getPreferencesColor("selected", Color.WHITE): wayColor, showDirectionArrow);125 drawSegment(lastN, n, w.selected && !inactive ? selectedColor : wayColor, showDirectionArrow); 96 126 if (showOrderNumber) 97 127 drawOrderNumber(lastN, n, orderNumber); … … 101 131 102 132 public void visit(Relation e) { 103 // relations are not drawn. 104 } 133 // relations are not (yet?) drawn. 134 } 135 105 136 /** 106 137 * Draw an number of the order of the two consecutive nodes within the … … 117 148 if (screen.contains(x,y)) { 118 149 Color c = g.getColor(); 119 g.setColor( getPreferencesColor("background", Color.BLACK));150 g.setColor(backgroundColor); 120 151 g.fillRect(x-1, y-12, 8*strlen+1, 14); 121 152 g.setColor(c); … … 135 166 Rectangle screen = g.getClipBounds(); 136 167 137 if ( screen.contains(p.x, p.y))168 if (screen.contains(p.x, p.y)) 138 169 g.drawRect(p.x-1, p.y-1, 2, 2); 139 170 } … … 152 183 { 153 184 g.drawLine(p1.x, p1.y, p2.x, p2.y); 154 185 currentPath.moveTo(p1.x, p1.y); 186 currentPath.lineTo(p2.x, p2.y); 187 155 188 if (showDirection) { 156 189 double t = Math.atan2(p2.y-p1.y, p2.x-p1.x) + Math.PI; 157 g.drawLine(p2.x,p2.y, (int)(p2.x + 10*Math.cos(t-PHI)), (int)(p2.y + 10*Math.sin(t-PHI))); 158 g.drawLine(p2.x,p2.y, (int)(p2.x + 10*Math.cos(t+PHI)), (int)(p2.y + 10*Math.sin(t+PHI))); 190 currentPath.lineTo((int)(p2.x + 10*Math.cos(t-PHI)), (int)(p2.y + 10*Math.sin(t-PHI))); 191 currentPath.moveTo((int)(p2.x + 10*Math.cos(t+PHI)), (int)(p2.y + 10*Math.sin(t+PHI))); 192 currentPath.lineTo(p2.x, p2.y); 159 193 } 160 194 } … … 169 203 return ColorHelper.html2color(colStr); 170 204 } 171 172 205 173 206 public void setGraphics(Graphics g) { 174 207 this.g = g; … … 178 211 this.nc = nc; 179 212 } 213 214 protected void displaySegments(Color newColor) { 215 if (currentPath != null) { 216 g.setColor(currentColor); 217 ((Graphics2D) g).draw(currentPath); 218 currentPath = new GeneralPath(); 219 currentColor = newColor; 220 } 221 } 180 222 } -
branch/0.5/src/org/openstreetmap/josm/gui/ConflictResolver.java
r329 r340 156 156 } 157 157 158 if (this.conflicts.isEmpty()) {159 JOptionPane.showMessageDialog(Main.parent,160 "The ConflictResolver and the Merger disagree about conflicts in your dataset.\n"+161 "Of course, this is a bug.\n"+162 "The bug is very old, but unfortunatly, Imi (programmer) was not able to catch it.\n"+163 "If you know exactly what bounding boxes you downloaded (bookmarks?) and/or what\n"+164 "files you opened (have them ready?) to display this message again, pretty please\n"+165 "inform Imi at josm@eigenheimstrasse.de about the details.\n"+166 "Thanks.");167 //throw new RuntimeException("No conflicts but in conflict list:\n"+Arrays.toString(conflicts.entrySet().toArray()));168 }169 158 170 159 // have to initialize the JTables here and not in the declaration, because its constructor -
branch/0.5/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java
r298 r340 74 74 taggingPresetSources.setVisibleRowCount(3); 75 75 76 taggingPresetSources.setToolTipText(tr("The sources (url or filename) of tagging preset definition files. See http://josm. eigenheimstrasse.de/wiki/TaggingPresets for help."));76 taggingPresetSources.setToolTipText(tr("The sources (url or filename) of tagging preset definition files. See http://josm.openstreetmap.de/wiki/TaggingPresets for help.")); 77 77 addAnno.setToolTipText(tr("Add a new tagging preset source to the list.")); 78 78 deleteAnno.setToolTipText(tr("Delete the selected source from the list.")); -
branch/0.5/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r319 r340 70 70 report(); 71 71 else if (characters != null && !current.isEmpty()) { 72 setValue(qname, characters );72 setValue(qname, characters.trim()); 73 73 characters = ""; 74 74 }
Note:
See TracChangeset
for help on using the changeset viewer.