Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » 2 figures on 2 different layers
2 figures on 2 different layers [message #150905] Wed, 15 September 2004 14:09 Go to next message
Skhiri Sabri is currently offline Skhiri SabriFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,

I would like to draw 2 figures on 2 different layers, someone can
explain-me how I can do that ?

Thanks,

Sabri.
Re: 2 figures on 2 different layers [message #151082 is a reply to message #150905] Wed, 15 September 2004 15:09 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
From purely a Draw2d perspective? You create a LayeredPane, add two layers
to it, and then add a figure to each of those layers.

If you're using GEF, you can access a layer from your EditPart's
getLayer(id) method.

"Skhiri Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
news:ci9ie9$to4$1@eclipse.org...
> Hi,
>
> I would like to draw 2 figures on 2 different layers, someone can
> explain-me how I can do that ?
>
> Thanks,
>
> Sabri.
>
Re: 2 figures on 2 different layers [message #151194 is a reply to message #151082] Thu, 16 September 2004 09:13 Go to previous messageGo to next message
Skhiri Sabri is currently offline Skhiri SabriFriend
Messages: 23
Registered: July 2009
Junior Member
Thanks for your response Patrik,

Ok, but I tried that, but nothing appears. My main figure is a
figureCanvas, can I directly add a layeredPane to the figureCanvas ?

Sabri.

Pratik Shah wrote:

> From purely a Draw2d perspective? You create a LayeredPane, add two layers
> to it, and then add a figure to each of those layers.

> If you're using GEF, you can access a layer from your EditPart's
> getLayer(id) method.

> "Skhiri Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> news:ci9ie9$to4$1@eclipse.org...
> > Hi,
> >
> > I would like to draw 2 figures on 2 different layers, someone can
> > explain-me how I can do that ?
> >
> > Thanks,
> >
> > Sabri.
> >
Re: 2 figures on 2 different layers [message #151239 is a reply to message #151194] Thu, 16 September 2004 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Please look at NonResizableEditPolicy and how it adds handle figures to the
handle layer.

"Skhiri dit Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
news:ciblgh$5v2$1@eclipse.org...
> Thanks for your response Patrik,
>
> Ok, but I tried that, but nothing appears. My main figure is a
> figureCanvas, can I directly add a layeredPane to the figureCanvas ?
>
> Sabri.
>
> Pratik Shah wrote:
>
> > From purely a Draw2d perspective? You create a LayeredPane, add two
layers
> > to it, and then add a figure to each of those layers.
>
> > If you're using GEF, you can access a layer from your EditPart's
> > getLayer(id) method.
>
> > "Skhiri Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> > news:ci9ie9$to4$1@eclipse.org...
> > > Hi,
> > >
> > > I would like to draw 2 figures on 2 different layers, someone can
> > > explain-me how I can do that ?
> > >
> > > Thanks,
> > >
> > > Sabri.
> > >
>
>
Re: 2 figures on 2 different layers [message #151294 is a reply to message #151239] Fri, 17 September 2004 08:14 Go to previous messageGo to next message
Skhiri Sabri is currently offline Skhiri SabriFriend
Messages: 23
Registered: July 2009
Junior Member
Thanks Randy, sorry for my stupid questions but I looked to this class
and I understand how the layer mechanisms work. Bu My situation is quiet
different. I use a simple draw2DView, I have a FigureCanvas linked to a
LightweightSystem, and my main Figure is a Simple Figure. Here is a piece
of code of the createPartControl() of my ViewPart:

LayeredPane mainPane = new FreeformLayeredPane();
Layer figureLayer = new FreeformLayer();
mainPane.add(figureLayer, LayerConstants.PRIMARY_LAYER);
mainPane.setOpaque(false);
figureLayer.setOpaque(false);
figure = (IFIgure) getSimpleFigure();
figure.setOpaque(false);
system = new LightweightSystem(principalCanvas);
principalCanvas = new FigureCanvas(parent, system);
figureLayer.add(figure);
principalCanvas.getViewport().setContents(mainPane);

Nothing appears in the view, while if I add directly the figure
principalCanvas.getViewport().setContents(figure) , without using
LayeredPane it works well, my figure appears.

Then, I'm doing something wrong ?

Thanks,

Sabri.


Randy Hudson wrote:

> Please look at NonResizableEditPolicy and how it adds handle figures to the
> handle layer.

> "Skhiri dit Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> news:ciblgh$5v2$1@eclipse.org...
> > Thanks for your response Patrik,
> >
> > Ok, but I tried that, but nothing appears. My main figure is a
> > figureCanvas, can I directly add a layeredPane to the figureCanvas ?
> >
> > Sabri.
> >
> > Pratik Shah wrote:
> >
> > > From purely a Draw2d perspective? You create a LayeredPane, add two
> layers
> > > to it, and then add a figure to each of those layers.
> >
> > > If you're using GEF, you can access a layer from your EditPart's
> > > getLayer(id) method.
> >
> > > "Skhiri Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> > > news:ci9ie9$to4$1@eclipse.org...
> > > > Hi,
> > > >
> > > > I would like to draw 2 figures on 2 different layers, someone can
> > > > explain-me how I can do that ?
> > > >
> > > > Thanks,
> > > >
> > > > Sabri.
> > > >
> >
> >
Re: 2 figures on 2 different layers [message #151447 is a reply to message #151294] Mon, 20 September 2004 14:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Are you using a FreeformViewport??

"Skhiri dit Gabouje Sabr" <sskhirid@ulb.ac.be> wrote in message
news:cie6cc$6i7$1@eclipse.org...
> Thanks Randy, sorry for my stupid questions but I looked to this class
> and I understand how the layer mechanisms work. Bu My situation is quiet
> different. I use a simple draw2DView, I have a FigureCanvas linked to a
> LightweightSystem, and my main Figure is a Simple Figure. Here is a piece
> of code of the createPartControl() of my ViewPart:
>
> LayeredPane mainPane = new FreeformLayeredPane();
> Layer figureLayer = new FreeformLayer();
> mainPane.add(figureLayer, LayerConstants.PRIMARY_LAYER);
> mainPane.setOpaque(false);
> figureLayer.setOpaque(false);
> figure = (IFIgure) getSimpleFigure();
> figure.setOpaque(false);
> system = new LightweightSystem(principalCanvas);
> principalCanvas = new FigureCanvas(parent, system);
> figureLayer.add(figure);
> principalCanvas.getViewport().setContents(mainPane);
>
> Nothing appears in the view, while if I add directly the figure
> principalCanvas.getViewport().setContents(figure) , without using
> LayeredPane it works well, my figure appears.
>
> Then, I'm doing something wrong ?
>
> Thanks,
>
> Sabri.
>
>
> Randy Hudson wrote:
>
> > Please look at NonResizableEditPolicy and how it adds handle figures to
the
> > handle layer.
>
> > "Skhiri dit Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> > news:ciblgh$5v2$1@eclipse.org...
> > > Thanks for your response Patrik,
> > >
> > > Ok, but I tried that, but nothing appears. My main figure is a
> > > figureCanvas, can I directly add a layeredPane to the figureCanvas ?
> > >
> > > Sabri.
> > >
> > > Pratik Shah wrote:
> > >
> > > > From purely a Draw2d perspective? You create a LayeredPane, add two
> > layers
> > > > to it, and then add a figure to each of those layers.
> > >
> > > > If you're using GEF, you can access a layer from your EditPart's
> > > > getLayer(id) method.
> > >
> > > > "Skhiri Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> > > > news:ci9ie9$to4$1@eclipse.org...
> > > > > Hi,
> > > > >
> > > > > I would like to draw 2 figures on 2 different layers, someone can
> > > > > explain-me how I can do that ?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Sabri.
> > > > >
> > >
> > >
>
>
Re: 2 figures on 2 different layers [message #151791 is a reply to message #151447] Thu, 23 September 2004 06:56 Go to previous message
Skhiri Sabri is currently offline Skhiri SabriFriend
Messages: 23
Registered: July 2009
Junior Member
Even if I add this two lines:
FreeformViewport viewPort = new FreeformViewport();
principalCanvas.setViewport(viewPort);

It doesn't work.

Sabri.

Randy Hudson wrote:

> Are you using a FreeformViewport??

> "Skhiri dit Gabouje Sabr" <sskhirid@ulb.ac.be> wrote in message
> news:cie6cc$6i7$1@eclipse.org...
> > Thanks Randy, sorry for my stupid questions but I looked to this class
> > and I understand how the layer mechanisms work. Bu My situation is quiet
> > different. I use a simple draw2DView, I have a FigureCanvas linked to a
> > LightweightSystem, and my main Figure is a Simple Figure. Here is a piece
> > of code of the createPartControl() of my ViewPart:
> >
> > LayeredPane mainPane = new FreeformLayeredPane();
> > Layer figureLayer = new FreeformLayer();
> > mainPane.add(figureLayer, LayerConstants.PRIMARY_LAYER);
> > mainPane.setOpaque(false);
> > figureLayer.setOpaque(false);
> > figure = (IFIgure) getSimpleFigure();
> > figure.setOpaque(false);
> > system = new LightweightSystem(principalCanvas);
> > principalCanvas = new FigureCanvas(parent, system);
> > figureLayer.add(figure);
> > principalCanvas.getViewport().setContents(mainPane);
> >
> > Nothing appears in the view, while if I add directly the figure
> > principalCanvas.getViewport().setContents(figure) , without using
> > LayeredPane it works well, my figure appears.
> >
> > Then, I'm doing something wrong ?
> >
> > Thanks,
> >
> > Sabri.
> >
> >
> > Randy Hudson wrote:
> >
> > > Please look at NonResizableEditPolicy and how it adds handle figures to
> the
> > > handle layer.
> >
> > > "Skhiri dit Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> > > news:ciblgh$5v2$1@eclipse.org...
> > > > Thanks for your response Patrik,
> > > >
> > > > Ok, but I tried that, but nothing appears. My main figure is a
> > > > figureCanvas, can I directly add a layeredPane to the figureCanvas ?
> > > >
> > > > Sabri.
> > > >
> > > > Pratik Shah wrote:
> > > >
> > > > > From purely a Draw2d perspective? You create a LayeredPane, add two
> > > layers
> > > > > to it, and then add a figure to each of those layers.
> > > >
> > > > > If you're using GEF, you can access a layer from your EditPart's
> > > > > getLayer(id) method.
> > > >
> > > > > "Skhiri Gabouje Sabri" <sskhirid@ulb.ac.be> wrote in message
> > > > > news:ci9ie9$to4$1@eclipse.org...
> > > > > > Hi,
> > > > > >
> > > > > > I would like to draw 2 figures on 2 different layers, someone can
> > > > > > explain-me how I can do that ?
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Sabri.
> > > > > >
> > > >
> > > >
> >
> >
Previous Topic:Repopulate palette -- Null pointer in PaletteViewer
Next Topic:MS Project style interface
Goto Forum:
  


Current Time: Tue Apr 23 14:35:36 GMT 2024

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

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

Back to the top