Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » collapse/expand nested container problem
collapse/expand nested container problem [message #152327] Wed, 29 September 2004 00:34 Go to next message
Eclipse UserFriend
Originally posted by: zenilnh.infotech.stph.net

Hi Guys,

I am trying to create a Collapsible container figure in GEF.I have attached
an image of what have I achieved so far-"image1.gif"

What i have done is extend the GroupBoxBorder to draw icons and label on it.
My custom figure listens for clicks on the expand/collapse icon on this
border,and performs the necessary action.

My problem is when i select this figure,the selection handle border goes
over the expand/collapse icon[refer "image2.gif"]
This kind of looks odd. What i want to do is when i select the figure,the
selection border is shown ,but
it comes "UNDER" the expand/collapse icon..How do i achieve this. Probably
via Layers??

But since my Custom border paints the icons and labels,how do i specify
layering, such that
selection handles come below it??

Also wanted to validate whether this whole approach is an okey way of
implementing collapsible containers
Here's my basic steps:
a)A Figure which uses a custom border that has a label and icon painted on
it
b)The editpart which listens for figure mouse clicks,tests whether it is on
the "expand/collapse" icon position, and calls
refresh.
refresh() will a) repaint the figure with the new icon(expand/collapse)
b)refresh the children.[when a container is
collapsed,i send its children as null,which effectively removes all the
children,and collapses the container
and when it is
expanded,i send its original children,which adds all teh children back]
c)recalculate connections.

Appreciate anyone who's got a better idea on how to implement this.

Rgds,
Zenil



  • Attachment: image1.GIF
    (Size: 70.16KB, Downloaded 176 times)
  • Attachment: image2.GIF
    (Size: 85.86KB, Downloaded 172 times)
Re: collapse/expand nested container problem [message #152427 is a reply to message #152327] Wed, 29 September 2004 16:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You should customize showSelection and hideSelection. You don't need that
black rectangle at all. Or, you could have it but make it invisible.
Instead, you should call setForeground on your border and have it repaint
but using a darker/thicker line to indicate selection.

"Zenil" <zenilnh@infotech.stph.net> wrote in message
news:cjd0b7$f77$1@eclipse.org...
> Hi Guys,
>
> I am trying to create a Collapsible container figure in GEF.I have
attached
> an image of what have I achieved so far-"image1.gif"
>
> What i have done is extend the GroupBoxBorder to draw icons and label on
it.
> My custom figure listens for clicks on the expand/collapse icon on this
> border,and performs the necessary action.
>
> My problem is when i select this figure,the selection handle border goes
> over the expand/collapse icon[refer "image2.gif"]
> This kind of looks odd. What i want to do is when i select the figure,the
> selection border is shown ,but
> it comes "UNDER" the expand/collapse icon..How do i achieve this. Probably
> via Layers??
>
> But since my Custom border paints the icons and labels,how do i specify
> layering, such that
> selection handles come below it??
>
> Also wanted to validate whether this whole approach is an okey way of
> implementing collapsible containers
> Here's my basic steps:
> a)A Figure which uses a custom border that has a label and icon painted on
> it
> b)The editpart which listens for figure mouse clicks,tests whether it is
on
> the "expand/collapse" icon position, and calls
> refresh.
> refresh() will a) repaint the figure with the new
icon(expand/collapse)
> b)refresh the children.[when a container is
> collapsed,i send its children as null,which effectively removes all the
> children,and collapses the container
> and when it is
> expanded,i send its original children,which adds all teh children back]
> c)recalculate connections.
>
> Appreciate anyone who's got a better idea on how to implement this.
>
> Rgds,
> Zenil
>
>
>
Re: collapse/expand nested container problem [message #152434 is a reply to message #152427] Wed, 29 September 2004 18:47 Go to previous message
Eclipse UserFriend
Originally posted by: zenilnh.infotech.stph.net

Hi Randy,

Thanks for the answer.

I understand the first part, showSelection and hideSelection.U are talking
about customizing the SelectionHandelsEditPolicy right..
I didnt understand the "setForeGround on the border..darker/thicker line to
indicate selection" statement..How do u draw such a line under the icon??
Are u talking about customizing the border/figure...
Could u elaborate on this..

Apart from that what do u think in general on what i am doing on collapsible
containers.

I think there are 2 strategies:

Strategy 1:Each figure handles its own expand/collapse behaviour,and based
on expansion/collapsion the corresponding editpart sends the children..[A
collapsed container is the same as one with no children and any connection
to elements in a collapsed container gets redrawn to the container]

Strategy 2:The RootFigure handles the expand/collapse behaviour of the child
figure.From the ui point,the rootfigure calculates where to put the
"expand/collapse" icon and paints it on each figure and handles the
"expand/collapse" management like constraining the figure sizes.
The rootfigure Editpart also handles the problem of reconnections.

I am right now following strategy 1. But trying to visualize the problems
that I may encounter by following any one of the above strategies.I am
looking for ideas/potential roadblocks/"things that i should be aware of "'s
kind of stuff..

Thanks again for your inputs.

Rgds,
Zenil

"Randy Hudson" <none@us.ibm.com> wrote in message
news:cjep5q$qds$1@eclipse.org...
> You should customize showSelection and hideSelection. You don't need that
> black rectangle at all. Or, you could have it but make it invisible.
> Instead, you should call setForeground on your border and have it repaint
> but using a darker/thicker line to indicate selection.
>
> "Zenil" <zenilnh@infotech.stph.net> wrote in message
> news:cjd0b7$f77$1@eclipse.org...
> > Hi Guys,
> >
> > I am trying to create a Collapsible container figure in GEF.I have
> attached
> > an image of what have I achieved so far-"image1.gif"
> >
> > What i have done is extend the GroupBoxBorder to draw icons and label on
> it.
> > My custom figure listens for clicks on the expand/collapse icon on this
> > border,and performs the necessary action.
> >
> > My problem is when i select this figure,the selection handle border goes
> > over the expand/collapse icon[refer "image2.gif"]
> > This kind of looks odd. What i want to do is when i select the
figure,the
> > selection border is shown ,but
> > it comes "UNDER" the expand/collapse icon..How do i achieve this.
Probably
> > via Layers??
> >
> > But since my Custom border paints the icons and labels,how do i specify
> > layering, such that
> > selection handles come below it??
> >
> > Also wanted to validate whether this whole approach is an okey way of
> > implementing collapsible containers
> > Here's my basic steps:
> > a)A Figure which uses a custom border that has a label and icon painted
on
> > it
> > b)The editpart which listens for figure mouse clicks,tests whether it is
> on
> > the "expand/collapse" icon position, and calls
> > refresh.
> > refresh() will a) repaint the figure with the new
> icon(expand/collapse)
> > b)refresh the children.[when a container is
> > collapsed,i send its children as null,which effectively removes all the
> > children,and collapses the container
> > and when it
is
> > expanded,i send its original children,which adds all teh children back]
> > c)recalculate connections.
> >
> > Appreciate anyone who's got a better idea on how to implement this.
> >
> > Rgds,
> > Zenil
> >
> >
> >
>
>
Previous Topic:Migration - How to make my Selection Actions work again
Next Topic:Flip and rotate display
Goto Forum:
  


Current Time: Fri Apr 26 09:06:03 GMT 2024

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

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

Back to the top