2013-12-10 19:36:50 +00:00
|
|
|
/* ========================================================================
|
|
|
|
* PlantUML : a free UML diagram generator
|
|
|
|
* ========================================================================
|
|
|
|
*
|
2023-02-22 18:43:48 +00:00
|
|
|
* (C) Copyright 2009-2024, Arnaud Roques
|
2013-12-10 19:36:50 +00:00
|
|
|
*
|
2023-02-22 18:43:48 +00:00
|
|
|
* Project Info: https://plantuml.com
|
2022-02-08 22:22:48 +00:00
|
|
|
*
|
2017-03-15 19:13:31 +00:00
|
|
|
* If you like this project or if you find it useful, you can support us at:
|
2022-02-08 22:22:48 +00:00
|
|
|
*
|
2023-02-22 18:43:48 +00:00
|
|
|
* https://plantuml.com/patreon (only 1$ per month!)
|
|
|
|
* https://plantuml.com/paypal
|
2022-02-08 22:22:48 +00:00
|
|
|
*
|
2013-12-10 19:36:50 +00:00
|
|
|
* 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
|
2022-02-08 22:22:48 +00:00
|
|
|
*
|
2013-12-10 19:36:50 +00:00
|
|
|
*
|
|
|
|
*/
|
2016-11-18 21:12:09 +00:00
|
|
|
package net.sourceforge.plantuml.eggs;
|
2013-12-10 19:36:50 +00:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import net.sourceforge.plantuml.FileFormatOption;
|
2021-03-23 09:40:50 +00:00
|
|
|
import net.sourceforge.plantuml.PlainDiagram;
|
2013-12-10 19:36:50 +00:00
|
|
|
import net.sourceforge.plantuml.core.DiagramDescription;
|
2021-05-23 15:35:13 +00:00
|
|
|
import net.sourceforge.plantuml.core.UmlSource;
|
2023-02-22 18:43:48 +00:00
|
|
|
import net.sourceforge.plantuml.klimt.geom.GraphicPosition;
|
|
|
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
2023-02-26 18:51:17 +00:00
|
|
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
2023-02-22 18:43:48 +00:00
|
|
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
2016-11-18 21:12:09 +00:00
|
|
|
import net.sourceforge.plantuml.version.PSystemVersion;
|
2013-12-10 19:36:50 +00:00
|
|
|
|
2021-03-23 09:40:50 +00:00
|
|
|
public class PSystemWelcome extends PlainDiagram {
|
2013-12-10 19:36:50 +00:00
|
|
|
|
2021-05-14 08:42:57 +00:00
|
|
|
private final List<String> strings = new ArrayList<>();
|
2017-03-12 17:22:02 +00:00
|
|
|
private final GraphicPosition position;
|
2013-12-10 19:36:50 +00:00
|
|
|
|
2021-05-23 15:35:13 +00:00
|
|
|
public PSystemWelcome(UmlSource source, GraphicPosition position) {
|
|
|
|
super(source);
|
2017-03-12 17:22:02 +00:00
|
|
|
this.position = position;
|
2016-11-18 21:12:09 +00:00
|
|
|
strings.add("<b>Welcome to PlantUML!");
|
|
|
|
strings.add(" ");
|
|
|
|
strings.add("You can start with a simple UML Diagram like:");
|
|
|
|
strings.add(" ");
|
|
|
|
strings.add("\"\"Bob->Alice: Hello\"\"");
|
|
|
|
strings.add(" ");
|
|
|
|
strings.add("Or");
|
|
|
|
strings.add(" ");
|
|
|
|
strings.add("\"\"class Example\"\"");
|
|
|
|
strings.add(" ");
|
2020-04-26 18:31:41 +00:00
|
|
|
strings.add("You will find more information about PlantUML syntax on <u>https://plantuml.com</u>");
|
2020-07-06 01:52:54 +00:00
|
|
|
strings.add(" ");
|
2021-03-07 12:23:24 +00:00
|
|
|
strings.add("(Details by typing \"\"license\"\" keyword)");
|
2021-03-04 18:11:16 +00:00
|
|
|
strings.add(" ");
|
2017-03-12 17:22:02 +00:00
|
|
|
if (position == GraphicPosition.BACKGROUND_CORNER_BOTTOM_RIGHT) {
|
2016-12-21 22:10:29 +00:00
|
|
|
strings.add(" ");
|
|
|
|
strings.add(" ");
|
|
|
|
strings.add(" ");
|
|
|
|
strings.add(" ");
|
|
|
|
}
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
|
2016-12-01 20:29:25 +00:00
|
|
|
@Override
|
2021-03-23 09:40:50 +00:00
|
|
|
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException {
|
|
|
|
return getGraphicStrings();
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
|
2023-02-26 18:51:17 +00:00
|
|
|
public TextBlock getGraphicStrings() {
|
2022-12-13 17:30:41 +00:00
|
|
|
if (position != null)
|
2017-03-12 17:22:02 +00:00
|
|
|
return GraphicStrings.createBlackOnWhite(strings, PSystemVersion.getPlantumlImage(), position);
|
2022-12-13 17:30:41 +00:00
|
|
|
|
2016-12-21 22:10:29 +00:00
|
|
|
return GraphicStrings.createBlackOnWhite(strings);
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public DiagramDescription getDescription() {
|
2017-03-12 17:22:02 +00:00
|
|
|
return new DiagramDescription("(Empty)");
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|