Creating links via dragging from anchors [message #146308] |
Tue, 03 August 2004 12:16  |
Eclipse User |
|
|
|
Originally posted by: rsudra.hotmail.com
Dear all,
I was hoping to get some information/direction regarding creating links
between components by dragging from the sources components anchor to the
target components anchor. I am currently using Gef 2.1.2 and it is
unlikely for the moment that we will be upgrading.
Many thanks,
Raj
|
|
|
|
|
|
Re: Creating links via dragging from anchors [message #146459 is a reply to message #146452] |
Wed, 04 August 2004 10:33  |
Eclipse User |
|
|
|
Originally posted by: rsudra.hotmail.com
Thanks Eugene,
i have created my own subtype of NonResizableEditPolicy:
public class DragLinkCreationNonResizableEditPolicy extends
NonResizableEditPolicy {
private final GraphicalEditPart graphicalEditPart;
public DragLinkCreationNonResizableEditPolicy(GraphicalEditPart child)
{
graphicalEditPart = child;
}
protected List createSelectionHandles() {
SquareHandle handle = new SquareHandle(graphicalEditPart,
new RelativeHandleLocator(graphicalEditPart.getFigure(),
PositionConstants.EAST)) {
protected DragTracker createDragTracker() {
return new ConnectionDragCreationTool();
}
};
List selectionHandles = super.createSelectionHandles();
selectionHandles.add(handle);
return selectionHandles;
}
}
I then override XYLayoutEditPolicy.createChildEditPolicy(..) returning the
above edit policy.
It seems to work, but I know want to show feedback when hovering over the
handle that allows creation of links. Would I need to register another
edit policy on my base ComponentGraphEditParts SELECTION_FEEDBACK_ROLE?
Which policy would I subtype?
Is there an alternate way of providing this type of feedback, such as
direct on the GraphEditPart?
TIA,
Raj
---
Eugene Ostroukhov wrote:
> Look at ResizableEditPolicy::createSelectionHandles - there's handle
> creation code there.
|
|
|
Powered by
FUDForum. Page generated in 0.02823 seconds