T
Thomas G. Marshall
Dale King coughed up:
I think you're wrong here.
Most gui designers I know using swing, in fact /all/ of them, do nearly
everything in GridBagLayout. It just so easy to cut and paste the
structural gobledy-gook once you have the thing mastered. And it gives you
full resizing control (well, mostly ). SpringLayout may one day be the
most commonly used LM, but GBL seems very popular. And with GBL, you often
end up laying out many components in a single container.
I want those components in one place, along with all the others. It allows
me to easily change, say, ThingyButtons for SmedlyButtons, should the need
arise.
I question whether you meant model or controller here, but we'll sidestep
that one.
Yep. And I've done that extensively as well, in the deeper past. *However*
, I would argue that it smells of over-design in many cases. {shrug} I'm
discovering that I don't care much for this toopic.
Thomas G. Marshall wrote:
....[rip]...
It's not a bad goal. But regarding GUI's, I tend to want the
entirety of the gui elements all in one place.
And I find that usually means I am trying to do too much in one place.
It shows I am trying to put all the logic in one place rather than
distributing it over a bunch of lightweight objects.
I think you're wrong here.
Most gui designers I know using swing, in fact /all/ of them, do nearly
everything in GridBagLayout. It just so easy to cut and paste the
structural gobledy-gook once you have the thing mastered. And it gives you
full resizing control (well, mostly ). SpringLayout may one day be the
most commonly used LM, but GBL seems very popular. And with GBL, you often
end up laying out many components in a single container.
I want those components in one place, along with all the others. It allows
me to easily change, say, ThingyButtons for SmedlyButtons, should the need
arise.
I question whether it is the gui component it should talk to or the
model, but we'll sidestep that one.
I question whether you meant model or controller here, but we'll sidestep
that one.
And the answer is simply that the object that implements the listener
interface itself has the reference to the other component.
So if the listener for component a needs to talk to component b then
you might have:
a.addFooListener( new AFoolistener( b ) );
Yep. And I've done that extensively as well, in the deeper past. *However*
, I would argue that it smells of over-design in many cases. {shrug} I'm
discovering that I don't care much for this toopic.