1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-01 16:10:48 +00:00
plantuml/src/net/sourceforge/plantuml/skin/rose/Rose.java

362 lines
18 KiB
Java
Raw Normal View History

2010-11-15 20:35:36 +00:00
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
2016-01-09 12:15:40 +00:00
* (C) Copyright 2009-2017, Arnaud Roques
2010-11-15 20:35:36 +00:00
*
2016-03-06 16:47:34 +00:00
* Project Info: http://plantuml.com
2010-11-15 20:35:36 +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:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
2010-11-15 20:35:36 +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
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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.skin.rose;
2018-07-27 21:56:46 +00:00
import net.sourceforge.plantuml.AlignmentParam;
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;
2017-02-26 16:26:11 +00:00
import net.sourceforge.plantuml.PaddingParam;
2018-04-06 20:36:30 +00:00
import net.sourceforge.plantuml.CornerParam;
2015-11-01 18:37:20 +00:00
import net.sourceforge.plantuml.SkinParamUtils;
2013-12-10 19:36:50 +00:00
import net.sourceforge.plantuml.cucadiagram.Display;
2015-04-07 18:18:37 +00:00
import net.sourceforge.plantuml.cucadiagram.Stereotype;
2015-05-03 15:36:36 +00:00
import net.sourceforge.plantuml.graphic.FontConfiguration;
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;
2015-05-03 15:36:36 +00:00
import net.sourceforge.plantuml.graphic.SymbolContext;
2013-12-10 19:36:50 +00:00
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) {
2016-01-09 12:15:40 +00:00
return skin.getFontHtmlColor(null, fontParam);
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
}
return result;
}
2015-09-28 20:42:17 +00:00
private FontConfiguration getUFont2(ISkinParam skinParam, FontParam fontParam) {
return new FontConfiguration(skinParam, fontParam, null);
2015-04-20 19:45:13 +00:00
}
2013-12-10 19:36:50 +00:00
public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param,
Display stringsToDisplay) {
2016-01-09 12:15:40 +00:00
final UFont fontGrouping = param.getFont(null, false, FontParam.SEQUENCE_GROUP);
2010-11-15 20:35:36 +00:00
2016-01-09 12:15:40 +00:00
final UFont newFontForStereotype = param.getFont(null, false, FontParam.SEQUENCE_STEREOTYPE);
2010-11-15 20:35:36 +00:00
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());
// }
2017-06-05 11:27:21 +00:00
final HtmlColor sequenceArrow = config.getColor() == null ? getHtmlColor(param, ColorParam.arrow) : config
.getColor();
2013-12-10 19:36:50 +00:00
if (config.getArrowDirection() == ArrowDirection.SELF) {
2017-06-05 11:27:21 +00:00
return new ComponentRoseSelfArrow(sequenceArrow, getUFont2(param, FontParam.ARROW), stringsToDisplay,
config, param, param.maxMessageSize(), param.strictUmlStyle() == false);
2011-01-11 07:42:49 +00:00
}
2016-11-04 21:39:29 +00:00
final HorizontalAlignment messageHorizontalAlignment = param.getHorizontalAlignment(
2018-11-26 18:46:22 +00:00
AlignmentParam.sequenceMessageAlignment, config.getArrowDirection(), config.isReverseDefine());
2016-11-04 21:39:29 +00:00
final HorizontalAlignment textHorizontalAlignment = param.getHorizontalAlignment(
2018-11-26 18:46:22 +00:00
AlignmentParam.sequenceMessageTextAlignment, config.getArrowDirection(), false);
2017-06-05 11:27:21 +00:00
return new ComponentRoseArrow(sequenceArrow, getUFont2(param, FontParam.ARROW), stringsToDisplay, config,
messageHorizontalAlignment, param, textHorizontalAlignment, param.maxMessageSize(),
2018-03-09 21:37:34 +00:00
param.strictUmlStyle() == false, param.responseMessageBelowArrow());
2010-11-15 20:35:36 +00:00
}
2017-02-26 16:26:11 +00:00
final double padding = param.getPadding(PaddingParam.PARTICIPANT);
2018-04-06 20:36:30 +00:00
final double roundCorner = param.getRoundCorner(CornerParam.DEFAULT, null);
2010-11-15 20:35:36 +00:00
if (type == ComponentType.PARTICIPANT_HEAD) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
2018-01-28 22:08:15 +00:00
FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), false, padding);
2010-11-15 20:35:36 +00:00
}
if (type == ComponentType.PARTICIPANT_TAIL) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
2018-01-28 22:08:15 +00:00
FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), false, padding);
2016-06-19 14:16:41 +00:00
}
if (type == ComponentType.COLLECTIONS_HEAD) {
2018-01-28 22:08:15 +00:00
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.collectionsBorder), getUFont2(param,
FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), true, padding);
2016-06-19 14:16:41 +00:00
}
if (type == ComponentType.COLLECTIONS_TAIL) {
2018-01-28 22:08:15 +00:00
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.collectionsBorder), getUFont2(param,
FontParam.PARTICIPANT), stringsToDisplay, param, roundCorner, newFontForStereotype, getFontColor(
param, FontParam.SEQUENCE_STEREOTYPE), param.minClassWidth(), true, padding);
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-05-03 15:36:36 +00:00
return new ComponentRoseActor(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
2015-04-20 19:45:13 +00:00
FontParam.SEQUENCE_STEREOTYPE));
2010-11-15 20:35:36 +00:00
}
if (type == ComponentType.ACTOR_TAIL) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseActor(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
2015-04-20 19:45:13 +00:00
FontParam.SEQUENCE_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
if (type == ComponentType.BOUNDARY_HEAD) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseBoundary(getSymbolContext(param, ColorParam.boundaryBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.BOUNDARY), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
FontParam.BOUNDARY_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
if (type == ComponentType.BOUNDARY_TAIL) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseBoundary(getSymbolContext(param, ColorParam.boundaryBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.BOUNDARY), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
FontParam.BOUNDARY_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
if (type == ComponentType.CONTROL_HEAD) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseControl(getSymbolContext(param, ColorParam.controlBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.CONTROL), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
FontParam.CONTROL_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
if (type == ComponentType.CONTROL_TAIL) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseControl(getSymbolContext(param, ColorParam.controlBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.CONTROL), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
FontParam.CONTROL_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
if (type == ComponentType.ENTITY_HEAD) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseEntity(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.ENTITY), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
FontParam.ENTITY_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
if (type == ComponentType.ENTITY_TAIL) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseEntity(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.ENTITY), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
FontParam.ENTITY_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
2017-06-05 11:27:21 +00:00
if (type == ComponentType.QUEUE_HEAD) {
return new ComponentRoseQueue(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.QUEUE), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
FontParam.QUEUE_STEREOTYPE));
2017-06-05 11:27:21 +00:00
}
if (type == ComponentType.QUEUE_TAIL) {
return new ComponentRoseQueue(getSymbolContext(param, ColorParam.entityBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.QUEUE), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
FontParam.QUEUE_STEREOTYPE));
2017-06-05 11:27:21 +00:00
}
2013-12-10 19:36:50 +00:00
if (type == ComponentType.DATABASE_HEAD) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseDatabase(getSymbolContext(param, ColorParam.databaseBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.DATABASE), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
FontParam.DATABASE_STEREOTYPE));
2013-12-10 19:36:50 +00:00
}
if (type == ComponentType.DATABASE_TAIL) {
2016-11-04 21:39:29 +00:00
return new ComponentRoseDatabase(getSymbolContext(param, ColorParam.databaseBorder), getUFont2(param,
2018-05-01 17:26:04 +00:00
FontParam.DATABASE), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
FontParam.DATABASE_STEREOTYPE));
2010-11-15 20:35:36 +00:00
}
if (type == ComponentType.NOTE) {
2018-11-26 18:46:22 +00:00
final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false);
2015-05-03 15:36:36 +00:00
return new ComponentRoseNote(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
2018-07-27 21:56:46 +00:00
FontParam.NOTE), stringsToDisplay, paddingX, paddingY, param, roundCorner, alignment);
2010-11-15 20:35:36 +00:00
}
2011-09-07 20:41:58 +00:00
if (type == ComponentType.NOTE_HEXAGONAL) {
2018-11-26 18:46:22 +00:00
final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false);
2015-05-03 15:36:36 +00:00
return new ComponentRoseNoteHexagonal(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
2018-10-21 19:44:14 +00:00
FontParam.NOTE), stringsToDisplay, param, alignment);
2011-09-07 20:41:58 +00:00
}
if (type == ComponentType.NOTE_BOX) {
2018-11-26 18:46:22 +00:00
final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false);
2015-05-03 15:36:36 +00:00
return new ComponentRoseNoteBox(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
2018-10-21 19:44:14 +00:00
FontParam.NOTE), stringsToDisplay, param, alignment);
2011-09-07 20:41:58 +00:00
}
2015-11-01 18:37:20 +00:00
final FontConfiguration bigFont = getUFont2(param, FontParam.SEQUENCE_GROUP_HEADER);
2010-11-15 20:35:36 +00:00
if (type == ComponentType.GROUPING_HEADER) {
2015-11-01 18:37:20 +00:00
FontConfiguration smallFont = bigFont.forceFont(fontGrouping, null);
final HtmlColor smallColor = SkinParamUtils.getFontColor(param, FontParam.SEQUENCE_GROUP, null);
if (smallColor != null) {
smallFont = smallFont.changeColor(smallColor);
}
2015-05-03 15:36:36 +00:00
return new ComponentRoseGroupingHeader(param.getBackgroundColor(), getSymbolContext(param,
2018-01-28 22:08:15 +00:00
ColorParam.sequenceGroupBorder), bigFont, smallFont, stringsToDisplay, param, roundCorner);
2010-11-15 20:35:36 +00:00
}
if (type == ComponentType.GROUPING_ELSE) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseGroupingElse(getHtmlColor(param, ColorParam.sequenceGroupBorder), getUFont2(param,
FontParam.SEQUENCE_GROUP), stringsToDisplay.get(0), param, param.getBackgroundColor());
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) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), true, true);
2011-01-29 15:09:35 +00:00
}
if (type == ComponentType.ALIVE_BOX_CLOSE_OPEN) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), true, false);
2011-01-29 15:09:35 +00:00
}
if (type == ComponentType.ALIVE_BOX_OPEN_CLOSE) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), false, true);
2011-01-29 15:09:35 +00:00
}
if (type == ComponentType.ALIVE_BOX_OPEN_OPEN) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), false, false);
2010-11-15 20:35:36 +00:00
}
2011-01-12 19:06:53 +00:00
if (type == ComponentType.DELAY_LINE) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseDelayLine(getHtmlColor(param, ColorParam.sequenceLifeLineBorder));
2011-01-12 19:06:53 +00:00
}
if (type == ComponentType.DELAY_TEXT) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseDelayText(getUFont2(param, FontParam.SEQUENCE_DELAY), stringsToDisplay, param);
2011-01-12 19:06:53 +00:00
}
2010-11-15 20:35:36 +00:00
if (type == ComponentType.DESTROY) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseDestroy(getHtmlColor(param, ColorParam.sequenceLifeLineBorder));
2010-11-15 20:35:36 +00:00
}
if (type == ComponentType.NEWPAGE) {
2016-04-22 20:36:08 +00:00
return new ComponentRoseNewpage(getHtmlColor(param, ColorParam.sequenceNewpageSeparator));
2010-11-15 20:35:36 +00:00
}
if (type == ComponentType.DIVIDER) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseDivider(getUFont2(param, FontParam.SEQUENCE_DIVIDER), getHtmlColor(param,
ColorParam.sequenceDividerBackground), stringsToDisplay, param, deltaShadow(param) > 0, getStroke(
2015-09-06 17:28:59 +00:00
param, LineParam.sequenceDividerBorder, 2), getHtmlColor(param, ColorParam.sequenceDividerBorder));
2010-11-15 20:35:36 +00:00
}
2011-04-19 16:50:40 +00:00
if (type == ComponentType.REFERENCE) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseReference(getUFont2(param, FontParam.SEQUENCE_REFERENCE), getSymbolContext(param,
2016-11-04 21:39:29 +00:00
ColorParam.sequenceReferenceBorder), bigFont, stringsToDisplay, param.getHorizontalAlignment(
2018-11-26 18:46:22 +00:00
AlignmentParam.sequenceReferenceAlignment, null, false), param, getHtmlColor(param,
2016-11-04 21:39:29 +00:00
ColorParam.sequenceReferenceBackground));
}
// if (type == ComponentType.TITLE) {
// return new ComponentRoseTitle(getUFont2(param, FontParam.SEQUENCE_TITLE), stringsToDisplay, param);
// }
// if (type == ComponentType.SIGNATURE) {
// return new ComponentRoseTitle(fontGrouping.toFont2(HtmlColorUtils.BLACK, param.useUnderlineForHyperlink(),
// param.getHyperlinkColor(), param.getTabSize()), Display.create("This skin was created ",
// "in April 2009."), param);
// }
2010-11-15 20:35:36 +00:00
if (type == ComponentType.ENGLOBER) {
2015-05-03 15:36:36 +00:00
return new ComponentRoseEnglober(getSymbolContext(param, ColorParam.sequenceBoxBorder), stringsToDisplay,
2018-01-28 22:08:15 +00:00
getUFont2(param, FontParam.SEQUENCE_BOX), param, roundCorner);
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;
}
2015-05-03 15:36:36 +00:00
private double deltaShadow(ISkinParam param) {
2018-09-23 12:15:14 +00:00
return param.shadowing(null) ? 4.0 : 0;
2015-05-03 15:36:36 +00:00
}
private SymbolContext getSymbolContext(ISkinParam param, ColorParam color) {
if (color == ColorParam.participantBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.participantBackground), getHtmlColor(param,
ColorParam.participantBorder)).withStroke(
getStroke(param, LineParam.sequenceParticipantBorder, 1.5)).withDeltaShadow(deltaShadow(param));
}
if (color == ColorParam.actorBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.actorBackground), getHtmlColor(param,
ColorParam.actorBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 2))
.withDeltaShadow(deltaShadow(param));
}
2016-11-04 21:39:29 +00:00
if (color == ColorParam.boundaryBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.boundaryBackground), getHtmlColor(param,
ColorParam.boundaryBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 2))
.withDeltaShadow(deltaShadow(param));
}
if (color == ColorParam.controlBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.controlBackground), getHtmlColor(param,
ColorParam.controlBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 2))
.withDeltaShadow(deltaShadow(param));
}
2018-01-28 22:08:15 +00:00
if (color == ColorParam.collectionsBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.collectionsBackground), getHtmlColor(param,
ColorParam.collectionsBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 1.5))
.withDeltaShadow(deltaShadow(param));
}
2016-11-04 21:39:29 +00:00
if (color == ColorParam.entityBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.entityBackground), getHtmlColor(param,
ColorParam.entityBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 2))
.withDeltaShadow(deltaShadow(param));
}
if (color == ColorParam.databaseBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.databaseBackground), getHtmlColor(param,
ColorParam.databaseBorder)).withStroke(getStroke(param, LineParam.sequenceActorBorder, 2))
.withDeltaShadow(deltaShadow(param));
}
2015-05-03 15:36:36 +00:00
if (color == ColorParam.sequenceLifeLineBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.sequenceLifeLineBackground), getHtmlColor(param,
ColorParam.sequenceLifeLineBorder)).withDeltaShadow(deltaShadow(param));
}
if (color == ColorParam.noteBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.noteBackground), getHtmlColor(param,
ColorParam.noteBorder)).withStroke(getStroke(param, LineParam.noteBorder, 1)).withDeltaShadow(
deltaShadow(param));
}
if (color == ColorParam.sequenceGroupBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.sequenceGroupBackground), getHtmlColor(param,
ColorParam.sequenceGroupBorder)).withStroke(getStroke(param, LineParam.sequenceGroupBorder, 2))
.withDeltaShadow(deltaShadow(param));
}
if (color == ColorParam.sequenceBoxBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.sequenceBoxBackground), getHtmlColor(param,
ColorParam.sequenceBoxBorder));
}
if (color == ColorParam.sequenceReferenceBorder) {
return new SymbolContext(getHtmlColor(param, ColorParam.sequenceReferenceHeaderBackground), getHtmlColor(
param, ColorParam.sequenceReferenceBorder)).withStroke(
getStroke(param, LineParam.sequenceReferenceBorder, 2)).withDeltaShadow(deltaShadow(param));
}
throw new IllegalArgumentException();
}
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;
}
}