Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » default font
default font [message #218873] Sat, 14 February 2009 10:50 Go to next message
Eclipse UserFriend
Hi,

I have a simple rectangle figure with a label and try to give a default
font to it. Later it should be possible to change the font in the
Appearance section of the Eclipse property view.

The following code in the figure's editpart sets the font, but it can't
be changed later:
protected NodeFigure createNodeFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
shape.setFont(FIGURE_FONT);
contentPane = setupContentPane(shape);
return figure;
}
Thanks,
Michael
Re: default font [message #218894 is a reply to message #218873] Mon, 16 February 2009 05:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cayla_sha.gmx.net

Hello Michael,

What happens, when you set the Font in the gmfgraph-file?

Best wishes
Julia


Michael Dengler schrieb:
> Hi,
>
> I have a simple rectangle figure with a label and try to give a default
> font to it. Later it should be possible to change the font in the
> Appearance section of the Eclipse property view.
>
> The following code in the figure's editpart sets the font, but it can't
> be changed later:
> protected NodeFigure createNodeFigure() {
> NodeFigure figure = createNodePlate();
> figure.setLayoutManager(new StackLayout());
> IFigure shape = createNodeShape();
> figure.add(shape);
> shape.setFont(FIGURE_FONT);
> contentPane = setupContentPane(shape);
> return figure;
> }
> Thanks,
> Michael
Re: default font [message #219006 is a reply to message #218894] Mon, 16 February 2009 13:14 Go to previous messageGo to next message
Eclipse UserFriend
Hi Julia,
thanks for your reply.
when I set the font to the label, I cannot change it later when the
diagram is opened.

Cayla Sha wrote:
> Hello Michael,
>
> What happens, when you set the Font in the gmfgraph-file?
>
> Best wishes
> Julia
>
>
> Michael Dengler schrieb:
>> Hi,
>>
>> I have a simple rectangle figure with a label and try to give a
>> default font to it. Later it should be possible to change the font in
>> the Appearance section of the Eclipse property view.
>>
>> The following code in the figure's editpart sets the font, but it
>> can't be changed later:
>> protected NodeFigure createNodeFigure() {
>> NodeFigure figure = createNodePlate();
>> figure.setLayoutManager(new StackLayout());
>> IFigure shape = createNodeShape();
>> figure.add(shape);
>> shape.setFont(FIGURE_FONT);
>> contentPane = setupContentPane(shape);
>> return figure;
>> }
>> Thanks,
>> Michael
Re: default font [message #219022 is a reply to message #219006] Mon, 16 February 2009 13:44 Go to previous message
Eclipse UserFriend
Originally posted by: cayla_sha.gmx.net

Hi Michael,

hm, your`re right.
In my editor I set the Font-Size and the Font-Color in the
gmfgraph-file. I never tried to set the Font with the Appearance-Tab. I
just tried it and it didn`t work. I can only change the Color, but not
the Size or the Style.

Uhm, well, I can`t help you with this... Perhaps one of the
Newsgroup-Gurus ;) knows what to do?

While waiting for the answer you could debug refreshFont() in the
EditPart of your Label and see what happens, when you change something
in the Appearance-Tab.

Sorry!
Best wishes
Julia


Michael Dengler schrieb:
> Hi Julia,
> thanks for your reply.
> when I set the font to the label, I cannot change it later when the
> diagram is opened.
>
> Cayla Sha wrote:
>> Hello Michael,
>>
>> What happens, when you set the Font in the gmfgraph-file?
>>
>> Best wishes
>> Julia
>>
>>
>> Michael Dengler schrieb:
>>> Hi,
>>>
>>> I have a simple rectangle figure with a label and try to give a
>>> default font to it. Later it should be possible to change the font in
>>> the Appearance section of the Eclipse property view.
>>>
>>> The following code in the figure's editpart sets the font, but it
>>> can't be changed later:
>>> protected NodeFigure createNodeFigure() {
>>> NodeFigure figure = createNodePlate();
>>> figure.setLayoutManager(new StackLayout());
>>> IFigure shape = createNodeShape();
>>> figure.add(shape);
>>> shape.setFont(FIGURE_FONT);
>>> contentPane = setupContentPane(shape);
>>> return figure;
>>> }
>>> Thanks,
>>> Michael
Previous Topic:Changing a DiagramRoot Property
Next Topic:Auto-generating tool commands.
Goto Forum:
  


Current Time: Sun Jul 06 04:40:24 EDT 2025

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

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

Back to the top