Ignore:
Timestamp:
2009-10-11T22:03:25+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3694: History dialog for relations does not work

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  
    139139        } else if (history.getEarliest().getType().equals(OsmPrimitiveType.RELATION)) {
    140140            tpViewers.add(relationMemberListViewer);
    141             tpViewers.setTitleAt(2, tr("Members"));
     141            tpViewers.setTitleAt(1, tr("Members"));
    142142        }
    143143        revalidate();
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryLoadTask.java

    r2239 r2275  
    2222import org.xml.sax.SAXException;
    2323
     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 */
    2443public class HistoryLoadTask extends PleaseWaitRunnable {
    2544
     
    3453    }
    3554
     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     */
    3662    public HistoryLoadTask add(long id, OsmPrimitiveType type) {
    3763        if (id <= 0)
     
    4571    }
    4672
    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  {
    4881        if (primitive == null)
    4982            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitive"));
     
    5487    }
    5588
    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 {
    5797        if (history == null)
    5898            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "history"));
     
    63103    }
    64104
    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 {
    66114        if (primitive == null)
    67115            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
    68119        return add(primitive.getId(), OsmPrimitiveType.from(primitive));
    69120    }
    70121
    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{
    72131        if (primitives == null)
    73132            throw new IllegalArgumentException(tr("Parameter ''{0}'' must not be null.", "primitives"));
Note: See TracChangeset for help on using the changeset viewer.