scala-swing
scala-swing copied to clipboard
GridBagPanel is inflexible
Suggested changes:
-
Constraintsshould be a member of the companion object rather than the class, as there's no reason to tie constraint construction to a particular panel instance. -
The
addmethod should not be protected. That may have made sense ifGridBagPanelis to be used only declaratively, but arguably this layout is too complex for that. Rather, it's a prime candidate for wrapping by some application-specific declarative framework, in which case the protection is just a pain. -
The single mutating constraints object as used in the demo code is nasty. Ideally
Constraintsshould be a case class with keyword arguments.
Imported From: https://issues.scala-lang.org/browse/SI-4078?orig=1 Reporter: Jamie Webb (jmawebb)