Changeset 20606 in osm for applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap
- Timestamp:
- 2010-03-22T13:10:48+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java
r20586 r20606 181 181 * in whose context this editor is working 182 182 */ 183 public void setVias(List<OsmPrimitive> vias) {183 public void setVias(List<OsmPrimitive> vias) throws IllegalArgumentException{ 184 184 boolean viasDeleted = removeMembersWithRole("via"); 185 185 if (vias == null || vias.isEmpty()){ -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxModel.java
r20489 r20606 40 40 41 41 String tagValue = model.getRestrictionTagValue(); 42 if (tagValue == null) {42 if (tagValue.trim().equals("")) { 43 43 selectedTagValue = null; 44 44 } else { -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java
r20586 r20606 68 68 private RelationMemberEditorModel memberModel; 69 69 private IssuesModel issuesModel; 70 private NavigationControler navigationControler; 70 71 71 72 /** … … 73 74 * 74 75 * @param layer the layer. Must not be null. 76 * @param navigationControler control to direct the user to specific UI components. Must not be null 75 77 * @throws IllegalArgumentException thrown if {@code layer} is null 76 78 */ 77 79 public TurnRestrictionEditorModel(OsmDataLayer layer, NavigationControler navigationControler) throws IllegalArgumentException{ 78 80 CheckParameterUtil.ensureParameterNotNull(layer, "layer"); 81 CheckParameterUtil.ensureParameterNotNull(navigationControler, "navigationControler"); 79 82 this.layer = layer; 83 this.navigationControler = navigationControler; 80 84 memberModel = new RelationMemberEditorModel(layer); 81 85 memberModel.addTableModelListener(new RelationMemberModelListener()); 82 issuesModel = new IssuesModel(this ,navigationControler);86 issuesModel = new IssuesModel(this); 83 87 addObserver(issuesModel); 84 88 tagEditorModel.addTableModelListener(new TagEditorModelObserver()); … … 214 218 /** 215 219 * Replies the current tag value for the tag <tt>restriction</tt>. 216 * null, if there isn't a tag <tt>restriction</tt>.220 * The empty tag, if there isn't a tag <tt>restriction</tt>. 217 221 * 218 222 * @return the tag value … … 220 224 public String getRestrictionTagValue() { 221 225 TagCollection tags = tagEditorModel.getTagCollection(); 222 if (!tags.hasTagsFor("restriction")) return null;226 if (!tags.hasTagsFor("restriction")) return ""; 223 227 return tags.getJoinedValues("restriction"); 224 228 } … … 238 242 tm.setValue(value); 239 243 } else { 240 tagEditorModel.add(new TagModel("restriction", value ));244 tagEditorModel.add(new TagModel("restriction", value.trim().toLowerCase())); 241 245 } 242 246 } … … 262 266 * must be equal to the dataset of this editor model, see {@see #getDataSet()} 263 267 * 268 * null values in {@see vias} are skipped. 269 * 264 270 * @param vias the list of vias 265 * @throws IllegalArgumentException thrown if one of the via objects is null or 266 * if it belongs to the wrong dataset 267 */ 268 public void setVias(List<OsmPrimitive> vias) { 271 * @throws IllegalArgumentException thrown if one of the via objects belongs to the wrong dataset 272 */ 273 public void setVias(List<OsmPrimitive> vias) throws IllegalArgumentException{ 269 274 memberModel.setVias(vias); 270 275 } … … 320 325 public IssuesModel getIssuesModel() { 321 326 return issuesModel; 327 } 328 329 public NavigationControler getNavigationControler() { 330 return navigationControler; 322 331 } 323 332 … … 422 431 } 423 432 } 424 433 434 /* ----------------------------------------------------------------------------------------- */ 435 /* inner classes */ 436 /* ----------------------------------------------------------------------------------------- */ 425 437 class TagEditorModelObserver implements TableModelListener { 426 438 public void tableChanged(TableModelEvent e) { -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java
r20556 r20606 354 354 public void focusLost(FocusEvent e) { 355 355 // if we loose the focus to a component outside of the popup panel 356 // we hide the popup 357 if ( !SwingUtilities.isDescendingFrom(e.getOppositeComponent(), TurnRestrictionSelectionPopupPanel.this)) {356 // we hide the popup 357 if (e.getOppositeComponent() == null ||!SwingUtilities.isDescendingFrom(e.getOppositeComponent(), TurnRestrictionSelectionPopupPanel.this)) { 358 358 if (parentPopup != null){ 359 359 parentPopup.hide(); -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java
r20586 r20606 30 30 public class IssuesModel extends Observable implements Observer{ 31 31 private final ArrayList<Issue> issues = new ArrayList<Issue>(); 32 private NavigationControler navigationContoler;33 32 private TurnRestrictionEditorModel editorModel; 34 33 … … 41 40 * 42 41 * @param editorModel the editor model. Must not be null. 43 * @param controler the navigation controler. Must not be null.44 42 * @throws IllegalArgumentException thrown if controler is null 45 43 */ 46 public IssuesModel(TurnRestrictionEditorModel editorModel , NavigationControler controler) throws IllegalArgumentException{44 public IssuesModel(TurnRestrictionEditorModel editorModel) throws IllegalArgumentException{ 47 45 CheckParameterUtil.ensureParameterNotNull(editorModel, "editorModel"); 48 CheckParameterUtil.ensureParameterNotNull(controler, "controler");49 this.navigationContoler = controler;50 46 this.editorModel = editorModel; 51 47 this.editorModel.addObserver(this); … … 193 189 194 190 public NavigationControler getNavigationControler() { 195 return navigationContoler;191 return editorModel.getNavigationControler(); 196 192 } 197 193
Note:
See TracChangeset
for help on using the changeset viewer.