summaryrefslogtreecommitdiff
path: root/src/net/sourceforge/plantuml/asciiart/TextSkin.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/sourceforge/plantuml/asciiart/TextSkin.java')
-rw-r--r--src/net/sourceforge/plantuml/asciiart/TextSkin.java31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/net/sourceforge/plantuml/asciiart/TextSkin.java b/src/net/sourceforge/plantuml/asciiart/TextSkin.java
index 4a7c8d7..5d609aa 100644
--- a/src/net/sourceforge/plantuml/asciiart/TextSkin.java
+++ b/src/net/sourceforge/plantuml/asciiart/TextSkin.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
*
@@ -38,14 +38,16 @@ package net.sourceforge.plantuml.asciiart;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.cucadiagram.Display;
+import net.sourceforge.plantuml.skin.ArrowComponent;
import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowDirection;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType;
-import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.skin.rose.ComponentRoseGroupingSpace;
+import net.sourceforge.plantuml.skin.rose.Rose;
+import net.sourceforge.plantuml.style.Style;
-public class TextSkin implements Skin {
+public class TextSkin extends Rose {
private final FileFormat fileFormat;
@@ -53,8 +55,23 @@ public class TextSkin implements Skin {
this.fileFormat = fileFormat;
}
- public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param,
- Display stringsToDisplay) {
+ @Override
+ public ArrowComponent createComponentArrow(Style[] styles, ArrowConfiguration config, ISkinParam param, Display stringsToDisplay) {
+ if (config.getArrowDirection() == ArrowDirection.LEFT_TO_RIGHT_NORMAL
+ || config.getArrowDirection() == ArrowDirection.RIGHT_TO_LEFT_REVERSE
+ || config.getArrowDirection() == ArrowDirection.BOTH_DIRECTION) {
+ return new ComponentTextArrow(ComponentType.ARROW, config, stringsToDisplay, fileFormat,
+ param.maxAsciiMessageLength());
+ }
+ if (config.isSelfArrow()) {
+ return new ComponentTextSelfArrow(ComponentType.ARROW, config, stringsToDisplay, fileFormat);
+ }
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Component createComponent(Style style[], ComponentType type, ArrowConfiguration config,
+ ISkinParam param, Display stringsToDisplay) {
if (type == ComponentType.ACTOR_HEAD || type == ComponentType.ACTOR_TAIL) {
return new ComponentTextActor(type, stringsToDisplay, fileFormat,
fileFormat == FileFormat.UTXT ? AsciiShape.STICKMAN_UNICODE : AsciiShape.STICKMAN);
@@ -125,8 +142,4 @@ public class TextSkin implements Skin {
throw new UnsupportedOperationException(type.toString());
}
- public Object getProtocolVersion() {
- return 1;
- }
-
}