| RE: [ve-dev] Painting Custom widgets in Swing for VE . |
Hi
Rich,
We are
building complex composite widgets. For Example : a single component consisting of a Text Field
and a checkbox put inside a panel. The composite component here is the panel.
When we change properties for the composite component, we want it to
reflect to the child component, which are placed inside the composite component.
Hence we require a paint method to add components and to change properties
related to the whole of the composite component.
So can you please
help us resolving this issue of paint
method?
Thanks in
Advance
Best
Regards,
Rashmi
H.Ramachandra.
| "H Ramachandra, Rashmi"
<rashmi.h.ramachandra@xxxxxxx> Sent by: ve-dev-bounces@xxxxxxxxxxx 11/07/2005 12:32 AM
|
|
We are using eclipse 3.1 and VE 1.1 for our project. We are trying to build custom widgets in Swing, that paint themselves when any property such as Color (Back Ground or Foreground) is changed. We have two questions here,
1.) How do we debug and follow the flow of execution? (Sysout's are not working here inside custom widgets).
2.) How do we customize the paint method to pick up and apply property from the user defined field?
For E.g.:-
We have a field called 'backGroundColor' , which has a setter and getter methods. On every change of this property by the user from the property palette. We want to change the color of the component .
this.setBackGround(this.getBackGroundColor());
We have used the above code inside the paint method. Since paint method is called ample number of times the eclipse runtime hangs and becomes very slow. It even does not reflect the property changes. Is there any way we can handle these custom properties inside the paint method.
Our paint method looks like this
public void paint(Graphics
g)
{
super.paint(g);
if(flag)
{
this.setBackground(this.getBackgroundColor());
this.setOpaque(true);
}
flag = false;
}
We used flag to restrict repainting of the component continuously. But we are unable to find how to reset the flag and call the paint, whenever there is a property change.
For the above component and the swing container I am using null layout.
Any help in this regard is greatly appreciated.
Thank you and Best Regards.
Rashmi H.Ramachandra _______________________________________________
ve-dev mailing
list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev