- Timestamp:
- 2018-03-25T18:53:04+02:00 (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r13434 r13564 30 30 import org.openstreetmap.josm.command.PurgeCommand; 31 31 import org.openstreetmap.josm.data.osm.DataSet; 32 import org.openstreetmap.josm.data.osm.IPrimitive; 32 33 import org.openstreetmap.josm.data.osm.OsmPrimitive; 33 34 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 34 35 import org.openstreetmap.josm.gui.MainApplication; 35 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;36 import org.openstreetmap.josm.gui.PrimitiveRenderer; 36 37 import org.openstreetmap.josm.gui.help.HelpUtil; 37 38 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 76 77 77 78 /** force selection to be active for all entries */ 78 static class SelectionForced OsmPrimitivRenderer extends OsmPrimitivRenderer {79 static class SelectionForcedPrimitiveRenderer extends PrimitiveRenderer { 79 80 @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) { 82 83 return super.getListCellRendererComponent(list, value, index, true, false); 83 84 } … … 151 152 JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[0])); 152 153 /* force selection to be active for all entries */ 153 list.setCellRenderer(new SelectionForced OsmPrimitivRenderer());154 list.setCellRenderer(new SelectionForcedPrimitiveRenderer()); 154 155 JScrollPane scroll = new JScrollPane(list); 155 156 scroll.setPreferredSize(new Dimension(250, 300)); -
trunk/src/org/openstreetmap/josm/actions/upload/RelationUploadOrderHook.java
r12678 r13564 21 21 import org.openstreetmap.josm.data.osm.Relation; 22 22 import org.openstreetmap.josm.gui.ExtendedDialog; 23 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;23 import org.openstreetmap.josm.gui.PrimitiveRenderer; 24 24 import org.openstreetmap.josm.gui.util.WindowGeometry; 25 25 … … 55 55 } 56 56 JTable tbl = new JTable(model); 57 OsmPrimitivRenderer renderer = new OsmPrimitivRenderer();57 PrimitiveRenderer renderer = new PrimitiveRenderer(); 58 58 tbl.getColumnModel().getColumn(0).setCellRenderer(renderer); 59 59 tbl.getColumnModel().getColumn(1).setCellRenderer(renderer); -
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r13561 r13564 316 316 public PrimitiveId getPrimitiveId() { 317 317 return new SimplePrimitiveId(getUniqueId(), getType()); 318 }319 320 /**321 * Gets the type this primitive is displayed at322 * @return A {@link OsmPrimitiveType}323 */324 public OsmPrimitiveType getDisplayType() {325 return getType();326 318 } 327 319 -
trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java
r13493 r13564 34 34 import org.openstreetmap.josm.tools.I18n; 35 35 import org.openstreetmap.josm.tools.Utils; 36 import org.openstreetmap.josm.tools.template_engine.TemplateEngineDataProvider; 36 37 37 38 /** 38 * This is the default implementation of a {@link NameFormatter} for names of {@link OsmPrimitive}s39 * This is the default implementation of a {@link NameFormatter} for names of {@link IPrimitive}s 39 40 * and {@link HistoryOsmPrimitive}s. 40 41 * @since 12663 (moved from {@code gui} package) … … 129 130 130 131 /** 131 * Formats a name for an {@link OsmPrimitive}.132 * Formats a name for an {@link IPrimitive}. 132 133 * 133 134 * @param osm the primitive 134 135 * @return the name 135 136 * @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); 144 146 } 145 147 return null; … … 147 149 148 150 @Override 149 public String format( Node node) {151 public String format(INode node) { 150 152 StringBuilder name = new StringBuilder(); 151 153 if (node.isIncomplete()) { … … 153 155 } else { 154 156 TaggingPreset preset = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(node); 155 if (preset == null ) {157 if (preset == null || !(node instanceof TemplateEngineDataProvider)) { 156 158 String n; 157 159 if (Config.getPref().getBoolean("osm-primitives.localize-name", true)) { … … 184 186 name.append(n); 185 187 } else { 186 preset.nameTemplate.appendText(name, node);188 preset.nameTemplate.appendText(name, (TemplateEngineDataProvider) node); 187 189 } 188 190 if (node.isLatLonKnown() && Config.getPref().getBoolean("osm-primitives.showcoor")) { … … 204 206 } 205 207 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() { 210 212 return nodeComparator; 211 213 } 212 214 213 215 @Override 214 public String format( Way way) {216 public String format(IWay way) { 215 217 StringBuilder name = new StringBuilder(); 216 218 … … 231 233 } else { 232 234 TaggingPreset preset = TaggingPresetNameTemplateList.getInstance().findPresetTemplate(way); 233 if (preset == null ) {235 if (preset == null || !(way instanceof TemplateEngineDataProvider)) { 234 236 String n; 235 237 if (Config.getPref().getBoolean("osm-primitives.localize-name", true)) { … … 274 276 name.append(n); 275 277 } else { 276 preset.nameTemplate.appendText(name, way);278 preset.nameTemplate.appendText(name, (TemplateEngineDataProvider) way); 277 279 } 278 280 … … 296 298 } 297 299 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() { 302 304 return wayComparator; 303 305 } 304 306 305 307 @Override 306 public String format( Relation relation) {308 public String format(IRelation relation) { 307 309 StringBuilder name = new StringBuilder(); 308 310 if (relation.isIncomplete()) { … … 334 336 } 335 337 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)) { 338 340 result.append(getRelationTypeName(relation)); 339 341 String relationName = getRelationName(relation); … … 345 347 result.append(" (").append(relationName).append(", "); 346 348 } else { 347 preset.nameTemplate.appendText(result, relation);349 preset.nameTemplate.appendText(result, (TemplateEngineDataProvider) relation); 348 350 result.append('('); 349 351 } … … 351 353 } 352 354 353 private final Comparator< Relation> relationComparator = (r1, r2) -> {355 private final Comparator<IRelation> relationComparator = (r1, r2) -> { 354 356 //TODO This doesn't work correctly with formatHooks 355 357 … … 394 396 395 397 @Override 396 public Comparator< Relation> getRelationComparator() {398 public Comparator<IRelation> getRelationComparator() { 397 399 return relationComparator; 398 400 } -
trunk/src/org/openstreetmap/josm/data/osm/INode.java
r12161 r13564 29 29 */ 30 30 void setEastNorth(EastNorth eastNorth); 31 32 @Override 33 default String getDisplayName(NameFormatter formatter) { 34 return formatter.format(this); 35 } 31 36 } -
trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
r13493 r13564 233 233 */ 234 234 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 } 235 253 } -
trunk/src/org/openstreetmap/josm/data/osm/IRelation.java
r9460 r13564 34 34 */ 35 35 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 } 36 51 } -
trunk/src/org/openstreetmap/josm/data/osm/IWay.java
r9460 r13564 16 16 17 17 /** 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 /** 18 33 * Returns id of the node at given index. 19 34 * @param idx node index … … 27 42 */ 28 43 boolean isClosed(); 44 45 @Override 46 default String getDisplayName(NameFormatter formatter) { 47 return formatter.format(this); 48 } 29 49 } -
trunk/src/org/openstreetmap/josm/data/osm/NameFormatter.java
r12189 r13564 5 5 6 6 /** 7 * Formats a name for a {@link OsmPrimitive}.7 * Formats a name for an {@link IPrimitive}. 8 8 * @since 1990 9 9 */ … … 11 11 12 12 /** 13 * Formats a name for a {@link Node}.13 * Formats a name for a {@link INode}. 14 14 * 15 15 * @param node the node 16 16 * @return the name 17 * @since 13564 (signature) 17 18 */ 18 String format( Node node);19 String format(INode node); 19 20 20 21 /** 21 * Formats a name for a {@link Way}.22 * Formats a name for a {@link IWay}. 22 23 * 23 24 * @param way the way 24 25 * @return the name 26 * @since 13564 (signature) 25 27 */ 26 String format( Way way);28 String format(IWay way); 27 29 28 30 /** 29 * Formats a name for a {@link Relation}.31 * Formats a name for a {@link IRelation}. 30 32 * 31 33 * @param relation the relation 32 34 * @return the name 35 * @since 13564 (signature) 33 36 */ 34 String format( Relation relation);37 String format(IRelation relation); 35 38 36 39 /** … … 45 48 * Gets a comparator that sorts the nodes by the string that this formatter would create for them 46 49 * @return That comparator 50 * @since 13564 (signature) 47 51 */ 48 Comparator< Node> getNodeComparator();52 Comparator<INode> getNodeComparator(); 49 53 50 54 /** 51 55 * Gets a comparator that sorts the ways by the string that this formatter would create for them 52 56 * @return That comparator 57 * @since 13564 (signature) 53 58 */ 54 Comparator< Way> getWayComparator();59 Comparator<IWay> getWayComparator(); 55 60 56 61 /** 57 62 * Gets a comparator that sorts the relations by the string that this formatter would create for them 58 63 * @return That comparator 64 * @since 13564 (signature) 59 65 */ 60 Comparator< Relation> getRelationComparator();66 Comparator<IRelation> getRelationComparator(); 61 67 } -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r13173 r13564 317 317 318 318 @Override 319 public String getDisplayName(NameFormatter formatter) {320 return formatter.format(this);321 }322 323 @Override324 319 public OsmPrimitiveType getType() { 325 320 return OsmPrimitiveType.NODE; -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r13453 r13564 1365 1365 } 1366 1366 1367 /**1368 * Replies the display name of a primitive formatted by <code>formatter</code>1369 * @param formatter formatter to use1370 *1371 * @return the display name1372 */1373 public abstract String getDisplayName(NameFormatter formatter);1374 1375 1367 @Override 1376 1368 public Collection<String> getTemplateKeys() { -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r13434 r13564 395 395 } 396 396 397 @Override398 public String getDisplayName(NameFormatter formatter) {399 return formatter.format(this);400 }401 402 397 /** 403 398 * Replies the set of {@link OsmPrimitive}s referred to by at least one … … 525 520 } 526 521 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 532 523 public boolean hasIncompleteMembers() { 533 524 RelationMember[] members = this.members; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r13512 r13564 105 105 106 106 /** 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 5847114 */115 public int getRealNodesCount() {116 int count = getNodesCount();117 return isClosed() ? count-1 : count;118 }119 120 /**121 107 * Replies the node at position <code>index</code>. 122 108 * … … 576 562 } 577 563 return false; 578 }579 580 @Override581 public String getDisplayName(NameFormatter formatter) {582 return formatter.format(this);583 564 } 584 565 -
trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java
r12663 r13564 26 26 * @author imi 27 27 * @author Frederik Ramm 28 * @deprecated since 13564. Use {@link PrimitiveRenderer} instead 28 29 */ 30 @Deprecated 29 31 public class OsmPrimitivRenderer implements ListCellRenderer<OsmPrimitive>, TableCellRenderer { 30 32 private final DefaultNameFormatter formatter = DefaultNameFormatter.getInstance(); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java
r12660 r13564 12 12 import javax.swing.table.TableColumn; 13 13 14 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;14 import org.openstreetmap.josm.gui.PrimitiveRenderer; 15 15 import org.openstreetmap.josm.gui.conflict.ConflictColors; 16 16 import org.openstreetmap.josm.gui.conflict.pair.relation.RelationMemberTable; … … 22 22 public class RelationMemberConflictResolverColumnModel extends DefaultTableColumnModel { 23 23 24 static final class MemberRenderer extends OsmPrimitivRenderer {24 static final class MemberRenderer extends PrimitiveRenderer { 25 25 @Override 26 26 public Component getTableCellRendererComponent(JTable table, … … 33 33 private final DefaultTableCellRenderer defaultTableCellRenderer = new DefaultTableCellRenderer(); 34 34 35 private final transient OsmPrimitivRenderer primitiveRenderer = new MemberRenderer();35 private final transient PrimitiveRenderer primitiveRenderer = new MemberRenderer(); 36 36 37 37 private final transient TableCellRenderer tableRenderer = (table, value, isSelected, hasFocus, row, column) -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r13434 r13564 57 57 import org.openstreetmap.josm.gui.MainApplication; 58 58 import org.openstreetmap.josm.gui.NavigatableComponent; 59 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;59 import org.openstreetmap.josm.gui.PrimitiveRenderer; 60 60 import org.openstreetmap.josm.gui.PopupMenuHandler; 61 61 import org.openstreetmap.josm.gui.SideButton; … … 127 127 lstConflicts = new JList<>(model); 128 128 lstConflicts.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 129 lstConflicts.setCellRenderer(new OsmPrimitivRenderer());129 lstConflicts.setCellRenderer(new PrimitiveRenderer()); 130 130 lstConflicts.addMouseListener(new MouseEventHandler()); 131 131 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/DeleteFromRelationConfirmationDialog.java
r12678 r13564 37 37 import org.openstreetmap.josm.data.osm.OsmPrimitive; 38 38 import org.openstreetmap.josm.data.osm.RelationToChildReference; 39 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;39 import org.openstreetmap.josm.gui.PrimitiveRenderer; 40 40 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction; 41 41 import org.openstreetmap.josm.gui.help.HelpUtil; … … 296 296 col.setWidth(100); 297 297 col.setPreferredWidth(100); 298 col.setCellRenderer(new OsmPrimitivRenderer());298 col.setCellRenderer(new PrimitiveRenderer()); 299 299 addColumn(col); 300 300 … … 305 305 col.setWidth(100); 306 306 col.setPreferredWidth(100); 307 col.setCellRenderer(new OsmPrimitivRenderer());307 col.setCellRenderer(new PrimitiveRenderer()); 308 308 addColumn(col); 309 309 -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r13453 r13564 49 49 import org.openstreetmap.josm.data.osm.DataSet; 50 50 import org.openstreetmap.josm.data.osm.DefaultNameFormatter; 51 import org.openstreetmap.josm.data.osm.IPrimitive; 51 52 import org.openstreetmap.josm.data.osm.OsmPrimitive; 52 53 import org.openstreetmap.josm.data.osm.Relation; … … 66 67 import org.openstreetmap.josm.gui.MapView; 67 68 import org.openstreetmap.josm.gui.NavigatableComponent; 68 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;69 69 import org.openstreetmap.josm.gui.PopupMenuHandler; 70 import org.openstreetmap.josm.gui.PrimitiveRenderer; 70 71 import org.openstreetmap.josm.gui.SideButton; 71 72 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; … … 322 323 } 323 324 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) { 327 328 // Don't show the default tooltip in the relation list 328 329 return null; -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r13545 r13564 65 65 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 66 66 import org.openstreetmap.josm.gui.MainApplication; 67 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;67 import org.openstreetmap.josm.gui.PrimitiveRenderer; 68 68 import org.openstreetmap.josm.gui.PopupMenuHandler; 69 69 import org.openstreetmap.josm.gui.SideButton; … … 113 113 lstPrimitives.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 114 114 lstPrimitives.setSelectionModel(selectionModel); 115 lstPrimitives.setCellRenderer(new OsmPrimitivRenderer());115 lstPrimitives.setCellRenderer(new PrimitiveRenderer()); 116 116 lstPrimitives.setTransferHandler(new SelectionTransferHandler()); 117 117 if (!GraphicsEnvironment.isHeadless()) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableCellRenderer.java
r13344 r13564 13 13 /** 14 14 * 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}. 16 16 */ 17 17 public class ChangesetContentTableCellRenderer extends AbstractCellRenderer { -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableColumnModel.java
r10308 r13564 7 7 import javax.swing.table.TableColumn; 8 8 9 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;9 import org.openstreetmap.josm.gui.PrimitiveRenderer; 10 10 11 11 /** … … 48 48 col.setResizable(true); 49 49 col.setPreferredWidth(200); 50 col.setCellRenderer(new OsmPrimitivRenderer());50 col.setCellRenderer(new PrimitiveRenderer()); 51 51 addColumn(col); 52 52 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java
r13171 r13564 24 24 import org.openstreetmap.josm.data.osm.Relation; 25 25 import org.openstreetmap.josm.gui.MainApplication; 26 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;26 import org.openstreetmap.josm.gui.PrimitiveRenderer; 27 27 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 28 28 import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor; … … 59 59 setLayout(new BorderLayout()); 60 60 referrers = new JList<>(model); 61 referrers.setCellRenderer(new OsmPrimitivRenderer());61 referrers.setCellRenderer(new PrimitiveRenderer()); 62 62 add(new JScrollPane(referrers), BorderLayout.CENTER); 63 63 referrers.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); -
trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
r13071 r13564 36 36 import org.openstreetmap.josm.data.osm.OsmPrimitive; 37 37 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 38 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;38 import org.openstreetmap.josm.gui.PrimitiveRenderer; 39 39 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction; 40 40 import org.openstreetmap.josm.gui.help.HelpUtil; … … 196 196 protected void init() { 197 197 setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 198 setCellRenderer(new OsmPrimitivRenderer());198 setCellRenderer(new PrimitiveRenderer()); 199 199 } 200 200 -
trunk/src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java
r12370 r13564 18 18 19 19 import org.openstreetmap.josm.data.osm.OsmPrimitive; 20 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;20 import org.openstreetmap.josm.gui.PrimitiveRenderer; 21 21 22 22 /** … … 52 52 protected void build() { 53 53 setLayout(new GridBagLayout()); 54 OsmPrimitivRenderer renderer = new OsmPrimitivRenderer();54 PrimitiveRenderer renderer = new PrimitiveRenderer(); 55 55 // initialize the three lists for uploaded primitives, but don't add them to the dialog yet, see setUploadedPrimitives() 56 56 // -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetNameTemplateList.java
r12620 r13564 7 7 import java.util.List; 8 8 9 import org.openstreetmap.josm.data.osm. OsmPrimitive;9 import org.openstreetmap.josm.data.osm.IPrimitive; 10 10 import org.openstreetmap.josm.tools.Logging; 11 11 … … 52 52 * @return the first occurence of preset with template name matching the primitive 53 53 */ 54 public TaggingPreset findPresetTemplate( OsmPrimitive primitive) {54 public TaggingPreset findPresetTemplate(IPrimitive primitive) { 55 55 synchronized (this) { 56 56 for (TaggingPreset t : presetsWithPattern) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetType.java
r9615 r13564 2 2 package org.openstreetmap.josm.gui.tagging.presets; 3 3 4 import org.openstreetmap.josm.data.osm. OsmPrimitive;4 import org.openstreetmap.josm.data.osm.IPrimitive; 5 5 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 6 6 … … 49 49 * @return the {@code TaggingPresetType} of {@code p} 50 50 */ 51 public static TaggingPresetType forPrimitive( OsmPrimitive p) {51 public static TaggingPresetType forPrimitive(IPrimitive p) { 52 52 return forPrimitiveType(p.getDisplayType()); 53 53 } -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
r13338 r13564 24 24 import org.openstreetmap.josm.gui.MainApplication; 25 25 import org.openstreetmap.josm.gui.MapFrame; 26 import org.openstreetmap.josm.gui. OsmPrimitivRenderer;26 import org.openstreetmap.josm.gui.PrimitiveRenderer; 27 27 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 28 28 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 44 44 /** 45 45 * 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. 47 47 * @throws SecurityException see {@link Class#getDeclaredField} for details 48 48 * @throws NoSuchFieldException see {@link Class#getDeclaredField} for details … … 82 82 83 83 JList<OsmPrimitive> lstPrimitives = new JList<>(); 84 OsmPrimitivRenderer renderer = new OsmPrimitivRenderer();84 PrimitiveRenderer renderer = new PrimitiveRenderer(); 85 85 86 86 assertEquals(3, w.getNodesCount()); -
trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
r13413 r13564 63 63 TaggingPresets.addTaggingPresets(TaggingPresetReader.readAll("http://localhost:" + wireMockRule.port() + "/" + source, true)); 64 64 65 Comparator< Relation> comparator = DefaultNameFormatter.getInstance().getRelationComparator();65 Comparator<IRelation> comparator = DefaultNameFormatter.getInstance().getRelationComparator(); 66 66 67 67 try (InputStream is = TestUtils.getRegressionDataStream(9632, "data.osm.zip")) {
Note:
See TracChangeset
for help on using the changeset viewer.