This page is no longer maintained — Please continue to the home page at www.scala-lang.org

[Swing]Proposal for extending SuperMixin

2 replies
Rodrigo Cano
Joined: 2009-03-22,
User offline. Last seen 42 years 45 weeks ago.
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.

imaier
Joined: 2008-07-01,
User offline. Last seen 23 weeks 2 days ago.
Re: [Swing]Proposal for extending SuperMixin

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.
>

Rodrigo Cano
Joined: 2009-03-22,
User offline. Last seen 42 years 45 weeks ago.
Re: [Swing]Proposal for extending SuperMixin
Ok, done :).

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.



Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland