Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Changing background of label
Changing background of label [message #78743] Sun, 19 November 2006 04:58 Go to next message
Eclipse UserFriend
Originally posted by: vikas.goyal.hp.com

Hi ,

I want to change background of a label of node in gmf. My requirnment
is like this:

My present BackGround is like this:

-----------------------
| Topic |
| |
------------------------
| |
| |
------------------------

I want its view to be Hatched as shown below:
I want its view to be like this:


----------------------
|.....................|
|........Topic........|
|.....................|
-----------------------
| |
| |
-----------------------

Using edit part I am able to change Label name's (Topic) Font. I want to
change its background.

Can some one help me how can I achive it.

Thanks in Advance

Regards,
Vikas
Re: Changing background of label [message #78930 is a reply to message #78743] Mon, 20 November 2006 19:59 Go to previous message
Mohammed Mostafa is currently offline Mohammed MostafaFriend
Messages: 143
Registered: July 2009
Senior Member
you can override the paintFigure method on your figure and do something
like this :


Rectangle figBounds = getBounds();
IMapMode mapMode = MapModeUtil.getMapMode(this);
int step = mapMode.DPtoLP(5);
g.translate(figBounds.x, figBounds.y);
g.pushState();
g.setLineStyle(SWT.LINE_DOT);
for (int y = step ; y < figBounds.height;y+=step){
g.drawLine(0, y, figBounds.width, y);
}
g.popState();



Vikas Goyal wrote:

> Hi ,
>
> I want to change background of a label of node in gmf. My requirnment
> is like this:
>
> My present BackGround is like this:
>
> -----------------------
> | Topic |
> | |
> ------------------------
> | |
> | |
> ------------------------
> I want its view to be Hatched as shown below:
> I want its view to be like this:
>
>
> ----------------------
> |.....................|
> |........Topic........|
> |.....................|
> -----------------------
> | |
> | |
> -----------------------
>
> Using edit part I am able to change Label name's (Topic) Font. I want to
> change its background.
>
> Can some one help me how can I achive it.
>
> Thanks in Advance
>
> Regards,
> Vikas
>
>
>
>
>
>
Previous Topic:Persisting diagram in rdb
Next Topic:Adding Object to a line
Goto Forum:
  


Current Time: Sat Jul 27 16:15:54 GMT 2024

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

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

Back to the top