1

I usually found the answer of my questions in StackExchange or over Internet. But this time I can't. I look for a lot yesterday and I didn't find a solution.

Recently I started to use LaTex, and I'm using metaUML for describe a few of my important classes. But I have a problem with abstract classes.

I have an abstract class with some methods abstract, an the rest of the methods not. I want to put the abstract methods in Italic or Oblique (value metauml_defaultFontOblique), but I don't know how to access to the font of each method to put that value.

For example:

input metauml;
beginfig(1);

AbstractClass.AbsClass("AbsClass")()(
"+AbsClass()",
"+abstractMethod(): void",
"+nonAbstractMethod(): void"
);

drawObject(AbsClass);
endfig;
end

The result of the above code

Here I want abstractMethod will appear in italic, and noAbstractMethod will appear normal.

How can I do this?

I can put the name of the class in Italic if I add:

AbsClass.info.iName.iFont.name := metauml_defaultFontOblique;

And I can put all the methods in Italic if I use:

AbsClass.info.iMethodStack.iPict.iFont.name := metauml_defaultFontOblique;

The result if I put all methods in italic using the above code

But I only want the abstract method in Italic.

Thank you for your help.

2
  • Welcome to TeX.SX! There are at least two packages based on PGF for building UML diagrams: pgf-umlcd and pgf-umlsd. The Metapost based metauml has severe limitations about fonts, which shouldn't be a concern with the other packages.
    – egreg
    Jun 22, 2014 at 11:07
  • Despite of it looks like I can set the methods in italic (because I can set all the methods in italic), i will try to use pgf-umlcd as you recomended. Thanks for your fast answer.
    – nemugakun
    Jun 22, 2014 at 11:24

1 Answer 1

1

This was not possible in MetaUML 0.2.5 due to the way in which method stacks were generated.

The master branch of MetaUML now allows for abstract, static classic features:

Class.A("A")
    (static "-instanceCount:int")
    (static "+getInstanceCount():int", abstract "+work()");

MetaUML: Static and abstract class features

1
  • Nice to know, and welcome to the site :) Be sure to update this answer once that feature is added. :) Jul 17, 2015 at 20:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .