Changeset 7948 in josm
- Timestamp:
- 2015-01-09T22:18:53+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanel.java
r7937 r7948 7 7 import java.awt.Component; 8 8 import java.awt.FlowLayout; 9 import java.awt.Rectangle; 9 10 import java.awt.event.ActionEvent; 10 11 import java.beans.PropertyChangeEvent; … … 112 113 JPanel pnl = new JPanel(new BorderLayout()); 113 114 table = new JTable(model, new ChangesetDiscussionTableColumnModel()); 115 table.getColumnModel().getColumn(2).addPropertyChangeListener(new PropertyChangeListener() { 116 @Override 117 public void propertyChange(PropertyChangeEvent evt) { 118 if ("width".equals(evt.getPropertyName())) { 119 updateRowHeights(); 120 } 121 } 122 }); 114 123 pnl.add(new JScrollPane(table), BorderLayout.CENTER); 115 124 return pnl; … … 122 131 protected void updateView(Changeset cs) { 123 132 model.populate(cs.getDiscussion()); 133 updateRowHeights(); 134 } 135 136 protected void updateRowHeights() { 137 int intercellWidth = table.getIntercellSpacing().width; 138 int colWidth = table.getColumnModel().getColumn(2).getWidth(); 124 139 // Update row heights 125 140 for (int row = 0; row < table.getRowCount(); row++) { … … 127 142 128 143 Component comp = table.prepareRenderer(table.getCellRenderer(row, 2), row, 2); 144 // constrain width of component 145 comp.setBounds(new Rectangle(0, 0, colWidth - intercellWidth, Integer.MAX_VALUE)); 129 146 rowHeight = Math.max(rowHeight, comp.getPreferredSize().height); 130 147 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionTableCellRenderer.java
r7937 r7948 34 34 case 2: 35 35 comp = new JosmTextArea((String) value); 36 ((JosmTextArea)comp).setLineWrap(true); 37 ((JosmTextArea)comp).setWrapStyleWord(true); 36 38 reset(comp, false); 37 39 renderColors(comp, isSelected);
Note:
See TracChangeset
for help on using the changeset viewer.