Changeset 17889 in josm for trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
- Timestamp:
- 2021-05-13T00:19:26+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java
r17733 r17889 19 19 import javax.swing.DefaultCellEditor; 20 20 import javax.swing.JCheckBox; 21 import javax.swing.JLabel;22 21 import javax.swing.JPopupMenu; 23 22 import javax.swing.JRadioButton; … … 324 323 } 325 324 326 /**327 * Renderer for history version labels, allowing to define horizontal alignment.328 */329 public static class AlignedRenderer extends JLabel implements TableCellRenderer {330 331 /**332 * Constructs a new {@code AlignedRenderer}.333 * @param hAlignment Horizontal alignment. One of the following constants defined in SwingConstants:334 * LEFT, CENTER (the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILING335 */336 public AlignedRenderer(int hAlignment) {337 setHorizontalAlignment(hAlignment);338 }339 340 AlignedRenderer() {341 this(SwingConstants.LEADING);342 }343 344 @Override345 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,346 int row, int column) {347 String v = "";348 if (value != null) {349 v = value.toString();350 }351 setText(v);352 return this;353 }354 }355 356 325 private static void adjustColumnWidth(JTable tbl, int col, int cellInset) { 357 326 int maxwidth = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
