|
Re: How to add an EditPart below the Primary Layer [message #156072 is a reply to message #156010] |
Fri, 29 October 2004 06:09 |
Eclipse User |
|
|
|
Originally posted by: eostroukhov.hotmail.com
1. The Draw2d draws the figures in the order they are in the children list
(i.e. if you want one figure to be drawn above the other you should add it
second). In most cases you should return the children in the correct order
from the getModelChildren method of your container edit part. That's the
principle I used to implement the move above/below actions and it actually
works :)
2. If, for some reason, case #1 is not helpful for you, you could switch to
layered figure.
3. In your case it looks like the children edit parts must be put into the
groupbox edit parts.
"Steve Harper" <steve_harper@adp.com> wrote in message
news:clre0d$5nj$1@eclipse.org...
> The GEF editor that I'm working on is a Visual Builder for a 4GL language.
> One of the components on my Palette is a GroupBox that is really just a
> box drawn around some other components.
>
> The run-time is implemented using Swing, so during Design time with GEF
> I'm using ImageFigures that capture an off-screen Swing image (sort of the
> same trick that VE uses for WYSIWYG).
>
> Everything works well except when a GroupBox is drawn around some existing
> components. Even though the IFigure is transparent, it overlays the
> components that it surrounds because the whole offscreen image is used.
>
> I tried to fix this by overriding paintFigure() for the IFigure of the
> GroupBox. In the override I only drew the outside of the GroupBox and thus
> it would not hide the components it surrounded. But clicking on a
> Component inside the GroupBox would select the GroupBox itself and not the
> Component that was clicked on.
>
> So I'm thinking the way to fix this would be to place the GroupBox on the
> ConnectionLayer of something "below" the PrimaryLayer. I see how to call
> ScalableRootEditPart.getLayer(), but have no idea how to use the returned
> IFigure to control the layer that my GroupBox is added to. Also feels like
> I'd do this in my EditPartFactory, but again see no way to control Layer
> there. Also tried overriding AbstractGraphicalEditPart.getLayer() thinking
> it would use the value returned, but found that this is never called.
>
> I'm open to suggestions...
>
|
|
|
|
Re: How to add an EditPart below the Primary Layer [message #156254 is a reply to message #156087] |
Mon, 01 November 2004 07:24 |
Eclipse User |
|
|
|
Originally posted by: eostroukhov.hotmail.com
I guess, in your case you could write your getModelChildren this way:
public List getModelChildren() {
final List children = new LinkedList();
final Model model = (Model) getModel(); // Your model
children.addAll(model.getGroupboxes());
children.addAll(model.getChildren()); // Excluding groupboxes
return children;
}
I guess, using layered approach could overcomplicate your code.
"Steve Harper" <steve_harper@adp.com> wrote in message
news:cltb6h$6pc$1@eclipse.org...
> Eugene Ostroukhov wrote:
>
> > 1. The Draw2d draws the figures in the order they are in the children
list
> > (i.e. if you want one figure to be drawn above the other you should add
it
> > second). In most cases you should return the children in the correct
order
> > from the getModelChildren method of your container edit part. That's the
> > principle I used to implement the move above/below actions and it
actually
> > works :)
> > 2. If, for some reason, case #1 is not helpful for you, you could switch
to
> > layered figure.
> > 3. In your case it looks like the children edit parts must be put into
the
> > groupbox edit parts.
>
> 1. I don't want to make users add the GroupBox first, as a hack guess I
> could programmatically ensure that all GroupBox components appear as the
> last children. That makes the add logic a little ugly.
> 3. The GroupBox is not a parent to the children that it encloses. You can
> move or delete the GroupBox independantly of the components it encloses.
>
> 2. Yes a layered figure seems to be what I need. But I've been unable to
> determine how to add the GroupBox components at any layer other than the
> Primary.
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05203 seconds