Factor out loging from resizePanel, positionPanel
introduce preferredSize() with most of the logic of resizePanel() and also most of the logic of positionPanel() in separed methods so that a positionAndResizePanel() which does a single setGeometry can be done. The method is still not used in this mr, as is done to have no behavior change whatsoever, further refactor will happen afterwards.
(For future reference, follow the guidelines at https://cbea.ms/git-commit/#seven-rules)