summaryrefslogtreecommitdiff
path: root/src/net/sourceforge/plantuml/graphic/USymbolStack.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/sourceforge/plantuml/graphic/USymbolStack.java')
-rw-r--r--src/net/sourceforge/plantuml/graphic/USymbolStack.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/net/sourceforge/plantuml/graphic/USymbolStack.java b/src/net/sourceforge/plantuml/graphic/USymbolStack.java
index 3511f2b..f00bfb4 100644
--- a/src/net/sourceforge/plantuml/graphic/USymbolStack.java
+++ b/src/net/sourceforge/plantuml/graphic/USymbolStack.java
@@ -2,7 +2,7 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2017, Arnaud Roques
+ * (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
@@ -91,7 +91,7 @@ class USymbolStack extends USymbol {
@Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
- final SymbolContext symbolContext) {
+ final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
@@ -115,8 +115,27 @@ class USymbolStack extends USymbol {
@Override
public TextBlock asBig(final TextBlock title, HorizontalAlignment labelAlignment, final TextBlock stereotype,
- final double width, final double height, final SymbolContext symbolContext) {
- throw new UnsupportedOperationException();
+ final double width, final double height, final SymbolContext symbolContext,
+ final HorizontalAlignment stereoAlignment) {
+ return new AbstractTextBlock() {
+
+ public void drawU(UGraphic ug) {
+ final Dimension2D dim = calculateDimension(ug.getStringBounder());
+ ug = symbolContext.apply(ug);
+ drawQueue(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
+ symbolContext.getRoundCorner());
+ final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
+ final double posStereo = (width - dimStereo.getWidth()) / 2;
+ stereotype.drawU(ug.apply(new UTranslate(posStereo, 13)));
+ final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
+ final double posTitle = (width - dimTitle.getWidth()) / 2;
+ title.drawU(ug.apply(new UTranslate(posTitle, 13 + dimStereo.getHeight())));
+ }
+
+ public Dimension2D calculateDimension(StringBounder stringBounder) {
+ return new Dimension2DDouble(width, height);
+ }
+ };
}
@Override