Changeset 11878 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2017-04-10T00:14:42+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableCellRenderer.java
r8510 r11878 17 17 public class ChangesetContentTableCellRenderer extends AbstractCellRenderer { 18 18 19 /** 20 * Renders primitive modification type. 21 * @param type modification type 22 */ 19 23 protected void renderModificationType(ChangesetModificationType type) { 20 24 switch(type) { … … 35 39 switch(column) { 36 40 case 0: 37 ChangesetModificationType type = (ChangesetModificationType) value; 38 renderModificationType(type); 41 renderModificationType((ChangesetModificationType) value); 39 42 break; 40 43 case 1: 41 HistoryOsmPrimitive primitive = (HistoryOsmPrimitive) value; 42 renderId(primitive.getId()); 44 renderId(((HistoryOsmPrimitive) value).getId()); 43 45 break; 44 46 default: -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java
r10619 r11878 18 18 /** 19 19 * This is the table model for the content of a changeset. 20 * 20 * @since 2689 21 21 */ 22 22 public class ChangesetContentTableModel extends AbstractTableModel { … … 25 25 private final DefaultListSelectionModel selectionModel; 26 26 27 /** 28 * Constructs a new {@code ChangesetContentTableModel}. 29 * @param selectionModel selection model 30 */ 27 31 public ChangesetContentTableModel(DefaultListSelectionModel selectionModel) { 28 32 this.selectionModel = selectionModel; … … 38 42 } 39 43 44 /** 45 * Selects a single item by its index. 46 * @param row index 47 */ 40 48 public void setSelectedByIdx(int row) { 41 49 selectionModel.setSelectionInterval(row, row); … … 50 58 } 51 59 60 /** 61 * Returns the selected history primitives. 62 * @return the selected history primitives 63 */ 52 64 public Set<HistoryOsmPrimitive> getSelectedPrimitives() { 53 65 Set<HistoryOsmPrimitive> ret = new HashSet<>(); … … 78 90 } 79 91 92 /** 93 * Sort data. 94 */ 80 95 protected void sort() { 81 96 data.sort((c1, c2) -> { … … 130 145 * The type used internally to keep information about {@link HistoryOsmPrimitive} 131 146 * with their {@link ChangesetModificationType}. 132 *133 147 */ 134 148 private static class ChangesetContentEntry implements ChangesetDataSetEntry { -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r11848 r11878 17 17 import java.text.DateFormat; 18 18 import java.util.Collections; 19 import java.util.Date; 19 20 import java.util.HashSet; 20 21 import java.util.Set; … … 238 239 DateFormat sdf = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.SHORT); 239 240 240 tfCreatedOn.setText(cs.getCreatedAt() == null ? "" : sdf.format(cs.getCreatedAt())); 241 tfClosedOn.setText(cs.getClosedAt() == null ? "" : sdf.format(cs.getClosedAt())); 241 Date createdDate = cs.getCreatedAt(); 242 Date closedDate = cs.getClosedAt(); 243 tfCreatedOn.setText(createdDate == null ? "" : sdf.format(createdDate)); 244 tfClosedOn.setText(closedDate == null ? "" : sdf.format(closedDate)); 242 245 } 243 246 -
trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
r11059 r11878 231 231 protected final Pair<LatLon, LatLon> getCoordinates() { 232 232 HistoryOsmPrimitive p = getPrimitive(); 233 if (!(p instanceof HistoryNode)) return null; 233 234 HistoryOsmPrimitive opposite = getOppositePrimitive(); 234 if (!(p instanceof HistoryNode)) return null;235 235 if (!(opposite instanceof HistoryNode)) return null; 236 236 HistoryNode node = (HistoryNode) p; -
trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java
r11848 r11878 6 6 import java.awt.Component; 7 7 import java.text.DateFormat; 8 import java.util.Date; 8 9 9 10 import javax.swing.ImageIcon; … … 37 38 StringBuilder sb = new StringBuilder(64); 38 39 sb.append("<html><strong>").append(tr("Changeset id:")).append("</strong>").append(cs.getId()).append("<br>"); 39 if (cs.getCreatedAt() != null) { 40 Date createdDate = cs.getCreatedAt(); 41 if (createdDate != null) { 40 42 sb.append("<strong>").append(tr("Created at:")).append("</strong>").append( 41 DateUtils.formatDateTime(c s.getCreatedAt(), DateFormat.SHORT, DateFormat.SHORT)).append("<br>");43 DateUtils.formatDateTime(createdDate, DateFormat.SHORT, DateFormat.SHORT)).append("<br>"); 42 44 } 43 45 String comment = cs.get("comment"); -
trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java
r10611 r11878 91 91 92 92 public void setRange(Date dateMin, Date dateMax) { 93 this.dateMin = dateMin;94 this.dateMax = dateMax;93 this.dateMin = DateUtils.cloneDate(dateMin); 94 this.dateMax = DateUtils.cloneDate(dateMax); 95 95 } 96 96 97 97 public void setDate(Date date) { 98 spinner.setValue( date);98 spinner.setValue(DateUtils.cloneDate(date)); 99 99 } 100 100 101 101 public Date getDate() { 102 return (Date) spinner.getValue();102 return DateUtils.cloneDate((Date) spinner.getValue()); 103 103 } 104 104
Note:
See TracChangeset
for help on using the changeset viewer.