Changeset 12189 in josm for trunk


Ignore:
Timestamp:
2017-05-15T23:42:03+02:00 (8 years ago)
Author:
michael2402
Message:

See #14794: Javadoc for data.osm package

Location:
trunk/src/org/openstreetmap/josm/data/osm
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetCacheEvent.java

    r8510 r12189  
    44import java.util.Collection;
    55
     6/**
     7 * An event indicating a change in the {@link ChangesetCache}
     8 */
    69public interface ChangesetCacheEvent {
     10    /**
     11     * The changeset cache the change happened in.
     12     * @return The {@link ChangesetCache}
     13     */
    714    ChangesetCache getSource();
    815
     16    /**
     17     * Gets a list of {@link Changeset}s that were added to the cache
     18     * @return The changesets
     19     */
    920    Collection<Changeset> getAddedChangesets();
    1021
     22    /**
     23     * Gets a list of {@link Changeset}s that were removed from the cache
     24     * @return The changesets
     25     */
    1126    Collection<Changeset> getRemovedChangesets();
    1227
     28    /**
     29     * Gets a list of {@link Changeset}s that were changed
     30     * @return The changesets
     31     */
    1332    Collection<Changeset> getUpdatedChangesets();
    1433}
  • trunk/src/org/openstreetmap/josm/data/osm/DefaultChangesetCacheEvent.java

    r9059 r12189  
    77import java.util.Set;
    88
     9/**
     10 * The default event implementation that is used to indicate a change in the {@link ChangesetCache}
     11 */
    912public class DefaultChangesetCacheEvent implements ChangesetCacheEvent {
    1013
     
    1417    private final ChangesetCache source;
    1518
     19    /**
     20     * Creates a basic, empty {@link ChangesetCacheEvent}
     21     * @param source The source changeset
     22     */
    1623    public DefaultChangesetCacheEvent(ChangesetCache source) {
    1724        this.source = source;
     
    1926        modified = new HashSet<>();
    2027        removed = new HashSet<>();
     28    }
     29
     30    @Override
     31    public ChangesetCache getSource() {
     32        return source;
    2133    }
    2234
     
    3244
    3345    @Override
    34     public ChangesetCache getSource() {
    35         return source;
    36     }
    37 
    38     @Override
    3946    public Collection<Changeset> getUpdatedChangesets() {
    4047        return Collections.unmodifiableCollection(modified);
    4148    }
    4249
     50    /**
     51     * Adds a {@link Changeset} to the added list
     52     * @param cs the {@link Changeset}
     53     */
    4354    public void rememberAddedChangeset(Changeset cs) {
    4455        if (cs == null) return;
     
    4657    }
    4758
     59    /**
     60     * Adds a {@link Changeset} to the updated list
     61     * @param cs the {@link Changeset}
     62     */
    4863    public void rememberUpdatedChangeset(Changeset cs) {
    4964        if (cs == null) return;
     
    5166    }
    5267
     68    /**
     69     * Adds a {@link Changeset} to the removed list
     70     * @param cs the {@link Changeset}
     71     */
    5372    public void rememberRemovedChangeset(Changeset cs) {
    5473        if (cs == null) return;
     
    5675    }
    5776
     77    /**
     78     * Checks if this event contains any {@link Changeset}s
     79     * @return <code>true</code> if changesets were added
     80     */
    5881    public boolean isEmpty() {
    5982        return added.isEmpty() && modified.isEmpty() && removed.isEmpty();
  • trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java

    r9203 r12189  
    4242    String format(Changeset changeset);
    4343
     44    /**
     45     * Gets a comparator that sorts the nodes by the string that this formatter would create for them
     46     * @return That comparator
     47     */
    4448    Comparator<Node> getNodeComparator();
    4549
     50    /**
     51     * Gets a comparator that sorts the ways by the string that this formatter would create for them
     52     * @return That comparator
     53     */
    4654    Comparator<Way> getWayComparator();
    4755
     56    /**
     57     * Gets a comparator that sorts the relations by the string that this formatter would create for them
     58     * @return That comparator
     59     */
    4860    Comparator<Relation> getRelationComparator();
    4961}
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r11383 r12189  
    779779    }
    780780
     781    /**
     782     * Clears all cached styles for all nodes of this way. This should not be called from outside.
     783     * @see Node#clearCachedStyle()
     784     */
    781785    public void clearCachedNodeStyles() {
    782786        for (final Node n : nodes) {
  • trunk/src/org/openstreetmap/josm/data/osm/event/AbstractDatasetChangedEvent.java

    r11928 r12189  
    1717     */
    1818    public enum DatasetEventType {
     19        /**
     20         * A combination of multiple events
     21         */
    1922        DATA_CHANGED,
     23        /**
     24         * The lat/lon coordinates of a node have changed.
     25         */
    2026        NODE_MOVED,
     27        /**
     28         * Primitives have been added to this dataset
     29         */
    2130        PRIMITIVES_ADDED,
     31        /**
     32         * Primitives have been removed from this dataset
     33         */
    2234        PRIMITIVES_REMOVED,
     35        /**
     36         * The members of a relation have changed
     37         */
    2338        RELATION_MEMBERS_CHANGED,
     39        /**
     40         * The tags of a primitve have changed
     41         */
    2442        TAGS_CHANGED,
     43        /**
     44         * The nodes of a way or their order has changed
     45         */
    2546        WAY_NODES_CHANGED,
     47        /**
     48         * The changeset id changed for a list of primitives
     49         */
    2650        CHANGESET_ID_CHANGED,
     51        /**
     52         * The flags changed for a primitive and have not been covered in an other event
     53         */
    2754        PRIMITIVE_FLAGS_CHANGED,
    2855    }
  • trunk/src/org/openstreetmap/josm/data/osm/event/ChangesetIdChangedEvent.java

    r11928 r12189  
    77import org.openstreetmap.josm.data.osm.OsmPrimitive;
    88
     9/**
     10 * An event that is triggered when the changeset id has changed for a list of primitives.
     11 */
    912public class ChangesetIdChangedEvent extends AbstractDatasetChangedEvent {
    1013
  • trunk/src/org/openstreetmap/josm/data/osm/event/DataChangedEvent.java

    r11928 r12189  
    99import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1010
     11/**
     12 * A combined data change event. It consists of multiple dataset events.
     13 */
    1114public class DataChangedEvent extends AbstractDatasetChangedEvent {
    1215
  • trunk/src/org/openstreetmap/josm/data/osm/event/NodeMovedEvent.java

    r11928 r12189  
    99import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1010
     11/**
     12 * An event that is triggered on a node move (lat/lon change)
     13 */
    1114public class NodeMovedEvent extends AbstractDatasetChangedEvent {
    1215
  • trunk/src/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEvent.java

    r11928 r12189  
    1010import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1111
     12/**
     13 * An event that is triggered if primitives have been added to the dataset
     14 */
    1215public class PrimitivesAddedEvent extends AbstractDatasetChangedEvent {
    1316
  • trunk/src/org/openstreetmap/josm/data/osm/event/PrimitivesRemovedEvent.java

    r11928 r12189  
    1010import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1111
     12/**
     13 * An event that is triggered when primitives were removed from the dataset
     14 */
    1215public class PrimitivesRemovedEvent extends AbstractDatasetChangedEvent {
    1316
  • trunk/src/org/openstreetmap/josm/data/osm/event/RelationMembersChangedEvent.java

    r11928 r12189  
    99import org.openstreetmap.josm.data.osm.Relation;
    1010
     11/**
     12 * An event that is triggered if the members of a single relation have changed
     13 */
    1114public class RelationMembersChangedEvent extends AbstractDatasetChangedEvent {
    1215
  • trunk/src/org/openstreetmap/josm/data/osm/event/TagsChangedEvent.java

    r11928 r12189  
    99import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1010
     11/**
     12 * An event that is triggered if the tags of a single primitive have changed
     13 */
    1114public class TagsChangedEvent extends AbstractDatasetChangedEvent {
    1215
  • trunk/src/org/openstreetmap/josm/data/osm/event/WayNodesChangedEvent.java

    r11928 r12189  
    99import org.openstreetmap.josm.data.osm.Way;
    1010
     11/**
     12 * An event that is triggered when the nodes of a way have been changed (nodes added, removed or the order was changed)
     13 */
    1114public class WayNodesChangedEvent extends AbstractDatasetChangedEvent {
    1215
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java

    r10386 r12189  
    6060    }
    6161
     62    /**
     63     * Adds a listener that listens to history data set events.
     64     * @param listener The listener
     65     */
    6266    public void addHistoryDataSetListener(HistoryDataSetListener listener) {
    6367        if (listener != null) {
     
    6670    }
    6771
     72    /**
     73     * Removes a listener that listens to history data set events.
     74     * @param listener The listener
     75     */
    6876    public void removeHistoryDataSetListener(HistoryDataSetListener listener) {
    6977        listeners.remove(listener);
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSetListener.java

    r5266 r12189  
    44import org.openstreetmap.josm.data.osm.PrimitiveId;
    55
     6/**
     7 * A listener that listens to changes in the {@link HistoryDataSet}.
     8 * @see HistoryDataSet#addHistoryDataSetListener(HistoryDataSetListener)
     9 */
    610public interface HistoryDataSetListener {
    711    /**
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java

    r11537 r12189  
    4444    public static final String PREF_KEY_RENDERER_CLASS_NAME = "mappaint.renderer-class-name";
    4545
     46    /**
     47     * An exception thrown while creating a map renderer
     48     */
    4649    public static class MapRendererFactoryException extends RuntimeException {
    4750
     51        /**
     52         * Create a new {@link MapRendererFactoryException}
     53         * @param message The message
     54         * @param cause The cause
     55         */
    4856        public MapRendererFactoryException(String message, Throwable cause) {
    4957            super(message, cause);
    5058        }
    5159
     60        /**
     61         * Create a new {@link MapRendererFactoryException}
     62         * @param message The message
     63         */
    5264        public MapRendererFactoryException(String message) {
    5365            super(message);
    5466        }
    5567
     68        /**
     69         * Create a new {@link MapRendererFactoryException}
     70         * @param cause The cause
     71         */
    5672        public MapRendererFactoryException(Throwable cause) {
    5773            super(cause);
     
    5975    }
    6076
     77    /**
     78     * A description of a possible renderer for the map
     79     */
    6180    public static class Descriptor {
    6281        private final Class<? extends AbstractMapRenderer> renderer;
     
    6483        private final String description;
    6584
     85        /**
     86         * Creates a new map renderer description
     87         * @param renderer The renderer
     88         * @param displayName The display name for the renderer
     89         * @param description The longer description that should be displayed to the user.
     90         */
    6691        public Descriptor(Class<? extends AbstractMapRenderer> renderer, String displayName, String description) {
    6792            this.renderer = renderer;
     
    7095        }
    7196
     97        /**
     98         * Get the class of the renderer
     99         * @return The class
     100         */
    72101        public Class<? extends AbstractMapRenderer> getRenderer() {
    73102            return renderer;
    74103        }
    75104
     105        /**
     106         * Get the display name
     107         * @return The name
     108         */
    76109        public String getDisplayName() {
    77110            return displayName;
    78111        }
    79112
     113        /**
     114         * Get the description
     115         * @return The description
     116         */
    80117        public String getDescription() {
    81118            return description;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r11553 r12189  
    247247    }
    248248
     249    /**
     250     * The polygon data for a multipolygon part.
     251     * It contains the outline of this polygon in east/north space.
     252     */
    249253    public static class PolyData extends JoinedWay {
     254        /**
     255         * The intersection type used for {@link PolyData#contains(java.awt.geom.Path2D.Double)}
     256         */
    250257        public enum Intersection {
     258            /**
     259             * The polygon is completely inside this PolyData
     260             */
    251261            INSIDE,
     262            /**
     263             * The polygon is completely outside of this PolyData
     264             */
    252265            OUTSIDE,
     266            /**
     267             * The polygon is partially inside and outside of this PolyData
     268             */
    253269            CROSSING
    254270        }
     
    313329        }
    314330
     331        /**
     332         * Checks if this multipolygon contains or crosses an other polygon
     333         * @param p The path to check. Needs to be in east/north space.
     334         * @return a {@link Intersection} constant
     335         */
    315336        public Intersection contains(Path2D.Double p) {
    316337            int contains = 0;
     
    334355        }
    335356
     357        /**
     358         * Adds an inner polygon
     359         * @param inner The polygon to add as inner polygon.
     360         */
    336361        public void addInner(PolyData inner) {
    337362            inners.add(inner);
     
    343368        }
    344369
     370        /**
     371         * Gets the polygon outline and interior as java path
     372         * @return The path in east/north space.
     373         */
    345374        public Path2D.Double get() {
    346375            return poly;
    347376        }
    348377
     378        /**
     379         * Gets the bounds as {@link Rectangle2D} in east/north space.
     380         * @return The bounds
     381         */
    349382        public Rectangle2D getBounds() {
    350383            if (bounds == null) {
     
    354387        }
    355388
     389        /**
     390         * Gets a list of all inner polygons.
     391         * @return The inner polygons.
     392         */
    356393        public List<PolyData> getInners() {
    357394            return Collections.unmodifiableList(inners);
     
    395432        }
    396433
     434        /**
     435         * Check if this polygon was changed by a node move
     436         * @param event The node move event
     437         */
    397438        public void nodeMoved(NodeMovedEvent event) {
    398439            final Node n = event.getNode();
     
    409450        }
    410451
     452        /**
     453         * Check if this polygon was affected by a way change
     454         * @param event The way event
     455         */
    411456        public void wayNodesChanged(WayNodesChangedEvent event) {
    412457            final Long wayId = event.getChangedWay().getUniqueId();
     
    526571    }
    527572
     573    /**
     574     * Attempt to combine the ways in the list if they share common end nodes
     575     * @param waysToJoin The ways to join
     576     * @return A collection of {@link JoinedWay} objects indicating the possible join of those ways
     577     */
    528578    public static Collection<JoinedWay> joinWays(Collection<Way> waysToJoin) {
    529579        final Collection<JoinedWay> result = new ArrayList<>();
     
    621671    }
    622672
     673    /**
     674     * Find a matching outer polygon for the inner one
     675     * @param inner The inner polygon to search the outer for
     676     * @param outerPolygons The possible outer polygons
     677     * @return The outer polygon that was found or <code>null</code> if none was found.
     678     */
    623679    public PolyData findOuterPolygon(PolyData inner, List<PolyData> outerPolygons) {
    624680        // First try to test only bbox, use precise testing only if we don't get unique result
Note: See TracChangeset for help on using the changeset viewer.