Changeset 20724 in osm
- Timestamp:
- 2010-03-28T22:07:43+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java
r20556 r20724 13 13 import org.openstreetmap.josm.tools.CheckParameterUtil; 14 14 15 /** 16 * TurnRestrictionBuilder creates a turn restriction and initializes it with 17 * objects from a selection of OSM primitives, i.e. the current selection 18 * in a {@see OsmDataLayer}. 19 * 20 */ 15 21 public class TurnRestrictionBuilder { 16 22 -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java
r20527 r20724 11 11 12 12 /** 13 * PrimitiveIdListTransferHandler is a transfer handler for component which13 * PrimitiveIdListTransferHandler is a transfer handler for components which 14 14 * provide and/or accept a list of {@see PrimitiveId} via copy/paste or 15 15 * drag-and-drop. -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java
r20675 r20724 7 7 import javax.swing.table.TableColumn; 8 8 9 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;10 9 import org.openstreetmap.josm.tools.CheckParameterUtil; 11 10 … … 23 22 col.setPreferredWidth(100); 24 23 col.setCellEditor(new MemberRoleCellEditor()); 24 col.setCellRenderer(new RelationMemberRoleCellRenderer()); 25 25 addColumn(col); 26 26 … … 30 30 col.setResizable(true); 31 31 col.setPreferredWidth(300); 32 col.setCellRenderer(new OsmPrimitivRenderer());32 col.setCellRenderer(new RelationMemberTargetCellRenderer()); 33 33 addColumn(col); 34 34 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java
r20675 r20724 327 327 */ 328 328 protected void removedSelectedMembers() { 329 int j = 0; 330 for(int i=0; i < getRowCount();i++){ 329 for(int i=getRowCount()-1; i >= 0;i--){ 331 330 if (rowSelectionModel.isSelectedIndex(i)) { 332 members.remove(i - j); 333 j++; 331 members.remove(i); 334 332 } 335 333 } … … 448 446 449 447 public int getRowCount() { 450 return members.size(); 448 if (members.size() > 0) return members.size(); 449 450 // we display an empty row if the model is empty because otherwise 451 // we can't drag/drop into the empty table. 452 // FIXME: use JTable.setFillsViewportHeight(boolean) after the migration 453 // to Java 6. 454 return 1; 451 455 } 452 456 453 457 public Object getValueAt(int rowIndex, int columnIndex) { 458 if (members.size() == 0 && rowIndex == 0){ 459 // we display an empty row if the model is empty because otherwise 460 // we can't drag/drop into the empty table. 461 // FIXME: use JTable.setFillsViewportHeight(boolean) after the migration 462 // to Java 6. 463 return null; 464 } 454 465 switch(columnIndex){ 455 466 case 0: return members.get(rowIndex).getRole(); … … 461 472 @Override 462 473 public boolean isCellEditable(int rowIndex, int columnIndex) { 474 // we display an empty row if the model is empty because otherwise 475 // we can't drag/drop into the empty table. This row isn't editable 476 // FIXME: use JTable.setFillsViewportHeight(boolean) after the migration 477 // to Java 6. 478 if (members.size() == 0 && rowIndex == 0) return false; 479 480 // otherwise only the column with the member roles is editable 463 481 return columnIndex == 0; 464 482 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java
r20606 r20724 242 242 tm.setValue(value); 243 243 } else { 244 tagEditorModel. add(new TagModel("restriction", value.trim().toLowerCase()));244 tagEditorModel.prepend(new TagModel("restriction", value.trim().toLowerCase())); 245 245 } 246 246 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java
r20622 r20724 184 184 OsmPrimitive from = fromLegs.iterator().next(); 185 185 OsmPrimitive to = toLegs.iterator().next(); 186 186 187 if (! (from instanceof Way)) return; 187 188 if (! (to instanceof Way)) return; 188 if (from.equals(to)){ 189 if (from.equals(to) && ! "no_u_turn".equals(editorModel.getRestrictionTagValue())){ 190 // identical from and to allowed for "no_u_turn" only 191 // 189 192 issues.add(new IdenticalTurnRestrictionLegsError(this, from)); 190 193 }
Note:
See TracChangeset
for help on using the changeset viewer.