Changeset 4406 in josm for trunk/src/org
- Timestamp:
- 2011-09-07T23:56:18+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/history
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
r3083 r4406 30 30 private CoordinateInfoViewer coordinateInfoViewer; 31 31 private JTabbedPane tpViewers; 32 private VersionTable versionTable; 32 33 33 34 /** … … 53 54 pnl.setLayout(new BorderLayout()); 54 55 55 VersionTable tbl= new VersionTable(model);56 pnl.add(embeddInScrollPane( tbl), BorderLayout.CENTER);56 versionTable = new VersionTable(model); 57 pnl.add(embeddInScrollPane(versionTable), BorderLayout.CENTER); 57 58 return pnl; 58 59 } … … 126 127 public void populate(History history) { 127 128 model.setHistory(history); 129 versionTable.updateSelection(); 128 130 129 131 tpViewers.removeAll(); -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r4339 r4406 174 174 this.history = history; 175 175 if (history.getNumVersions() > 0) { 176 current = history.getEarliest(); 177 reference = history.getEarliest(); 178 setLatest(null); 176 HistoryOsmPrimitive newLatest = null; 179 177 if (getEditLayer() != null) { 180 178 OsmPrimitive p = getEditLayer().data.getPrimitiveById(history.getId(), history.getType()); 181 179 if (canShowAsLatest(p)) { 182 HistoryOsmPrimitive latest = new HistoryPrimitiveBuilder().build(p); 183 setLatest(latest); 180 newLatest = new HistoryPrimitiveBuilder().build(p); 184 181 } 185 182 } 183 if (newLatest == null) { 184 current = history.getLatest(); 185 int prevIndex = history.getNumVersions() - 2; 186 reference = prevIndex < 0 ? history.getEarliest() : history.get(prevIndex); 187 } else { 188 reference = history.getLatest(); 189 current = newLatest; 190 } 191 setLatest(newLatest); 186 192 } 187 193 initTagTableModels(); -
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r4191 r4406 95 95 } 96 96 97 public void updateSelection() { 98 final int row = getVersionTableModel().getRowCount() - 1; 99 setRowSelectionInterval(row, row); 100 } 101 97 102 class PopupMenuTrigger extends MouseAdapter { 98 103 @Override
Note:
See TracChangeset
for help on using the changeset viewer.