Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How can i get control of star mouse pointer drag?
How can i get control of star mouse pointer drag? [message #204160] Tue, 02 September 2008 05:53 Go to next message
Eclipse UserFriend
Hello All,

I am facing problem on editpart dragging. I am able to get the dragging
event on editpart select and drag from middle of editpart by mouse the
control calls "getDragTracker" method. But by selecting editpart and
moving mouse side a star mouse pointer getting and drag using this not
calling this "getDragTracker". How can i get control of star mouse pointer
drag?.
^
Star mouse pointer <-|->


Please help me on this.

Thanks In Advance,
Nagesh Y.J.
Re: How can i get control of star mouse pointer drag? [message #206381 is a reply to message #204160] Tue, 23 September 2008 00:44 Go to previous messageGo to next message
Eclipse UserFriend
Hello All,

If the dragging editpart is of type border item editpart, then you need to
pass isMove as true always so that it can't dragged out of its component.
By using BorderItemSelectionEditPolicy you can write like,


return new BorderItemSelectionEditPolicy()
{
@Override
protected void replaceHandleDragEditPartsTracker(Handle handle)
{
if (handle instanceof AbstractHandle)
{
AbstractHandle h = (AbstractHandle) handle;
h.setDragTracker(new DragEditPartsTrackerEx(getHost())
{
@Override
protected boolean isMove()
{
return true;
}
});
}
}
};


Nagesh wrote:

> Hello All,

> I am facing problem on editpart dragging. I am able to get the dragging
> event on editpart select and drag from middle of editpart by mouse the
> control calls "getDragTracker" method. But by selecting editpart and
> moving mouse side a star mouse pointer getting and drag using this not
> calling this "getDragTracker". How can i get control of star mouse pointer
> drag?.
> ^
> Star mouse pointer <-|->


> Please help me on this.

> Thanks In Advance,
> Nagesh Y.J.
Re: How can i get control of star mouse pointer drag? [message #206947 is a reply to message #206381] Thu, 25 September 2008 00:02 Go to previous message
Eclipse UserFriend
Hello All,

If you are dragging a component editpart then override
getPrimaryDragEditPolicy() like below and the control of it,

@Override
public EditPolicy getPrimaryDragEditPolicy()
{
return new ResizableShapeEditPolicy()
{
@Override
protected void replaceHandleDragEditPartsTracker(Handle handle)
{
if (handle instanceof AbstractHandle)
{
AbstractHandle h = (AbstractHandle) handle;
h.setDragTracker(new DragEditPartsTrackerEx(getHost())
{
@Override
protected boolean handleDragStarted()
{
try
{
lockTargetEditPart(getParent());
}
catch (Exception e)
{
FlowVinciDiagramEditorPlugin.getInstance().logException(e);
}
return super.handleDragStarted();
}
});
}
}
};
}
Previous Topic:Changing Link Arrows
Next Topic:CanonicalEditPolicy (shouldDeleteView)
Goto Forum:
  


Current Time: Sat Jul 12 20:24:30 EDT 2025

Powered by FUDForum. Page generated in 0.04789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top