Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages
Started by Jean Bresse
Mon, 07 Oct 2002 16:09
LabelUI and ComponentUI
Author: Jean Bresse
Date: Mon, 07 Oct 2002 16:09
Date: Mon, 07 Oct 2002 16:09
7 lines
1223 bytes
1223 bytes
Just wondering... Why would the API have a LabelUI class is while extending ComponentUI it offers no additional methods, properties, constructors, or overwritten methods. Jean
Re: LabelUI and ComponentUI
Author: John McGrath TeamB
Date: Wed, 16 Oct 2002 07:48
Date: Wed, 16 Oct 2002 07:48
32 lines
2149 bytes
2149 bytes
On Mon, 7 Oct 2002 12:09:23 -0400, Jean Bresse wrote:
> Why would the API have a LabelUI class is while extending
> ComponentUI it offers no additional methods, properties,
> constructors, or overwritten methods.
There are some standard methods that UI components are supposed to have
that fit the standard pattern. For example, the JLabel class has the
following methods:
public LabelUI getUI();
public void setUI(LabelUI ui);
If a JLabel used a ComponentUI, the signatures for these methods would
have to change. That would preclude changes to the interaction between
a JLabel and its UI delegate. Also, ComponentUI is an abstract class,
so that would also have to change.
It makes a lot more sense to define a pattern and then stick with it,
even if it does not seem the most efficient thing to do in some cases.
If you break the pattern, you often end up jumping through hoops later
on to deal with the exception cases. The result is that deviating from
the pattern often ends up making things less efficient.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads