- Timestamp:
- 2018-04-23T21:34:25+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
r13662 r13664 119 119 120 120 /** 121 * Determines if this object is selectable. 122 * <p> 123 * A primitive can be selected if all conditions are met: 124 * <ul> 125 * <li>it is drawable 126 * <li>it is not disabled (greyed out) by a filter. 127 * </ul> 128 * @return {@code true} if this object is selectable 129 * @since 13664 130 */ 131 default boolean isSelectable() { 132 return true; 133 } 134 135 /** 136 * Determines if this object is drawable. 137 * <p> 138 * A primitive is complete if all conditions are met: 139 * <ul> 140 * <li>type and id is known 141 * <li>tags are known 142 * <li>it is not deleted 143 * <li>it is not hidden by a filter 144 * <li>for nodes: lat/lon are known 145 * <li>for ways: all nodes are known and complete 146 * <li>for relations: all members are known and complete 147 * </ul> 148 * @return {@code true} if this object is drawable 149 * @since xxx 150 */ 151 default boolean isDrawable() { 152 return true; 153 } 154 155 /** 156 * Determines whether the primitive is selected 157 * @return whether the primitive is selected 158 * @since xxx 159 */ 160 default boolean isSelected() { 161 return false; 162 } 163 164 /** 165 * Determines if this primitive is a member of a selected relation. 166 * @return {@code true} if this primitive is a member of a selected relation, {@code false} otherwise 167 * @since xxx 168 */ 169 default boolean isMemberOfSelected() { 170 return false; 171 } 172 173 /** 174 * Determines if this primitive is an outer member of a selected multipolygon relation. 175 * @return {@code true} if this primitive is an outer member of a selected multipolygon relation, {@code false} otherwise 176 * @since xxx 177 */ 178 default boolean isOuterMemberOfSelected() { 179 return false; 180 } 181 182 /** 121 183 * Replies the id of this primitive. 122 184 * … … 271 333 272 334 /** 335 * Updates the highlight flag for this primitive. 336 * @param highlighted The new highlight flag. 337 * @since 13664 338 */ 339 void setHighlighted(boolean highlighted); 340 341 /** 342 * Checks if the highlight flag for this primitive was set 343 * @return The highlight flag. 344 * @since 13664 345 */ 346 boolean isHighlighted(); 347 348 /** 273 349 * Determines if this object is considered "tagged". To be "tagged", an object 274 350 * must have one or more "interesting" tags. "created_by" and "source" -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r13662 r13664 480 480 } 481 481 482 /** 483 * Determines if this object is selectable. 484 * <p> 485 * A primitive can be selected if all conditions are met: 486 * <ul> 487 * <li>it is drawable 488 * <li>it is not disabled (greyed out) by a filter. 489 * </ul> 490 * @return {@code true} if this object is selectable 491 */ 482 @Override 492 483 public boolean isSelectable() { 493 484 // not synchronized -> check disabled twice just to be sure we did not have a race condition. … … 495 486 } 496 487 497 /** 498 * Determines if this object is drawable. 499 * <p> 500 * A primitive is complete if all conditions are met: 501 * <ul> 502 * <li>type and id is known 503 * <li>tags are known 504 * <li>it is not deleted 505 * <li>it is not hidden by a filter 506 * <li>for nodes: lat/lon are known 507 * <li>for ways: all nodes are known and complete 508 * <li>for relations: all members are known and complete 509 * </ul> 510 * @return {@code true} if this object is drawable 511 */ 488 @Override 512 489 public boolean isDrawable() { 513 490 return (flags & (FLAG_DELETED + FLAG_INCOMPLETE + FLAG_HIDE_IF_DISABLED)) == 0; … … 578 555 } 579 556 580 /** 581 * Determines whether the primitive is selected 582 * @return whether the primitive is selected 583 * @see DataSet#isSelected(OsmPrimitive) 584 */ 557 @Override 585 558 public boolean isSelected() { 586 559 return dataSet != null && dataSet.isSelected(this); 587 560 } 588 561 589 /** 590 * Determines if this primitive is a member of a selected relation. 591 * @return {@code true} if this primitive is a member of a selected relation, {@code false} otherwise 592 */ 562 @Override 593 563 public boolean isMemberOfSelected() { 594 564 if (referrers == null) … … 603 573 } 604 574 605 /** 606 * Determines if this primitive is an outer member of a selected multipolygon relation. 607 * @return {@code true} if this primitive is an outer member of a selected multipolygon relation, {@code false} otherwise 608 * @since 7621 609 */ 575 @Override 610 576 public boolean isOuterMemberOfSelected() { 611 577 if (referrers == null) … … 632 598 } 633 599 634 /** 635 * Updates the highlight flag for this primitive. 636 * @param highlighted The new highlight flag. 637 */ 600 @Override 638 601 public void setHighlighted(boolean highlighted) { 639 602 if (isHighlighted() != highlighted) { … … 645 608 } 646 609 647 /** 648 * Checks if the highlight flag for this primitive was set 649 * @return The highlight flag. 650 */ 610 @Override 651 611 public boolean isHighlighted() { 652 612 return (flags & FLAG_HIGHLIGHTED) != 0; -
trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
r13662 r13664 154 154 155 155 @Override 156 public void setHighlighted(boolean highlighted) { 157 // Override if needed 158 } 159 160 @Override 161 public boolean isHighlighted() { 162 return false; 163 } 164 165 @Override 156 166 public StyleCache getCachedStyle() { 157 167 return null; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r13633 r13664 33 33 import org.openstreetmap.josm.data.osm.Node; 34 34 import org.openstreetmap.josm.data.osm.OsmPrimitive; 35 import org.openstreetmap.josm.data.osm.OsmUtils; 35 36 import org.openstreetmap.josm.data.osm.Relation; 36 37 import org.openstreetmap.josm.data.osm.Tagged; … … 641 642 matchingRuleIndex = nodeRules; 642 643 } else if (osm instanceof Way) { 643 if ( osm.isKeyFalse("area")) {644 if (OsmUtils.isFalse(osm.get("area"))) { 644 645 matchingRuleIndex = wayNoAreaRules; 645 646 } else {
Note: See TracChangeset
for help on using the changeset viewer.