Creating links via dragging from anchors [message #146308] |
Tue, 03 August 2004 16:16 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #146317 is a reply to message #146308] |
Tue, 03 August 2004 17:19 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: none.us.ibm.com
Create a handle and place it on the handle layer. have the handle return
the ConnectionDragCreationTool.
"Rajeev Sudra" <rsudra@hotmail.com> wrote in message
news:ceodpa$5v7$1@eclipse.org...
> 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 #146440 is a reply to message #146317] |
Wed, 04 August 2004 10:54 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: rsudra.hotmail.com
I create my on handle as:
Handle dragLinkCreationHandle = new SquareHandle() {
protected DragTracker createDragTracker() {
return new ConnectionDragCreationTool();
}
};
in the edit parts constructor but how do I I add it to the edit parts
handle layer. Calling getLayer(...) in the constructor throws an NPE (prob
because the layers are initialised later).
On my editpart (representing a component, not a connection) where do I add
the handle? Is there a way of giving the handle visual selection feedback?
Not sure if it is relevant but my editpart returns an input and output
ConnectionAnchor, perhaps there is a way of adding the handle to that
along with the visual feedback?
Randy Hudson wrote:
> Create a handle and place it on the handle layer. have the handle return
> the ConnectionDragCreationTool.
|
|
|
Re: Creating links via dragging from anchors [message #146452 is a reply to message #146440] |
Wed, 04 August 2004 11:56 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: eostroukhov.hotmail.com
Look at ResizableEditPolicy::createSelectionHandles - there's handle
creation code there.
"Rajeev Sudra" <rsudra@hotmail.com> wrote in message
news:ceqf9m$5dv$1@eclipse.org...
> I create my on handle as:
>
> Handle dragLinkCreationHandle = new SquareHandle() {
> protected DragTracker createDragTracker() {
> return new ConnectionDragCreationTool();
> }
> };
>
> in the edit parts constructor but how do I I add it to the edit parts
> handle layer. Calling getLayer(...) in the constructor throws an NPE (prob
> because the layers are initialised later).
>
> On my editpart (representing a component, not a connection) where do I add
> the handle? Is there a way of giving the handle visual selection feedback?
>
> Not sure if it is relevant but my editpart returns an input and output
> ConnectionAnchor, perhaps there is a way of adding the handle to that
> along with the visual feedback?
>
>
> Randy Hudson wrote:
>
> > Create a handle and place it on the handle layer. have the handle
return
> > the ConnectionDragCreationTool.
>
>
>
|
|
|
Re: Creating links via dragging from anchors [message #146459 is a reply to message #146452] |
Wed, 04 August 2004 14:33 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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.04323 seconds