Changeset 2275 in josm for trunk/src/org
- Timestamp:
- 2009-10-11T22:03:25+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/history
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java
r2250 r2275 139 139 } else if (history.getEarliest().getType().equals(OsmPrimitiveType.RELATION)) { 140 140 tpViewers.add(relationMemberListViewer); 141 tpViewers.setTitleAt( 2, tr("Members"));141 tpViewers.setTitleAt(1, tr("Members")); 142 142 } 143 143 revalidate(); -
trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java
r2239 r2275 22 22 import org.xml.sax.SAXException; 23 23 24 /** 25 * Loads the the object history of an collection of objects from the 26 * server. 27 * 28 * It provides a fluent API for configuration. 29 * 30 * Sample usage: 31 * 32 * <pre> 33 * HistoryLoadTask task = new HistoryLoadTask() 34 * .add(1, OsmPrimitiveType.NODE) 35 * .add(1233, OsmPrimitiveType.WAY) 36 * .add(37234, OsmPrimitveType.RELATION) 37 * .add(aHistoryItem); 38 * 39 * Main.worker.execute(task); 40 * 41 * </pre> 42 */ 24 43 public class HistoryLoadTask extends PleaseWaitRunnable { 25 44 … … 34 53 } 35 54 55 /** 56 * Adds an object whose history is to be loaded. 57 * 58 * @param id the object id 59 * @param type the object type 60 * @return this task 61 */ 36 62 public HistoryLoadTask add(long id, OsmPrimitiveType type) { 37 63 if (id <= 0) … … 45 71 } 46 72 47 public HistoryLoadTask add(HistoryOsmPrimitive primitive) { 73 /** 74 * Adds an object to be loaded, the object is specified by a history item. 75 * 76 * @param primitive the history item 77 * @return this task 78 * @throws IllegalArgumentException thrown if primitive is null 79 */ 80 public HistoryLoadTask add(HistoryOsmPrimitive primitive) throws IllegalArgumentException { 48 81 if (primitive == null) 49 82 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive")); … … 54 87 } 55 88 56 public HistoryLoadTask add(History history) { 89 /** 90 * Adds an object to be loaded, the object is specified by an already loaded object history. 91 * 92 * @param history the history. Must not be null. 93 * @return this task 94 * @throws IllegalArgumentException thrown if history is null 95 */ 96 public HistoryLoadTask add(History history)throws IllegalArgumentException { 57 97 if (history == null) 58 98 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "history")); … … 63 103 } 64 104 65 public HistoryLoadTask add(OsmPrimitive primitive) { 105 /** 106 * Adds an object to be loaded, the object is specified by an OSM primitive. 107 * 108 * @param primitive the OSM primitive. Must not be null. primitive.getId() > 0 required. 109 * @return this task 110 * @throws IllegalArgumentException thrown if the primitive is null 111 * @throws IllegalArgumentException thrown if primitive.getId() <= 0 112 */ 113 public HistoryLoadTask add(OsmPrimitive primitive) throws IllegalArgumentException { 66 114 if (primitive == null) 67 115 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive")); 116 if (primitive.getId() <= 0) 117 throw new IllegalArgumentException(tr("Object id > 0 expected. Got {0}", primitive.getId())); 118 68 119 return add(primitive.getId(), OsmPrimitiveType.from(primitive)); 69 120 } 70 121 71 public HistoryLoadTask add(Collection<? extends OsmPrimitive> primitives) { 122 /** 123 * Adds a collection of objects to loaded, specified by a collection of OSM primitives. 124 * 125 * @param primitive the OSM primitive. Must not be null. primitive.getId() > 0 required. 126 * @return this task 127 * @throws IllegalArgumentException thrown if primitives is null 128 * @throws IllegalArgumentException thrown if one of the ids in the collection <= 0 129 */ 130 public HistoryLoadTask add(Collection<? extends OsmPrimitive> primitives) throws IllegalArgumentException{ 72 131 if (primitives == null) 73 132 throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitives"));
Note:
See TracChangeset
for help on using the changeset viewer.