| RE: [ve-dev] Painting Custom widgets in Swing for VE . |
Hi Rich,
Thanks for the input. But our
requirement is not just to apply a property to the whole
component .
Let us explain more
about our composite object. The
composite component has
two of the properties as
follows.
ComponentHeight
No_of_Display_Items.
The component Height is the height
of the swing widgets inside the panel . Not the height of the panel
itself.
The height of the panel depends on
two aspects that is No_of_Display_Items
and Component height. Depending on
the No_of_Display_Items, we duplicate the
swing widget that many number of
times inside the panel. Hence we have "No_of_Display_Items" number of rows of
the swing widget inside the panel.
You can see the example in the image attachments with this mail.
Pic1.jpg shows a single swing widget inside the panel.(No_of_Display_Items=1)
Pic2.jpg shows multiple swing widget inside the panel. (No_of_Display_Items=3)
Can you please help how do I go
about implementing such a kind of task.
Thanks in
Advance,
Best Regards
Rashmi H.Ramachandra
| "H Ramachandra, Rashmi"
<rashmi.h.ramachandra@xxxxxxx> Sent by: ve-dev-bounces@xxxxxxxxxxx 11/08/2005 03:44 AM
|
|
| "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_______________________________________________
ve-dev
mailing
list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev
Attachment:
pic1.JPG
Description: pic1.JPG
Attachment:
pic2.JPG
Description: pic2.JPG