- Timestamp:
- 2018-08-07T19:50:47+02:00 (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/NoteData.java
r14101 r14102 51 51 52 52 /** 53 * Construct a new note container with a given list ofnotes53 * Construct a new note container without notes 54 54 * @since 14101 55 55 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r13150 r14102 277 277 @Override 278 278 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 279 FilterTableModel model = (FilterTableModel) table.getModel();280 279 Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 281 cell.setEnabled(model.isCellEnabled(row, column)); 280 TableModel model = table.getModel(); 281 if (model instanceof FilterTableModel) { 282 cell.setEnabled(((FilterTableModel) model).isCellEnabled(row, column)); 283 } 282 284 return cell; 283 285 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r14097 r14102 813 813 if (c instanceof JLabel) { 814 814 JLabel label = (JLabel) c; 815 label.setText(((MemberInfo) table.getValueAt(row, 1)).getPositionString()); 815 MemberInfo member = (MemberInfo) table.getValueAt(row, 1); 816 if (member != null) { 817 label.setText(member.getPositionString()); 818 } 816 819 if (isDisabledAndHidden) { 817 820 label.setFont(label.getFont().deriveFont(Font.ITALIC)); -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r14101 r14102 19 19 import java.util.Collections; 20 20 import java.util.List; 21 import java.util.Objects; 21 22 import java.util.regex.Matcher; 22 23 import java.util.regex.Pattern; … … 97 98 */ 98 99 public NoteLayer(Collection<Note> notes, String name) { 99 super(name); 100 noteData = new NoteData(notes); 101 noteData.addNoteDataUpdateListener(this); 100 this(new NoteData(notes), name); 102 101 } 103 102 … … 110 109 public NoteLayer(NoteData noteData, String name) { 111 110 super(name); 112 this.noteData = noteData;111 this.noteData = Objects.requireNonNull(noteData); 113 112 this.noteData.addNoteDataUpdateListener(this); 114 113 } -
trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
r14100 r14102 9 9 import java.util.Collection; 10 10 import java.util.Set; 11 import java.util.logging.Level; 11 12 12 13 import javax.swing.JTable; … … 18 19 import org.openstreetmap.josm.TestUtils; 19 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 import org.openstreetmap.josm.tools.Logging; 20 22 import org.openstreetmap.josm.tools.Utils; 21 23 … … 71 73 continue; 72 74 } 73 assertNotNull(createInstance(klass).getTableCellRendererComponent(tbl, null, false, false, 0, 0)); 75 try { 76 Logging.info(klass.toString()); 77 assertNotNull(createInstance(klass).getTableCellRendererComponent(tbl, null, false, false, 0, 0)); 78 } catch (ReflectiveOperationException e) { 79 Logging.logWithStackTrace(Level.WARNING, "Unable to test " + klass, e); 80 } 74 81 } 75 82 }
Note:
See TracChangeset
for help on using the changeset viewer.