- Timestamp:
- 2016-02-01T21:26:21+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java
r9705 r9708 46 46 boolean isSelected, boolean cellHasFocus) { 47 47 Component def = defaultListCellRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 48 return renderer(def, value );48 return renderer(def, value, list.getModel().getSize() > 1000); 49 49 } 50 50 … … 56 56 Component def = defaultTableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 57 57 if (value instanceof OsmPrimitive) 58 return renderer(def, (OsmPrimitive) value );58 return renderer(def, (OsmPrimitive) value, table.getModel().getRowCount() > 1000); 59 59 else if (value instanceof HistoryOsmPrimitive) 60 60 return renderer(def, (HistoryOsmPrimitive) value); … … 68 68 * @param def the rendering component 69 69 * @param value the OsmPrimitive to render 70 * @param fast whether the icons should be loaded fast since many items are being displayed 70 71 * @return the modified rendering component 71 72 */ 72 private Component renderer(Component def, OsmPrimitive value ) {73 private Component renderer(Component def, OsmPrimitive value, boolean fast) { 73 74 if (value != null && def instanceof JLabel) { 74 75 ((JLabel) def).setText(getComponentText(value)); 75 ImageIcon icon = ImageProvider.getPadded(value, 76 // Height of component no yet known, assume the default 16px. 77 ImageProvider.ImageSizes.SMALLICON.getImageDimension()); 76 final ImageIcon icon = fast 77 ? ImageProvider.get(value.getType()) 78 : ImageProvider.getPadded(value, 79 // Height of component no yet known, assume the default 16px. 80 ImageProvider.ImageSizes.SMALLICON.getImageDimension()); 78 81 if (icon != null) { 79 82 ((JLabel) def).setIcon(icon);
Note:
See TracChangeset
for help on using the changeset viewer.