diff options
author | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2020-03-10 16:38:20 +0100 |
---|---|---|
committer | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2020-03-10 16:38:20 +0100 |
commit | 7cc8c823de644a510fcc434f39b53e5fffe66bfd (patch) | |
tree | 8f4d027284bb366734f610040c621a0c5dd0a12a /src/net/sourceforge/plantuml/salt | |
parent | 567b200b91537405689ae0ca944f121201360a6b (diff) |
New upstream version 1.2020.2
Diffstat (limited to 'src/net/sourceforge/plantuml/salt')
60 files changed, 351 insertions, 91 deletions
diff --git a/src/net/sourceforge/plantuml/salt/Cell.java b/src/net/sourceforge/plantuml/salt/Cell.java index 7e6a75c..ba09e5d 100644 --- a/src/net/sourceforge/plantuml/salt/Cell.java +++ b/src/net/sourceforge/plantuml/salt/Cell.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 * diff --git a/src/net/sourceforge/plantuml/salt/DataSource.java b/src/net/sourceforge/plantuml/salt/DataSource.java index ceaed82..68ee4df 100644 --- a/src/net/sourceforge/plantuml/salt/DataSource.java +++ b/src/net/sourceforge/plantuml/salt/DataSource.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 * diff --git a/src/net/sourceforge/plantuml/salt/DataSourceImpl.java b/src/net/sourceforge/plantuml/salt/DataSourceImpl.java index 3cfbb39..5918b8d 100644 --- a/src/net/sourceforge/plantuml/salt/DataSourceImpl.java +++ b/src/net/sourceforge/plantuml/salt/DataSourceImpl.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 * @@ -36,16 +36,10 @@ package net.sourceforge.plantuml.salt; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import net.sourceforge.plantuml.StringUtils; -import net.sourceforge.plantuml.WithSprite; -import net.sourceforge.plantuml.command.BlocLines; -import net.sourceforge.plantuml.command.Command; -import net.sourceforge.plantuml.command.CommandExecutionResult; -import net.sourceforge.plantuml.command.FactorySpriteCommand; import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.Pattern2; @@ -56,7 +50,7 @@ public class DataSourceImpl implements DataSource { private final List<Terminated<String>> data = new ArrayList<Terminated<String>>(); public DataSourceImpl(List<String> data) { - final Pattern2 p = MyPattern.cmpile("\\{[-+^#!*/]?"); + final Pattern2 p = MyPattern.cmpile("\\{(?:[-+^#!*/]|S-|SI|S)?"); for (String s : data) { final StringTokenizer st = new StringTokenizer(s, "|}", true); diff --git a/src/net/sourceforge/plantuml/salt/Dictionary.java b/src/net/sourceforge/plantuml/salt/Dictionary.java index 2c12abc..3157d50 100644 --- a/src/net/sourceforge/plantuml/salt/Dictionary.java +++ b/src/net/sourceforge/plantuml/salt/Dictionary.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,6 +38,7 @@ package net.sourceforge.plantuml.salt; import java.util.HashMap; import java.util.Map; +import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.SpriteContainer; @@ -46,9 +47,9 @@ import net.sourceforge.plantuml.graphic.HtmlColorSetSimple; import net.sourceforge.plantuml.graphic.IHtmlColorSet; import net.sourceforge.plantuml.salt.element.Element; import net.sourceforge.plantuml.salt.element.WrappedElement; +import net.sourceforge.plantuml.sprite.Sprite; import net.sourceforge.plantuml.ugraphic.ColorMapper; import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; -import net.sourceforge.plantuml.ugraphic.sprite.Sprite; public class Dictionary implements SpriteContainer, ISkinSimple { @@ -78,8 +79,8 @@ public class Dictionary implements SpriteContainer, ISkinSimple { return 0; } - public boolean useGuillemet() { - return true; + public Guillemet guillemet() { + return Guillemet.GUILLEMET; } public String getMonospacedFamily() { @@ -113,4 +114,12 @@ public class Dictionary implements SpriteContainer, ISkinSimple { return new ColorMapperIdentity(); } + public void copyAllFrom(ISkinSimple other) { + throw new UnsupportedOperationException(); + } + + public Map<String, String> values() { + throw new UnsupportedOperationException(); + } + } diff --git a/src/net/sourceforge/plantuml/salt/PSystemSalt.java b/src/net/sourceforge/plantuml/salt/PSystemSalt.java index f0ef2a5..9ade106 100644 --- a/src/net/sourceforge/plantuml/salt/PSystemSalt.java +++ b/src/net/sourceforge/plantuml/salt/PSystemSalt.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 * @@ -54,7 +54,7 @@ import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.command.BlocLines; import net.sourceforge.plantuml.command.Command; import net.sourceforge.plantuml.command.CommandExecutionResult; -import net.sourceforge.plantuml.command.FactorySpriteCommand; +import net.sourceforge.plantuml.command.CommandFactorySprite; import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.graphic.HtmlColorUtils; @@ -74,15 +74,16 @@ import net.sourceforge.plantuml.salt.factory.ElementFactoryPyramid; import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOff; import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOn; import net.sourceforge.plantuml.salt.factory.ElementFactoryRetrieveFromDictonnary; +import net.sourceforge.plantuml.salt.factory.ElementFactoryScroll; import net.sourceforge.plantuml.salt.factory.ElementFactoryTab; import net.sourceforge.plantuml.salt.factory.ElementFactoryText; import net.sourceforge.plantuml.salt.factory.ElementFactoryTextField; import net.sourceforge.plantuml.salt.factory.ElementFactoryTree; +import net.sourceforge.plantuml.sprite.Sprite; import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.sprite.Sprite; public class PSystemSalt extends AbstractPSystem implements WithSprite { @@ -142,8 +143,7 @@ public class PSystemSalt extends AbstractPSystem implements WithSprite { private List<String> manageSprite() { - final FactorySpriteCommand factorySpriteCommand = new FactorySpriteCommand(); - Command<WithSprite> cmd = factorySpriteCommand.createMultiLine(false); + final Command<WithSprite> cmd = new CommandFactorySprite().createMultiLine(false); final List<String> result = new ArrayList<String>(); for (Iterator<String> it = data.iterator(); it.hasNext();) { @@ -153,14 +153,14 @@ public class PSystemSalt extends AbstractPSystem implements WithSprite { } else if (s.startsWith("skinparam ")) { // System.err.println("skipping " + s); } else if (s.startsWith("scale ")) { - final Double scale = Double.parseDouble(s.substring("scale ".length())); + final double scale = Double.parseDouble(s.substring("scale ".length())); this.setScale(new ScaleSimple(scale)); // System.err.println("skipping " + s); } else if (s.startsWith("sprite $")) { - BlocLines bloc = BlocLines.single(s); + BlocLines bloc = BlocLines.singleString(s); do { s = it.next(); - bloc = bloc.add2(s); + bloc = bloc.addString(s); } while (s.equals("}") == false); final CommandExecutionResult cmdResult = cmd.execute(this, bloc); } else { @@ -178,6 +178,7 @@ public class PSystemSalt extends AbstractPSystem implements WithSprite { // cpx.add(new ElementFactorySimpleFrame(source, dictionnary)); cpx.add(new ElementFactoryPyramid(source, dictionary)); + cpx.add(new ElementFactoryScroll(source, dictionary)); cpx.add(new ElementFactoryBorder(source, dictionary)); for (AbstractElementFactoryComplex f : cpx) { diff --git a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java index 8de7b67..766b4fc 100644 --- a/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.java +++ b/src/net/sourceforge/plantuml/salt/PSystemSaltFactory.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 * diff --git a/src/net/sourceforge/plantuml/salt/Position.java b/src/net/sourceforge/plantuml/salt/Position.java index 212bf67..9437af2 100644 --- a/src/net/sourceforge/plantuml/salt/Position.java +++ b/src/net/sourceforge/plantuml/salt/Position.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 * diff --git a/src/net/sourceforge/plantuml/salt/Positionner2.java b/src/net/sourceforge/plantuml/salt/Positionner2.java index 92d8d96..1031cdc 100644 --- a/src/net/sourceforge/plantuml/salt/Positionner2.java +++ b/src/net/sourceforge/plantuml/salt/Positionner2.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 * diff --git a/src/net/sourceforge/plantuml/salt/Terminated.java b/src/net/sourceforge/plantuml/salt/Terminated.java index 878da08..43ae53c 100644 --- a/src/net/sourceforge/plantuml/salt/Terminated.java +++ b/src/net/sourceforge/plantuml/salt/Terminated.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 * diff --git a/src/net/sourceforge/plantuml/salt/Terminator.java b/src/net/sourceforge/plantuml/salt/Terminator.java index f0dc198..8db014b 100644 --- a/src/net/sourceforge/plantuml/salt/Terminator.java +++ b/src/net/sourceforge/plantuml/salt/Terminator.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/AbstractElement.java b/src/net/sourceforge/plantuml/salt/element/AbstractElement.java index 2be393e..d46a76d 100644 --- a/src/net/sourceforge/plantuml/salt/element/AbstractElement.java +++ b/src/net/sourceforge/plantuml/salt/element/AbstractElement.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/AbstractElementText.java b/src/net/sourceforge/plantuml/salt/element/AbstractElementText.java index ced52ca..4d47ec2 100644 --- a/src/net/sourceforge/plantuml/salt/element/AbstractElementText.java +++ b/src/net/sourceforge/plantuml/salt/element/AbstractElementText.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/Element.java b/src/net/sourceforge/plantuml/salt/element/Element.java index bc9b8d0..a38dce7 100644 --- a/src/net/sourceforge/plantuml/salt/element/Element.java +++ b/src/net/sourceforge/plantuml/salt/element/Element.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementBorder.java b/src/net/sourceforge/plantuml/salt/element/ElementBorder.java index 9494813..b0bbb24 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementBorder.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementBorder.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementButton.java b/src/net/sourceforge/plantuml/salt/element/ElementButton.java index 933675f..f7ea79b 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementButton.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementButton.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java b/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java index 6dbe5ef..e4b5f53 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementDroplist.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementDroplist.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementEmpty.java b/src/net/sourceforge/plantuml/salt/element/ElementEmpty.java index 89d6ad7..5708ca9 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementEmpty.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementEmpty.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementImage.java b/src/net/sourceforge/plantuml/salt/element/ElementImage.java index 2c506de..4818fb8 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementImage.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementImage.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementLine.java b/src/net/sourceforge/plantuml/salt/element/ElementLine.java index f5176bd..3f0edc0 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementLine.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementLine.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java index 6c8117f..13a86c5 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuBar.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java index 98b4952..6c1dfcf 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuEntry.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java b/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java index 010b753..184c882 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementMenuPopup.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java b/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java index 35ca94c..0948f04 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementPyramid.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementPyramidScrolled.java b/src/net/sourceforge/plantuml/salt/element/ElementPyramidScrolled.java new file mode 100644 index 0000000..b805384 --- /dev/null +++ b/src/net/sourceforge/plantuml/salt/element/ElementPyramidScrolled.java @@ -0,0 +1,144 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2020, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * http://plantuml.com/patreon (only 1$ per month!) + * http://plantuml.com/paypal + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * + * Original Author: Arnaud Roques + * + * + */ +package net.sourceforge.plantuml.salt.element; + +import java.awt.geom.Dimension2D; + +import net.sourceforge.plantuml.Dimension2DDouble; +import net.sourceforge.plantuml.ISkinSimple; +import net.sourceforge.plantuml.graphic.HtmlColorUtils; +import net.sourceforge.plantuml.graphic.StringBounder; +import net.sourceforge.plantuml.salt.Positionner2; +import net.sourceforge.plantuml.salt.factory.ScrollStrategy; +import net.sourceforge.plantuml.ugraphic.UChangeBackColor; +import net.sourceforge.plantuml.ugraphic.UGraphic; +import net.sourceforge.plantuml.ugraphic.ULine; +import net.sourceforge.plantuml.ugraphic.UPath; +import net.sourceforge.plantuml.ugraphic.URectangle; +import net.sourceforge.plantuml.ugraphic.UTranslate; + +public class ElementPyramidScrolled extends ElementPyramid { + + private final double v1 = 15; + private final double v2 = 12; + private final ScrollStrategy scrollStrategy; + + public ElementPyramidScrolled(Positionner2 positionner, ISkinSimple spriteContainer, ScrollStrategy scrollStrategy) { + super(positionner, TableStrategy.DRAW_OUTSIDE, null, spriteContainer); + this.scrollStrategy = scrollStrategy; + } + + @Override + public Dimension2D getPreferredDimension(StringBounder stringBounder, double x, double y) { + final Dimension2D result = super.getPreferredDimension(stringBounder, x, y); + if (scrollStrategy == ScrollStrategy.HORIZONTAL_ONLY) { + return Dimension2DDouble.delta(result, 0, 30); + } + if (scrollStrategy == ScrollStrategy.VERTICAL_ONLY) { + return Dimension2DDouble.delta(result, 30, 0); + } + return Dimension2DDouble.delta(result, 30); + } + + @Override + public void drawU(UGraphic ug, int zIndex, Dimension2D dimToUse) { + super.drawU(ug, zIndex, dimToUse); + final Dimension2D dim = super.getPreferredDimension(ug.getStringBounder(), 0, 0); + if (scrollStrategy == ScrollStrategy.BOTH || scrollStrategy == ScrollStrategy.VERTICAL_ONLY) { + drawV(ug.apply(new UTranslate(dim.getWidth() + 4, 0)), v1, dim.getHeight()); + } + if (scrollStrategy == ScrollStrategy.BOTH || scrollStrategy == ScrollStrategy.HORIZONTAL_ONLY) { + drawH(ug.apply(new UTranslate(0, dim.getHeight() + 4)), dim.getWidth(), v1); + } + } + + private UPath getTr0() { + final UPath poly = new UPath(); + poly.moveTo(3, 0); + poly.lineTo(6, 5); + poly.lineTo(0, 5); + poly.lineTo(3, 0); + poly.closePath(); + return poly; + } + + private UPath getTr180() { + final UPath poly = new UPath(); + poly.moveTo(3, 5); + poly.lineTo(6, 0); + poly.lineTo(0, 0); + poly.lineTo(3, 5); + poly.closePath(); + return poly; + } + + private UPath getTr90() { + final UPath poly = new UPath(); + poly.moveTo(0, 3); + poly.lineTo(5, 6); + poly.lineTo(5, 0); + poly.lineTo(0, 3); + poly.closePath(); + return poly; + } + + private UPath getTr270() { + final UPath poly = new UPath(); + poly.moveTo(5, 3); + poly.lineTo(0, 6); + poly.lineTo(0, 0); + poly.lineTo(5, 3); + poly.closePath(); + return poly; + } + + private void drawV(UGraphic ug, double width, double height) { + ug.draw(new URectangle(width, height)); + ug.apply(new UTranslate(0, v2)).draw(new ULine(width, 0)); + ug.apply(new UTranslate(0, height - v2)).draw(new ULine(width, 0)); + ug.apply(new UTranslate(4, 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr0()); + ug.apply(new UTranslate(4, height - v2 + 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr180()); + } + + private void drawH(UGraphic ug, double width, double height) { + ug.draw(new URectangle(width, height)); + ug.apply(new UTranslate(v2, 0)).draw(new ULine(0, height)); + ug.apply(new UTranslate(width - v2, 0)).draw(new ULine(0, height)); + ug.apply(new UTranslate(4, 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr90()); + ug.apply(new UTranslate(width - v2 + 4, 4)).apply(new UChangeBackColor(HtmlColorUtils.BLACK)).draw(getTr270()); + } + +} diff --git a/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java b/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java index bc0913a..f6338cf 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementRadioCheckbox.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java b/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java index 8b97cfd..c1f641d 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementTabBar.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementTabBar.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementText.java b/src/net/sourceforge/plantuml/salt/element/ElementText.java index 9413a5c..6c9aa9e 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementText.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementText.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTextField.java b/src/net/sourceforge/plantuml/salt/element/ElementTextField.java index 35abc2f..961985e 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementTextField.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementTextField.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTree.java b/src/net/sourceforge/plantuml/salt/element/ElementTree.java index cb099c4..6f0c136 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementTree.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementTree.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java b/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java index 5462575..e5deb9e 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementTreeEntry.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/Grid.java b/src/net/sourceforge/plantuml/salt/element/Grid.java index 63490dc..7bae8a6 100644 --- a/src/net/sourceforge/plantuml/salt/element/Grid.java +++ b/src/net/sourceforge/plantuml/salt/element/Grid.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/Grid2.java b/src/net/sourceforge/plantuml/salt/element/Grid2.java index 033c961..8a888a3 100644 --- a/src/net/sourceforge/plantuml/salt/element/Grid2.java +++ b/src/net/sourceforge/plantuml/salt/element/Grid2.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/LeftFirst.java b/src/net/sourceforge/plantuml/salt/element/LeftFirst.java index 2a2c78d..d4101d0 100644 --- a/src/net/sourceforge/plantuml/salt/element/LeftFirst.java +++ b/src/net/sourceforge/plantuml/salt/element/LeftFirst.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/ListWidth.java b/src/net/sourceforge/plantuml/salt/element/ListWidth.java index a5b55eb..7eb9564 100644 --- a/src/net/sourceforge/plantuml/salt/element/ListWidth.java +++ b/src/net/sourceforge/plantuml/salt/element/ListWidth.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/Segment.java b/src/net/sourceforge/plantuml/salt/element/Segment.java index b48a16b..789ba8d 100644 --- a/src/net/sourceforge/plantuml/salt/element/Segment.java +++ b/src/net/sourceforge/plantuml/salt/element/Segment.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/Skeleton.java b/src/net/sourceforge/plantuml/salt/element/Skeleton.java index 02cb1d9..5b82792 100644 --- a/src/net/sourceforge/plantuml/salt/element/Skeleton.java +++ b/src/net/sourceforge/plantuml/salt/element/Skeleton.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/Skeleton2.java b/src/net/sourceforge/plantuml/salt/element/Skeleton2.java index ad73227..634471d 100644 --- a/src/net/sourceforge/plantuml/salt/element/Skeleton2.java +++ b/src/net/sourceforge/plantuml/salt/element/Skeleton2.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/TableStrategy.java b/src/net/sourceforge/plantuml/salt/element/TableStrategy.java index ca0ed6c..8ef5280 100644 --- a/src/net/sourceforge/plantuml/salt/element/TableStrategy.java +++ b/src/net/sourceforge/plantuml/salt/element/TableStrategy.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/TopFirst.java b/src/net/sourceforge/plantuml/salt/element/TopFirst.java index b356930..8ffcd92 100644 --- a/src/net/sourceforge/plantuml/salt/element/TopFirst.java +++ b/src/net/sourceforge/plantuml/salt/element/TopFirst.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 * diff --git a/src/net/sourceforge/plantuml/salt/element/WrappedElement.java b/src/net/sourceforge/plantuml/salt/element/WrappedElement.java index 9a42c2b..684228e 100644 --- a/src/net/sourceforge/plantuml/salt/element/WrappedElement.java +++ b/src/net/sourceforge/plantuml/salt/element/WrappedElement.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java b/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java index d91585a..e35c0c9 100644 --- a/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.java +++ b/src/net/sourceforge/plantuml/salt/factory/AbstractElementFactoryComplex.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactory.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactory.java index 9a61ad2..f7f5d40 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactory.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactory.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java index 61ad26f..f8a7c6d 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryBorder.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java index 777c3da..eb7f949 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryButton.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 * @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; - import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.salt.DataSource; import net.sourceforge.plantuml.salt.Terminated; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java index e1132a2..37a18dc 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOff.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 * @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; import java.util.Arrays; import java.util.List; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java index 544c390..9b23e10 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryCheckboxOn.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 * @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; import java.util.Arrays; import java.util.List; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java index 73f4aed..662bd9e 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryDroplist.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 * @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; - import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.salt.DataSource; import net.sourceforge.plantuml.salt.Terminated; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java index 631b30e..c5720ed 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryImage.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java index 9894992..9e1fc18 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryLine.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java index 93b84c0..2c2772e 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryMenu.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 * @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; - import net.sourceforge.plantuml.salt.DataSource; import net.sourceforge.plantuml.salt.Dictionary; import net.sourceforge.plantuml.salt.Terminated; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java index d836f6a..31ae006 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryPyramid.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java index 210b357..5d8b5b7 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOff.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 * @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; import java.util.Arrays; import java.util.List; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java index c75d754..dd18bcd 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRadioOn.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 * @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; import java.util.Arrays; import java.util.List; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java index 05950fc..f337e7b 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryRetrieveFromDictonnary.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 * diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryScroll.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryScroll.java new file mode 100644 index 0000000..c919602 --- /dev/null +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryScroll.java @@ -0,0 +1,77 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2020, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * http://plantuml.com/patreon (only 1$ per month!) + * http://plantuml.com/paypal + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * + * Original Author: Arnaud Roques + * + * + */ +package net.sourceforge.plantuml.salt.factory; + +import net.sourceforge.plantuml.salt.DataSource; +import net.sourceforge.plantuml.salt.Dictionary; +import net.sourceforge.plantuml.salt.Positionner2; +import net.sourceforge.plantuml.salt.Terminated; +import net.sourceforge.plantuml.salt.element.Element; +import net.sourceforge.plantuml.salt.element.ElementPyramidScrolled; + +public class ElementFactoryScroll extends AbstractElementFactoryComplex { + + public ElementFactoryScroll(DataSource dataSource, Dictionary dictionary) { + super(dataSource, dictionary); + } + + public Terminated<Element> create() { + if (ready() == false) { + throw new IllegalStateException(); + } + final Terminated<String> tmp = getDataSource().next(); + final String header = tmp.getElement(); + assert header.startsWith("{"); + + final Positionner2 positionner = new Positionner2(); + + while (getDataSource().peek(0).getElement().equals("}") == false) { + final Terminated<Element> next = getNextElement(); + positionner.add(next); + } + final Terminated<String> next = getDataSource().next(); + return new Terminated<Element>(new ElementPyramidScrolled(positionner, getDictionary(), + ScrollStrategy.fromDesc(header)), next.getTerminator()); + } + + public boolean ready() { + final String text = getDataSource().peek(0).getElement(); + if (text.equals("{S") || text.equals("{S-") || text.equals("{SI")) { + return true; + } + return false; + } +} diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java index f33e918..6acb91c 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTab.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 * @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; - import net.sourceforge.plantuml.salt.DataSource; import net.sourceforge.plantuml.salt.Dictionary; import net.sourceforge.plantuml.salt.Terminated; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java index 42e5b4e..0e65a79 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryText.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 * @@ -35,7 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; import java.util.Arrays; import net.sourceforge.plantuml.ISkinSimple; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java index 7891d67..f07a56e 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTextField.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 * @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; - import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.salt.DataSource; import net.sourceforge.plantuml.salt.Terminated; diff --git a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java index 1f8bfb0..0a1a88b 100644 --- a/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.java +++ b/src/net/sourceforge/plantuml/salt/factory/ElementFactoryTree.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 * @@ -35,8 +35,6 @@ */ package net.sourceforge.plantuml.salt.factory; -import java.awt.Font; - import net.sourceforge.plantuml.salt.DataSource; import net.sourceforge.plantuml.salt.Dictionary; import net.sourceforge.plantuml.salt.Terminated; diff --git a/src/net/sourceforge/plantuml/salt/factory/ScrollStrategy.java b/src/net/sourceforge/plantuml/salt/factory/ScrollStrategy.java new file mode 100644 index 0000000..d62bb55 --- /dev/null +++ b/src/net/sourceforge/plantuml/salt/factory/ScrollStrategy.java @@ -0,0 +1,52 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2020, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * If you like this project or if you find it useful, you can support us at: + * + * http://plantuml.com/patreon (only 1$ per month!) + * http://plantuml.com/paypal + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * + * Original Author: Arnaud Roques + * + * + */ +package net.sourceforge.plantuml.salt.factory; + +public enum ScrollStrategy { + + BOTH, VERTICAL_ONLY, HORIZONTAL_ONLY; + + public static ScrollStrategy fromDesc(String s) { + if (s.endsWith("-")) { + return HORIZONTAL_ONLY; + } + if (s.endsWith("I")) { + return VERTICAL_ONLY; + } + return BOTH; + } + +} |