Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » changing the colour of the editor canvas
changing the colour of the editor canvas [message #51654] Wed, 20 September 2006 06:40 Go to next message
Eclipse UserFriend
Originally posted by: sayed.shoed.tavant.com

Hi,

I want to change the colour of the editor canvas.Is there anyway by
which I can do this.

Regards
Sayed Aamir Shoeb
Re: changing the colour of the editor canvas [message #51937 is a reply to message #51654] Wed, 20 September 2006 12:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: thmeier.fastmail.fm

Override createFigure() in your DiagramEditPart. By calling
super.createFigure() you get a reference to the IFigure. You can then set
the background colour directly for this figure. You also need to set it to
be opaque.

protected IFigure createFigure() {
IFigure fig = super.createFigure();
fig.setBackgroundColor(ColorConstants.green);
fig.setOpaque(true);
return fig;
}

-Tom

"sayed" <sayed.shoed@tavant.com> wrote in message
news:eeqnkg$6fa$1@utils.eclipse.org...
> Hi,
>
> I want to change the colour of the editor canvas.Is there anyway by which
> I can do this.
>
> Regards
> Sayed Aamir Shoeb
Re: changing the colour of the editor canvas [message #178006 is a reply to message #51937] Wed, 19 March 2008 00:39 Go to previous message
Jelle Herold is currently offline Jelle HeroldFriend
Messages: 42
Registered: July 2009
Member
Hi,

Thomas Meier wrote:
> "sayed" <sayed.shoed@tavant.com> wrote:
>
> > I want to change the colour of the editor canvas.Is there anyway by which
> > I can do this.
>
> Override createFigure() in your DiagramEditPart. By calling
> super.createFigure() you get a reference to the IFigure. You can then set
> the background colour directly for this figure. You also need to set it to
> be opaque.
>
> protected IFigure createFigure() {
> IFigure fig = super.createFigure();
> fig.setBackgroundColor(ColorConstants.green);
> fig.setOpaque(true);
> return fig;
> }

This does indeed change the colour of the canvas, but also hides the
grid. Unless the grid is set to 'Grid in front', but then it is above
all other objects.

How to change the background color and have the grid appear below the
object, but above the canvas?


Thanks,
Jelle.
Previous Topic:link mapping
Next Topic:Contents of pallete in Gmf project must be highlighted (bold,italics etc)
Goto Forum:
  


Current Time: Sat Sep 21 03:24:29 GMT 2024

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

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

Back to the top