Changeset 5754 in josm
- Timestamp:
- 2013-03-03T16:19:49+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r5687 r5754 26 26 import org.openstreetmap.josm.tools.Predicate; 27 27 import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider; 28 28 29 29 30 /** … … 101 102 102 103 /** 104 * If the primitive is annotated with a tag such as note, fixme, etc. 105 * Match the "work in progress" tags in default elemstyles.xml. 106 */ 107 protected static final int FLAG_ANNOTATED = 1 << 12; 108 109 /** 103 110 * Replies the sub-collection of {@link OsmPrimitive}s of type <code>type</code> present in 104 111 * another collection of {@link OsmPrimitive}s. The result collection is a list. … … 606 613 } 607 614 608 /*---------------------------------- 609 * UNINTERESTING AND DIRECTION KEYS 610 *----------------------------------*/ 611 615 /*--------------------------------------------------- 616 * WORK IN PROGRESS, UNINTERESTING AND DIRECTION KEYS 617 *--------------------------------------------------*/ 618 619 private static volatile Collection<String> workinprogress = null; 612 620 private static volatile Collection<String> uninteresting = null; 613 621 private static volatile Collection<String> discardable = null; 614 622 615 623 /** 616 * Contains a list of "uninteresting" keys that do not make an object624 * Returns a list of "uninteresting" keys that do not make an object 617 625 * "tagged". Entries that end with ':' are causing a whole namespace to be considered 618 626 * "uninteresting". Only the first level namespace is considered. 619 627 * Initialized by isUninterestingKey() 628 * @return The list of uninteresting keys. 620 629 */ 621 630 public static Collection<String> getUninterestingKeys() { 622 631 if (uninteresting == null) { 623 632 LinkedList<String> l = new LinkedList<String>(Arrays.asList( 624 "source", "source_ref", "source:", " note", "comment",625 "converted_by", "watch", "watch:", "fixme", "FIXME",633 "source", "source_ref", "source:", "comment", 634 "converted_by", "watch", "watch:", 626 635 "description", "attribution")); 627 636 l.addAll(getDiscardableKeys()); 637 l.addAll(getWorkInProgressKeys()); 628 638 uninteresting = Main.pref.getCollection("tags.uninteresting", l); 629 639 } … … 634 644 * Returns a list of keys which have been deemed uninteresting to the point 635 645 * that they can be silently removed from data which is being edited. 646 * @return The list of discardable keys. 636 647 */ 637 648 public static Collection<String> getDiscardableKeys() { 638 if (discardable == null) {649 if (discardable == null) { 639 650 discardable = Main.pref.getCollection("tags.discardable", 640 651 Arrays.asList("created_by", … … 647 658 return discardable; 648 659 } 649 650 /** 651 * Returns true if key is considered "uninteresting". 660 661 /** 662 * Returns a list of "work in progress" keys that do not make an object 663 * "tagged" but "annotated". 664 * @return The list of work in progress keys. 665 * @since 5754 666 */ 667 public static Collection<String> getWorkInProgressKeys() { 668 if (workinprogress == null) { 669 workinprogress = Main.pref.getCollection("tags.workinprogress", 670 Arrays.asList("note", "fixme", "FIXME")); 671 } 672 return workinprogress; 673 } 674 675 /** 676 * Determines if key is considered "uninteresting". 677 * @param key The key to check 678 * @return true if key is considered "uninteresting". 652 679 */ 653 680 public static boolean isUninterestingKey(String key) { … … 713 740 } 714 741 715 /** 716 * true if this object is considered "tagged". To be "tagged", an object 742 private void updateAnnotated() { 743 if (keys != null) { 744 for (String key: keySet()) { 745 if (getWorkInProgressKeys().contains(key)) { 746 updateFlagsNoLock(FLAG_ANNOTATED, true); 747 return; 748 } 749 } 750 } 751 updateFlagsNoLock(FLAG_ANNOTATED, false); 752 } 753 754 /** 755 * Determines if this object is considered "tagged". To be "tagged", an object 717 756 * must have one or more "interesting" tags. "created_by" and "source" 718 757 * are typically considered "uninteresting" and do not make an object 719 758 * "tagged". 759 * @return true if this object is considered "tagged" 720 760 */ 721 761 public boolean isTagged() { 722 762 return (flags & FLAG_TAGGED) != 0; 763 } 764 765 /** 766 * Determines if this object is considered "annotated". To be "annotated", an object 767 * must have one or more "work in progress" tags, such as "note" or "fixme". 768 * @return true if this object is considered "annotated" 769 * @since 5754 770 */ 771 public boolean isAnnotated() { 772 return (flags & FLAG_ANNOTATED) != 0; 723 773 } 724 774 … … 803 853 updateDirectionFlags(); 804 854 updateTagged(); 855 updateAnnotated(); 805 856 if (dataSet != null) { 806 857 dataSet.fireTagsChanged(this, originalKeys); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r5657 r5754 248 248 color = selectedColor; 249 249 } else if (n.isConnectionNode()) { 250 if ( n.isTagged()) {250 if (isNodeTagged(n)) { 251 251 color = taggedConnectionColor; 252 252 } else { … … 254 254 } 255 255 } else { 256 if ( n.isTagged()) {256 if (isNodeTagged(n)) { 257 257 color = taggedColor; 258 258 } else { … … 262 262 263 263 final int size = max((ds.isSelected(n) ? selectedNodeSize : 0), 264 ( n.isTagged() ? taggedNodeSize : 0),264 (isNodeTagged(n) ? taggedNodeSize : 0), 265 265 (n.isConnectionNode() ? connectionNodeSize : 0), 266 266 unselectedNodeSize); 267 267 268 268 final boolean fill = (ds.isSelected(n) && fillSelectedNode) || 269 ( n.isTagged() && fillTaggedNode) ||269 (isNodeTagged(n) && fillTaggedNode) || 270 270 (n.isConnectionNode() && fillConnectionNode) || 271 271 fillUnselectedNode; … … 273 273 drawNode(n, color, size, fill); 274 274 } 275 } 276 277 private boolean isNodeTagged(Node n) { 278 return n.isTagged() || n.isAnnotated(); 275 279 } 276 280
Note:
See TracChangeset
for help on using the changeset viewer.