Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:53 Go to next message
Nagesh is currently offline NageshFriend
Messages: 55
Registered: July 2009
Member
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 04:44 Go to previous messageGo to next message
Nagesh is currently offline NageshFriend
Messages: 55
Registered: July 2009
Member
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 04:02 Go to previous message
Nagesh is currently offline NageshFriend
Messages: 55
Registered: July 2009
Member
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: Wed Apr 24 18:41:47 GMT 2024

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

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

Back to the top