Changeset 2242 in josm for trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
- Timestamp:
- 2009-10-04T00:37:05+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
r1709 r2242 14 14 15 15 import org.openstreetmap.josm.data.osm.history.History; 16 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 16 17 17 18 /** 18 19 * HistoryBrowser is an UI component which displays history information about an {@see OsmPrimitive}. 19 * 20 * 20 21 * 21 22 */ … … 24 25 /** the model */ 25 26 private HistoryBrowserModel model; 27 private JTabbedPane dataPane; 26 28 27 29 /** 28 30 * embedds table in a {@see JScrollPane} 29 * 31 * 30 32 * @param table the table 31 33 * @return the {@see JScrollPane} with the embedded table … … 40 42 /** 41 43 * creates the table which shows the list of versions 42 * 44 * 43 45 * @return the panel with the version table 44 46 */ … … 55 57 * creates the panel which shows information about two different versions 56 58 * of the same {@see OsmPrimitive}. 57 * 59 * 58 60 * @return the panel 59 61 */ 62 60 63 protected JPanel createVersionComparePanel() { 61 JTabbedPane pane = new JTabbedPane();62 pane.add(new TagInfoViewer(model));63 pane.setTitleAt(0, tr("Tags"));64 dataPane = new JTabbedPane(); 65 dataPane.add(new TagInfoViewer(model)); 66 dataPane.setTitleAt(0, tr("Tags")); 64 67 65 pane.add(new NodeListViewer(model));66 pane.setTitleAt(1, tr("Nodes"));68 dataPane.add(new NodeListViewer(model)); 69 dataPane.setTitleAt(1, tr("Nodes")); 67 70 68 pane.add(new RelationMemberListViewer(model)); 69 pane.setTitleAt(2, tr("Members")); 71 dataPane.add(new RelationMemberListViewer(model)); 72 dataPane.setTitleAt(2, tr("Members")); 73 74 dataPane.add(new CoordinateViewer(model)); 75 dataPane.setTitleAt(3, tr("Coordinate")); 70 76 71 77 JPanel pnl = new JPanel(); 72 78 pnl.setLayout(new BorderLayout()); 73 pnl.add( pane, BorderLayout.CENTER);79 pnl.add(dataPane, BorderLayout.CENTER); 74 80 return pnl; 75 81 } … … 116 122 /** 117 123 * populates the browser with the history of a specific {@see OsmPrimitive} 118 * 124 * 119 125 * @param history the history 120 126 */ 121 127 public void populate(History history) { 122 128 model.setHistory(history); 129 OsmPrimitiveType type = history.getType(); 130 if(type != null) 131 { 132 if(type == OsmPrimitiveType.NODE) 133 { 134 dataPane.setEnabledAt(1, false); 135 dataPane.setEnabledAt(2, false); 136 } 137 else if(type == OsmPrimitiveType.WAY) 138 { 139 dataPane.setEnabledAt(2, false); 140 dataPane.setEnabledAt(3, false); 141 } 142 else 143 { 144 dataPane.setEnabledAt(3, false); 145 } 146 } 123 147 } 124 148 125 149 /** 126 150 * replies the {@see History} currently displayed by this browser 127 * 151 * 128 152 * @return the current history 129 153 */
Note:
See TracChangeset
for help on using the changeset viewer.