class Method cannot be hidden

0 votes
asked Aug 29 in Bug by anonymous
class Method {
    foo()
}

hide Method

This does not hide the class named Method, but it hides methods.
It seems that the matching for "hide methods" is too generous.

class "Method" {
    foo()
}

hide "Method"

This is no workaround: methods are no longer hidden, but the class is still shown.

1 Answer

0 votes
answered Sep 1 by plantuml (184,600 points)

With last beta http://beta.plantuml.net/plantuml.jar we've added a new "hide-class" keyword which is synonym of "hide"

So you can now have :

@startuml
class Method {
    foo()
}

class Other {
    foo()
}

hide-class Method
@enduml

Does it help ?

commented Sep 3 by anonymous
It works!

In a generated include file, however, we hide all classes, and then we show them explicitly.
This means, the same change is required for

show Method

BTW: the beta rendered one of our diagrams with a lot of unexplainable white space on the left.
commented Sep 3 by plantuml (184,600 points)
show-class added in last beta http://beta.plantuml.net/plantuml.jar

Your diagram with white space maybe related to the new "remove" keyword (see http://forum.plantuml.net/7337/classes-then-show-only-classes-bearing-given-class-diagram )
You may try to use "remove/restore" instead of "hide/show"
commented Sep 4 by anonymous
I t works!

But "remove/restore" is what we were really looking for. This makes our workaround from three years ago obsolete. We generated

    !ifdef HIDE
    hide Foo
    !endif

for each class Foo, to be able to switch between "show by default" and "hide by default".

Indeed, "remove/restore" also avoids the white space.
...