- Timestamp:
- 2017-05-15T23:42:03+02:00 (8 years ago)
- 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 4 4 import java.util.Collection; 5 5 6 /** 7 * An event indicating a change in the {@link ChangesetCache} 8 */ 6 9 public interface ChangesetCacheEvent { 10 /** 11 * The changeset cache the change happened in. 12 * @return The {@link ChangesetCache} 13 */ 7 14 ChangesetCache getSource(); 8 15 16 /** 17 * Gets a list of {@link Changeset}s that were added to the cache 18 * @return The changesets 19 */ 9 20 Collection<Changeset> getAddedChangesets(); 10 21 22 /** 23 * Gets a list of {@link Changeset}s that were removed from the cache 24 * @return The changesets 25 */ 11 26 Collection<Changeset> getRemovedChangesets(); 12 27 28 /** 29 * Gets a list of {@link Changeset}s that were changed 30 * @return The changesets 31 */ 13 32 Collection<Changeset> getUpdatedChangesets(); 14 33 } -
trunk/src/org/openstreetmap/josm/data/osm/DefaultChangesetCacheEvent.java
r9059 r12189 7 7 import java.util.Set; 8 8 9 /** 10 * The default event implementation that is used to indicate a change in the {@link ChangesetCache} 11 */ 9 12 public class DefaultChangesetCacheEvent implements ChangesetCacheEvent { 10 13 … … 14 17 private final ChangesetCache source; 15 18 19 /** 20 * Creates a basic, empty {@link ChangesetCacheEvent} 21 * @param source The source changeset 22 */ 16 23 public DefaultChangesetCacheEvent(ChangesetCache source) { 17 24 this.source = source; … … 19 26 modified = new HashSet<>(); 20 27 removed = new HashSet<>(); 28 } 29 30 @Override 31 public ChangesetCache getSource() { 32 return source; 21 33 } 22 34 … … 32 44 33 45 @Override 34 public ChangesetCache getSource() {35 return source;36 }37 38 @Override39 46 public Collection<Changeset> getUpdatedChangesets() { 40 47 return Collections.unmodifiableCollection(modified); 41 48 } 42 49 50 /** 51 * Adds a {@link Changeset} to the added list 52 * @param cs the {@link Changeset} 53 */ 43 54 public void rememberAddedChangeset(Changeset cs) { 44 55 if (cs == null) return; … … 46 57 } 47 58 59 /** 60 * Adds a {@link Changeset} to the updated list 61 * @param cs the {@link Changeset} 62 */ 48 63 public void rememberUpdatedChangeset(Changeset cs) { 49 64 if (cs == null) return; … … 51 66 } 52 67 68 /** 69 * Adds a {@link Changeset} to the removed list 70 * @param cs the {@link Changeset} 71 */ 53 72 public void rememberRemovedChangeset(Changeset cs) { 54 73 if (cs == null) return; … … 56 75 } 57 76 77 /** 78 * Checks if this event contains any {@link Changeset}s 79 * @return <code>true</code> if changesets were added 80 */ 58 81 public boolean isEmpty() { 59 82 return added.isEmpty() && modified.isEmpty() && removed.isEmpty(); -
trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java
r9203 r12189 42 42 String format(Changeset changeset); 43 43 44 /** 45 * Gets a comparator that sorts the nodes by the string that this formatter would create for them 46 * @return That comparator 47 */ 44 48 Comparator<Node> getNodeComparator(); 45 49 50 /** 51 * Gets a comparator that sorts the ways by the string that this formatter would create for them 52 * @return That comparator 53 */ 46 54 Comparator<Way> getWayComparator(); 47 55 56 /** 57 * Gets a comparator that sorts the relations by the string that this formatter would create for them 58 * @return That comparator 59 */ 48 60 Comparator<Relation> getRelationComparator(); 49 61 } -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r11383 r12189 779 779 } 780 780 781 /** 782 * Clears all cached styles for all nodes of this way. This should not be called from outside. 783 * @see Node#clearCachedStyle() 784 */ 781 785 public void clearCachedNodeStyles() { 782 786 for (final Node n : nodes) { -
trunk/src/org/openstreetmap/josm/data/osm/event/AbstractDatasetChangedEvent.java
r11928 r12189 17 17 */ 18 18 public enum DatasetEventType { 19 /** 20 * A combination of multiple events 21 */ 19 22 DATA_CHANGED, 23 /** 24 * The lat/lon coordinates of a node have changed. 25 */ 20 26 NODE_MOVED, 27 /** 28 * Primitives have been added to this dataset 29 */ 21 30 PRIMITIVES_ADDED, 31 /** 32 * Primitives have been removed from this dataset 33 */ 22 34 PRIMITIVES_REMOVED, 35 /** 36 * The members of a relation have changed 37 */ 23 38 RELATION_MEMBERS_CHANGED, 39 /** 40 * The tags of a primitve have changed 41 */ 24 42 TAGS_CHANGED, 43 /** 44 * The nodes of a way or their order has changed 45 */ 25 46 WAY_NODES_CHANGED, 47 /** 48 * The changeset id changed for a list of primitives 49 */ 26 50 CHANGESET_ID_CHANGED, 51 /** 52 * The flags changed for a primitive and have not been covered in an other event 53 */ 27 54 PRIMITIVE_FLAGS_CHANGED, 28 55 } -
trunk/src/org/openstreetmap/josm/data/osm/event/ChangesetIdChangedEvent.java
r11928 r12189 7 7 import org.openstreetmap.josm.data.osm.OsmPrimitive; 8 8 9 /** 10 * An event that is triggered when the changeset id has changed for a list of primitives. 11 */ 9 12 public class ChangesetIdChangedEvent extends AbstractDatasetChangedEvent { 10 13 -
trunk/src/org/openstreetmap/josm/data/osm/event/DataChangedEvent.java
r11928 r12189 9 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 10 11 /** 12 * A combined data change event. It consists of multiple dataset events. 13 */ 11 14 public class DataChangedEvent extends AbstractDatasetChangedEvent { 12 15 -
trunk/src/org/openstreetmap/josm/data/osm/event/NodeMovedEvent.java
r11928 r12189 9 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 10 11 /** 12 * An event that is triggered on a node move (lat/lon change) 13 */ 11 14 public class NodeMovedEvent extends AbstractDatasetChangedEvent { 12 15 -
trunk/src/org/openstreetmap/josm/data/osm/event/PrimitivesAddedEvent.java
r11928 r12189 10 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 11 12 /** 13 * An event that is triggered if primitives have been added to the dataset 14 */ 12 15 public class PrimitivesAddedEvent extends AbstractDatasetChangedEvent { 13 16 -
trunk/src/org/openstreetmap/josm/data/osm/event/PrimitivesRemovedEvent.java
r11928 r12189 10 10 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 11 12 /** 13 * An event that is triggered when primitives were removed from the dataset 14 */ 12 15 public class PrimitivesRemovedEvent extends AbstractDatasetChangedEvent { 13 16 -
trunk/src/org/openstreetmap/josm/data/osm/event/RelationMembersChangedEvent.java
r11928 r12189 9 9 import org.openstreetmap.josm.data.osm.Relation; 10 10 11 /** 12 * An event that is triggered if the members of a single relation have changed 13 */ 11 14 public class RelationMembersChangedEvent extends AbstractDatasetChangedEvent { 12 15 -
trunk/src/org/openstreetmap/josm/data/osm/event/TagsChangedEvent.java
r11928 r12189 9 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 10 11 /** 12 * An event that is triggered if the tags of a single primitive have changed 13 */ 11 14 public class TagsChangedEvent extends AbstractDatasetChangedEvent { 12 15 -
trunk/src/org/openstreetmap/josm/data/osm/event/WayNodesChangedEvent.java
r11928 r12189 9 9 import org.openstreetmap.josm.data.osm.Way; 10 10 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 */ 11 14 public class WayNodesChangedEvent extends AbstractDatasetChangedEvent { 12 15 -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java
r10386 r12189 60 60 } 61 61 62 /** 63 * Adds a listener that listens to history data set events. 64 * @param listener The listener 65 */ 62 66 public void addHistoryDataSetListener(HistoryDataSetListener listener) { 63 67 if (listener != null) { … … 66 70 } 67 71 72 /** 73 * Removes a listener that listens to history data set events. 74 * @param listener The listener 75 */ 68 76 public void removeHistoryDataSetListener(HistoryDataSetListener listener) { 69 77 listeners.remove(listener); -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSetListener.java
r5266 r12189 4 4 import org.openstreetmap.josm.data.osm.PrimitiveId; 5 5 6 /** 7 * A listener that listens to changes in the {@link HistoryDataSet}. 8 * @see HistoryDataSet#addHistoryDataSetListener(HistoryDataSetListener) 9 */ 6 10 public interface HistoryDataSetListener { 7 11 /** -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r11537 r12189 44 44 public static final String PREF_KEY_RENDERER_CLASS_NAME = "mappaint.renderer-class-name"; 45 45 46 /** 47 * An exception thrown while creating a map renderer 48 */ 46 49 public static class MapRendererFactoryException extends RuntimeException { 47 50 51 /** 52 * Create a new {@link MapRendererFactoryException} 53 * @param message The message 54 * @param cause The cause 55 */ 48 56 public MapRendererFactoryException(String message, Throwable cause) { 49 57 super(message, cause); 50 58 } 51 59 60 /** 61 * Create a new {@link MapRendererFactoryException} 62 * @param message The message 63 */ 52 64 public MapRendererFactoryException(String message) { 53 65 super(message); 54 66 } 55 67 68 /** 69 * Create a new {@link MapRendererFactoryException} 70 * @param cause The cause 71 */ 56 72 public MapRendererFactoryException(Throwable cause) { 57 73 super(cause); … … 59 75 } 60 76 77 /** 78 * A description of a possible renderer for the map 79 */ 61 80 public static class Descriptor { 62 81 private final Class<? extends AbstractMapRenderer> renderer; … … 64 83 private final String description; 65 84 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 */ 66 91 public Descriptor(Class<? extends AbstractMapRenderer> renderer, String displayName, String description) { 67 92 this.renderer = renderer; … … 70 95 } 71 96 97 /** 98 * Get the class of the renderer 99 * @return The class 100 */ 72 101 public Class<? extends AbstractMapRenderer> getRenderer() { 73 102 return renderer; 74 103 } 75 104 105 /** 106 * Get the display name 107 * @return The name 108 */ 76 109 public String getDisplayName() { 77 110 return displayName; 78 111 } 79 112 113 /** 114 * Get the description 115 * @return The description 116 */ 80 117 public String getDescription() { 81 118 return description; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r11553 r12189 247 247 } 248 248 249 /** 250 * The polygon data for a multipolygon part. 251 * It contains the outline of this polygon in east/north space. 252 */ 249 253 public static class PolyData extends JoinedWay { 254 /** 255 * The intersection type used for {@link PolyData#contains(java.awt.geom.Path2D.Double)} 256 */ 250 257 public enum Intersection { 258 /** 259 * The polygon is completely inside this PolyData 260 */ 251 261 INSIDE, 262 /** 263 * The polygon is completely outside of this PolyData 264 */ 252 265 OUTSIDE, 266 /** 267 * The polygon is partially inside and outside of this PolyData 268 */ 253 269 CROSSING 254 270 } … … 313 329 } 314 330 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 */ 315 336 public Intersection contains(Path2D.Double p) { 316 337 int contains = 0; … … 334 355 } 335 356 357 /** 358 * Adds an inner polygon 359 * @param inner The polygon to add as inner polygon. 360 */ 336 361 public void addInner(PolyData inner) { 337 362 inners.add(inner); … … 343 368 } 344 369 370 /** 371 * Gets the polygon outline and interior as java path 372 * @return The path in east/north space. 373 */ 345 374 public Path2D.Double get() { 346 375 return poly; 347 376 } 348 377 378 /** 379 * Gets the bounds as {@link Rectangle2D} in east/north space. 380 * @return The bounds 381 */ 349 382 public Rectangle2D getBounds() { 350 383 if (bounds == null) { … … 354 387 } 355 388 389 /** 390 * Gets a list of all inner polygons. 391 * @return The inner polygons. 392 */ 356 393 public List<PolyData> getInners() { 357 394 return Collections.unmodifiableList(inners); … … 395 432 } 396 433 434 /** 435 * Check if this polygon was changed by a node move 436 * @param event The node move event 437 */ 397 438 public void nodeMoved(NodeMovedEvent event) { 398 439 final Node n = event.getNode(); … … 409 450 } 410 451 452 /** 453 * Check if this polygon was affected by a way change 454 * @param event The way event 455 */ 411 456 public void wayNodesChanged(WayNodesChangedEvent event) { 412 457 final Long wayId = event.getChangedWay().getUniqueId(); … … 526 571 } 527 572 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 */ 528 578 public static Collection<JoinedWay> joinWays(Collection<Way> waysToJoin) { 529 579 final Collection<JoinedWay> result = new ArrayList<>(); … … 621 671 } 622 672 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 */ 623 679 public PolyData findOuterPolygon(PolyData inner, List<PolyData> outerPolygons) { 624 680 // 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.