From 26b872bb194ec7622997914bba53309a94b64d20 Mon Sep 17 00:00:00 2001 From: Andrew Shadura Date: Tue, 21 Jul 2015 14:52:03 +0200 Subject: Imported Upstream version 8024 --- .../activitydiagram3/InstructionRepeat.java | 112 +++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java (limited to 'src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java') diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java new file mode 100644 index 0000000..97ee9f4 --- /dev/null +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionRepeat.java @@ -0,0 +1,112 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2014, Arnaud Roques + * + * Project Info: http://plantuml.sourceforge.net + * + * This file is part of PlantUML. + * + * Licensed under The MIT License (Massachusetts Institute of Technology License) + * + * See http://opensource.org/licenses/MIT + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + * Original Author: Arnaud Roques + */ +package net.sourceforge.plantuml.activitydiagram3; + +import java.util.Set; + +import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; +import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; +import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; +import net.sourceforge.plantuml.cucadiagram.Display; +import net.sourceforge.plantuml.graphic.HtmlColor; +import net.sourceforge.plantuml.sequencediagram.NotePosition; + +public class InstructionRepeat implements Instruction { + + private final InstructionList repeatList = new InstructionList(); + private final Instruction parent; + private final LinkRendering nextLinkRenderer; + private final Swimlane swimlane; + private final HtmlColor color; + + private Display test; + private Display yes; + private Display out; + private LinkRendering endRepeatLinkRendering; + private LinkRendering backRepeatLinkRendering; + + public InstructionRepeat(Swimlane swimlane, Instruction parent, LinkRendering nextLinkRenderer, HtmlColor color) { + this.parent = parent; + this.swimlane = swimlane; + this.nextLinkRenderer = nextLinkRenderer; + this.color = color; + } + + public void add(Instruction ins) { + repeatList.add(ins); + } + + public Ftile createFtile(FtileFactory factory) { + return factory.repeat(swimlane, factory.decorateOut(repeatList.createFtile(factory), endRepeatLinkRendering), + test, yes, out, color, backRepeatLinkRendering); + } + + public Instruction getParent() { + return parent; + } + + public void setTest(Display test, Display yes, Display out, LinkRendering endRepeatLinkRendering, LinkRendering backRepeatLinkRendering) { + this.test = test; + this.yes = yes; + this.out = out; + this.endRepeatLinkRendering = endRepeatLinkRendering; + this.backRepeatLinkRendering = backRepeatLinkRendering; + } + + final public boolean kill() { + return repeatList.kill(); + } + + public LinkRendering getInLinkRendering() { + return nextLinkRenderer; + } + + public void addNote(Display note, NotePosition position) { + repeatList.addNote(note, position); + } + + public Set getSwimlanes() { + return repeatList.getSwimlanes(); + } + + public Swimlane getSwimlaneIn() { + return parent.getSwimlaneOut(); + } + + public Swimlane getSwimlaneOut() { + return repeatList.getSwimlaneOut(); + } + +} -- cgit v1.2.3