- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
[Swing]Proposal for extending SuperMixin
Mon, 2010-04-05, 22:51
He there,
The actual implementation of SuperMixin allows us to extend scala components customizing parts of the inherent JComponent. I think there's still place for more customization, and hence SuperMixing should be augmented.
I think the next methods should be also override-able:
setPreferredSize, setMaximumSize, setMinimumSize: overriding them would allow us better control over behavior in layouts (for example, I frequently extends getMaximumSize so that it returns
new Dimension(Integer.MAX_VALUE, getPreferredSize.height) in order to make a component horizontally resizable but honoring the component's height when adding them into a BoxLayout with Y_AXIS orientation, similar case for the X_AXIS)
repaint: sometimes its useful to override this method into an no-op, so that repaint calls are ignored (when doing active rendering, or cell renderers)
setBounds, getBounds: there are cases when you need to intercept this method, again for example for cell renderers
There are probably others that also should be override-able, what you think?
Cheers.
The actual implementation of SuperMixin allows us to extend scala components customizing parts of the inherent JComponent. I think there's still place for more customization, and hence SuperMixing should be augmented.
I think the next methods should be also override-able:
setPreferredSize, setMaximumSize, setMinimumSize: overriding them would allow us better control over behavior in layouts (for example, I frequently extends getMaximumSize so that it returns
new Dimension(Integer.MAX_VALUE, getPreferredSize.height) in order to make a component horizontally resizable but honoring the component's height when adding them into a BoxLayout with Y_AXIS orientation, similar case for the X_AXIS)
repaint: sometimes its useful to override this method into an no-op, so that repaint calls are ignored (when doing active rendering, or cell renderers)
setBounds, getBounds: there are cases when you need to intercept this method, again for example for cell renderers
There are probably others that also should be override-able, what you think?
Cheers.
Tue, 2010-04-06, 16:47
#2
Re: [Swing]Proposal for extending SuperMixin
Ok, done :).
On Tue, Apr 6, 2010 at 10:57 AM, Ingo Maier <ingo.maier@epfl.ch> wrote:
On Tue, Apr 6, 2010 at 10:57 AM, Ingo Maier <ingo.maier@epfl.ch> wrote:
Could you add an enhancement ticket on trac, so that it won't be forgotten?
Thanks,
Ingo
On 4/5/10 11:51 PM, Rodrigo Cano wrote:
He there,
The actual implementation of SuperMixin allows us to extend scala
components customizing parts of the inherent JComponent. I think there's
still place for more customization, and hence SuperMixing should be
augmented.
I think the next methods should be also override-able:
setPreferredSize, setMaximumSize, setMinimumSize: overriding them would
allow us better control over behavior in layouts (for example, I
frequently extends getMaximumSize so that it returns
new Dimension(Integer.MAX_VALUE, getPreferredSize.height) in order to
make a component horizontally resizable but honoring the component's
height when adding them into a BoxLayout with Y_AXIS orientation,
similar case for the X_AXIS)
repaint: sometimes its useful to override this method into an no-op, so
that repaint calls are ignored (when doing active rendering, or cell
renderers)
setBounds, getBounds: there are cases when you need to intercept this
method, again for example for cell renderers
There are probably others that also should be override-able, what you think?
Cheers.
Could you add an enhancement ticket on trac, so that it won't be forgotten?
Thanks,
Ingo
On 4/5/10 11:51 PM, Rodrigo Cano wrote:
> He there,
>
> The actual implementation of SuperMixin allows us to extend scala
> components customizing parts of the inherent JComponent. I think there's
> still place for more customization, and hence SuperMixing should be
> augmented.
>
> I think the next methods should be also override-able:
>
> setPreferredSize, setMaximumSize, setMinimumSize: overriding them would
> allow us better control over behavior in layouts (for example, I
> frequently extends getMaximumSize so that it returns
> new Dimension(Integer.MAX_VALUE, getPreferredSize.height) in order to
> make a component horizontally resizable but honoring the component's
> height when adding them into a BoxLayout with Y_AXIS orientation,
> similar case for the X_AXIS)
>
> repaint: sometimes its useful to override this method into an no-op, so
> that repaint calls are ignored (when doing active rendering, or cell
> renderers)
> setBounds, getBounds: there are cases when you need to intercept this
> method, again for example for cell renderers
>
> There are probably others that also should be override-able, what you think?
>
> Cheers.
>