- Timestamp:
- 2015-12-28T19:15:45+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java
r8510 r9203 4 4 import java.util.Comparator; 5 5 6 /** 7 * Formats a name for a {@link OsmPrimitive}. 8 * @since 1990 9 */ 6 10 public interface NameFormatter { 11 12 /** 13 * Formats a name for a {@link Node}. 14 * 15 * @param node the node 16 * @return the name 17 */ 7 18 String format(Node node); 8 19 20 /** 21 * Formats a name for a {@link Way}. 22 * 23 * @param way the way 24 * @return the name 25 */ 9 26 String format(Way way); 10 27 28 /** 29 * Formats a name for a {@link Relation}. 30 * 31 * @param relation the relation 32 * @return the name 33 */ 11 34 String format(Relation relation); 12 35 36 /** 37 * Formats a name for a {@link Changeset}. 38 * 39 * @param changeset the changeset 40 * @return the name 41 */ 13 42 String format(Changeset changeset); 14 43 -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNameFormatter.java
r8510 r9203 2 2 package org.openstreetmap.josm.data.osm.history; 3 3 4 /** 5 * Formats a name for a {@link HistoryOsmPrimitive}. 6 * @since 2686 7 */ 4 8 public interface HistoryNameFormatter { 9 10 /** 11 * Formats a name for a {@link HistoryNode}. 12 * 13 * @param node the node 14 * @return the name 15 */ 5 16 String format(HistoryNode node); 6 17 7 String format(HistoryWay node); 18 /** 19 * Formats a name for a {@link HistoryWay}. 20 * 21 * @param way the way 22 * @return the name 23 */ 24 String format(HistoryWay way); 8 25 9 String format(HistoryRelation node); 26 /** 27 * Formats a name for a {@link HistoryRelation}. 28 * 29 * @param relation the relation 30 * @return the name 31 */ 32 String format(HistoryRelation relation); 10 33 } -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r8882 r9203 45 45 46 46 /** 47 * This is the default implementation of a {@link NameFormatter} for names of {@link OsmPrimitive}s. 48 * 47 * This is the default implementation of a {@link NameFormatter} for names of {@link OsmPrimitive}s 48 * and {@link HistoryOsmPrimitive}s. 49 * @since 1990 49 50 */ 50 51 public class DefaultNameFormatter implements NameFormatter, HistoryNameFormatter { … … 135 136 } 136 137 137 /**138 * Formats a name for a node139 *140 * @param node the node141 * @return the name142 */143 138 @Override 144 139 public String format(Node node) { … … 211 206 } 212 207 213 214 /**215 * Formats a name for a way216 *217 * @param way the way218 * @return the name219 */220 208 @Override 221 209 public String format(Way way) { … … 249 237 } 250 238 if (n == null) { 251 n = 252 253 254 239 n = (way.get("highway") != null) ? tr("highway") : 240 (way.get("railway") != null) ? tr("railway") : 241 (way.get("waterway") != null) ? tr("waterway") : 242 (way.get("landuse") != null) ? tr("landuse") : null; 255 243 } 256 244 if (n == null) { … … 313 301 } 314 302 315 316 /**317 * Formats a name for a relation318 *319 * @param relation the relation320 * @return the name321 */322 303 @Override 323 304 public String format(Relation relation) { … … 488 469 } 489 470 490 /**491 * Formats a name for a changeset492 *493 * @param changeset the changeset494 * @return the name495 */496 471 @Override 497 472 public String format(Changeset changeset) { … … 554 529 } 555 530 556 /**557 * Formats a name for a history node558 *559 * @param node the node560 * @return the name561 */562 531 @Override 563 532 public String format(HistoryNode node) { … … 586 555 } 587 556 588 /**589 * Formats a name for a way590 *591 * @param way the way592 * @return the name593 */594 557 @Override 595 558 public String format(HistoryWay way) { … … 628 591 } 629 592 630 /**631 * Formats a name for a {@link HistoryRelation})632 *633 * @param relation the relation634 * @return the name635 */636 593 @Override 637 594 public String format(HistoryRelation relation) { … … 684 641 } 685 642 643 /** 644 * Formats the given collection of primitives as an HTML unordered list. 645 * @param primitives collection of primitives to format 646 * @return HTML unordered list 647 */ 686 648 public String formatAsHtmlUnorderedList(Collection<? extends OsmPrimitive> primitives) { 687 649 return Utils.joinAsHtmlUnorderedList(Utils.transform(primitives, new Function<OsmPrimitive, String>() { … … 694 656 } 695 657 658 /** 659 * Formats the given primitive(s) as an HTML unordered list. 660 * @param primitives primitive(s) to format 661 * @return HTML unordered list 662 */ 696 663 public String formatAsHtmlUnorderedList(OsmPrimitive... primitives) { 697 664 return formatAsHtmlUnorderedList(Arrays.asList(primitives));
Note:
See TracChangeset
for help on using the changeset viewer.