scala-swing icon indicating copy to clipboard operation
scala-swing copied to clipboard

GridBagPanel is inflexible

Open scabug opened this issue 14 years ago • 1 comments

Suggested changes:

  • Constraints should 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 add method should not be protected. That may have made sense if GridBagPanel is 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 Constraints should be a case class with keyword arguments.

scabug avatar Dec 13 '10 12:12 scabug

Imported From: https://issues.scala-lang.org/browse/SI-4078?orig=1 Reporter: Jamie Webb (jmawebb)

scabug avatar Dec 13 '10 12:12 scabug