Home » Eclipse Projects » GEF » 2 figures on 2 different layers
| |
Re: 2 figures on 2 different layers [message #151194 is a reply to message #151082] |
Thu, 16 September 2004 09:13 |
Skhiri Sabri 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 |
Eclipse User |
|
|
|
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 |
Skhiri Sabri 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 |
Eclipse User |
|
|
|
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 |
Skhiri Sabri 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.
> > > > > >
> > > >
> > > >
> >
> >
|
|
|
Goto Forum:
Current Time: Sat Jan 18 08:48:00 GMT 2025
Powered by FUDForum. Page generated in 0.03741 seconds
|