Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Initializing the viewport scroll to location in a scrollable compartment
Initializing the viewport scroll to location in a scrollable compartment [message #178827] Fri, 22 April 2005 17:39
No real name is currently offline No real nameFriend
Messages: 6
Registered: July 2009
Junior Member
Hello,

I have a diagram with a shape that has a scrollable compartment that
contains subshapes. In the scrollable compartment, I can move one of the
subshapes up past the original viewport (which causes the scrollbars to
adjust). If I look at the subshape figure's location, it has a negative y
value. If I close and reopen the diagram, I do not see this subshape with
the negative y value as the viewport is not scrolled to the top-left corner.
The viewport's initial position is (0,0). I want the initial position to be
the top-left most area of my compartment (i.e. the negative y value so that
subshape will show up).

From what I can tell, the viewport's scroll to location is first set in
FreeformViewPort.readjustScrollBars() when the figures are validated:
getVerticalRangeModel().setAll(bounds.y, clientArea.height,
bounds.bottom());
getHorizontalRangeModel().setAll(bounds.x, clientArea.width,
bounds.right());
and it scrolls to location (0,0) just because the DefaultRangeModel has its
value initialized to 0. In other words, it seems to be that the scroll to
location is not being initialized it just happens to be 0 because of the
DefaultRangeModel.

I want to scroll to the minimum x and y values. I am trying to figure out a
way to override this. I could override readjustScrollBars() to set the
value in the vertical/horizontal range model to be the minimum value if this
is the first time readjustScrollBars() is being called. My other option is
to do a scrollTo() on the scrollpane of my compartment figure; however, I
can't find a suitable location where this would be called only once and the
figure world has all been initialized. If I do it in activate() of the
editpart the figures aren't set up yet.

Any suggestions? Is this a Draw2D bug? I think readjustScrollBars() should
set the value in the range models to be the minimum if it hasn't been set
yet.

Thanks,
Cherie
Previous Topic:how to response model elements relation changes
Next Topic:Focus display and traversing
Goto Forum:
  


Current Time: Sun Feb 05 15:28:14 GMT 2023

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

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

Back to the top