2010-11-15 20:35:36 +00:00
|
|
|
/* ========================================================================
|
|
|
|
* PlantUML : a free UML diagram generator
|
|
|
|
* ========================================================================
|
|
|
|
*
|
2015-04-07 18:18:37 +00:00
|
|
|
* (C) Copyright 2009-2014, Arnaud Roques
|
2010-11-15 20:35:36 +00:00
|
|
|
*
|
|
|
|
* 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
|
2013-12-10 19:36:50 +00:00
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
2010-11-15 20:35:36 +00:00
|
|
|
* 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
|
|
|
|
*
|
2015-04-07 18:18:37 +00:00
|
|
|
* Revision $Revision: 15812 $
|
2010-11-15 20:35:36 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
package net.sourceforge.plantuml.skin.rose;
|
|
|
|
|
2011-08-08 17:48:29 +00:00
|
|
|
import net.sourceforge.plantuml.AlignParam;
|
2010-11-15 20:35:36 +00:00
|
|
|
import net.sourceforge.plantuml.ColorParam;
|
|
|
|
import net.sourceforge.plantuml.FontParam;
|
|
|
|
import net.sourceforge.plantuml.ISkinParam;
|
2013-12-10 19:36:50 +00:00
|
|
|
import net.sourceforge.plantuml.LineParam;
|
|
|
|
import net.sourceforge.plantuml.cucadiagram.Display;
|
2015-04-07 18:18:37 +00:00
|
|
|
import net.sourceforge.plantuml.cucadiagram.Stereotype;
|
2013-12-10 19:36:50 +00:00
|
|
|
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
2010-11-15 20:35:36 +00:00
|
|
|
import net.sourceforge.plantuml.graphic.HtmlColor;
|
2013-12-10 19:36:50 +00:00
|
|
|
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
|
|
|
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
|
|
|
import net.sourceforge.plantuml.skin.ArrowDirection;
|
2010-11-15 20:35:36 +00:00
|
|
|
import net.sourceforge.plantuml.skin.Component;
|
|
|
|
import net.sourceforge.plantuml.skin.ComponentType;
|
|
|
|
import net.sourceforge.plantuml.skin.Skin;
|
2011-08-08 17:48:29 +00:00
|
|
|
import net.sourceforge.plantuml.ugraphic.UFont;
|
2013-12-10 19:36:50 +00:00
|
|
|
import net.sourceforge.plantuml.ugraphic.UStroke;
|
2010-11-15 20:35:36 +00:00
|
|
|
|
|
|
|
public class Rose implements Skin {
|
|
|
|
|
2013-12-10 19:36:50 +00:00
|
|
|
final private double paddingX = 5;
|
|
|
|
final private double paddingY = 5;
|
2010-11-15 20:35:36 +00:00
|
|
|
|
2011-08-08 17:48:29 +00:00
|
|
|
public HtmlColor getFontColor(ISkinParam skin, FontParam fontParam) {
|
|
|
|
return skin.getFontHtmlColor(fontParam, null);
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
2011-01-11 07:42:49 +00:00
|
|
|
|
2010-11-15 20:35:36 +00:00
|
|
|
public HtmlColor getHtmlColor(ISkinParam param, ColorParam color) {
|
2011-01-05 18:23:06 +00:00
|
|
|
return getHtmlColor(param, color, null);
|
|
|
|
}
|
|
|
|
|
2015-04-07 18:18:37 +00:00
|
|
|
public HtmlColor getHtmlColor(ISkinParam param, ColorParam color, Stereotype stereotype) {
|
2013-12-10 19:36:50 +00:00
|
|
|
HtmlColor result = param.getHtmlColor(color, stereotype, false);
|
2010-11-15 20:35:36 +00:00
|
|
|
if (result == null) {
|
2015-04-07 18:18:37 +00:00
|
|
|
result = color.getDefaultValue();
|
2010-11-15 20:35:36 +00:00
|
|
|
if (result == null) {
|
|
|
|
throw new IllegalArgumentException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2013-12-10 19:36:50 +00:00
|
|
|
public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param,
|
|
|
|
Display stringsToDisplay) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor background = param.getBackgroundColor();
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor hyperlinkColor = param.getHyperlinkColor();
|
|
|
|
final boolean useUnderlineForHyperlink = param.useUnderlineForHyperlink();
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor groupBorder = getHtmlColor(param, ColorParam.sequenceGroupBorder);
|
|
|
|
final HtmlColor groupBackground = getHtmlColor(param, ColorParam.sequenceGroupBackground);
|
|
|
|
final HtmlColor sequenceDividerBackground = getHtmlColor(param, ColorParam.sequenceDividerBackground);
|
|
|
|
final HtmlColor sequenceReferenceBackground = getHtmlColor(param, ColorParam.sequenceReferenceBackground);
|
|
|
|
final HtmlColor sequenceReferenceHeaderBackground = getHtmlColor(param,
|
|
|
|
ColorParam.sequenceReferenceHeaderBackground);
|
|
|
|
final HtmlColor sequenceReferenceBorder = getHtmlColor(param, ColorParam.sequenceReferenceBorder);
|
|
|
|
final HtmlColor lifeLineBackgroundColor = getHtmlColor(param, ColorParam.sequenceLifeLineBackground);
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor sequenceActorBackground = getHtmlColor(param, ColorParam.actorBackground);
|
|
|
|
final HtmlColor sequenceParticipantBackground = getHtmlColor(param, ColorParam.participantBackground);
|
|
|
|
|
|
|
|
final UFont fontArrow = param.getFont(FontParam.SEQUENCE_ARROW, null, false);
|
|
|
|
final UFont fontGrouping = param.getFont(FontParam.SEQUENCE_GROUP, null, false);
|
|
|
|
final UFont fontParticipant = param.getFont(FontParam.PARTICIPANT, null, false);
|
|
|
|
final UFont fontActor = param.getFont(FontParam.ACTOR, null, false);
|
2010-11-15 20:35:36 +00:00
|
|
|
|
2015-04-07 18:18:37 +00:00
|
|
|
final UFont newFontForStereotype = param.getFont(FontParam.SEQUENCE_STEREOTYPE, null, false);
|
2010-11-15 20:35:36 +00:00
|
|
|
|
2013-12-10 19:36:50 +00:00
|
|
|
final double deltaShadow = param.shadowing() ? 4.0 : 0;
|
|
|
|
|
2011-01-11 07:42:49 +00:00
|
|
|
if (type.isArrow()) {
|
2013-12-10 19:36:50 +00:00
|
|
|
// if (param.maxMessageSize() > 0) {
|
|
|
|
// final FontConfiguration fc = new FontConfiguration(fontArrow, HtmlColorUtils.BLACK);
|
|
|
|
// stringsToDisplay = DisplayUtils.breakLines(stringsToDisplay, fc, param, param.maxMessageSize());
|
|
|
|
// }
|
|
|
|
final HtmlColor sequenceArrow = config.getColor() == null ? getHtmlColor(param, ColorParam.sequenceArrow)
|
|
|
|
: config.getColor();
|
|
|
|
if (config.getArrowDirection() == ArrowDirection.SELF) {
|
2011-01-11 07:42:49 +00:00
|
|
|
return new ComponentRoseSelfArrow(sequenceArrow, getFontColor(param, FontParam.SEQUENCE_ARROW),
|
2015-04-07 18:18:37 +00:00
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontArrow, stringsToDisplay, config, param,
|
|
|
|
param.maxMessageSize(), param.strictUmlStyle() == false);
|
2011-01-11 07:42:49 +00:00
|
|
|
}
|
2013-12-10 19:36:50 +00:00
|
|
|
final HorizontalAlignment messageHorizontalAlignment = param
|
|
|
|
.getHorizontalAlignment(AlignParam.SEQUENCE_MESSAGE_ALIGN);
|
|
|
|
final HorizontalAlignment textHorizontalAlignment = param
|
|
|
|
.getHorizontalAlignment(AlignParam.SEQUENCE_MESSAGETEXT_ALIGN);
|
2015-04-07 18:18:37 +00:00
|
|
|
return new ComponentRoseArrow(sequenceArrow, getFontColor(param, FontParam.SEQUENCE_ARROW), hyperlinkColor,
|
|
|
|
useUnderlineForHyperlink, fontArrow, stringsToDisplay, config, messageHorizontalAlignment, param,
|
|
|
|
textHorizontalAlignment, param.maxMessageSize(), param.strictUmlStyle() == false);
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.PARTICIPANT_HEAD) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder);
|
2010-11-15 20:35:36 +00:00
|
|
|
return new ComponentRoseParticipant(sequenceParticipantBackground, borderColor, getFontColor(param,
|
2015-04-07 18:18:37 +00:00
|
|
|
FontParam.PARTICIPANT), hyperlinkColor, useUnderlineForHyperlink, fontParticipant,
|
|
|
|
stringsToDisplay, param, deltaShadow, param.getRoundCorner(), getStroke(param,
|
|
|
|
LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.PARTICIPANT_TAIL) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder);
|
2010-11-15 20:35:36 +00:00
|
|
|
return new ComponentRoseParticipant(sequenceParticipantBackground, borderColor, getFontColor(param,
|
2015-04-07 18:18:37 +00:00
|
|
|
FontParam.PARTICIPANT), hyperlinkColor, useUnderlineForHyperlink, fontParticipant,
|
|
|
|
stringsToDisplay, param, deltaShadow, param.getRoundCorner(), getStroke(param,
|
|
|
|
LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.PARTICIPANT_LINE) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2013-12-10 19:36:50 +00:00
|
|
|
return new ComponentRoseLine(borderColor, false, getStroke(param, LineParam.sequenceLifeLineBorder, 1));
|
2011-01-23 19:36:52 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.CONTINUE_LINE) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2013-12-10 19:36:50 +00:00
|
|
|
return new ComponentRoseLine(borderColor, true, getStroke(param, LineParam.sequenceLifeLineBorder, 1.5));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ACTOR_HEAD) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseActor(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR),
|
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, true, param, deltaShadow,
|
|
|
|
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ACTOR_TAIL) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseActor(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR),
|
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, false, param, deltaShadow,
|
|
|
|
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.BOUNDARY_HEAD) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseBoundary(sequenceActorBackground, borderColor,
|
|
|
|
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor,
|
|
|
|
stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
|
|
|
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.BOUNDARY_TAIL) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseBoundary(sequenceActorBackground, borderColor,
|
|
|
|
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor,
|
|
|
|
stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
|
|
|
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.CONTROL_HEAD) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseControl(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR),
|
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, true, param, deltaShadow,
|
|
|
|
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.CONTROL_TAIL) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseControl(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR),
|
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, false, param, deltaShadow,
|
|
|
|
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ENTITY_HEAD) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseEntity(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR),
|
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, true, param, deltaShadow,
|
|
|
|
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ENTITY_TAIL) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseEntity(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR),
|
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, false, param, deltaShadow,
|
|
|
|
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
|
|
|
FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.DATABASE_HEAD) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseDatabase(sequenceActorBackground, borderColor,
|
|
|
|
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor,
|
|
|
|
stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
|
|
|
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.DATABASE_TAIL) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
|
|
|
return new ComponentRoseDatabase(sequenceActorBackground, borderColor,
|
|
|
|
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor,
|
|
|
|
stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
|
|
|
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.NOTE) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
|
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
|
2015-04-07 18:18:37 +00:00
|
|
|
final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
|
2010-11-15 20:35:36 +00:00
|
|
|
return new ComponentRoseNote(noteBackgroundColor, borderColor, getFontColor(param, FontParam.NOTE),
|
2015-04-07 18:18:37 +00:00
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontNote, stringsToDisplay, paddingX, paddingY, param,
|
|
|
|
deltaShadow, getStroke(param, LineParam.noteBorder, 1));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
2011-09-07 20:41:58 +00:00
|
|
|
if (type == ComponentType.NOTE_HEXAGONAL) {
|
|
|
|
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
|
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
|
2015-04-07 18:18:37 +00:00
|
|
|
final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
|
2013-12-10 19:36:50 +00:00
|
|
|
return new ComponentRoseNoteHexagonal(noteBackgroundColor, borderColor,
|
2015-04-07 18:18:37 +00:00
|
|
|
getFontColor(param, FontParam.NOTE), hyperlinkColor, useUnderlineForHyperlink, fontNote,
|
|
|
|
stringsToDisplay, param, deltaShadow, getStroke(param, LineParam.noteBorder, 1));
|
2011-09-07 20:41:58 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.NOTE_BOX) {
|
|
|
|
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
|
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
|
2015-04-07 18:18:37 +00:00
|
|
|
final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
|
2011-09-07 20:41:58 +00:00
|
|
|
return new ComponentRoseNoteBox(noteBackgroundColor, borderColor, getFontColor(param, FontParam.NOTE),
|
2015-04-07 18:18:37 +00:00
|
|
|
hyperlinkColor, useUnderlineForHyperlink, fontNote, stringsToDisplay, param, deltaShadow,
|
|
|
|
getStroke(param, LineParam.noteBorder, 1));
|
2011-09-07 20:41:58 +00:00
|
|
|
}
|
2010-11-15 20:35:36 +00:00
|
|
|
if (type == ComponentType.GROUPING_HEADER) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final UFont fontGroupingHeader = param.getFont(FontParam.SEQUENCE_GROUP_HEADER, null, false);
|
|
|
|
return new ComponentRoseGroupingHeader(getFontColor(param, FontParam.SEQUENCE_GROUP_HEADER),
|
|
|
|
hyperlinkColor, useUnderlineForHyperlink, background, groupBackground, groupBorder,
|
|
|
|
fontGroupingHeader, fontGrouping, stringsToDisplay, param, deltaShadow, getStroke(param,
|
|
|
|
LineParam.sequenceGroupBorder, 2));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.GROUPING_ELSE) {
|
2015-04-07 18:18:37 +00:00
|
|
|
return new ComponentRoseGroupingElse(getFontColor(param, FontParam.SEQUENCE_GROUP), hyperlinkColor,
|
|
|
|
useUnderlineForHyperlink, groupBorder, fontGrouping, stringsToDisplay.get(0), param, background,
|
|
|
|
getStroke(param, LineParam.sequenceGroupBorder, 2));
|
2013-12-10 19:36:50 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.GROUPING_SPACE) {
|
|
|
|
return new ComponentRoseGroupingSpace(7);
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
2011-01-29 15:09:35 +00:00
|
|
|
if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2013-12-10 19:36:50 +00:00
|
|
|
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, true, true, deltaShadow > 0);
|
2011-01-29 15:09:35 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ALIVE_BOX_CLOSE_OPEN) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2013-12-10 19:36:50 +00:00
|
|
|
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, true, false, deltaShadow > 0);
|
2011-01-29 15:09:35 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ALIVE_BOX_OPEN_CLOSE) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2013-12-10 19:36:50 +00:00
|
|
|
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, false, true, deltaShadow > 0);
|
2011-01-29 15:09:35 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ALIVE_BOX_OPEN_OPEN) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2013-12-10 19:36:50 +00:00
|
|
|
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, false, false, deltaShadow > 0);
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
2011-01-12 19:06:53 +00:00
|
|
|
if (type == ComponentType.DELAY_LINE) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2011-01-12 19:06:53 +00:00
|
|
|
return new ComponentRoseDelayLine(borderColor);
|
|
|
|
}
|
|
|
|
if (type == ComponentType.DELAY_TEXT) {
|
2015-04-07 18:18:37 +00:00
|
|
|
return new ComponentRoseDelayText(getFontColor(param, FontParam.SEQUENCE_DELAY), hyperlinkColor,
|
|
|
|
useUnderlineForHyperlink, param.getFont(FontParam.SEQUENCE_DELAY, null, false), stringsToDisplay,
|
|
|
|
param);
|
2011-01-12 19:06:53 +00:00
|
|
|
}
|
2010-11-15 20:35:36 +00:00
|
|
|
if (type == ComponentType.DESTROY) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
2010-11-15 20:35:36 +00:00
|
|
|
return new ComponentRoseDestroy(borderColor);
|
|
|
|
}
|
|
|
|
if (type == ComponentType.NEWPAGE) {
|
2011-04-19 16:50:40 +00:00
|
|
|
return new ComponentRoseNewpage(getFontColor(param, FontParam.SEQUENCE_GROUP));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.DIVIDER) {
|
2015-04-07 18:18:37 +00:00
|
|
|
return new ComponentRoseDivider(getFontColor(param, FontParam.SEQUENCE_DIVIDER), hyperlinkColor,
|
|
|
|
useUnderlineForHyperlink, param.getFont(FontParam.SEQUENCE_DIVIDER, null, false),
|
|
|
|
sequenceDividerBackground, stringsToDisplay, param, deltaShadow > 0, getStroke(param,
|
|
|
|
LineParam.sequenceDividerBorder, 2));
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
2011-04-19 16:50:40 +00:00
|
|
|
if (type == ComponentType.REFERENCE) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final UFont fontGroupingHeader = param.getFont(FontParam.SEQUENCE_GROUP_HEADER, null, false);
|
|
|
|
return new ComponentRoseReference(getFontColor(param, FontParam.SEQUENCE_REFERENCE), hyperlinkColor,
|
|
|
|
useUnderlineForHyperlink, getFontColor(param, FontParam.SEQUENCE_GROUP), param.getFont(
|
|
|
|
FontParam.SEQUENCE_REFERENCE, null, false), sequenceReferenceBorder,
|
|
|
|
sequenceReferenceHeaderBackground, sequenceReferenceBackground, fontGroupingHeader,
|
|
|
|
stringsToDisplay, param.getHorizontalAlignment(AlignParam.SEQUENCE_REFERENCE_ALIGN), param,
|
|
|
|
deltaShadow, getStroke(param, LineParam.sequenceReferenceBorder, 2));
|
2011-04-19 16:50:40 +00:00
|
|
|
}
|
2010-11-15 20:35:36 +00:00
|
|
|
if (type == ComponentType.TITLE) {
|
2015-04-07 18:18:37 +00:00
|
|
|
return new ComponentRoseTitle(getFontColor(param, FontParam.SEQUENCE_TITLE), hyperlinkColor,
|
|
|
|
useUnderlineForHyperlink, param.getFont(FontParam.SEQUENCE_TITLE, null, false), stringsToDisplay,
|
|
|
|
param);
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.SIGNATURE) {
|
2015-04-07 18:18:37 +00:00
|
|
|
return new ComponentRoseTitle(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, fontGrouping,
|
|
|
|
Display.create("This skin was created ", "in April 2009."), param);
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
|
|
|
if (type == ComponentType.ENGLOBER) {
|
2011-08-08 17:48:29 +00:00
|
|
|
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceBoxBorder);
|
|
|
|
final HtmlColor backColor = getHtmlColor(param, ColorParam.sequenceBoxBackground);
|
2010-11-15 20:35:36 +00:00
|
|
|
return new ComponentRoseEnglober(borderColor, backColor, stringsToDisplay, getFontColor(param,
|
2015-04-07 18:18:37 +00:00
|
|
|
FontParam.SEQUENCE_BOX), hyperlinkColor, useUnderlineForHyperlink, param.getFont(
|
|
|
|
FontParam.SEQUENCE_BOX, null, false), param);
|
2010-11-15 20:35:36 +00:00
|
|
|
}
|
2013-12-10 19:36:50 +00:00
|
|
|
|
2010-11-15 20:35:36 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2013-12-10 19:36:50 +00:00
|
|
|
static public UStroke getStroke(ISkinParam param, LineParam lineParam, double defaultValue) {
|
2015-04-07 18:18:37 +00:00
|
|
|
final UStroke result = param.getThickness(lineParam, null);
|
2013-12-10 19:36:50 +00:00
|
|
|
if (result == null) {
|
|
|
|
return new UStroke(defaultValue);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2010-11-15 20:35:36 +00:00
|
|
|
public Object getProtocolVersion() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|