Ignore:
Timestamp:
2018-04-23T21:34:25+02:00 (6 years ago)
Author:
Don-vip
Message:

move a few methods from OsmPrimitive to IPrimitive

File:
1 edited

Legend:

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

    r13662 r13664  
    119119
    120120    /**
     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    /**
    121183     * Replies the id of this primitive.
    122184     *
     
    271333
    272334    /**
     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    /**
    273349     * Determines if this object is considered "tagged". To be "tagged", an object
    274350     * must have one or more "interesting" tags. "created_by" and "source"
Note: See TracChangeset for help on using the changeset viewer.