Home » Eclipse Projects » GEF » DragEditPartsTracker and snapping the source feedback
DragEditPartsTracker and snapping the source feedback [message #187067] |
Fri, 08 July 2005 11:44 |
Eclipse User |
|
|
|
Originally posted by: sidney.lee.ibs.net
Hi! I was wondering whether it was possible to snap the source feedback
figure, pretty much the same way that source feedback figures do when
dragging a View within a Perspective. Have subclassed the
DragEditPartsTracker but, in the handleDrag(), I don't seem to have
acess to the source feedback to be able to reposition and/or resize
it... can anyone point out where I am going wrong?
- Also, was wondering if there is a border similar to that used for
View source feedback figures available anywhere?
many Thanks!
|
|
|
Re: DragEditPartsTracker and snapping the source feedback [message #187168 is a reply to message #187067] |
Fri, 08 July 2005 17:47 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Have you looked at the snapping in the logic example? SnapToHelpers modify
the request to cause snapping, and so feedback and other things don't need
to be modified.
"Sidney Lee" <sidney.lee@ibs.net> wrote in message
news:dalort$bqf$1@news.eclipse.org...
> Hi! I was wondering whether it was possible to snap the source feedback
> figure, pretty much the same way that source feedback figures do when
> dragging a View within a Perspective. Have subclassed the
> DragEditPartsTracker but, in the handleDrag(), I don't seem to have
> acess to the source feedback to be able to reposition and/or resize
> it... can anyone point out where I am going wrong?
> - Also, was wondering if there is a border similar to that used for
> View source feedback figures available anywhere?
>
> many Thanks!
|
|
|
Re: DragEditPartsTracker and snapping the source feedback [message #187251 is a reply to message #187168] |
Mon, 11 July 2005 08:35 |
Eclipse User |
|
|
|
Originally posted by: sidney.lee.ibs.net
Hi! Had a look at the logic example but didn't find much on the
SnapTohelper, except where it is used with reference to SnapToGrid and
SnapToGeomtery (still not sure what SnapToGeomtery is used for). Perhaps
have an out of date version of the example (not sure what version I have).
Anyway, to reiterate, what I am after is more how moving views in a
perspective is handled, i.e. moving a view form the bottom into the
editor snaps the feedback to one of the edges of the workplace based on
cursor position. Or when moved over another view, snaps the feeback to
the whole of that view, or to the left or right half of it, etc.
Thanks in advance!
Pratik Shah wrote:
> Have you looked at the snapping in the logic example? SnapToHelpers modify
> the request to cause snapping, and so feedback and other things don't need
> to be modified.
>
> "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> news:dalort$bqf$1@news.eclipse.org...
>
>>Hi! I was wondering whether it was possible to snap the source feedback
>>figure, pretty much the same way that source feedback figures do when
>>dragging a View within a Perspective. Have subclassed the
>>DragEditPartsTracker but, in the handleDrag(), I don't seem to have
>>acess to the source feedback to be able to reposition and/or resize
>>it... can anyone point out where I am going wrong?
>> - Also, was wondering if there is a border similar to that used for
>>View source feedback figures available anywhere?
>>
>>many Thanks!
>
>
>
|
|
|
Re: DragEditPartsTracker and snapping the source feedback [message #187288 is a reply to message #187251] |
Mon, 11 July 2005 16:15 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
"Sidney Lee" <sidney.lee@ibs.net> wrote in message
news:datate$7vd$1@news.eclipse.org...
> Hi! Had a look at the logic example but didn't find much on the
> SnapTohelper, except where it is used with reference to SnapToGrid and
> SnapToGeomtery (still not sure what SnapToGeomtery is used for). Perhaps
> have an out of date version of the example (not sure what version I have).
Look at the New and Noteworthy for the 3.0 GEF release.
>
> Anyway, to reiterate, what I am after is more how moving views in a
> perspective is handled, i.e. moving a view form the bottom into the
> editor snaps the feedback to one of the edges of the workplace based on
> cursor position. Or when moved over another view, snaps the feeback to
> the whole of that view, or to the left or right half of it, etc.
Are you talking about when dragging EditParts in a graphical viewer?
>
> Thanks in advance!
>
>
> Pratik Shah wrote:
> > Have you looked at the snapping in the logic example? SnapToHelpers
modify
> > the request to cause snapping, and so feedback and other things don't
need
> > to be modified.
> >
> > "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> > news:dalort$bqf$1@news.eclipse.org...
> >
> >>Hi! I was wondering whether it was possible to snap the source feedback
> >>figure, pretty much the same way that source feedback figures do when
> >>dragging a View within a Perspective. Have subclassed the
> >>DragEditPartsTracker but, in the handleDrag(), I don't seem to have
> >>acess to the source feedback to be able to reposition and/or resize
> >>it... can anyone point out where I am going wrong?
> >> - Also, was wondering if there is a border similar to that used for
> >>View source feedback figures available anywhere?
> >>
> >>many Thanks!
> >
> >
> >
|
|
|
Re: DragEditPartsTracker and snapping the source feedback [message #187382 is a reply to message #187288] |
Tue, 12 July 2005 10:30 |
Eclipse User |
|
|
|
Originally posted by: sidney.lee.ibs.net
Thanks, Pratik!
Yes, I am talking about dragging edit parts in a viewer. Am creating an
editor for customising views within in a perspective w.r.t. location,
size, etc.... So far, have implemented showLayoutTargetFeedback() in the
XYLayoutEditPolicy for the Perspective (my top-level model object) which
has allowed me to create a protoype of snapping views to the appropriate
edge as determined by the mouse location. This would be applicable for a
move, add or create (for create, I have had to update the newObject
directly w.r.t. location/size as updating the request has no affect
since the CreateCommand has already been initialized at this point).
I am on the right track now or? If so: I have a few problems:
(i)My perspective is a Freeformlayer and seems to be resizing itself
when the feedback figure is being moved/resized during the drag - how
can I prevent this?
(ii) when I use the client area to determine the new bounds for the
view, any existing children of the perspective are not considered. How
do I take children into consideration when calculating bounds?
I final question and comes form being a bit of a novice: could u
perhaps explain the concepts of constraints and insets?
Sorry, I know its a lot but am extremely grateful for any assistance :)
Many Thanks!
Pratik Shah wrote:
> "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> news:datate$7vd$1@news.eclipse.org...
>
>>Hi! Had a look at the logic example but didn't find much on the
>>SnapTohelper, except where it is used with reference to SnapToGrid and
>>SnapToGeomtery (still not sure what SnapToGeomtery is used for). Perhaps
>>have an out of date version of the example (not sure what version I have).
>
>
> Look at the New and Noteworthy for the 3.0 GEF release.
>
>
>>Anyway, to reiterate, what I am after is more how moving views in a
>>perspective is handled, i.e. moving a view form the bottom into the
>>editor snaps the feedback to one of the edges of the workplace based on
>>cursor position. Or when moved over another view, snaps the feeback to
>>the whole of that view, or to the left or right half of it, etc.
>
>
> Are you talking about when dragging EditParts in a graphical viewer?
>
>
>>Thanks in advance!
>>
>>
>>Pratik Shah wrote:
>>
>>>Have you looked at the snapping in the logic example? SnapToHelpers
>
> modify
>
>>>the request to cause snapping, and so feedback and other things don't
>
> need
>
>>>to be modified.
>>>
>>>"Sidney Lee" <sidney.lee@ibs.net> wrote in message
>>>news:dalort$bqf$1@news.eclipse.org...
>>>
>>>
>>>>Hi! I was wondering whether it was possible to snap the source feedback
>>>>figure, pretty much the same way that source feedback figures do when
>>>>dragging a View within a Perspective. Have subclassed the
>>>>DragEditPartsTracker but, in the handleDrag(), I don't seem to have
>>>>acess to the source feedback to be able to reposition and/or resize
>>>>it... can anyone point out where I am going wrong?
>>>> - Also, was wondering if there is a border similar to that used for
>>>>View source feedback figures available anywhere?
>>>>
>>>>many Thanks!
>>>
>>>
>>>
>
>
|
|
|
Re: DragEditPartsTracker and snapping the source feedback [message #187390 is a reply to message #187288] |
Tue, 12 July 2005 11:29 |
Eclipse User |
|
|
|
Originally posted by: sidney.lee.ibs.net
Thanks, Pratik!
Yes, I am talking about dragging edit parts in a viewer. Am creating an
editor for customising views within in a perspective w.r.t. location,
size, etc.... So far, have implemented showLayoutTargetFeedback() in the
XYLayoutEditPolicy for the Perspective (my top-level model object) which
has allowed me to create a protoype of snapping views to the appropriate
edge as determined by the mouse location. This would be applicable for a
move, add or create (for create, I have had to update the newObject
directly w.r.t. location/size as updating the request has no affect
since the CreateCommand has already been initialized at this point).
Am I on the right track now or? If so: I have a few problems:
(i) my perspective is a Freeformlayer and seems to be resizing itself
when the feedback figure is being moved/resized during the drag - how
can I prevent this?
(ii) when I use the client area to determine the new bounds for the
view, any existing children of the perspective are not considered. How
do I take children into consideration when calculating bounds?
(iii) when creating a view and the parent is the perspective, I need to
create a container for the view... what is the best way to handle this
i.e. to create both a container for views and the view itself - should I
create a subclass of my CreateCommand specifically for views (to create
both container and child ) and retunr that command in the
getCreatCommand()... or is there a better more elegant solution?
A final question and comes form being a bit of a novice: could u
perhaps explain the concepts of constraints and insets?
Sorry, I know its a lot but would be extremely grateful for any assistance.
Many Thanks!
Pratik Shah wrote:
> "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> news:datate$7vd$1@news.eclipse.org...
>
>>Hi! Had a look at the logic example but didn't find much on the
>>SnapTohelper, except where it is used with reference to SnapToGrid and
>>SnapToGeomtery (still not sure what SnapToGeomtery is used for). Perhaps
>>have an out of date version of the example (not sure what version I have).
>
>
> Look at the New and Noteworthy for the 3.0 GEF release.
>
>
>>Anyway, to reiterate, what I am after is more how moving views in a
>>perspective is handled, i.e. moving a view form the bottom into the
>>editor snaps the feedback to one of the edges of the workplace based on
>>cursor position. Or when moved over another view, snaps the feeback to
>>the whole of that view, or to the left or right half of it, etc.
>
>
> Are you talking about when dragging EditParts in a graphical viewer?
>
>
>>Thanks in advance!
>>
>>
>>Pratik Shah wrote:
>>
>>>Have you looked at the snapping in the logic example? SnapToHelpers
>
> modify
>
>>>the request to cause snapping, and so feedback and other things don't
>
> need
>
>>>to be modified.
>>>
>>>"Sidney Lee" <sidney.lee@ibs.net> wrote in message
>>>news:dalort$bqf$1@news.eclipse.org...
>>>
>>>
>>>>Hi! I was wondering whether it was possible to snap the source feedback
>>>>figure, pretty much the same way that source feedback figures do when
>>>>dragging a View within a Perspective. Have subclassed the
>>>>DragEditPartsTracker but, in the handleDrag(), I don't seem to have
>>>>acess to the source feedback to be able to reposition and/or resize
>>>>it... can anyone point out where I am going wrong?
>>>> - Also, was wondering if there is a border similar to that used for
>>>>View source feedback figures available anywhere?
>>>>
>>>>many Thanks!
>>>
>>>
>>>
>
>
|
|
|
Re: DragEditPartsTracker and snapping the source feedback [message #187707 is a reply to message #187390] |
Thu, 14 July 2005 18:24 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
"Sidney Lee" <sidney.lee@ibs.net> wrote in message
news:db09ff$tab$1@news.eclipse.org...
> Thanks, Pratik!
>
> Yes, I am talking about dragging edit parts in a viewer. Am creating an
> editor for customising views within in a perspective w.r.t. location,
> size, etc.... So far, have implemented showLayoutTargetFeedback() in the
> XYLayoutEditPolicy for the Perspective (my top-level model object) which
> has allowed me to create a protoype of snapping views to the appropriate
> edge as determined by the mouse location. This would be applicable for a
> move, add or create (for create, I have had to update the newObject
> directly w.r.t. location/size as updating the request has no affect
> since the CreateCommand has already been initialized at this point).
You should still implement the snap strategy by subclassing SnapToHelper.
This will update the request in the tool itself, before the EditPart is
asked for a command for that request. Re-use between different actions
(creation, move, add) will be easier as well.
>
> Am I on the right track now or? If so: I have a few problems:
> (i) my perspective is a Freeformlayer and seems to be resizing itself
> when the feedback figure is being moved/resized during the drag - how
> can I prevent this?
Your editor is showing the layout of an Eclipse perspective, right? So,
your editor never has any scrollbars? You can just remove the
AutoExposeHelper that is returned from the getAdapter() method of your root
editpart.
> (ii) when I use the client area to determine the new bounds for the
> view, any existing children of the perspective are not considered. How
> do I take children into consideration when calculating bounds?
This question is not clear to me.
> (iii) when creating a view and the parent is the perspective, I need to
> create a container for the view... what is the best way to handle this
> i.e. to create both a container for views and the view itself - should I
> create a subclass of my CreateCommand specifically for views (to create
> both container and child ) and retunr that command in the
> getCreatCommand()... or is there a better more elegant solution?
Is there any reason to think why handling this in the CreateCommand is not
elegant? That is the ideal way.
>
> A final question and comes form being a bit of a novice: could u
> perhaps explain the concepts of constraints and insets?
Insets indicate the space that a figure must leave at each of its edges for
the border to be drawn.
Bounds - Insets = Client Area
Constraint ~~ SWT's LayoutData
Constraint provides some information that helps the layout manager lay out
the child figure in question.
Eg., for BorderLayout, the constraints specify whether a given child is top,
left, right, bottom or center. Without this information, the layout manager
doesn't know where to put the child.
>
> Sorry, I know its a lot but would be extremely grateful for any
assistance.
>
> Many Thanks!
>
> Pratik Shah wrote:
> > "Sidney Lee" <sidney.lee@ibs.net> wrote in message
> > news:datate$7vd$1@news.eclipse.org...
> >
> >>Hi! Had a look at the logic example but didn't find much on the
> >>SnapTohelper, except where it is used with reference to SnapToGrid and
> >>SnapToGeomtery (still not sure what SnapToGeomtery is used for). Perhaps
> >>have an out of date version of the example (not sure what version I
have).
> >
> >
> > Look at the New and Noteworthy for the 3.0 GEF release.
> >
> >
> >>Anyway, to reiterate, what I am after is more how moving views in a
> >>perspective is handled, i.e. moving a view form the bottom into the
> >>editor snaps the feedback to one of the edges of the workplace based on
> >>cursor position. Or when moved over another view, snaps the feeback to
> >>the whole of that view, or to the left or right half of it, etc.
> >
> >
> > Are you talking about when dragging EditParts in a graphical viewer?
> >
> >
> >>Thanks in advance!
> >>
> >>
> >>Pratik Shah wrote:
> >>
> >>>Have you looked at the snapping in the logic example? SnapToHelpers
> >
> > modify
> >
> >>>the request to cause snapping, and so feedback and other things don't
> >
> > need
> >
> >>>to be modified.
> >>>
> >>>"Sidney Lee" <sidney.lee@ibs.net> wrote in message
> >>>news:dalort$bqf$1@news.eclipse.org...
> >>>
> >>>
> >>>>Hi! I was wondering whether it was possible to snap the source
feedback
> >>>>figure, pretty much the same way that source feedback figures do when
> >>>>dragging a View within a Perspective. Have subclassed the
> >>>>DragEditPartsTracker but, in the handleDrag(), I don't seem to have
> >>>>acess to the source feedback to be able to reposition and/or resize
> >>>>it... can anyone point out where I am going wrong?
> >>>> - Also, was wondering if there is a border similar to that used for
> >>>>View source feedback figures available anywhere?
> >>>>
> >>>>many Thanks!
> >>>
> >>>
> >>>
> >
> >
|
|
|
Goto Forum:
Current Time: Thu Dec 12 18:14:39 GMT 2024
Powered by FUDForum. Page generated in 0.03671 seconds
|