Changing background of label [message #78743] |
Sat, 18 November 2006 23:58  |
Eclipse User |
|
|
|
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 14:59  |
Eclipse User |
|
|
|
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
>
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03788 seconds