Skip to main content



      Home
Home » Eclipse Projects » GEF » DirectEditProblem- help neede
DirectEditProblem- help neede [message #167319] Mon, 07 February 2005 01:58 Go to next message
Eclipse UserFriend
Originally posted by: swaroop_rks.rediffmail.com

Hi there,

We have an editor implemented in Eclipse2.1 , with provision for
directEdit and AutoLayout using directGraphLayout.


a.)The rootEditPart is ScalableFreeformRootEditpart, (with scroll bar).The
contents of the editors behave as containers and components .The contents
grow and may exceed the viewing region (thats where scrolling helps).
when the user invokes a directEditRequest the label is being shown
on the figure/part on which directEdit is raised - if and only if figure
resides in the bounds of viewer (no scroll), if you scroll on the figure
the labelEditor comes up some where below at the actual position where the
figure would be with out scrolling ,This inturn effectivly means absence
of directEdit support if figure falls some where out which my VDU cann't
show (as it seems to me that DirectEdit does'nt support scrolling) .

What should i do with my cellEditorLocator or any other so that label
shows onthe EditPart (intelligible to scrolling).Or ami missing something
critical ,Isn't it better if GEF's DirectEdit recognize scroll (if it
doesn't ,i am not sure !).

thanks in advance
Re: DirectEditProblem- help neede [message #167340 is a reply to message #167319] Mon, 07 February 2005 09:16 Go to previous messageGo to next message
Eclipse UserFriend
swaroop wrote:

> Hi there,
>
> We have an editor implemented in Eclipse2.1 , with provision for
> directEdit and AutoLayout using directGraphLayout.
>
>
> a.)The rootEditPart is ScalableFreeformRootEditpart, (with scroll bar).The
> contents of the editors behave as containers and components .The contents
> grow and may exceed the viewing region (thats where scrolling helps).
> when the user invokes a directEditRequest the label is being shown
> on the figure/part on which directEdit is raised - if and only if figure
> resides in the bounds of viewer (no scroll), if you scroll on the figure
> the labelEditor comes up some where below at the actual position where the
> figure would be with out scrolling ,This inturn effectivly means absence
> of directEdit support if figure falls some where out which my VDU cann't
> show (as it seems to me that DirectEdit does'nt support scrolling) .
>
> What should i do with my cellEditorLocator or any other so that label
> shows onthe EditPart (intelligible to scrolling).Or ami missing something
> critical ,Isn't it better if GEF's DirectEdit recognize scroll (if it
> doesn't ,i am not sure !).
>
> thanks in advance

In your DirectEditHitTest (or whatever it is called) method you need
something like that

((ScalableFreeformRootEditPart)getRoot()).getFigure().transl ateToParent(rect);

whereas "rect" are the bounds of your label your testing on.

(Assuming your labels parent is the RootEditPart, if not, you need to
translate it further up the chain).

Hope that helps.

Fabian

P.S.: If you use zooming in your editor, don't forget to scale the bounds of
the label your testing on dependant on the zoom level.
@see ScalableFreeformRootEditPart.getZoomManager().getZoom()
Re: DirectEditProblem- help neede [message #167415 is a reply to message #167340] Tue, 08 February 2005 05:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: swaroop_rks.rediffmail.com

Thanks Fabian,

Your answer was really useful and served my cause, by the way -i was
trying out other fncs meant for catering the same ,can some one explain
how absolute and relative differ,

i tried printing the values of absolute and relative loc before & after
scrolling . i could see no difference, i felt that absolute means the
location value as per the display's top-left-corner (treated 0,0)and
Relative in as per Figures' topleft corner - ami wrong some where ?

And when scrolling occurs what are the changes that really occur? i.e how
are the figures layed out when scrolled , i suppose the top-left corner of
display becomes something other than 0,0 then some of the coordinates need
to take negative values, does this happen ?

Obviuosly i am confused here , please elaborate this ,it would be useful
if the explanation was in terms of

void translateFromParent(Translatable t)
void translateToParent(Translatable t)

void translateToAbsolute(Translatable t)
void translateToRelative(Translatable t)

I can tell u that i have understood the first two (some what atleast).the
parent's(treated as Root here) location -at times moves to a diff.
location than that given by dispaly unit's top-left (if u consider
dispaly's top-left as (0,0) always then parent's loc becomes negative ,the
rest of the figures need to be translated by a value equivalent to diff
between display's left-top corner and parents location.

If iam mistaken please correct me , any reference material is appreciated
Re: DirectEditProblem- help neede [message #167423 is a reply to message #167340] Tue, 08 February 2005 05:47 Go to previous message
Eclipse UserFriend
Originally posted by: swaroop_rks.rediffmail.com

Thanks Fabian,

Your answer was really useful and served my cause, by the way -i was
trying out other fncs meant for catering the same ,can some one explain
how absolute and relative differ,

i tried printing the values of absolute and relative loc before & after
scrolling . i could see no difference, i felt that absolute means the
location value as per the display's top-left-corner (treated 0,0)and
Relative in as per Figures' topleft corner - ami wrong some where ?

And when scrolling occurs what are the changes that really occur? i.e how
are the figures layed out when scrolled , i suppose the top-left corner of
display becomes something other than 0,0 then some of the coordinates need
to take negative values, does this happen ?

Obviuosly i am confused here , please elaborate this ,it would be useful
if the explanation was in terms of

void translateFromParent(Translatable t)
void translateToParent(Translatable t)

void translateToAbsolute(Translatable t)
void translateToRelative(Translatable t)

I can tell u that i have understood the first two (some what atleast).the
parent's(treated as Root here) location -at times moves to a diff.
location than that given by dispaly unit's top-left (if u consider
dispaly's top-left as (0,0) always then parent's loc becomes negative ,the
rest of the figures need to be translated by a value equivalent to diff
between display's left-top corner and parents location.

If iam mistaken please correct me , any reference material is appreciated
Previous Topic:Editing JavaBeans in GEF
Next Topic:Scrolling viewer while draging/resizing
Goto Forum:
  


Current Time: Tue Jun 24 01:11:57 EDT 2025

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

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

Back to the top