diff options
Diffstat (limited to 'src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java')
-rw-r--r-- | src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java index 28ec670..8fb8b2b 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhanced.java @@ -45,6 +45,7 @@ import java.util.ListIterator; import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinSimple; +import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.creole.CreoleMode; @@ -76,6 +77,7 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo private final List<Url> urls = new ArrayList<Url>(); private final Stereotype stereotype; private final ILeaf entity; + private final boolean inEllipse; public BodyEnhanced(List<String> rawBody, FontParam fontParam, ISkinParam skinParam, boolean manageModifier, Stereotype stereotype, ILeaf entity) { @@ -90,6 +92,7 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo this.manageHorizontalLine = true; this.manageModifier = manageModifier; this.entity = entity; + this.inEllipse = false; } public BodyEnhanced(Display display, FontParam fontParam, ISkinParam skinParam, HorizontalAlignment align, @@ -97,9 +100,6 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo this.entity = entity; this.stereotype = stereotype; this.rawBody = new ArrayList<String>(); - for (CharSequence s : display) { - this.rawBody.add(s.toString()); - } this.fontParam = fontParam; this.skinParam = skinParam; @@ -108,6 +108,14 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo this.align = skinParam.getDefaultTextAlignment(align); this.manageHorizontalLine = manageHorizontalLine; this.manageModifier = manageModifier; + this.inEllipse = fontParam == FontParam.USECASE; + + if (manageHorizontalLine && inEllipse && display.size() > 0 && isBlockSeparator(display.get(0).toString())) { + this.rawBody.add(""); + } + for (CharSequence s : display) { + this.rawBody.add(s.toString()); + } } @@ -138,6 +146,7 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo char separator = lineFirst ? '_' : 0; TextBlock title = null; List<Member> members = new ArrayList<Member>(); + // final LineBreakStrategy lineBreakStrategy = skinParam.wrapWidth(); for (ListIterator<String> it = rawBody.listIterator(); it.hasNext();) { final String s = it.next(); if (manageHorizontalLine && isBlockSeparator(s)) { @@ -164,6 +173,9 @@ public class BodyEnhanced extends AbstractTextBlock implements TextBlock, WithPo } } } + if (inEllipse && members.size() == 0) { + members.add(new MemberImpl("", false, false)); + } blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(members, fontParam, skinParam, align, stereotype, entity), separator, title)); |