Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PLAF and BasicTreeUI for custom tree line painting.

2 views
Skip to first unread message

Nathan Babb

unread,
Apr 29, 2002, 10:49:36 AM4/29/02
to
I need a JTree where I can control the line painting at the node level
(i.e. a node depending on some attribute yet tbd will paint a dotted
versus a solid line) I understand that I need to create my own PLAF
which I have done by outright copying BasicTreeUI (alot of the methods
in BasicTreeUI are protected so I can't subclass it in my own
package...right? Could I just keep it in the plaf.basic package?) I
also needed to change the private method calls to isLeftToRight...

leftToRight = BasicGraphicsUtils.isLeftToRight(tree);
leftToRight = tree.getComponentOrientation().isLeftToRight();

...but I mention that purely for informational reasons... My real
question is this. I want to be able to use the other standard plaf's
in combination with my plaf. What would be the best way to go about
this. Currently I am setting my plaf at the begining of my JTree
constructor and then switching it back to its original plaf at the end
of the constructor which is an unsatisfying solution. Any
suggestions?

Frank Breuer

unread,
Apr 29, 2002, 1:15:19 PM4/29/02
to
nb...@hotmail.com (Nathan Babb) wrote in
news:57854e84.02042...@posting.google.com:

> (alot of the methods in BasicTreeUI are protected so I can't
> subclass it in my own package...right?

You need a beginners book about Java.

Nathan Babb

unread,
May 2, 2002, 11:47:36 AM5/2/02
to
Never mind about the protected part...I was confused there. My
original question still stands though about being able to mix plafs.
Any help would be appreciated.
0 new messages