Changeset 7700 in josm
- Timestamp:
- 2014-11-03T13:30:12+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r7005 r7700 35 35 /** the max. coordinates of the bounding box of this changeset */ 36 36 private LatLon max; 37 /** the number of comments for this changeset */ 38 private int commentsCount; 37 39 /** the map of tags */ 38 40 private Map<String,String> tags; … … 161 163 } 162 164 165 /** 166 * Replies the number of comments for this changeset. 167 * @return the number of comments for this changeset 168 * @since 7700 169 */ 170 public final int getCommentsCount() { 171 return commentsCount; 172 } 173 174 /** 175 * Sets the number of comments for this changeset. 176 * @param commentsCount the number of comments for this changeset 177 * @since 7700 178 */ 179 public final void setCommentsCount(int commentsCount) { 180 this.commentsCount = commentsCount; 181 } 182 163 183 @Override 164 184 public Map<String, String> getKeys() { … … 236 256 } else if (!user.equals(other.user)) 237 257 return false; 258 if (commentsCount != other.commentsCount) { 259 return false; 260 } 238 261 return true; 239 262 } … … 286 309 this.min = other.min; 287 310 this.max = other.max; 311 this.commentsCount = other.commentsCount; 288 312 this.tags = new HashMap<>(other.tags); 289 313 this.incomplete = other.incomplete; -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
r7299 r7700 96 96 } 97 97 98 protected void renderDiscussions(Changeset cs) { 99 setText(Integer.toString(cs.getCommentsCount())); 100 setToolTipText(""); 101 } 102 98 103 @Override 99 104 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, … … 111 116 case 4: /* created at */ renderDate(cs.getCreatedAt()); break; 112 117 case 5: /* closed at */ renderDate(cs.getClosedAt()); break; 118 case 6: /* discussions */ renderDiscussions(cs); break; 113 119 } 114 120 return this; -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModel.java
r7509 r7700 36 36 37 37 // column 2 - Open 38 createColumn(2, tr("Open"), 50, -1);38 createColumn(2, tr("Open"), 25, -1); 39 39 40 40 // column 3 - User … … 46 46 // column 5 - Closed at 47 47 createColumn(5, tr("Closed at"), 100, -1); 48 49 // column 6 - Discussions 50 createColumn(6, tr("Discussions"), 25, -1); 48 51 } 49 52 -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r7299 r7700 76 76 throwException(tr("Missing mandatory attribute ''{0}''.", "id")); 77 77 } 78 int id = 0; 79 try { 80 id = Integer.parseInt(value); 81 } catch(NumberFormatException e) { 82 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "id", value)); 83 } 84 if (id <= 0) { 85 throwException(tr("Illegal numeric value for attribute ''{0}''. Got ''{1}''.", "id", id)); 86 } 87 current.setId(id); 78 current.setId(parseNumericAttribute(value, 1)); 88 79 89 80 // -- user … … 156 147 current.setMax(new LatLon(maxLon, maxLat)); 157 148 } 149 150 // -- comments_count 151 String commentsCount = atts.getValue("comments_count"); 152 if (commentsCount != null) { 153 current.setCommentsCount(parseNumericAttribute(commentsCount, 0)); 154 } 155 } 156 157 private int parseNumericAttribute(String value, int minAllowed) throws XmlParsingException { 158 int att = 0; 159 try { 160 att = Integer.parseInt(value); 161 } catch(NumberFormatException e) { 162 throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "id", value)); 163 } 164 if (att < minAllowed) { 165 throwException(tr("Illegal numeric value for attribute ''{0}''. Got ''{1}''.", "id", att)); 166 } 167 return att; 158 168 } 159 169 … … 164 174 if (atts == null) { 165 175 throwException(tr("Missing mandatory attribute ''{0}'' of XML element {1}.", "version", "osm")); 176 return; 166 177 } 167 178 String v = atts.getValue("version");
Note:
See TracChangeset
for help on using the changeset viewer.