Changeset 13564 in josm for trunk


Ignore:
Timestamp:
2018-03-25T18:53:04+02:00 (7 years ago)
Author:
Don-vip
Message:

introduce PrimitiveRenderer to replace OsmPrimitivRenderer (now deprecated). Change NameFormatter API to support IPrimitive instead of OsmPrimitive. Enhances interfaces in consequence.

Location:
trunk
Files:
1 added
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r13434 r13564  
    3030import org.openstreetmap.josm.command.PurgeCommand;
    3131import org.openstreetmap.josm.data.osm.DataSet;
     32import org.openstreetmap.josm.data.osm.IPrimitive;
    3233import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3334import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
    3435import org.openstreetmap.josm.gui.MainApplication;
    35 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     36import org.openstreetmap.josm.gui.PrimitiveRenderer;
    3637import org.openstreetmap.josm.gui.help.HelpUtil;
    3738import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    7677
    7778    /** force selection to be active for all entries */
    78     static class SelectionForcedOsmPrimitivRenderer extends OsmPrimitivRenderer {
     79    static class SelectionForcedPrimitiveRenderer extends PrimitiveRenderer {
    7980        @Override
    80         public Component getListCellRendererComponent(JList<? extends OsmPrimitive> list,
    81                 OsmPrimitive value, int index, boolean isSelected, boolean cellHasFocus) {
     81        public Component getListCellRendererComponent(JList<? extends IPrimitive> list,
     82                IPrimitive value, int index, boolean isSelected, boolean cellHasFocus) {
    8283            return super.getListCellRendererComponent(list, value, index, true, false);
    8384        }
     
    151152            JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[0]));
    152153            /* force selection to be active for all entries */
    153             list.setCellRenderer(new SelectionForcedOsmPrimitivRenderer());
     154            list.setCellRenderer(new SelectionForcedPrimitiveRenderer());
    154155            JScrollPane scroll = new JScrollPane(list);
    155156            scroll.setPreferredSize(new Dimension(250, 300));
  • trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java

    r12678 r13564  
    2121import org.openstreetmap.josm.data.osm.Relation;
    2222import org.openstreetmap.josm.gui.ExtendedDialog;
    23 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     23import org.openstreetmap.josm.gui.PrimitiveRenderer;
    2424import org.openstreetmap.josm.gui.util.WindowGeometry;
    2525
     
    5555        }
    5656        JTable tbl = new JTable(model);
    57         OsmPrimitivRenderer renderer = new OsmPrimitivRenderer();
     57        PrimitiveRenderer renderer = new PrimitiveRenderer();
    5858        tbl.getColumnModel().getColumn(0).setCellRenderer(renderer);
    5959        tbl.getColumnModel().getColumn(1).setCellRenderer(renderer);
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r13561 r13564  
    316316    public PrimitiveId getPrimitiveId() {
    317317        return new SimplePrimitiveId(getUniqueId(), getType());
    318     }
    319 
    320     /**
    321      * Gets the type this primitive is displayed at
    322      * @return A {@link OsmPrimitiveType}
    323      */
    324     public OsmPrimitiveType getDisplayType() {
    325         return getType();
    326318    }
    327319
  • trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java

    r13493 r13564  
    3434import org.openstreetmap.josm.tools.I18n;
    3535import org.openstreetmap.josm.tools.Utils;
     36import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider;
    3637
    3738/**
    38  * This is the default implementation of a {@link NameFormatter} for names of {@link OsmPrimitive}s
     39 * This is the default implementation of a {@link NameFormatter} for names of {@link IPrimitive}s
    3940 * and {@link HistoryOsmPrimitive}s.
    4041 * @since 12663 (moved from {@code gui} package)
     
    129130
    130131    /**
    131      * Formats a name for an {@link OsmPrimitive}.
     132     * Formats a name for an {@link IPrimitive}.
    132133     *
    133134     * @param osm the primitive
    134135     * @return the name
    135136     * @since 10991
    136      */
    137     public String format(OsmPrimitive osm) {
    138         if (osm instanceof Node) {
    139             return format((Node) osm);
    140         } else if (osm instanceof Way) {
    141             return format((Way) osm);
    142         } else if (osm instanceof Relation) {
    143             return format((Relation) osm);
     137     * @since 13564 (signature)
     138     */
     139    public String format(IPrimitive osm) {
     140        if (osm instanceof INode) {
     141            return format((INode) osm);
     142        } else if (osm instanceof IWay) {
     143            return format((IWay) osm);
     144        } else if (osm instanceof IRelation) {
     145            return format((IRelation) osm);
    144146        }
    145147        return null;
     
    147149
    148150    @Override
    149     public String format(Node node) {
     151    public String format(INode node) {
    150152        StringBuilder name = new StringBuilder();
    151153        if (node.isIncomplete()) {
     
    153155        } else {
    154156            TaggingPreset preset = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(node);
    155             if (preset == null) {
     157            if (preset == null || !(node instanceof TemplateEngineDataProvider)) {
    156158                String n;
    157159                if (Config.getPref().getBoolean("osm-primitives.localize-name", true)) {
     
    184186                name.append(n);
    185187            } else {
    186                 preset.nameTemplate.appendText(name, node);
     188                preset.nameTemplate.appendText(name, (TemplateEngineDataProvider) node);
    187189            }
    188190            if (node.isLatLonKnown() && Config.getPref().getBoolean("osm-primitives.showcoor")) {
     
    204206    }
    205207
    206     private final Comparator<Node> nodeComparator = (n1, n2) -> format(n1).compareTo(format(n2));
    207 
    208     @Override
    209     public Comparator<Node> getNodeComparator() {
     208    private final Comparator<INode> nodeComparator = (n1, n2) -> format(n1).compareTo(format(n2));
     209
     210    @Override
     211    public Comparator<INode> getNodeComparator() {
    210212        return nodeComparator;
    211213    }
    212214
    213215    @Override
    214     public String format(Way way) {
     216    public String format(IWay way) {
    215217        StringBuilder name = new StringBuilder();
    216218
     
    231233        } else {
    232234            TaggingPreset preset = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(way);
    233             if (preset == null) {
     235            if (preset == null || !(way instanceof TemplateEngineDataProvider)) {
    234236                String n;
    235237                if (Config.getPref().getBoolean("osm-primitives.localize-name", true)) {
     
    274276                name.append(n);
    275277            } else {
    276                 preset.nameTemplate.appendText(name, way);
     278                preset.nameTemplate.appendText(name, (TemplateEngineDataProvider) way);
    277279            }
    278280
     
    296298    }
    297299
    298     private final Comparator<Way> wayComparator = (w1, w2) -> format(w1).compareTo(format(w2));
    299 
    300     @Override
    301     public Comparator<Way> getWayComparator() {
     300    private final Comparator<IWay> wayComparator = (w1, w2) -> format(w1).compareTo(format(w2));
     301
     302    @Override
     303    public Comparator<IWay> getWayComparator() {
    302304        return wayComparator;
    303305    }
    304306
    305307    @Override
    306     public String format(Relation relation) {
     308    public String format(IRelation relation) {
    307309        StringBuilder name = new StringBuilder();
    308310        if (relation.isIncomplete()) {
     
    334336    }
    335337
    336     private static StringBuilder formatRelationNameAndType(Relation relation, StringBuilder result, TaggingPreset preset) {
    337         if (preset == null) {
     338    private static StringBuilder formatRelationNameAndType(IRelation relation, StringBuilder result, TaggingPreset preset) {
     339        if (preset == null || !(relation instanceof TemplateEngineDataProvider)) {
    338340            result.append(getRelationTypeName(relation));
    339341            String relationName = getRelationName(relation);
     
    345347            result.append(" (").append(relationName).append(", ");
    346348        } else {
    347             preset.nameTemplate.appendText(result, relation);
     349            preset.nameTemplate.appendText(result, (TemplateEngineDataProvider) relation);
    348350            result.append('(');
    349351        }
     
    351353    }
    352354
    353     private final Comparator<Relation> relationComparator = (r1, r2) -> {
     355    private final Comparator<IRelation> relationComparator = (r1, r2) -> {
    354356        //TODO This doesn't work correctly with formatHooks
    355357
     
    394396
    395397    @Override
    396     public Comparator<Relation> getRelationComparator() {
     398    public Comparator<IRelation> getRelationComparator() {
    397399        return relationComparator;
    398400    }
  • trunk/src/org/openstreetmap/josm/data/osm/INode.java

    r12161 r13564  
    2929     */
    3030    void setEastNorth(EastNorth eastNorth);
     31
     32    @Override
     33    default String getDisplayName(NameFormatter formatter) {
     34        return formatter.format(this);
     35    }
    3136}
  • trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java

    r13493 r13564  
    233233     */
    234234    String getLocalName();
     235
     236    /**
     237     * Replies the display name of a primitive formatted by <code>formatter</code>
     238     * @param formatter formatter to use
     239     *
     240     * @return the display name
     241     * @since 13564
     242     */
     243    String getDisplayName(NameFormatter formatter);
     244
     245    /**
     246     * Gets the type this primitive is displayed at
     247     * @return A {@link OsmPrimitiveType}
     248     * @since 13564
     249     */
     250    default OsmPrimitiveType getDisplayType() {
     251        return getType();
     252    }
    235253}
  • trunk/src/org/openstreetmap/josm/data/osm/IRelation.java

    r9460 r13564  
    3434     */
    3535    OsmPrimitiveType getMemberType(int idx);
     36
     37    /**
     38     * Determines if at least one child primitive is incomplete.
     39     *
     40     * @return true if at least one child primitive is incomplete
     41     * @since 13564
     42     */
     43    default boolean hasIncompleteMembers() {
     44        return false;
     45    }
     46
     47    @Override
     48    default String getDisplayName(NameFormatter formatter) {
     49        return formatter.format(this);
     50    }
    3651}
  • trunk/src/org/openstreetmap/josm/data/osm/IWay.java

    r9460 r13564  
    1616
    1717    /**
     18     * Replies the real number of nodes in this way (full number of nodes minus one if this way is closed)
     19     *
     20     * @return the real number of nodes in this way.
     21     *
     22     * @see #getNodesCount()
     23     * @see #isClosed()
     24     * @since 5847
     25     * @since 13564 (IWay)
     26     */
     27    default int getRealNodesCount() {
     28        int count = getNodesCount();
     29        return isClosed() ? count-1 : count;
     30    }
     31
     32    /**
    1833     * Returns id of the node at given index.
    1934     * @param idx node index
     
    2742     */
    2843    boolean isClosed();
     44
     45    @Override
     46    default String getDisplayName(NameFormatter formatter) {
     47        return formatter.format(this);
     48    }
    2949}
  • trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java

    r12189 r13564  
    55
    66/**
    7  * Formats a name for a {@link OsmPrimitive}.
     7 * Formats a name for an {@link IPrimitive}.
    88 * @since 1990
    99 */
     
    1111
    1212    /**
    13      * Formats a name for a {@link Node}.
     13     * Formats a name for a {@link INode}.
    1414     *
    1515     * @param node the node
    1616     * @return the name
     17     * @since 13564 (signature)
    1718     */
    18     String format(Node node);
     19    String format(INode node);
    1920
    2021    /**
    21      * Formats a name for a {@link Way}.
     22     * Formats a name for a {@link IWay}.
    2223     *
    2324     * @param way the way
    2425     * @return the name
     26     * @since 13564 (signature)
    2527     */
    26     String format(Way way);
     28    String format(IWay way);
    2729
    2830    /**
    29      * Formats a name for a {@link Relation}.
     31     * Formats a name for a {@link IRelation}.
    3032     *
    3133     * @param relation the relation
    3234     * @return the name
     35     * @since 13564 (signature)
    3336     */
    34     String format(Relation relation);
     37    String format(IRelation relation);
    3538
    3639    /**
     
    4548     * Gets a comparator that sorts the nodes by the string that this formatter would create for them
    4649     * @return That comparator
     50     * @since 13564 (signature)
    4751     */
    48     Comparator<Node> getNodeComparator();
     52    Comparator<INode> getNodeComparator();
    4953
    5054    /**
    5155     * Gets a comparator that sorts the ways by the string that this formatter would create for them
    5256     * @return That comparator
     57     * @since 13564 (signature)
    5358     */
    54     Comparator<Way> getWayComparator();
     59    Comparator<IWay> getWayComparator();
    5560
    5661    /**
    5762     * Gets a comparator that sorts the relations by the string that this formatter would create for them
    5863     * @return That comparator
     64     * @since 13564 (signature)
    5965     */
    60     Comparator<Relation> getRelationComparator();
     66    Comparator<IRelation> getRelationComparator();
    6167}
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r13173 r13564  
    317317
    318318    @Override
    319     public String getDisplayName(NameFormatter formatter) {
    320         return formatter.format(this);
    321     }
    322 
    323     @Override
    324319    public OsmPrimitiveType getType() {
    325320        return OsmPrimitiveType.NODE;
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r13453 r13564  
    13651365    }
    13661366
    1367     /**
    1368      * Replies the display name of a primitive formatted by <code>formatter</code>
    1369      * @param formatter formatter to use
    1370      *
    1371      * @return the display name
    1372      */
    1373     public abstract String getDisplayName(NameFormatter formatter);
    1374 
    13751367    @Override
    13761368    public Collection<String> getTemplateKeys() {
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r13434 r13564  
    395395    }
    396396
    397     @Override
    398     public String getDisplayName(NameFormatter formatter) {
    399         return formatter.format(this);
    400     }
    401 
    402397    /**
    403398     * Replies the set of  {@link OsmPrimitive}s referred to by at least one
     
    525520    }
    526521
    527     /**
    528      * Determines if at least one child primitive is incomplete.
    529      *
    530      * @return true if at least one child primitive is incomplete
    531      */
     522    @Override
    532523    public boolean hasIncompleteMembers() {
    533524        RelationMember[] members = this.members;
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r13512 r13564  
    105105
    106106    /**
    107      * Replies the real number of nodes in this way (full number of nodes minus one if this way is closed)
    108      *
    109      * @return the real number of nodes in this way.
    110      *
    111      * @see #getNodesCount()
    112      * @see #isClosed()
    113      * @since 5847
    114      */
    115     public int getRealNodesCount() {
    116         int count = getNodesCount();
    117         return isClosed() ? count-1 : count;
    118     }
    119 
    120     /**
    121107     * Replies the node at position <code>index</code>.
    122108     *
     
    576562        }
    577563        return false;
    578     }
    579 
    580     @Override
    581     public String getDisplayName(NameFormatter formatter) {
    582         return formatter.format(this);
    583564    }
    584565
  • trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java

    r12663 r13564  
    2626 * @author imi
    2727 * @author Frederik Ramm
     28 * @deprecated since 13564. Use {@link PrimitiveRenderer} instead
    2829 */
     30@Deprecated
    2931public class OsmPrimitivRenderer implements ListCellRenderer<OsmPrimitive>, TableCellRenderer {
    3032    private final DefaultNameFormatter formatter = DefaultNameFormatter.getInstance();
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java

    r12660 r13564  
    1212import javax.swing.table.TableColumn;
    1313
    14 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     14import org.openstreetmap.josm.gui.PrimitiveRenderer;
    1515import org.openstreetmap.josm.gui.conflict.ConflictColors;
    1616import org.openstreetmap.josm.gui.conflict.pair.relation.RelationMemberTable;
     
    2222public class RelationMemberConflictResolverColumnModel extends DefaultTableColumnModel {
    2323
    24     static final class MemberRenderer extends OsmPrimitivRenderer {
     24    static final class MemberRenderer extends PrimitiveRenderer {
    2525        @Override
    2626        public Component getTableCellRendererComponent(JTable table,
     
    3333    private final DefaultTableCellRenderer defaultTableCellRenderer = new DefaultTableCellRenderer();
    3434
    35     private final transient OsmPrimitivRenderer primitiveRenderer = new MemberRenderer();
     35    private final transient PrimitiveRenderer primitiveRenderer = new MemberRenderer();
    3636
    3737    private final transient TableCellRenderer tableRenderer = (table, value, isSelected, hasFocus, row, column)
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r13434 r13564  
    5757import org.openstreetmap.josm.gui.MainApplication;
    5858import org.openstreetmap.josm.gui.NavigatableComponent;
    59 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     59import org.openstreetmap.josm.gui.PrimitiveRenderer;
    6060import org.openstreetmap.josm.gui.PopupMenuHandler;
    6161import org.openstreetmap.josm.gui.SideButton;
     
    127127            lstConflicts = new JList<>(model);
    128128            lstConflicts.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    129             lstConflicts.setCellRenderer(new OsmPrimitivRenderer());
     129            lstConflicts.setCellRenderer(new PrimitiveRenderer());
    130130            lstConflicts.addMouseListener(new MouseEventHandler());
    131131        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java

    r12678 r13564  
    3737import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3838import org.openstreetmap.josm.data.osm.RelationToChildReference;
    39 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     39import org.openstreetmap.josm.gui.PrimitiveRenderer;
    4040import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
    4141import org.openstreetmap.josm.gui.help.HelpUtil;
     
    296296            col.setWidth(100);
    297297            col.setPreferredWidth(100);
    298             col.setCellRenderer(new OsmPrimitivRenderer());
     298            col.setCellRenderer(new PrimitiveRenderer());
    299299            addColumn(col);
    300300
     
    305305            col.setWidth(100);
    306306            col.setPreferredWidth(100);
    307             col.setCellRenderer(new OsmPrimitivRenderer());
     307            col.setCellRenderer(new PrimitiveRenderer());
    308308            addColumn(col);
    309309
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r13453 r13564  
    4949import org.openstreetmap.josm.data.osm.DataSet;
    5050import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
     51import org.openstreetmap.josm.data.osm.IPrimitive;
    5152import org.openstreetmap.josm.data.osm.OsmPrimitive;
    5253import org.openstreetmap.josm.data.osm.Relation;
     
    6667import org.openstreetmap.josm.gui.MapView;
    6768import org.openstreetmap.josm.gui.NavigatableComponent;
    68 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
    6969import org.openstreetmap.josm.gui.PopupMenuHandler;
     70import org.openstreetmap.josm.gui.PrimitiveRenderer;
    7071import org.openstreetmap.josm.gui.SideButton;
    7172import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
     
    322323    }
    323324
    324     static final class NoTooltipOsmRenderer extends OsmPrimitivRenderer {
    325         @Override
    326         protected String getComponentToolTipText(OsmPrimitive value) {
     325    static final class NoTooltipOsmRenderer extends PrimitiveRenderer {
     326        @Override
     327        protected String getComponentToolTipText(IPrimitive value) {
    327328            // Don't show the default tooltip in the relation list
    328329            return null;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r13545 r13564  
    6565import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    6666import org.openstreetmap.josm.gui.MainApplication;
    67 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     67import org.openstreetmap.josm.gui.PrimitiveRenderer;
    6868import org.openstreetmap.josm.gui.PopupMenuHandler;
    6969import org.openstreetmap.josm.gui.SideButton;
     
    113113        lstPrimitives.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    114114        lstPrimitives.setSelectionModel(selectionModel);
    115         lstPrimitives.setCellRenderer(new OsmPrimitivRenderer());
     115        lstPrimitives.setCellRenderer(new PrimitiveRenderer());
    116116        lstPrimitives.setTransferHandler(new SelectionTransferHandler());
    117117        if (!GraphicsEnvironment.isHeadless()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableCellRenderer.java

    r13344 r13564  
    1313/**
    1414 * The table cell renderer used in the changeset content table, except for the "name"
    15  * column in which we use a {@link org.openstreetmap.josm.gui.OsmPrimitivRenderer}.
     15 * column in which we use a {@link org.openstreetmap.josm.gui.PrimitiveRenderer}.
    1616 */
    1717public class ChangesetContentTableCellRenderer extends AbstractCellRenderer {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableColumnModel.java

    r10308 r13564  
    77import javax.swing.table.TableColumn;
    88
    9 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     9import org.openstreetmap.josm.gui.PrimitiveRenderer;
    1010
    1111/**
     
    4848        col.setResizable(true);
    4949        col.setPreferredWidth(200);
    50         col.setCellRenderer(new OsmPrimitivRenderer());
     50        col.setCellRenderer(new PrimitiveRenderer());
    5151        addColumn(col);
    5252    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java

    r13171 r13564  
    2424import org.openstreetmap.josm.data.osm.Relation;
    2525import org.openstreetmap.josm.gui.MainApplication;
    26 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     26import org.openstreetmap.josm.gui.PrimitiveRenderer;
    2727import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2828import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
     
    5959        setLayout(new BorderLayout());
    6060        referrers = new JList<>(model);
    61         referrers.setCellRenderer(new OsmPrimitivRenderer());
     61        referrers.setCellRenderer(new PrimitiveRenderer());
    6262        add(new JScrollPane(referrers), BorderLayout.CENTER);
    6363        referrers.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  • trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java

    r13071 r13564  
    3636import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3737import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    38 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     38import org.openstreetmap.josm.gui.PrimitiveRenderer;
    3939import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
    4040import org.openstreetmap.josm.gui.help.HelpUtil;
     
    196196        protected void init() {
    197197            setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    198             setCellRenderer(new OsmPrimitivRenderer());
     198            setCellRenderer(new PrimitiveRenderer());
    199199        }
    200200
  • trunk/src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java

    r12370 r13564  
    1818
    1919import org.openstreetmap.josm.data.osm.OsmPrimitive;
    20 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     20import org.openstreetmap.josm.gui.PrimitiveRenderer;
    2121
    2222/**
     
    5252    protected void build() {
    5353        setLayout(new GridBagLayout());
    54         OsmPrimitivRenderer renderer = new OsmPrimitivRenderer();
     54        PrimitiveRenderer renderer = new PrimitiveRenderer();
    5555        // initialize the three lists for uploaded primitives, but don't add them to the dialog yet, see setUploadedPrimitives()
    5656        //
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetNameTemplateList.java

    r12620 r13564  
    77import java.util.List;
    88
    9 import org.openstreetmap.josm.data.osm.OsmPrimitive;
     9import org.openstreetmap.josm.data.osm.IPrimitive;
    1010import org.openstreetmap.josm.tools.Logging;
    1111
     
    5252     * @return the first occurence of preset with template name matching the primitive
    5353     */
    54     public TaggingPreset findPresetTemplate(OsmPrimitive primitive) {
     54    public TaggingPreset findPresetTemplate(IPrimitive primitive) {
    5555        synchronized (this) {
    5656            for (TaggingPreset t : presetsWithPattern) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetType.java

    r9615 r13564  
    22package org.openstreetmap.josm.gui.tagging.presets;
    33
    4 import org.openstreetmap.josm.data.osm.OsmPrimitive;
     4import org.openstreetmap.josm.data.osm.IPrimitive;
    55import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    66
     
    4949     * @return the {@code TaggingPresetType} of {@code p}
    5050     */
    51     public static TaggingPresetType forPrimitive(OsmPrimitive p) {
     51    public static TaggingPresetType forPrimitive(IPrimitive p) {
    5252        return forPrimitiveType(p.getDisplayType());
    5353    }
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java

    r13338 r13564  
    2424import org.openstreetmap.josm.gui.MainApplication;
    2525import org.openstreetmap.josm.gui.MapFrame;
    26 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     26import org.openstreetmap.josm.gui.PrimitiveRenderer;
    2727import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2828import org.openstreetmap.josm.testutils.JOSMTestRules;
     
    4444    /**
    4545     * Non regression test case for bug #12011.
    46      * Add a new node in the middle of way then undo. The rendering of the node, selected, must not cause any crash in OsmPrimitivRenderer.
     46     * Add a new node in the middle of way then undo. The rendering of the node, selected, must not cause any crash in PrimitiveRenderer.
    4747     * @throws SecurityException see {@link Class#getDeclaredField} for details
    4848     * @throws NoSuchFieldException see {@link Class#getDeclaredField} for details
     
    8282
    8383            JList<OsmPrimitive> lstPrimitives = new JList<>();
    84             OsmPrimitivRenderer renderer = new OsmPrimitivRenderer();
     84            PrimitiveRenderer renderer = new PrimitiveRenderer();
    8585
    8686            assertEquals(3, w.getNodesCount());
  • trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java

    r13413 r13564  
    6363        TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll("http://localhost:" + wireMockRule.port() + "/" + source, true));
    6464
    65         Comparator<Relation> comparator = DefaultNameFormatter.getInstance().getRelationComparator();
     65        Comparator<IRelation> comparator = DefaultNameFormatter.getInstance().getRelationComparator();
    6666
    6767        try (InputStream is = TestUtils.getRegressionDataStream(9632, "data.osm.zip")) {
Note: See TracChangeset for help on using the changeset viewer.