Changeset 23526 in osm for applications/editors/josm/plugins
- Timestamp:
- 2010-10-09T15:35:42+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor
- Files:
-
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java
r23510 r23526 7 7 import javax.swing.table.TableColumn; 8 8 9 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 9 10 import org.openstreetmap.josm.tools.CheckParameterUtil; 10 11 … … 22 23 col.setPreferredWidth(100); 23 24 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 RelationMemberTargetCellRenderer());32 col.setCellRenderer(new OsmPrimitivRenderer()); 33 33 addColumn(col); 34 34 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java
r23510 r23526 446 446 447 447 public int getRowCount() { 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; 448 return members.size(); 455 449 } 456 450 457 451 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 otherwise460 // we can't drag/drop into the empty table.461 // FIXME: use JTable.setFillsViewportHeight(boolean) after the migration462 // to Java 6.463 return null;464 }465 452 switch(columnIndex){ 466 453 case 0: return members.get(rowIndex).getRole(); … … 472 459 @Override 473 460 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 461 // only the column with the member roles is editable 481 462 return columnIndex == 0; 482 463 } -
applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java
r23510 r23526 63 63 setRowSelectionAllowed(true); 64 64 setColumnSelectionAllowed(true); 65 setFillsViewportHeight(true); // make sure we can drag onto an empty table 65 66 66 67 // register the popup menu launcher
Note:
See TracChangeset
for help on using the changeset viewer.