Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] Difference in Behavior between Drag and Drop [using TemplateTransferDropTargetListener] and Click and Drop [using Creation Tool]

Hi,

I encountered a minor bug in my aaplication probabaly because of some error on my side and would be glad if any one of you can point that out.The bug (difference in behavior when doing a drag and drop from palette and when doing a click and drop from palette) is described below:

Say I have a Figure [A sub class of Shape] and there's an edit part and model corresponding to this shape
The figure that i create also has a label within it.(The label is added to the shape in the paintFigure method which has been subclassed)

Now in my edit part's perform request method the bounds of the label is same as the bounds of the figure/ shape in case of drag and drop (TemplateTransferDropTargetListener) which is what  I desire but in case of  click and drop (Creation Tool) its not the same.

I have fixed it by doing the following:
While creating the shape I add the label to the Shape
In the paint figure method I set the size of the label to be the same as that of shape

Although the above fix has so far wroked fine for me I wanted to know why does the two approaches of drag and drop and click and drop behave diffrently with regards to setting the bounds of the label and if there is some better fix which I should incorporate

Thanks alot for your help in advance

--
Regards,
Siddharth

Back to the top