Skip to main content



      Home
Home » Eclipse Projects » GEF » Preventing certain Figures from influencing Scrolling
Preventing certain Figures from influencing Scrolling [message #88658] Sun, 27 July 2003 23:32 Go to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Hi Guys,

I'm using a FreeformLayer with a FreeformLayout for my Contents EditPart.

I need a certain figure P to have height equal to the currently displayable
area. (It has to span the view from top to bottom). Right now, I implement
this by the following code
in RefreshVisuals in the figures EditPart

Rectangle a = ((GraphicalEditPart)getParent()).getContentPane().getBounds( );
Dimension size = a.getSize();
size.width = SLane.laneWidth;
Rectangle rect = new Rectangle(location, size);

This works fine when I crete this figure.

One problem is; when I create another object say Q (which is an ordinary
rectangle) and move it below the currently displayable area, I get
scrollbars. Good. But P remains the same size; not spanning the displayable
area as required.

If I create another object P at this point, then it obviously is larger; but
the problem will recur when I move Q further down. What scrolling event can
I listen to so that I can refereshVisuals at the right time ?


Another thing, If I move Q back to it's original location I would like the
scroll bars to disappear. They don't because the P figures are larger than
the current displayable area (is this a called viewport ?) which is the
normally required behaviour. However, I'd like that the scroll bars be
independent of object P's size or the P figures automatically resize to the
height of the bounding rectangle for all non P figures ?

Is there any layer that I can place P in ? I don't know exactly where this
behaviour is implemented either...

Thanks,
Brian.
Re: Preventing certain Figures from influencing Scrolling [message #88733 is a reply to message #88658] Mon, 28 July 2003 23:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

I'm going crazy here trying to figure this out.

Could someone at least tell me what I should be subclassing ? Who decides
whether to show the scrollbars or not ? Can I create my own figure that
returns different constraints ?

Usually I can work things out with the Logic example, but here I have
absolutely no clue.


Thanks,
Brian.


"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bg24tm$8o7$1@eclipse.org...
> Hi Guys,
>
> I'm using a FreeformLayer with a FreeformLayout for my Contents EditPart.
>
> I need a certain figure P to have height equal to the currently
displayable
> area. (It has to span the view from top to bottom). Right now, I
implement
> this by the following code
> in RefreshVisuals in the figures EditPart
>
> Rectangle a =
((GraphicalEditPart)getParent()).getContentPane().getBounds( );
> Dimension size = a.getSize();
> size.width = SLane.laneWidth;
> Rectangle rect = new Rectangle(location, size);
>
> This works fine when I crete this figure.
>
> One problem is; when I create another object say Q (which is an ordinary
> rectangle) and move it below the currently displayable area, I get
> scrollbars. Good. But P remains the same size; not spanning the
displayable
> area as required.
>
> If I create another object P at this point, then it obviously is larger;
but
> the problem will recur when I move Q further down. What scrolling event
can
> I listen to so that I can refereshVisuals at the right time ?
>
>
> Another thing, If I move Q back to it's original location I would like the
> scroll bars to disappear. They don't because the P figures are larger than
> the current displayable area (is this a called viewport ?) which is the
> normally required behaviour. However, I'd like that the scroll bars be
> independent of object P's size or the P figures automatically resize to
the
> height of the bounding rectangle for all non P figures ?
>
> Is there any layer that I can place P in ? I don't know exactly where this
> behaviour is implemented either...
>
> Thanks,
> Brian.
>
>
>
>
>
>
>
Re: Preventing certain Figures from influencing Scrolling [message #88765 is a reply to message #88733] Tue, 29 July 2003 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bgrieder.nospam.thanks

I have not done anything like this before, but why don't you try to
reimplement the layout method of the container of P (not to mention the
paint method). Aren't you actually asking the container of P to properly
layout P?



Brian Fernandes wrote:
> I'm going crazy here trying to figure this out.
>
> Could someone at least tell me what I should be subclassing ? Who decides
> whether to show the scrollbars or not ? Can I create my own figure that
> returns different constraints ?
>
> Usually I can work things out with the Logic example, but here I have
> absolutely no clue.
>
>
> Thanks,
> Brian.
>
>
> "Brian Fernandes" <brian.fernandes@codito.com> wrote in message
> news:bg24tm$8o7$1@eclipse.org...
>
>>Hi Guys,
>>
>>I'm using a FreeformLayer with a FreeformLayout for my Contents EditPart.
>>
>>I need a certain figure P to have height equal to the currently
>
> displayable
>
>>area. (It has to span the view from top to bottom). Right now, I
>
> implement
>
>>this by the following code
>>in RefreshVisuals in the figures EditPart
>>
>>Rectangle a =
>
> ((GraphicalEditPart)getParent()).getContentPane().getBounds( );
>
>>Dimension size = a.getSize();
>>size.width = SLane.laneWidth;
>>Rectangle rect = new Rectangle(location, size);
>>
>>This works fine when I crete this figure.
>>
>>One problem is; when I create another object say Q (which is an ordinary
>>rectangle) and move it below the currently displayable area, I get
>>scrollbars. Good. But P remains the same size; not spanning the
>
> displayable
>
>>area as required.
>>
>>If I create another object P at this point, then it obviously is larger;
>
> but
>
>>the problem will recur when I move Q further down. What scrolling event
>
> can
>
>>I listen to so that I can refereshVisuals at the right time ?
>>
>>
>>Another thing, If I move Q back to it's original location I would like the
>>scroll bars to disappear. They don't because the P figures are larger than
>>the current displayable area (is this a called viewport ?) which is the
>>normally required behaviour. However, I'd like that the scroll bars be
>>independent of object P's size or the P figures automatically resize to
>
> the
>
>>height of the bounding rectangle for all non P figures ?
>>
>>Is there any layer that I can place P in ? I don't know exactly where this
>>behaviour is implemented either...
>>
>>Thanks,
>>Brian.
>>
>>
>>
>>
>>
>>
>>
>
>
>
Re: Preventing certain Figures from influencing Scrolling [message #88799 is a reply to message #88658] Tue, 29 July 2003 08:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: g.wagenknecht.planet-wagenknecht.de

Brian Fernandes wrote:

> Rectangle a =
> ((GraphicalEditPart)getParent()).getContentPane().getBounds( );
> Dimension size = a.getSize();
> size.width = SLane.laneWidth;
> Rectangle rect = new Rectangle(location, size);
>
> This works fine when I crete this figure.

Yes, but I think you have to play around with the Viewport. This is a figure
provided by the ScalableFreeformRootEditPart and it handles scrolling. But I
havn't done anythig with it yet.

Cu, Gunnar
Re: Preventing certain Figures from influencing Scrolling [message #88857 is a reply to message #88658] Tue, 29 July 2003 10:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Normally, scrollbar's are determined by the viewport's content's preferred
size. But, since freeform is more difficult problem, it is different.
FreeformViewport uses a modified layout that will first validate() the
contents, causing your diagram to layout. Then, it uses the freeform bounds
to calculate its preferred size.

Can you describe in more detail what you are trying to do? It sounds like
you are displaying something to the user on top of the diagram. You could
always do this in SWT, by creating an overlaying Control, and positioning
this control relative to the Canvas' client area. The other option is to
extend Viewport to manage two figures instead of one. One figure would
scroll, while the other is a glass pane on top of the viewport which never
scrolls.

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bg24tm$8o7$1@eclipse.org...
> Hi Guys,
>
> I'm using a FreeformLayer with a FreeformLayout for my Contents EditPart.
>
> I need a certain figure P to have height equal to the currently
displayable
> area. (It has to span the view from top to bottom). Right now, I
implement
> this by the following code
> in RefreshVisuals in the figures EditPart
>
> Rectangle a =
((GraphicalEditPart)getParent()).getContentPane().getBounds( );
> Dimension size = a.getSize();
> size.width = SLane.laneWidth;
> Rectangle rect = new Rectangle(location, size);
>
> This works fine when I crete this figure.
>
> One problem is; when I create another object say Q (which is an ordinary
> rectangle) and move it below the currently displayable area, I get
> scrollbars. Good. But P remains the same size; not spanning the
displayable
> area as required.
>
> If I create another object P at this point, then it obviously is larger;
but
> the problem will recur when I move Q further down. What scrolling event
can
> I listen to so that I can refereshVisuals at the right time ?
>
>
> Another thing, If I move Q back to it's original location I would like the
> scroll bars to disappear. They don't because the P figures are larger than
> the current displayable area (is this a called viewport ?) which is the
> normally required behaviour. However, I'd like that the scroll bars be
> independent of object P's size or the P figures automatically resize to
the
> height of the bounding rectangle for all non P figures ?
>
> Is there any layer that I can place P in ? I don't know exactly where this
> behaviour is implemented either...
>
> Thanks,
> Brian.
>
>
>
>
>
>
>
Re: Preventing certain Figures from influencing Scrolling [message #88871 is a reply to message #88658] Tue, 29 July 2003 10:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Are you doing swimlanes?

You probably should not be using FreeformGraphicalRootEditPart. See the
post titled:
[INFO] If you are using FreeformGraphicalRootEditPart, ask why
06-02-03
Re: Preventing certain Figures from influencing Scrolling [message #88930 is a reply to message #88871] Tue, 29 July 2003 10:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Randy Hudson wrote:

> Are you doing swimlanes?

> You probably should not be using FreeformGraphicalRootEditPart. See the
> post titled:
> [INFO] If you are using FreeformGraphicalRootEditPart, ask why
> 06-02-03

Hi Randy,
I should have described it a little more in detail earlier.

I'm not too sure of the term swimlanes, but I think that's what I'm doing.

I'm not displaying an overlay (as you stated in your prev. reply) but I
intend to have a lane (rectangluar box) which extends from the top of the
viewport to the bottom. I will be inserting other objects into this lane.
So this lane should extend to + and - infinity.

I want to be able to select the lane also, and most likely it will be the
lowest figure in the viewport, with other objects on top of it.

The swimlanes can be added on demand, just like a normal object.

I'm reading up the other article now.

If something is still not clear, please let me know, I've already spent 2
days trying to figure this out.

Thanks again,
Brian.
Re: Preventing certain Figures from influencing Scrolling [message #88976 is a reply to message #88930] Tue, 29 July 2003 10:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I would have a diagram, which contains lanes, which contain objects. For
vertical lanes, the diagram would be in a ToolbarLayout with horizontal
orientation. Use setMatchMinorAxis(true) to make all lanes the height of
the largest lane.

Toolbar layout will layout the lanes from left to right, giving each one its
width based on its preferred width, and height equal to the height of the
longest lane.

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bg615s$aa8$1@eclipse.org...
> Randy Hudson wrote:
>
> > Are you doing swimlanes?
>
> > You probably should not be using FreeformGraphicalRootEditPart. See the
> > post titled:
> > [INFO] If you are using FreeformGraphicalRootEditPart, ask why
> > 06-02-03
>
> Hi Randy,
> I should have described it a little more in detail earlier.
>
> I'm not too sure of the term swimlanes, but I think that's what I'm doing.
>
> I'm not displaying an overlay (as you stated in your prev. reply) but I
> intend to have a lane (rectangluar box) which extends from the top of the
> viewport to the bottom. I will be inserting other objects into this lane.
> So this lane should extend to + and - infinity.
>
> I want to be able to select the lane also, and most likely it will be the
> lowest figure in the viewport, with other objects on top of it.
>
> The swimlanes can be added on demand, just like a normal object.
>
> I'm reading up the other article now.
>
> If something is still not clear, please let me know, I've already spent 2
> days trying to figure this out.
>
> Thanks again,
> Brian.
>
>
Re: Preventing certain Figures from influencing Scrolling [message #89021 is a reply to message #88871] Tue, 29 July 2003 12:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brianv.phreaker.net

Regarding the FreeformGraphicalRootEditPart, I am using it... this is what
my layout needs are.

1) I would like so support Zooming.
2) Swimlanes are positioned by algorithm.
3) Only one type of object ,say Q can be placed in a swim lane, but has
vertical freedom within the lane.
4) All other objects are placed within Q, but are positioned by algorithm.
(should use a OrderedLayoutPolicy for Q.. right ?)
5) An exception to 4 is a sort of "Note" box (rectangle) that can have any
dimensions and any position.
6) I do not require positioning into negative co-ordinates.

Based on "[INFO] If you are using FreeformGraphicalRootEditPart, ask why", I
should be using
[Scalable]FreeformRootEditPart, right ?

Thanks,
Brian.

Your GEF tutorial is great; going to read it again now. Wish I had it a
couple of weeks ago....
Re: Preventing certain Figures from influencing Scrolling [message #89065 is a reply to message #89021] Tue, 29 July 2003 13:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You should use just ScalableRootEditPart, which was added to 2.1.1.

Freeform is *only* for clients who wish to allow things to be placed using
negative X or Y coordinates.

"Brian Fernandes" <brianv@phreaker.net> wrote in message
news:bg65nf$gbk$1@eclipse.org...
> Regarding the FreeformGraphicalRootEditPart, I am using it... this is what
> my layout needs are.
>
> 1) I would like so support Zooming.
> 2) Swimlanes are positioned by algorithm.
> 3) Only one type of object ,say Q can be placed in a swim lane, but has
> vertical freedom within the lane.
> 4) All other objects are placed within Q, but are positioned by algorithm.
> (should use a OrderedLayoutPolicy for Q.. right ?)
> 5) An exception to 4 is a sort of "Note" box (rectangle) that can have any
> dimensions and any position.
> 6) I do not require positioning into negative co-ordinates.
>
> Based on "[INFO] If you are using FreeformGraphicalRootEditPart, ask why",
I
> should be using
> [Scalable]FreeformRootEditPart, right ?
>
> Thanks,
> Brian.
>
> Your GEF tutorial is great; going to read it again now. Wish I had it a
> couple of weeks ago....
>
>
Re: Preventing certain Figures from influencing Scrolling [message #89080 is a reply to message #88976] Tue, 29 July 2003 13:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brianv.phreaker.net

Randy,
Thanks for the info.

I still have a couple of doubts.

Will this layout .. ToolbarLayout allow certain objects to be placed
anywhere ? Or will it only allow objects in the lanes ?

>Toolbar layout will layout the lanes from left to right, giving each one
its
>width based on its preferred width, and height equal to the height of the
>longest lane.

Who decides the height of the longest lane ? Does it depend on the objects
in the lane ? If so then that's good ... seems to be just the functionality
I need.

Thanks for the time,
Brian.
Re: Preventing certain Figures from influencing Scrolling [message #89108 is a reply to message #89080] Tue, 29 July 2003 14:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Brian Fernandes" <brianv@phreaker.net> wrote in message
news:bg6ano$mff$1@eclipse.org...
> Randy,
> Thanks for the info.
>
> I still have a couple of doubts.
>
> Will this layout .. ToolbarLayout allow certain objects to be placed
> anywhere ? Or will it only allow objects in the lanes ?

You will have two levels of containers, the diagram, and the lanes.
The lanes themselves could be in XYLayout, in which case both the height and
width of the lanes would be determined by the rectangular constraints for
the contents of the lane itself.


>
> >Toolbar layout will layout the lanes from left to right, giving each one
> its
> >width based on its preferred width, and height equal to the height of the
> >longest lane.
>
> Who decides the height of the longest lane ? Does it depend on the
objects
> in the lane ? If so then that's good ... seems to be just the
functionality
> I need.
>
> Thanks for the time,
> Brian.
>
>
>
>
Re: Preventing certain Figures from influencing Scrolling [message #89167 is a reply to message #89108] Wed, 30 July 2003 00:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

"Randy Hudson" <none@us.ibm.com> wrote in message
news:bg6fno$sfr$1@eclipse.org...
>
> "Brian Fernandes" <brianv@phreaker.net> wrote in message
> news:bg6ano$mff$1@eclipse.org...
> > Randy,
> > Thanks for the info.
> >
> > I still have a couple of doubts.
> >
> > Will this layout .. ToolbarLayout allow certain objects to be placed
> > anywhere ? Or will it only allow objects in the lanes ?
>
> You will have two levels of containers, the diagram, and the lanes.
> The lanes themselves could be in XYLayout, in which case both the height
and
> width of the lanes would be determined by the rectangular constraints for
> the contents of the lane itself.
>

I misstated the question.

I can set up my own layout for the objects within the lanes, so the toolbar
layout will be of no concern within the lanes. Got that.

Though the diagram mostly contains lanes, it also requires certain types of
objects (like a comment / note box) to exist at any point in the diagram. I
don't think that's possible with using the ToolbarLayout, is it ? Do I have
to combine both XYLayout and ToolbarLayout for this functionality then ..
(this would behave mostly like XYLayout but treat my lanes specially ?)
Bruno Grieder had suggested that I overried the layout method of the
diagram. I was thinking of overriding the layout method of the
layoutmanager...

I wanted to clarify, if I'm using the ToolbarLayout, I'll have to use an
OrderedLayoutEditPolicy, correct ?

Thanks,
Brian.
Re: Preventing certain Figures from influencing Scrolling [message #89263 is a reply to message #89167] Wed, 30 July 2003 10:31 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> Though the diagram mostly contains lanes, it also requires certain types
of
> objects (like a comment / note box) to exist at any point in the diagram.
I
> don't think that's possible with using the ToolbarLayout, is it ? Do I
have

Correct. You would need either a hybrid layout which divided the children
into those with constraints (the post-it notes), and those without
constraints (the swim lanes). Essentially combining XYLayout and
Toolbarlayout as you've stated.

OR, you could have a diagram with two primary layers. One layer contains
all swim lanes, and one contains post-it notes in XYLayout. I'll bet you
have hte requirement that notes always appear on top of lanes, so this is
perhaps a better approach.

To manage two sets of children, it is common to insert additional
non-interactive editparts. So, your contents editpart would have two
children editparts, one for the lanes, one for floating notes. These two
child editparts cannot be selected, but they can be targeted for creation.
Their model objects are usually some spoofed-up pair, combining the parent's
model obejct (the diagram), plus some bogus identifier for the layer, such
as "lanes".


> to combine both XYLayout and ToolbarLayout for this functionality then ..
> (this would behave mostly like XYLayout but treat my lanes specially ?)
> Bruno Grieder had suggested that I overried the layout method of the
> diagram. I was thinking of overriding the layout method of the
> layoutmanager...
>
> I wanted to clarify, if I'm using the ToolbarLayout, I'll have to use an
> OrderedLayoutEditPolicy, correct ?
Yes, actually, FlowLayoutEditPolicy works fine for this.
>
> Thanks,
> Brian.
>
>
>
>
>
>
Previous Topic:[ANN] Reference Article "Getting Starter" Published
Next Topic:Strip palette from GEF?
Goto Forum:
  


Current Time: Thu Jul 24 18:38:37 EDT 2025

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

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

Back to the top