diff --git a/src/net/atmp/CucaDiagram.java b/src/net/atmp/CucaDiagram.java index c91cc88d63a..e6c89daaf1d 100644 --- a/src/net/atmp/CucaDiagram.java +++ b/src/net/atmp/CucaDiagram.java @@ -533,6 +533,7 @@ public List getVisibleStereotypeLabels(Entity entity) { return null; } + // collect hide or show statements on stereotypes List commands = new ArrayList<>(); for (EntityHideOrShow hideOrShowEntry : hideOrShows) { if (hideOrShowEntry.portion == EntityPortion.STEREOTYPE) { @@ -542,7 +543,7 @@ public List getVisibleStereotypeLabels(Entity entity) { List visibleStereotypeLabels = new ArrayList<>(); for (String stereoTypeLabel : entity.getStereotype().getLabels(Guillemet.DOUBLE_COMPARATOR)) { - if (isHiddenStereotypeLabel(stereoTypeLabel, commands)) { + if (!isHiddenStereotypeLabel(stereoTypeLabel, commands)) { visibleStereotypeLabels.add(stereoTypeLabel); } } @@ -552,12 +553,16 @@ public List getVisibleStereotypeLabels(Entity entity) { private boolean isHiddenStereotypeLabel(String stereoTypeLabel, List commands) { for (EntityHideOrShow cmd : commands) { + // gender is here the stereotype name given in the hide or show command String gender = cmd.gender.getGender(); if (gender != null && gender.equals(stereoTypeLabel)) { - return false; + return !cmd.show; + } else if (gender == null) { + // we have a hide or show command without a stereotype name => hide or show all stereotypes + return !cmd.show; } } - return true; + return false; } public final void hideOrShow(EntityGender gender, EntityPortion portions, boolean show) {