Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to turn-off the automatically refocusing support for editpart
How to turn-off the automatically refocusing support for editpart [message #42372] Fri, 15 November 2002 03:28 Go to next message
Zhu Jun (Joe) is currently offline Zhu Jun (Joe)Friend
Messages: 15
Registered: July 2009
Junior Member
Currently in the GEF editor, when an EditPart is selected , if it is not
completely visible in the canvas, the client area will be refoucsed to
make it visible.

The problem here is I hava a big drawing paper editpart, and everytime I
click anywhere on the paper, the client area will be refocused to the
initial position (with the paper at top-left), and this is really annoying.

My question is is there any way for me turn off the re-focus support for
the drawing paper editpart only, or if it difficult, can I turn off the
re-focusing capability for the whole editor.

Thanks.
Re: How to turn-off the automatically refocusing support for editpart [message #42802 is a reply to message #42372] Fri, 15 November 2002 21:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

"Joe" <zhujun@cn.ibm.com> wrote in message
news:ar1pkh$n5r$1@rogue.oti.com...
> Currently in the GEF editor, when an EditPart is selected , if it is not
> completely visible in the canvas, the client area will be refoucsed to
> make it visible.
>
> The problem here is I hava a big drawing paper editpart, and everytime I
> click anywhere on the paper, the client area will be refocused to the
> initial position (with the paper at top-left), and this is really
annoying.

You "contents" EditPart (a.k.a. drawing paper editpart) cannot be dragged.
It should return MarqueeDragTracker or DeselectAllDragTracker in the method
getDragTracker(Request).

> My question is is there any way for me turn off the re-focus support for
> the drawing paper editpart only, or if it difficult, can I turn off the
> re-focusing capability for the whole editor.
>
> Thanks.
>
Re: How to turn-off the automatically refocusing support for editpart [message #43114 is a reply to message #42802] Sat, 16 November 2002 06:04 Go to previous messageGo to next message
Zhu Jun (Joe) is currently offline Zhu Jun (Joe)Friend
Messages: 15
Registered: July 2009
Junior Member
Thanks Randy, now the problem of automatic refocusing is solved,

But after returning MarqueeDragTracker or DeselectAllTracker from an
EditPart, the EditPart can no longer be selected in the drawing canvas any
longer. Is there any method to solve this new problem?

Randy Hudson wrote:

> \"Joe\" <zhujun@cn.ibm.com> wrote in message
> news:ar1pkh$n5r$1@rogue.oti.com...
> > Currently in the GEF editor, when an EditPart is selected , if it is not
> > completely visible in the canvas, the client area will be refoucsed to
> > make it visible.
> >
> > The problem here is I hava a big drawing paper editpart, and everytime I
> > click anywhere on the paper, the client area will be refocused to the
> > initial position (with the paper at top-left), and this is really
> annoying.

> You \"contents\" EditPart (a.k.a. drawing paper editpart) cannot be dragged.
> It should return MarqueeDragTracker or DeselectAllDragTracker in the method
> getDragTracker(Request).

> > My question is is there any way for me turn off the re-focus support for
> > the drawing paper editpart only, or if it difficult, can I turn off the
> > re-focusing capability for the whole editor.
> >
> > Thanks.
> >
Re: How to turn-off the automatically refocusing support for editpart [message #43144 is a reply to message #43114] Sat, 16 November 2002 17:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

"Joe" <zhujun@cn.ibm.com> wrote in message
news:ar4n5i$4r3$1@rogue.oti.com...
> Thanks Randy, now the problem of automatic refocusing is solved,
>
> But after returning MarqueeDragTracker or DeselectAllTracker from an
> EditPart, the EditPart can no longer be selected in the drawing canvas any
> longer. Is there any method to solve this new problem?

That's not true actually. Anytime nothing is selected, the "contents" is
implicitly selected.
This is why you see in the Logic Example a Connection Router property in the
Property Sheet.

> Randy Hudson wrote:
>
> > \"Joe\" <zhujun@cn.ibm.com> wrote in message
> > news:ar1pkh$n5r$1@rogue.oti.com...
> > > Currently in the GEF editor, when an EditPart is selected , if it is
not
> > > completely visible in the canvas, the client area will be refoucsed to
> > > make it visible.
> > >
> > > The problem here is I hava a big drawing paper editpart, and everytime
I
> > > click anywhere on the paper, the client area will be refocused to the
> > > initial position (with the paper at top-left), and this is really
> > annoying.
>
> > You \"contents\" EditPart (a.k.a. drawing paper editpart) cannot be
dragged.
> > It should return MarqueeDragTracker or DeselectAllDragTracker in the
method
> > getDragTracker(Request).
>
> > > My question is is there any way for me turn off the re-focus support
for
> > > the drawing paper editpart only, or if it difficult, can I turn off
the
> > > re-focusing capability for the whole editor.
> > >
> > > Thanks.
> > >
>
>
>
>
>
Re: How to turn-off the automatically refocusing support for editpart [message #43181 is a reply to message #43144] Mon, 18 November 2002 01:59 Go to previous messageGo to next message
Zhu Jun (Joe) is currently offline Zhu Jun (Joe)Friend
Messages: 15
Registered: July 2009
Junior Member
Sorry I have not described my problem clearly. Yes, the content get
automatically selected by default.

My new problem here is that I have another kind of editpart called "Lane"
in the "contents". Lane is not a container, but it is designed to hold
other editparts. I want to have the lane being selected without
re-centering it in the ClientArea, but currently if I return
MarqueeDragTracker or DeselectAllTracker from the LaneEditPart. Everytime
I want to have the lane be selected by clicking inside of the lane, the
result is the "contents" gets selected.

So I want to know which class is responsible for re-adjust the location of
an editpart when it is selected in GEF implementation classes, and is
there possibility for me to turnoff this capability by overriding certain
methods in this class.

Randy Hudson wrote:

> "Joe" <zhujun@cn.ibm.com> wrote in message
> news:ar4n5i$4r3$1@rogue.oti.com...
> > Thanks Randy, now the problem of automatic refocusing is solved,
> >
> > But after returning MarqueeDragTracker or DeselectAllTracker from an
> > EditPart, the EditPart can no longer be selected in the drawing canvas any
> > longer. Is there any method to solve this new problem?

> That's not true actually. Anytime nothing is selected, the "contents" is
> implicitly selected.
> This is why you see in the Logic Example a Connection Router property in the
> Property Sheet.

> > Randy Hudson wrote:
> >
> > > \"Joe\" <zhujun@cn.ibm.com> wrote in message
> > > news:ar1pkh$n5r$1@rogue.oti.com...
> > > > Currently in the GEF editor, when an EditPart is selected , if it is
> not
> > > > completely visible in the canvas, the client area will be refoucsed to
> > > > make it visible.
> > > >
> > > > The problem here is I hava a big drawing paper editpart, and everytime
> I
> > > > click anywhere on the paper, the client area will be refocused to the
> > > > initial position (with the paper at top-left), and this is really
> > > annoying.
> >
> > > You \"contents\" EditPart (a.k.a. drawing paper editpart) cannot be
> dragged.
> > > It should return MarqueeDragTracker or DeselectAllDragTracker in the
> method
> > > getDragTracker(Request).
> >
> > > > My question is is there any way for me turn off the re-focus support
> for
> > > > the drawing paper editpart only, or if it difficult, can I turn off
> the
> > > > re-focusing capability for the whole editor.
> > > >
> > > > Thanks.
> > > >
> >
> >
> >
> >
> >
Re: How to turn-off the automatically refocusing support for editpart [message #43370 is a reply to message #43181] Mon, 18 November 2002 13:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

> Sorry I have not described my problem clearly. Yes, the content get
> automatically selected by default.

> My new problem here is that I have another kind of editpart called "Lane"
> in the "contents". Lane is not a container, but it is designed to hold
> other editparts. I want to have the lane being selected without
> re-centering it in the ClientArea, but currently if I return
> MarqueeDragTracker or DeselectAllTracker from the LaneEditPart. Everytime
> I want to have the lane be selected by clicking inside of the lane, the
> result is the "contents" gets selected.
>
> So I want to know which class is responsible for re-adjust the location of
> an editpart when it is selected in GEF implementation classes, and is
> there possibility for me to turnoff this capability by overriding certain
> methods in this class.

This behavior is implemented in the various select methods on
AbstractEditPartViewer. We will remove it there, but we will reimplement
this behavior again during keyboard selection changes,
SelectEditPartTracker, and other places, by calling a new method
EditPartViewer#reveal(EditPart).

I knew we were making an assumption that wasn't valid, and now there is a
good example. We added this behavior for keyboard usage. Assuming you have
lanes running vertically, you probably will still want to scroll
horizontally so that keyboard users can navigate across lanes with the
keyboard. Being an IBMer, I'm sure accessibility is a concern of yours.
You'll probably want to extend GraphicalKeyHandler so that up/down (again,
still assuming vertical lanes) scrolls the view vertically by a "line"
increment, without changing focus/selection.

Maybe you have to do nothing at all if we change the way large EditParts are
exposed. Large being defined as an EditPart which cannot be exposed in the
Viewport entirely. If scrolling in the x or y direction does not show more
of the EditPart, then no scrolling along that direction would occur.

You should open a bugzilla. We would appreciate any help here. If you want
to try making the changes yourself, the code to modify/override is found in
ScrollingGraphicalViewer#expose(EditPart) if you are using the Viewer,
otherwise it is in ViewportExposeHelper#expose(EditPart).

> Randy Hudson wrote:
>
> > "Joe" <zhujun@cn.ibm.com> wrote in message
> > news:ar4n5i$4r3$1@rogue.oti.com...
> > > Thanks Randy, now the problem of automatic refocusing is solved,
> > >
> > > But after returning MarqueeDragTracker or DeselectAllTracker from an
> > > EditPart, the EditPart can no longer be selected in the drawing canvas
any
> > > longer. Is there any method to solve this new problem?
>
> > That's not true actually. Anytime nothing is selected, the "contents"
is
> > implicitly selected.
> > This is why you see in the Logic Example a Connection Router property in
the
> > Property Sheet.
>
> > > Randy Hudson wrote:
> > >
> > > > \"Joe\" <zhujun@cn.ibm.com> wrote in message
> > > > news:ar1pkh$n5r$1@rogue.oti.com...
> > > > > Currently in the GEF editor, when an EditPart is selected , if it
is
> > not
> > > > > completely visible in the canvas, the client area will be
refoucsed to
> > > > > make it visible.
> > > > >
> > > > > The problem here is I hava a big drawing paper editpart, and
everytime
> > I
> > > > > click anywhere on the paper, the client area will be refocused to
the
> > > > > initial position (with the paper at top-left), and this is really
> > > > annoying.
> > >
> > > > You \"contents\" EditPart (a.k.a. drawing paper editpart) cannot be
> > dragged.
> > > > It should return MarqueeDragTracker or DeselectAllDragTracker in the
> > method
> > > > getDragTracker(Request).
> > >
> > > > > My question is is there any way for me turn off the re-focus
support
> > for
> > > > > the drawing paper editpart only, or if it difficult, can I turn
off
> > the
> > > > > re-focusing capability for the whole editor.
> > > > >
> > > > > Thanks.
> > > > >
> > >
> > >
> > >
> > >
> > >
>
>
>
>
>
Re: How to turn-off the automatically refocusing support for editpart [message #43523 is a reply to message #43370] Tue, 19 November 2002 08:38 Go to previous message
Zhu Jun (Joe) is currently offline Zhu Jun (Joe)Friend
Messages: 15
Registered: July 2009
Junior Member
Hi, Randy

The ScrollingGraphicalViewer::expose method is changed as following and
the problem is solved.

protected void expose(com.ibm.etools.gef.EditPart part){
super.expose(part);
Viewport port = getFigureCanvas().getViewport();
IFigure target = ((GraphicalEditPart)part).getFigure();
Rectangle exposeRegion = target.getBounds().getExpanded(5,5);
target = target.getParent();
while (target != null && target != port){
target.translateToParent(exposeRegion);
target = target.getParent();
}
Dimension viewportSize = port.getClientArea().getSize();

// Zhu Jun(Joe) added here
if (exposeRegion.width > viewportSize.width || exposeRegion.height >
viewportSize.height) return;

Point topLeft = exposeRegion.getTopLeft();
Point bottomRight = exposeRegion.
getBottomRight().
translate(viewportSize.negate());
Point finalLocation = Point.min(topLeft,
Point.max(bottomRight, port.getViewLocation()));
getFigureCanvas().scrollSmoothTo(finalLocation.x, finalLocation.y);
}

Thanks for help,

Randy Hudson wrote:

> > Sorry I have not described my problem clearly. Yes, the content get
> > automatically selected by default.

> > My new problem here is that I have another kind of editpart called "Lane"
> > in the "contents". Lane is not a container, but it is designed to hold
> > other editparts. I want to have the lane being selected without
> > re-centering it in the ClientArea, but currently if I return
> > MarqueeDragTracker or DeselectAllTracker from the LaneEditPart. Everytime
> > I want to have the lane be selected by clicking inside of the lane, the
> > result is the "contents" gets selected.
> >
> > So I want to know which class is responsible for re-adjust the location of
> > an editpart when it is selected in GEF implementation classes, and is
> > there possibility for me to turnoff this capability by overriding certain
> > methods in this class.

> This behavior is implemented in the various select methods on
> AbstractEditPartViewer. We will remove it there, but we will reimplement
> this behavior again during keyboard selection changes,
> SelectEditPartTracker, and other places, by calling a new method
> EditPartViewer#reveal(EditPart).

> I knew we were making an assumption that wasn't valid, and now there is a
> good example. We added this behavior for keyboard usage. Assuming you have
> lanes running vertically, you probably will still want to scroll
> horizontally so that keyboard users can navigate across lanes with the
> keyboard. Being an IBMer, I'm sure accessibility is a concern of yours.
> You'll probably want to extend GraphicalKeyHandler so that up/down (again,
> still assuming vertical lanes) scrolls the view vertically by a "line"
> increment, without changing focus/selection.

> Maybe you have to do nothing at all if we change the way large EditParts are
> exposed. Large being defined as an EditPart which cannot be exposed in the
> Viewport entirely. If scrolling in the x or y direction does not show more
> of the EditPart, then no scrolling along that direction would occur.

> You should open a bugzilla. We would appreciate any help here. If you want
> to try making the changes yourself, the code to modify/override is found in
> ScrollingGraphicalViewer#expose(EditPart) if you are using the Viewer,
> otherwise it is in ViewportExposeHelper#expose(EditPart).

> > Randy Hudson wrote:
> >
> > > "Joe" <zhujun@cn.ibm.com> wrote in message
> > > news:ar4n5i$4r3$1@rogue.oti.com...
> > > > Thanks Randy, now the problem of automatic refocusing is solved,
> > > >
> > > > But after returning MarqueeDragTracker or DeselectAllTracker from an
> > > > EditPart, the EditPart can no longer be selected in the drawing canvas
> any
> > > > longer. Is there any method to solve this new problem?
> >
> > > That's not true actually. Anytime nothing is selected, the "contents"
> is
> > > implicitly selected.
> > > This is why you see in the Logic Example a Connection Router property in
> the
> > > Property Sheet.
> >
> > > > Randy Hudson wrote:
> > > >
> > > > > \"Joe\" <zhujun@cn.ibm.com> wrote in message
> > > > > news:ar1pkh$n5r$1@rogue.oti.com...
> > > > > > Currently in the GEF editor, when an EditPart is selected , if it
> is
> > > not
> > > > > > completely visible in the canvas, the client area will be
> refoucsed to
> > > > > > make it visible.
> > > > > >
> > > > > > The problem here is I hava a big drawing paper editpart, and
> everytime
> > > I
> > > > > > click anywhere on the paper, the client area will be refocused to
> the
> > > > > > initial position (with the paper at top-left), and this is really
> > > > > annoying.
> > > >
> > > > > You \"contents\" EditPart (a.k.a. drawing paper editpart) cannot be
> > > dragged.
> > > > > It should return MarqueeDragTracker or DeselectAllDragTracker in the
> > > method
> > > > > getDragTracker(Request).
> > > >
> > > > > > My question is is there any way for me turn off the re-focus
> support
> > > for
> > > > > > the drawing paper editpart only, or if it difficult, can I turn
> off
> > > the
> > > > > > re-focusing capability for the whole editor.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> >
> >
> >
> >
> >
Previous Topic:is it possible to hide connections, like in visual age
Next Topic:Determining bounds for Label text
Goto Forum:
  


Current Time: Fri Dec 27 03:43:25 GMT 2024

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

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

Back to the top