Ignore:
Timestamp:
2011-05-29T21:04:54+02:00 (15 years ago)
Author:
bastiK
Message:

use IPrimitive to make upload code work for both OsmPrimitive and PrimitiveData

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r4070 r4100  
    1717import org.openstreetmap.josm.data.coor.CoordinateFormat;
    1818import org.openstreetmap.josm.data.osm.Changeset;
     19import org.openstreetmap.josm.data.osm.INode;
     20import org.openstreetmap.josm.data.osm.IPrimitive;
     21import org.openstreetmap.josm.data.osm.IRelation;
     22import org.openstreetmap.josm.data.osm.IWay;
    1923import org.openstreetmap.josm.data.osm.NameFormatter;
    2024import org.openstreetmap.josm.data.osm.Node;
     
    8387     * @return the decorated name
    8488     */
    85     protected String decorateNameWithId(String name, OsmPrimitive primitive) {
     89    protected String decorateNameWithId(String name, IPrimitive primitive) {
    8690        if (Main.pref.getBoolean("osm-primitives.showid"))
    8791            if (Main.pref.getBoolean("osm-primitives.showid.new-primitives"))
     
    99103     * @return the name
    100104     */
    101     public String format(Node node) {
     105    public String format(INode node) {
    102106        String name = "";
    103107        if (node.isIncomplete()) {
     
    157161     * @return the name
    158162     */
    159     public String format(Way way) {
     163    public String format(IWay way) {
    160164        String name = "";
    161165        if (way.isIncomplete()) {
     
    233237     * @return the name
    234238     */
    235     public String format(Relation relation) {
     239    public String format(IRelation relation) {
    236240        String name;
    237241        if (relation.isIncomplete()) {
     
    250254            name += trn("{0} member", "{0} members", mbno, mbno);
    251255
    252             if (relationHasIncompleteMember(relation)) {
    253                 name += ", "+tr("incomplete");
     256            if (relation instanceof Relation) {
     257                if (relationHasIncompleteMember((Relation) relation)) {
     258                    name += ", "+tr("incomplete");
     259                }
    254260            }
    255261
     
    325331    }
    326332
    327     private String getRelationTypeName(Relation relation) {
     333    private String getRelationTypeName(IRelation relation) {
    328334        String name = trc("Relation type", relation.get("type"));
    329335        if (name == null) {
     
    353359    }
    354360
    355     private String getNameTagValue(Relation relation, String nameTag) {
     361    private String getNameTagValue(IRelation relation, String nameTag) {
    356362        if (nameTag.equals("name")) {
    357363            if (Main.pref.getBoolean("osm-primitives.localize-name", true))
     
    369375    }
    370376
    371     private String getRelationName(Relation relation) {
     377    private String getRelationName(IRelation relation) {
    372378        String nameTag = null;
    373379        for (String n : getNamingtagsForRelations()) {
     
    403409     * @return the tooltip text
    404410     */
    405     public String buildDefaultToolTip(OsmPrimitive primitive) {
     411    public String buildDefaultToolTip(IPrimitive primitive) {
    406412        StringBuilder sb = new StringBuilder();
    407413        sb.append("<html>");
Note: See TracChangeset for help on using the changeset viewer.