Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » adding layer
adding layer [message #136055] Thu, 03 June 2004 18:51 Go to next message
steven melzer is currently offline steven melzerFriend
Messages: 38
Registered: July 2009
Member
i wish to add a background graphic to my entire diagram.

to do this, i figured i could add a new layer to the ScalableRootEditPart.
i thought this would cause the least refresh of this graphic, and also
have the benefit of not being part of the printed diagram since i can put
the graphic on a layer below the PrintLayer.

i do, however, need a way to update this graphic, so i also need a way to
refresh the layer.

is there a way to add a layer to the layer pane of the
ScalableRootEditPart, or should i subclass it.

i am currently using the 2.x code. if there is something in 3.0, i can
upgrade.

or am i completely barking up the wrong tree?

thanks,
steve
Re: adding layer [message #136327 is a reply to message #136055] Fri, 04 June 2004 20:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Why can't your contents editpart just paint the image on its figure? You
could also add a layer, but then you need a "glass" primary layer so you can
see it. Do you want the image to scroll?

"Steven Melzer" <smelzer@paymentech.com> wrote in message
news:c9ns0b$3m5$1@eclipse.org...
> i wish to add a background graphic to my entire diagram.
>
> to do this, i figured i could add a new layer to the ScalableRootEditPart.
> i thought this would cause the least refresh of this graphic, and also
> have the benefit of not being part of the printed diagram since i can put
> the graphic on a layer below the PrintLayer.
>
> i do, however, need a way to update this graphic, so i also need a way to
> refresh the layer.
>
> is there a way to add a layer to the layer pane of the
> ScalableRootEditPart, or should i subclass it.
>
> i am currently using the 2.x code. if there is something in 3.0, i can
> upgrade.
>
> or am i completely barking up the wrong tree?
>
> thanks,
> steve
>
Re: adding layer [message #136390 is a reply to message #136327] Sat, 05 June 2004 02:27 Go to previous messageGo to next message
steven melzer is currently offline steven melzerFriend
Messages: 17
Registered: July 2009
Junior Member
i can easily add the image to the content edit part. i was just concerned
that the diagram (meaning my background image) may be redrawn when
children are redrawn which seemed like a lot of overhead.

as for the printing part, i assume i can draw the children on an offscreen
image and print the offscreen image, thus not printing the diagram
background image.

steve

Randy Hudson wrote:

> Why can't your contents editpart just paint the image on its figure? You
> could also add a layer, but then you need a "glass" primary layer so you can
> see it. Do you want the image to scroll?

> "Steven Melzer" <smelzer@paymentech.com> wrote in message
> news:c9ns0b$3m5$1@eclipse.org...
> > i wish to add a background graphic to my entire diagram.
> >
> > to do this, i figured i could add a new layer to the ScalableRootEditPart.
> > i thought this would cause the least refresh of this graphic, and also
> > have the benefit of not being part of the printed diagram since i can put
> > the graphic on a layer below the PrintLayer.
> >
> > i do, however, need a way to update this graphic, so i also need a way to
> > refresh the layer.
> >
> > is there a way to add a layer to the layer pane of the
> > ScalableRootEditPart, or should i subclass it.
> >
> > i am currently using the 2.x code. if there is something in 3.0, i can
> > upgrade.
> >
> > or am i completely barking up the wrong tree?
> >
> > thanks,
> > steve
> >
Re: adding layer [message #136713 is a reply to message #136390] Mon, 07 June 2004 14:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You can also just set a flag termporarily on your contents figure telling it
not to draw its background image.

"steven melzer" <steven.melzer@verizon.net> wrote in message
news:c9rb1r$v57$1@eclipse.org...
> i can easily add the image to the content edit part. i was just concerned
> that the diagram (meaning my background image) may be redrawn when
> children are redrawn which seemed like a lot of overhead.
>
> as for the printing part, i assume i can draw the children on an offscreen
> image and print the offscreen image, thus not printing the diagram
> background image.
>
> steve
>
> Randy Hudson wrote:
>
> > Why can't your contents editpart just paint the image on its figure?
You
> > could also add a layer, but then you need a "glass" primary layer so you
can
> > see it. Do you want the image to scroll?
>
> > "Steven Melzer" <smelzer@paymentech.com> wrote in message
> > news:c9ns0b$3m5$1@eclipse.org...
> > > i wish to add a background graphic to my entire diagram.
> > >
> > > to do this, i figured i could add a new layer to the
ScalableRootEditPart.
> > > i thought this would cause the least refresh of this graphic, and
also
> > > have the benefit of not being part of the printed diagram since i can
put
> > > the graphic on a layer below the PrintLayer.
> > >
> > > i do, however, need a way to update this graphic, so i also need a way
to
> > > refresh the layer.
> > >
> > > is there a way to add a layer to the layer pane of the
> > > ScalableRootEditPart, or should i subclass it.
> > >
> > > i am currently using the 2.x code. if there is something in 3.0, i
can
> > > upgrade.
> > >
> > > or am i completely barking up the wrong tree?
> > >
> > > thanks,
> > > steve
> > >
>
>
Re: adding layer [message #137789 is a reply to message #136713] Fri, 11 June 2004 12:39 Go to previous message
steven melzer is currently offline steven melzerFriend
Messages: 38
Registered: July 2009
Member
in the end i decided to add a new layer because i wanted the grid to
appear on top of the image, not behind it (and i was curious to try it).

i subclassed ScalableRootEditPart to add an additional layer to the
ScaledLayer and changed createGridLayer to create my subclass of
GridLayer, and it works very well. it was actually pretty easy.

i now have a white, shadowed "page" and a colored background, and the grid
only shows in the page, not the whole view.

thanks,
steve

> Randy Hudson wrote:

> You can also just set a flag termporarily on your contents figure telling it
> not to draw its background image.

> "steven melzer" <steven.melzer@verizon.net> wrote in message
> news:c9rb1r$v57$1@eclipse.org...
> > i can easily add the image to the content edit part. i was just concerned
> > that the diagram (meaning my background image) may be redrawn when
> > children are redrawn which seemed like a lot of overhead.
> >
> > as for the printing part, i assume i can draw the children on an offscreen
> > image and print the offscreen image, thus not printing the diagram
> > background image.
> >
> > steve
> >
> > Randy Hudson wrote:
> >
> > > Why can't your contents editpart just paint the image on its figure?
> You
> > > could also add a layer, but then you need a "glass" primary layer so you
> can
> > > see it. Do you want the image to scroll?
> >
> > > "Steven Melzer" <smelzer@paymentech.com> wrote in message
> > > news:c9ns0b$3m5$1@eclipse.org...
> > > > i wish to add a background graphic to my entire diagram.
> > > >
> > > > to do this, i figured i could add a new layer to the
> ScalableRootEditPart.
> > > > i thought this would cause the least refresh of this graphic, and
> also
> > > > have the benefit of not being part of the printed diagram since i can
> put
> > > > the graphic on a layer below the PrintLayer.
> > > >
> > > > i do, however, need a way to update this graphic, so i also need a way
> to
> > > > refresh the layer.
> > > >
> > > > is there a way to add a layer to the layer pane of the
> > > > ScalableRootEditPart, or should i subclass it.
> > > >
> > > > i am currently using the 2.x code. if there is something in 3.0, i
> can
> > > > upgrade.
> > > >
> > > > or am i completely barking up the wrong tree?
> > > >
> > > > thanks,
> > > > steve
> > > >
> >
> >
Previous Topic:Automatic Routing of Connections
Next Topic:Add TextField-like-Component to Draw2d-Figure ?
Goto Forum:
  


Current Time: Thu Apr 25 18:55:23 GMT 2024

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

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

Back to the top