[GUI] List elements do not resize properly inside the attribute table.
What is the current bug behavior?
If a user resizes the right split panel of the topography editor while a list editor is visible the elements will only resize to fit the panel if the width of the panel increases. This results in a wrong calculated overal width of each editor when decreasing the panel width.
What is the expected correct behavior?
All editors should always fit the width of the panel. That means all editors should fit the width of the panel, when any list editor is visible.
Steps to reproduce
- Select any scenario element which contains a list attribute
- Click on the list attribute button in the attribute table to open the list editor
- resize the split panel (increase the width)
- resize the split panel (decrease the width)
Starting point
A possible cause of the problem is the current implementation of the ComponentListener in the private sub class MyStyler in org/vadere/gui/topographycreator/control/attribtable/cells/delegates/ListCellEditor.java.
The current implementation is necessary for displaying the remove buttons on the right side of each list element in correct size on each resize event.
It may be possible to fix this bug if another JComponent element was used instead of the table itself to get the width
public void componentResized(ComponentEvent e) {
super.componentResized(e);
var width = style.getWidth();
style.getColumn("attr").setPreferredWidth(width - 30);
style.getColumn("btn").setPreferredWidth(30);
}