Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ConnectionLayer
ConnectionLayer [message #142198] Fri, 09 July 2004 10:08 Go to next message
Eclipse UserFriend
Originally posted by: sergeyv.offshorecreations.com

Hello

I need to draw figures on front layer and connections on back layer. The
default order of printable layers of ScalableFreeformRootEditPart is
PRIMARY_LAYER and then CONNECTION_LAYER. I changed the order of the layers
(see code below) but now my connections are invisible. Why?

public class MyRootEditPart extends ScalableFreeformRootEditPart {

protected LayeredPane createPrintableLayers() {
FreeformLayeredPane layeredPane = new FreeformLayeredPane();
layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
return layeredPane;
} //createPrintableLayers
} //class MyRootEditPart

--
With Best Regards
Vyunnikov Sergey

Offshore Creations, Inc.
www.OffshoreCreations.com
Re: ConnectionLayer [message #142219 is a reply to message #142198] Fri, 09 July 2004 12:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rlemaigr.ulb.ac.be

Hello,

Maybe the background figure of the primary layer was opaque and when you=
=

switch the layers it hides the connection layer ?
I looks to simple to be true but who knows...

r=E9gis



On Fri, 9 Jul 2004 13:08:25 +0300, Sergey Vyunnikov =

<sergeyv@offshorecreations.com> wrote:

> Hello
>
> I need to draw figures on front layer and connections on back layer. T=
he
> default order of printable layers of ScalableFreeformRootEditPart is
> PRIMARY_LAYER and then CONNECTION_LAYER. I changed the order of the =

> layers
> (see code below) but now my connections are invisible. Why?
>
> public class MyRootEditPart extends ScalableFreeformRootEditPart {
>
> protected LayeredPane createPrintableLayers() {
> FreeformLayeredPane layeredPane =3D new FreeformLayeredPane();=

> layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
> layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
> return layeredPane;
> } //createPrintableLayers
> } //class MyRootEditPart
>



-- =

Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Re: ConnectionLayer [message #142256 is a reply to message #142219] Fri, 09 July 2004 12:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sergeyv.offshorecreations.com

The function setOpaque(false) does not solve this problem.
--
With Best Regards
Vyunnikov Sergey

Offshore Creations, Inc.
www.OffshoreCreations.com


<rlemaigr@ulb.ac.be> wrote in message
news:opsavdqqkoxn9g2u@xn--pcrgis-dva.mshome.net...
Hello,

Maybe the background figure of the primary layer was opaque and when you
switch the layers it hides the connection layer ?
I looks to simple to be true but who knows...

r
Re: ConnectionLayer [message #142643 is a reply to message #142256] Tue, 13 July 2004 19:42 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
On what figure did you invoke setOpaque(false)? The figure returned by your
base EditPart needs to be transparent as well, not just the layer.

"Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
news:ccm4og$o32$1@eclipse.org...
> The function setOpaque(false) does not solve this problem.
> --
> With Best Regards
> Vyunnikov Sergey
>
> Offshore Creations, Inc.
> www.OffshoreCreations.com
>
>
> <rlemaigr@ulb.ac.be> wrote in message
> news:opsavdqqkoxn9g2u@xn--pcrgis-dva.mshome.net...
> Hello,
>
> Maybe the background figure of the primary layer was opaque and when you
> switch the layers it hides the connection layer ?
> I looks to simple to be true but who knows...
>
> r
Re: ConnectionLayer [message #142727 is a reply to message #142643] Wed, 14 July 2004 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sergeyv.offshorecreations.com

Thanks. It works :)

--
With Best Regards
Vyunnikov Sergey

Offshore Creations, Inc.
www.OffshoreCreations.com

"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:cd1ds9$s7e$1@eclipse.org...
> On what figure did you invoke setOpaque(false)? The figure returned by
your
> base EditPart needs to be transparent as well, not just the layer.
Re: ConnectionLayer [message #170176 is a reply to message #142643] Wed, 02 March 2005 12:53 Go to previous message
Marion Schmid is currently offline Marion SchmidFriend
Messages: 35
Registered: July 2009
Member
Hello!
I ran into the same problem as Sergey did, unfortunately I still cannot see
my connections after having changed
primary and connection layer and I cannot see which layer or edit part is
still opaque.

In my ScalableRootEditPart extension, I overrode the following and changed
the layer order.

protected LayeredPane createPrintableLayers() {
LayeredPane pane = new LayeredPane();

Layer layer = new ConnectionLayer();
layer.setPreferredSize(new Dimension(5, 5));
layer.setBackgroundColor(MyColorConstants.COLOR_ORANGE);
pane.add(layer, CONNECTION_LAYER);

layer = new Layer();
layer.setOpaque(false);
layer.setBackgroundColor(MyColorConstants.COLOR_GREEN);
layer.setLayoutManager(new StackLayout());
pane.add(layer, PRIMARY_LAYER);

return pane;
}

Additionally, I added some System.out.println in the ScalableRootEditPart's
methods
getContents() and getContentPane() in order to get an output in case one of
the figures returned here are opaque.

public EditPart getContents() {
if (contents instanceof GraphicalEditPart) {
if (((GraphicalEditPart)contents).getFigure().isOpaque())
System.out.println("contents-figure is opaque");
}
return contents;
}
/* (non-Javadoc)
* @see org.eclipse.gef.GraphicalEditPart#getContentPane()
*/
public IFigure getContentPane() {
IFigure l = getLayer(PRIMARY_LAYER);
if(l.isOpaque())
System.out.println("layer is opaque");
return l;
}

None of these figures turn out to be opaque, so, something goes wrong with
my layer order ?

In my editor, things look like the following layer/edit parts order
(see also attached screenshots)
- gef_ng1.gif: I colored the layers - connection_layer: orange,
primary_layer:green (connections hidden)

(from top to bottom)

---
1) the model root element's children edit parts (except for the connections,
of course)
---
2) My Model Root Edit Part (which has no BGCOLOR and is not opaque) -
returned by ScalableRootEditPart#getContents()
----
3) PRIMARY_LAYER - what's returned by ScalableRootEditPart#getContentPane()
----
4) CONNECTION_LAYER (orange)
---

in gef_ng2.gif is the initial state with default order - bottom:
primary_layer, above: connection_layer -> connections above child edit
parts, I try to get them below th child edit parts...

I wonder, how I can get the primary layer (3) opaque (isn't it opaque when
my System.outs coding is never reached?).
Actually, I want the connections between 1) and 2)
Or did I misunderstand sth. and 2) is equals 3) ? Anyway, does anyone of you
see where's my problem?

Thanks a lot and best regards,
Marion





"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:cd1ds9$s7e$1@eclipse.org...
> On what figure did you invoke setOpaque(false)? The figure returned by
your
> base EditPart needs to be transparent as well, not just the layer.
>
> "Sergey Vyunnikov" <sergeyv@offshorecreations.com> wrote in message
> news:ccm4og$o32$1@eclipse.org...
> > The function setOpaque(false) does not solve this problem.
> > --
> > With Best Regards
> > Vyunnikov Sergey
> >
> > Offshore Creations, Inc.
> > www.OffshoreCreations.com
> >
> >
> > <rlemaigr@ulb.ac.be> wrote in message
> > news:opsavdqqkoxn9g2u@xn--pcrgis-dva.mshome.net...
> > Hello,
> >
> > Maybe the background figure of the primary layer was opaque and when you
> > switch the layers it hides the connection layer ?
> > I looks to simple to be true but who knows...
> >
> > r
  • Attachment: gef_ng2.gif
    (Size: 4.27KB, Downloaded 82 times)
  • Attachment: gef_ng1.gif
    (Size: 3.07KB, Downloaded 90 times)
Previous Topic:Command safety tip and debugging tip
Next Topic:org.eclipse.ui.PlatformUI
Goto Forum:
  


Current Time: Thu Apr 18 07:27:32 GMT 2024

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

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

Back to the top