1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-08 19:22:25 +00:00
plantuml/src/net/sourceforge/plantuml/sequencediagram/Reference.java

97 lines
2.7 KiB
Java
Raw Normal View History

2011-04-19 16:50:40 +00:00
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009, Arnaud Roques
*
* Project Info: http://plantuml.sourceforge.net
*
* 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 Lesser 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.
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* Original Author: Arnaud Roques
*
* Revision $Revision: 6097 $
*
*/
package net.sourceforge.plantuml.sequencediagram;
2011-08-08 17:48:29 +00:00
import java.util.Collections;
import java.util.Iterator;
2011-04-19 16:50:40 +00:00
import java.util.List;
import net.sourceforge.plantuml.Url;
2011-08-08 17:48:29 +00:00
import net.sourceforge.plantuml.graphic.HtmlColor;
2011-04-19 16:50:40 +00:00
public class Reference implements Event {
2011-08-08 17:48:29 +00:00
private final List<Participant> participants;
2011-04-19 16:50:40 +00:00
private final Url url;
2011-08-08 17:48:29 +00:00
private final HtmlColor backColorGeneral;
private final HtmlColor backColorElement;
2011-04-19 16:50:40 +00:00
private final List<String> strings;
2011-08-08 17:48:29 +00:00
public Reference(List<Participant> participants, Url url, List<String> strings, HtmlColor backColorGeneral, HtmlColor backColorElement) {
this.participants = participants;
2011-04-19 16:50:40 +00:00
this.url = url;
this.strings = strings;
2011-08-08 17:48:29 +00:00
this.backColorGeneral = backColorGeneral;
this.backColorElement = backColorElement;
2011-04-19 16:50:40 +00:00
}
2011-08-08 17:48:29 +00:00
public List<Participant> getParticipant() {
return Collections.unmodifiableList(participants);
2011-04-19 16:50:40 +00:00
}
public List<String> getStrings() {
return strings;
}
public boolean dealWith(Participant someone) {
2011-08-08 17:48:29 +00:00
return participants.contains(someone);
2011-04-19 16:50:40 +00:00
}
public final Url getUrl() {
return url;
}
@Override
public String toString() {
2011-08-08 17:48:29 +00:00
final StringBuilder sb = new StringBuilder();
for (final Iterator<Participant> it = participants.iterator(); it.hasNext();) {
sb.append(it.next().getCode());
if (it.hasNext()) {
sb.append("-");
}
}
return sb.toString();
}
public final HtmlColor getBackColorGeneral() {
return backColorGeneral;
}
public final HtmlColor getBackColorElement() {
return backColorElement;
2011-04-19 16:50:40 +00:00
}
}