mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-22 02:49:06 +00:00
version 8024
This commit is contained in:
parent
36ce60c4c1
commit
136819ca48
5
pom.xml
5
pom.xml
@ -30,13 +30,12 @@
|
||||
Script Author: Julien Eluard
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>net.sourceforge.plantuml</groupId>
|
||||
<artifactId>plantuml</artifactId>
|
||||
<version>8023-SNAPSHOT</version>
|
||||
<version>8025-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>PlantUML</name>
|
||||
|
@ -40,6 +40,7 @@ import net.sourceforge.plantuml.cucadiagram.dot.GraphvizLayoutStrategy;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
||||
import net.sourceforge.plantuml.graphic.SkinParameter;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
import net.sourceforge.plantuml.svek.PackageStyle;
|
||||
import net.sourceforge.plantuml.ugraphic.ColorMapper;
|
||||
@ -80,6 +81,8 @@ public interface ISkinParam extends ISkinSimple {
|
||||
|
||||
public boolean shadowing();
|
||||
|
||||
public boolean shadowing2(SkinParameter skinParameter);
|
||||
|
||||
public PackageStyle getPackageStyle();
|
||||
|
||||
public boolean useUml2ForComponent();
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15870 $
|
||||
* Revision $Revision: 15982 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -54,6 +54,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
||||
import net.sourceforge.plantuml.graphic.SkinParameter;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
import net.sourceforge.plantuml.svek.PackageStyle;
|
||||
import net.sourceforge.plantuml.ugraphic.ColorMapper;
|
||||
@ -434,6 +435,27 @@ public class SkinParam implements ISkinParam {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean shadowing2(SkinParameter skinParameter) {
|
||||
if (skinParameter == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
final String name = skinParameter.getUpperCaseName();
|
||||
final String value = getValue(name + "shadowing");
|
||||
if (value == null) {
|
||||
return shadowing();
|
||||
}
|
||||
if ("false".equalsIgnoreCase(value)) {
|
||||
return false;
|
||||
}
|
||||
if ("true".equalsIgnoreCase(value)) {
|
||||
return true;
|
||||
}
|
||||
if (strictUmlStyle()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public PackageStyle getPackageStyle() {
|
||||
final String value = getValue("packageStyle");
|
||||
final PackageStyle p = PackageStyle.fromString(value);
|
||||
|
@ -40,6 +40,7 @@ import net.sourceforge.plantuml.cucadiagram.dot.GraphvizLayoutStrategy;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
||||
import net.sourceforge.plantuml.graphic.SkinParameter;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
import net.sourceforge.plantuml.svek.PackageStyle;
|
||||
import net.sourceforge.plantuml.ugraphic.ColorMapper;
|
||||
@ -111,6 +112,10 @@ public class SkinParamDelegator implements ISkinParam {
|
||||
return skinParam.shadowing();
|
||||
}
|
||||
|
||||
public boolean shadowing2(SkinParameter skinParameter) {
|
||||
return skinParam.shadowing2(skinParameter);
|
||||
}
|
||||
|
||||
public PackageStyle getPackageStyle() {
|
||||
return skinParam.getPackageStyle();
|
||||
}
|
||||
|
@ -61,13 +61,12 @@ public class BodyEnhanced2 implements TextBlock {
|
||||
|
||||
// private final List<Url> urls = new ArrayList<Url>();
|
||||
|
||||
public BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple spriteContainer,
|
||||
HorizontalAlignment align, UFont fontNote, HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink) {
|
||||
public BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple spriteContainer, HorizontalAlignment align,
|
||||
FontConfiguration titleConfig) {
|
||||
this.rawBody2 = rawBody;
|
||||
// this.fontParam = fontParam;
|
||||
this.spriteContainer = spriteContainer;
|
||||
|
||||
this.titleConfig = new FontConfiguration(fontNote, fontColor, hyperlinkColor, useUnderlineForHyperlink);
|
||||
this.titleConfig = titleConfig;
|
||||
this.align = align;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ import net.sourceforge.plantuml.version.PSystemVersion;
|
||||
|
||||
public class PSystemDonors extends AbstractPSystem {
|
||||
|
||||
public static final String DONORS = "UDfTaajImp0CXlSwXTUPuH2XOSg4yfYMOS5EJKJZrfMAxHIIqwC2gTrgPOrUto-vTCM_aOSNYkHDoL7OOWElL2IJFImakJv0EPNY6kO-XMY05QqnH8jidgHZABaLR-P2SQJJy-D3CwPqP5XWDeWZL7Poh8CojPOZhFg4CC3S5fV60lL4sGTOHJfqn6OcSb1zrJI70Zpihqh5mqoSPREKFX3K_LMys8eAcPo3XSUC6lUvgwDAHz_8hQvprbdjka4_gDBbMJPlu2cdZoCyEtlKWiesEoK_Hop3NJYtvWoYe2DKuzv6FvW5Tj8YrAUbltUexREyWbmwbzfkq3KnHirJFkMg_-1fTw6Asmltjz9g8wTbppxQ4UvJk1Luj4r7pjoYTKEkm8qvJ0ZNQ3KXtzJOVFOKJDMlFUffNPB_9jj8JMSUF0PCI1lI7viTy0j-0FkXkCC0";
|
||||
public static final String DONORS = "UDfTaikosZ0CXlTw2gypquT8IOTEu5pcqEcYEv7e41sCH6s7DddwYhR11gsiqUtx9TU--cyKu9KI1LTBKc7iu1jLsVG4MyrkY50lfRY7TSWXcc17Uuo9KTop3WArz1hSMYdDT7s-lrl6aeu2Mom6IOA65uSzrBcrNc0tPeG9rbpTcoYq2-KOOPVeF92ubUhPz3NB78gmEJsKQe2LUXRtfcCaQCU7UFMX9cHnpWnF1JMUIjT6rPv-e_IspjN0rlM0OJAbRpVPSe3daZxDyEBvOWKDTqSZlqLOu4kyjPO2eg8BDFE9KvZS5WVj4ThhqdyCQEsBl8fyFfVPSR8r2IRBCpxZQl_1q_5EbVHtxjzAjaRUobv2uXc-vd2lyCJTGDvzHlPJgS3F9KoCZsWjeNngiVivKdJDk0zef_LP_dVzIDGDRXCmOaOwaFtOue2_hX_DKjn6Bmn_0C5QlDy0";
|
||||
|
||||
// public ImageData exportDiagram(OutputStream os, int num, FileFormatOption
|
||||
// fileFormat) throws IOException {
|
||||
|
@ -72,11 +72,7 @@ public class EpsGraphics {
|
||||
|
||||
public EpsGraphics() {
|
||||
header.append("%!PS-Adobe-3.0 EPSF-3.0\n");
|
||||
String v = Version.versionString();
|
||||
if (v.endsWith("beta") == false) {
|
||||
v += " ";
|
||||
}
|
||||
header.append("%%Creator: PlantUML v" + v + "\n");
|
||||
header.append("%%Creator: PlantUML v" + Version.versionString(10) + "\n");
|
||||
header.append("%%Title: noTitle\n");
|
||||
// header.append("%%CreationDate: " + new Date() + "\n");
|
||||
setcolorgradient.add(new PostScriptCommandRaw("3 index 7 index sub 1 index mul 7 index add", true));
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15812 $
|
||||
* Revision $Revision: 15932 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.graphic;
|
||||
@ -65,6 +65,18 @@ public class FontConfiguration {
|
||||
this(SkinParamUtils.getFont(skinParam, fontParam, stereo), SkinParamUtils.getFontColor(skinParam, fontParam,
|
||||
stereo), skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
|
||||
}
|
||||
|
||||
//---
|
||||
|
||||
public final boolean useUnderlineForHyperlink() {
|
||||
return useUnderlineForHyperlink;
|
||||
}
|
||||
|
||||
public final HtmlColor getHyperlinkColor() {
|
||||
return hyperlinkColor;
|
||||
}
|
||||
|
||||
//---
|
||||
|
||||
private static EnumSet<FontStyle> getStyles(UFont font) {
|
||||
final boolean bold = font.isBold();
|
||||
|
@ -146,6 +146,8 @@ public class QuoteUtils {
|
||||
"You Shall Not Pass", //
|
||||
"73.6% Of All Statistics Are Made Up", //
|
||||
"We can neither confirm nor deny that this is crashing"
|
||||
// When the beating of your heart echoes the beating of the drums
|
||||
// Never trust a computer you can't throw out a window
|
||||
);
|
||||
private QuoteUtils() {
|
||||
}
|
||||
|
130
src/net/sourceforge/plantuml/graphic/SkinParameter.java
Normal file
130
src/net/sourceforge/plantuml/graphic/SkinParameter.java
Normal file
@ -0,0 +1,130 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2014, 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 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: 8066 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
|
||||
public class SkinParameter {
|
||||
|
||||
public static final SkinParameter DATABASE = new SkinParameter("DATABASE", ColorParam.databaseBackground,
|
||||
ColorParam.databaseBorder, FontParam.DATABASE, FontParam.DATABASE_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter ARTIFACT = new SkinParameter("ARTIFACT", ColorParam.artifactBackground,
|
||||
ColorParam.artifactBorder, FontParam.ARTIFACT, FontParam.ARTIFACT_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter COMPONENT1 = new SkinParameter("COMPONENT1", ColorParam.componentBackground,
|
||||
ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter NODE = new SkinParameter("NODE", ColorParam.nodeBackground,
|
||||
ColorParam.nodeBorder, FontParam.NODE, FontParam.NODE_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter STORAGE = new SkinParameter("STORAGE", ColorParam.storageBackground,
|
||||
ColorParam.storageBorder, FontParam.STORAGE, FontParam.STORAGE_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter QUEUE = new SkinParameter("QUEUE", ColorParam.queueBackground,
|
||||
ColorParam.queueBorder, FontParam.QUEUE, FontParam.QUEUE_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter CLOUD = new SkinParameter("CLOUD", ColorParam.cloudBackground,
|
||||
ColorParam.cloudBorder, FontParam.CLOUD, FontParam.CLOUD_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter FRAME = new SkinParameter("FRAME", ColorParam.frameBackground,
|
||||
ColorParam.frameBorder, FontParam.FRAME, FontParam.FRAME_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter COMPONENT2 = new SkinParameter("COMPONENT2", ColorParam.componentBackground,
|
||||
ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter AGENT = new SkinParameter("AGENT", ColorParam.agentBackground,
|
||||
ColorParam.agentBorder, FontParam.AGENT, FontParam.AGENT_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter FOLDER = new SkinParameter("FOLDER", ColorParam.folderBackground,
|
||||
ColorParam.folderBorder, FontParam.FOLDER, FontParam.FOLDER_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter PACKAGE = new SkinParameter("PACKAGE", ColorParam.packageBackground,
|
||||
ColorParam.packageBorder, FontParam.FOLDER, FontParam.FOLDER_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter CARD = new SkinParameter("CARD", ColorParam.rectangleBackground,
|
||||
ColorParam.rectangleBorder, FontParam.RECTANGLE, FontParam.RECTANGLE_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter ACTOR = new SkinParameter("ACTOR", ColorParam.actorBackground,
|
||||
ColorParam.actorBorder, FontParam.ACTOR, FontParam.ACTOR_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter BOUNDARY = new SkinParameter("BOUNDARY", ColorParam.boundaryBackground,
|
||||
ColorParam.boundaryBorder, FontParam.BOUNDARY, FontParam.BOUNDARY_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter CONTROL = new SkinParameter("CONTROL", ColorParam.controlBackground,
|
||||
ColorParam.controlBorder, FontParam.CONTROL, FontParam.CONTROL_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter ENTITY_DOMAIN = new SkinParameter("ENTITY_DOMAIN", ColorParam.entityBackground,
|
||||
ColorParam.entityBorder, FontParam.ENTITY, FontParam.ENTITY_STEREOTYPE);
|
||||
|
||||
public static final SkinParameter INTERFACE = new SkinParameter("INTERFACE", ColorParam.interfaceBackground,
|
||||
ColorParam.interfaceBorder, FontParam.INTERFACE, FontParam.INTERFACE_STEREOTYPE);
|
||||
|
||||
private final ColorParam colorParamBorder;
|
||||
private final ColorParam colorParamBack;
|
||||
private final FontParam fontParam;
|
||||
private final FontParam fontParamStereotype;
|
||||
private final String name;
|
||||
|
||||
private SkinParameter(String name, ColorParam colorParamBack, ColorParam colorParamBorder, FontParam fontParam,
|
||||
FontParam fontParamStereotype) {
|
||||
this.name = name;
|
||||
this.colorParamBack = colorParamBack;
|
||||
this.colorParamBorder = colorParamBorder;
|
||||
this.fontParam = fontParam;
|
||||
this.fontParamStereotype = fontParamStereotype;
|
||||
}
|
||||
|
||||
public String getUpperCaseName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ColorParam getColorParamBorder() {
|
||||
return colorParamBorder;
|
||||
}
|
||||
|
||||
public ColorParam getColorParamBack() {
|
||||
return colorParamBack;
|
||||
}
|
||||
|
||||
public FontParam getFontParam() {
|
||||
return fontParam;
|
||||
}
|
||||
|
||||
public FontParam getFontParamStereotype() {
|
||||
return fontParamStereotype;
|
||||
}
|
||||
|
||||
}
|
@ -44,31 +44,55 @@ public class SymbolContext {
|
||||
private final HtmlColor foreColor;
|
||||
private final UStroke stroke;
|
||||
private final boolean shadowing;
|
||||
private final double deltaShadow;
|
||||
|
||||
private SymbolContext(HtmlColor backColor, HtmlColor foreColor, UStroke stroke, boolean shadowing) {
|
||||
private SymbolContext(HtmlColor backColor, HtmlColor foreColor, UStroke stroke, boolean shadowing,
|
||||
double deltaShadow) {
|
||||
this.backColor = backColor;
|
||||
this.foreColor = foreColor;
|
||||
this.stroke = stroke;
|
||||
this.shadowing = shadowing;
|
||||
// if (backColor instanceof HtmlColorTransparent) {
|
||||
// throw new UnsupportedOperationException();
|
||||
// }
|
||||
this.deltaShadow = deltaShadow;
|
||||
// if (backColor instanceof HtmlColorTransparent) {
|
||||
// throw new UnsupportedOperationException();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " backColor=" + backColor + " foreColor=" + foreColor;
|
||||
}
|
||||
|
||||
final public UGraphic apply(UGraphic ug) {
|
||||
return ug.apply(new UChangeColor(foreColor)).apply(new UChangeBackColor(backColor)).apply(stroke);
|
||||
return applyStroke(applyColors(ug));
|
||||
}
|
||||
|
||||
public UGraphic applyColors(UGraphic ug) {
|
||||
return ug.apply(new UChangeColor(foreColor)).apply(new UChangeBackColor(backColor));
|
||||
}
|
||||
|
||||
public UGraphic applyStroke(UGraphic ug) {
|
||||
return ug.apply(stroke);
|
||||
}
|
||||
|
||||
public SymbolContext(HtmlColor backColor, HtmlColor foreColor) {
|
||||
this(backColor, foreColor, new UStroke(), false);
|
||||
this(backColor, foreColor, new UStroke(), false, 0);
|
||||
}
|
||||
|
||||
public SymbolContext withShadow(boolean newShadow) {
|
||||
return new SymbolContext(backColor, foreColor, stroke, newShadow);
|
||||
return new SymbolContext(backColor, foreColor, stroke, newShadow, deltaShadow);
|
||||
}
|
||||
|
||||
public SymbolContext withDeltaShadow(double deltaShadow) {
|
||||
return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow);
|
||||
}
|
||||
|
||||
public SymbolContext withStroke(UStroke newStroke) {
|
||||
return new SymbolContext(backColor, foreColor, newStroke, shadowing);
|
||||
return new SymbolContext(backColor, foreColor, newStroke, shadowing, deltaShadow);
|
||||
}
|
||||
|
||||
public SymbolContext withBackColor(HtmlColor backColor) {
|
||||
return new SymbolContext(backColor, foreColor, stroke, shadowing, deltaShadow);
|
||||
}
|
||||
|
||||
public HtmlColor getBackColor() {
|
||||
@ -84,7 +108,11 @@ public class SymbolContext {
|
||||
}
|
||||
|
||||
public boolean isShadowing() {
|
||||
return shadowing;
|
||||
return shadowing || deltaShadow > 0;
|
||||
}
|
||||
|
||||
public double getDeltaShadow() {
|
||||
return deltaShadow;
|
||||
}
|
||||
|
||||
}
|
@ -46,61 +46,46 @@ public abstract class USymbol {
|
||||
|
||||
private static final Map<String, USymbol> all = new HashMap<String, USymbol>();
|
||||
|
||||
public final static USymbol STORAGE = record("STORAGE", new USymbolStorage());
|
||||
public final static USymbol DATABASE = record("DATABASE", new USymbolDatabase());
|
||||
public final static USymbol CLOUD = record("CLOUD", new USymbolCloud());
|
||||
public final static USymbol CARD = record("CARD", new USymbolCard(ColorParam.rectangleBackground,
|
||||
ColorParam.rectangleBorder, FontParam.RECTANGLE, FontParam.RECTANGLE_STEREOTYPE));
|
||||
public final static USymbol FRAME = record("FRAME", new USymbolFrame());
|
||||
public final static USymbol NODE = record("NODE", new USymbolNode());
|
||||
public final static USymbol ARTIFACT = record("ARTIFACT", new USymbolArtifact());
|
||||
public final static USymbol PACKAGE = record("PACKAGE", new USymbolFolder(ColorParam.packageBackground,
|
||||
ColorParam.packageBorder));
|
||||
public final static USymbol FOLDER = record("FOLDER", new USymbolFolder(ColorParam.folderBackground,
|
||||
ColorParam.folderBorder));
|
||||
public final static USymbol RECTANGLE = record("RECTANGLE", new USymbolRect(ColorParam.rectangleBackground,
|
||||
ColorParam.rectangleBorder, FontParam.RECTANGLE, FontParam.RECTANGLE_STEREOTYPE));
|
||||
public final static USymbol AGENT = record("AGENT", new USymbolRect(ColorParam.agentBackground,
|
||||
ColorParam.agentBorder, FontParam.AGENT, FontParam.AGENT_STEREOTYPE));
|
||||
public final static USymbol ACTOR = record("ACTOR", new USymbolActor());
|
||||
public final static USymbol STORAGE = record("STORAGE", SkinParameter.STORAGE, new USymbolStorage());
|
||||
public final static USymbol DATABASE = record("DATABASE", SkinParameter.DATABASE, new USymbolDatabase());
|
||||
public final static USymbol CLOUD = record("CLOUD", SkinParameter.CLOUD, new USymbolCloud());
|
||||
public final static USymbol CARD = record("CARD", SkinParameter.CARD, new USymbolCard(SkinParameter.CARD));
|
||||
public final static USymbol FRAME = record("FRAME", SkinParameter.FRAME, new USymbolFrame());
|
||||
public final static USymbol NODE = record("NODE", SkinParameter.NODE, new USymbolNode());
|
||||
public final static USymbol ARTIFACT = record("ARTIFACT", SkinParameter.ARTIFACT, new USymbolArtifact());
|
||||
public final static USymbol PACKAGE = record("PACKAGE", SkinParameter.PACKAGE, new USymbolFolder(
|
||||
SkinParameter.PACKAGE));
|
||||
public final static USymbol FOLDER = record("FOLDER", SkinParameter.FOLDER, new USymbolFolder(SkinParameter.FOLDER));
|
||||
public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.CARD, new USymbolRect(SkinParameter.CARD));
|
||||
public final static USymbol AGENT = record("AGENT", SkinParameter.AGENT, new USymbolRect(SkinParameter.AGENT));
|
||||
public final static USymbol ACTOR = record("ACTOR", SkinParameter.ACTOR, new USymbolActor());
|
||||
public final static USymbol USECASE = null;
|
||||
public final static USymbol COMPONENT1 = record("COMPONENT1", new USymbolComponent1());
|
||||
public final static USymbol COMPONENT2 = record("COMPONENT2", new USymbolComponent2());
|
||||
public final static USymbol BOUNDARY = record("BOUNDARY", new USymbolBoundary());
|
||||
public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", new USymbolEntityDomain(2));
|
||||
public final static USymbol CONTROL = record("CONTROL", new USymbolControl(2));
|
||||
public final static USymbol INTERFACE = record("INTERFACE", new USymbolInterface());
|
||||
public final static USymbol QUEUE = record("QUEUE", new USymbolQueue());
|
||||
public final static USymbol COMPONENT1 = record("COMPONENT1", SkinParameter.COMPONENT1, new USymbolComponent1());
|
||||
public final static USymbol COMPONENT2 = record("COMPONENT2", SkinParameter.COMPONENT2, new USymbolComponent2());
|
||||
public final static USymbol BOUNDARY = record("BOUNDARY", SkinParameter.BOUNDARY, new USymbolBoundary());
|
||||
public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", SkinParameter.ENTITY_DOMAIN,
|
||||
new USymbolEntityDomain(2));
|
||||
public final static USymbol CONTROL = record("CONTROL", SkinParameter.CONTROL, new USymbolControl(2));
|
||||
public final static USymbol INTERFACE = record("INTERFACE", SkinParameter.INTERFACE, new USymbolInterface());
|
||||
public final static USymbol QUEUE = record("QUEUE", SkinParameter.QUEUE, new USymbolQueue());
|
||||
|
||||
private final ColorParam colorParamBorder;
|
||||
private final ColorParam colorParamBack;
|
||||
private final FontParam fontParam;
|
||||
private final FontParam fontParamStereotype;
|
||||
|
||||
public USymbol(ColorParam colorParamBack, ColorParam colorParamBorder, FontParam fontParam,
|
||||
FontParam fontParamStereotype) {
|
||||
this.colorParamBack = colorParamBack;
|
||||
this.colorParamBorder = colorParamBorder;
|
||||
this.fontParam = fontParam;
|
||||
this.fontParamStereotype = fontParamStereotype;
|
||||
}
|
||||
abstract public SkinParameter getSkinParameter();
|
||||
|
||||
public FontParam getFontParam() {
|
||||
return fontParam;
|
||||
|
||||
return getSkinParameter().getFontParam();
|
||||
}
|
||||
|
||||
public FontParam getFontParamStereotype() {
|
||||
return fontParamStereotype;
|
||||
return getSkinParameter().getFontParamStereotype();
|
||||
|
||||
}
|
||||
|
||||
public ColorParam getColorParamBack() {
|
||||
return colorParamBack;
|
||||
return getSkinParameter().getColorParamBack();
|
||||
}
|
||||
|
||||
public ColorParam getColorParamBorder() {
|
||||
return colorParamBorder;
|
||||
return getSkinParameter().getColorParamBorder();
|
||||
}
|
||||
|
||||
public static USymbol getFromString(String s) {
|
||||
@ -114,7 +99,7 @@ public abstract class USymbol {
|
||||
return result;
|
||||
}
|
||||
|
||||
private static USymbol record(String code, USymbol symbol) {
|
||||
private static USymbol record(String code, SkinParameter skinParameter, USymbol symbol) {
|
||||
all.put(StringUtils.goUpperCase(code), symbol);
|
||||
return symbol;
|
||||
}
|
||||
@ -161,7 +146,7 @@ public abstract class USymbol {
|
||||
public boolean manageHorizontalLine() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public int suppHeightBecauseOfShape() {
|
||||
return 0;
|
||||
}
|
||||
|
@ -33,20 +33,21 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.skin.StickMan;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
class USymbolActor extends USymbolSimpleAbstract {
|
||||
|
||||
public USymbolActor() {
|
||||
super(ColorParam.actorBackground, ColorParam.actorBorder, FontParam.ACTOR, FontParam.ACTOR_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.ACTOR;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TextBlock getDrawing(SymbolContext symbolContext) {
|
||||
return new StickMan(symbolContext.getBackColor(), symbolContext.getForeColor(),
|
||||
symbolContext.isShadowing() ? 4.0 : 0.0);
|
||||
final double deltaShadow = symbolContext.isShadowing() ? 4.0 : 0.0;
|
||||
return new StickMan(symbolContext.withDeltaShadow(deltaShadow).withStroke(new UStroke(2)));
|
||||
}
|
||||
|
||||
}
|
@ -35,9 +35,7 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -46,11 +44,12 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolArtifact extends USymbol {
|
||||
|
||||
public USymbolArtifact() {
|
||||
super(ColorParam.artifactBackground, ColorParam.artifactBorder, FontParam.ARTIFACT,
|
||||
FontParam.ARTIFACT_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.ARTIFACT;
|
||||
}
|
||||
|
||||
|
||||
private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, boolean shadowing) {
|
||||
|
||||
final URectangle form = new URectangle(widthTotal, heightTotal);
|
||||
|
@ -33,20 +33,20 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.svek.Boundary;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
class USymbolBoundary extends USymbolSimpleAbstract {
|
||||
|
||||
public USymbolBoundary() {
|
||||
super(ColorParam.boundaryBackground, ColorParam.boundaryBorder, FontParam.BOUNDARY, FontParam.BOUNDARY_STEREOTYPE);
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.BOUNDARY;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TextBlock getDrawing(final SymbolContext symbolContext) {
|
||||
return new Boundary(symbolContext.getBackColor(), symbolContext.getForeColor(),
|
||||
symbolContext.isShadowing() ? 4.0 : 0.0, 2);
|
||||
return new Boundary(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0).withStroke(
|
||||
new UStroke(2)));
|
||||
}
|
||||
}
|
@ -35,20 +35,25 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolCard extends USymbol {
|
||||
|
||||
private final SkinParameter skinParameter;
|
||||
|
||||
public USymbolCard(ColorParam colorParamBack, ColorParam colorParamBorder, FontParam fontParam,
|
||||
FontParam fontParamStereotype) {
|
||||
super(colorParamBack, colorParamBorder, fontParam, fontParamStereotype);
|
||||
public USymbolCard(SkinParameter skinParameter) {
|
||||
this.skinParameter = skinParameter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return skinParameter;
|
||||
}
|
||||
|
||||
|
||||
private void drawRect(UGraphic ug, double width, double height, boolean shadowing, double top) {
|
||||
final URectangle shape = new URectangle(width, height);
|
||||
|
@ -35,19 +35,19 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPath;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolCloud extends USymbol {
|
||||
|
||||
public USymbolCloud() {
|
||||
super(ColorParam.cloudBackground, ColorParam.cloudBorder, FontParam.CLOUD, FontParam.CLOUD_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.CLOUD;
|
||||
}
|
||||
|
||||
|
||||
private void drawCloud(UGraphic ug, double width, double height, boolean shadowing) {
|
||||
final UPath shape = getSpecificFrontierForCloud(width, height);
|
||||
if (shadowing) {
|
||||
|
@ -35,18 +35,17 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UShape;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolComponent1 extends USymbol {
|
||||
|
||||
public USymbolComponent1() {
|
||||
super(ColorParam.componentBackground, ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE);
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.COMPONENT1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,9 +44,10 @@ import net.sourceforge.plantuml.ugraphic.UShape;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolComponent2 extends USymbol {
|
||||
|
||||
public USymbolComponent2() {
|
||||
super(ColorParam.componentBackground, ColorParam.componentBorder, FontParam.COMPONENT, FontParam.COMPONENT_STEREOTYPE);
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.COMPONENT2;
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,23 +33,27 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.svek.Control;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
class USymbolControl extends USymbolSimpleAbstract {
|
||||
|
||||
private final double thickness;
|
||||
|
||||
|
||||
public USymbolControl(double thickness) {
|
||||
super(ColorParam.controlBackground, ColorParam.controlBorder, FontParam.CONTROL, FontParam.CONTROL_STEREOTYPE);
|
||||
this.thickness = thickness;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.CONTROL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TextBlock getDrawing(final SymbolContext symbolContext) {
|
||||
return new Control(symbolContext.getBackColor(), symbolContext.getForeColor(),
|
||||
symbolContext.isShadowing() ? 4.0 : 0.0, thickness);
|
||||
return new Control(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0).withStroke(
|
||||
new UStroke(thickness)));
|
||||
}
|
||||
|
||||
}
|
@ -35,9 +35,7 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -47,11 +45,13 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolDatabase extends USymbol {
|
||||
|
||||
public USymbolDatabase() {
|
||||
super(ColorParam.databaseBackground, ColorParam.databaseBorder, FontParam.DATABASE,
|
||||
FontParam.DATABASE_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.DATABASE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void drawDatabase(UGraphic ug, double width, double height, boolean shadowing) {
|
||||
final UPath shape = new UPath();
|
||||
if (shadowing) {
|
||||
|
@ -33,23 +33,26 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.svek.EntityDomain;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
class USymbolEntityDomain extends USymbolSimpleAbstract {
|
||||
|
||||
private final double thickness;
|
||||
|
||||
public USymbolEntityDomain(double thickness) {
|
||||
super(ColorParam.entityBackground, ColorParam.entityBorder, FontParam.ENTITY, FontParam.ENTITY_STEREOTYPE);
|
||||
this.thickness = thickness;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.ENTITY_DOMAIN;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TextBlock getDrawing(final SymbolContext symbolContext) {
|
||||
return new EntityDomain(symbolContext.getBackColor(), symbolContext.getForeColor(),
|
||||
symbolContext.isShadowing() ? 4.0 : 0.0, thickness);
|
||||
return new EntityDomain(symbolContext.withDeltaShadow(symbolContext.isShadowing() ? 4.0 : 0.0).withStroke(
|
||||
new UStroke(thickness)));
|
||||
}
|
||||
|
||||
}
|
@ -35,9 +35,7 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -52,8 +50,15 @@ public class USymbolFolder extends USymbol {
|
||||
private final static int marginTitleY1 = 3;
|
||||
private final static int marginTitleY2 = 3;
|
||||
|
||||
public USymbolFolder(ColorParam colorParamBack, ColorParam colorParamBorder) {
|
||||
super(colorParamBack, colorParamBorder, FontParam.FOLDER, FontParam.FOLDER_STEREOTYPE);
|
||||
private final SkinParameter skinParameter;
|
||||
|
||||
public USymbolFolder(SkinParameter skinParameter) {
|
||||
this.skinParameter = skinParameter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return skinParameter;
|
||||
}
|
||||
|
||||
private void drawFolder(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing) {
|
||||
|
@ -35,9 +35,7 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPath;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
@ -45,10 +43,12 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolFrame extends USymbol {
|
||||
|
||||
public USymbolFrame() {
|
||||
super(ColorParam.frameBackground, ColorParam.frameBorder, FontParam.FRAME, FontParam.FRAME_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.FRAME;
|
||||
}
|
||||
|
||||
|
||||
private void drawFrame(UGraphic ug, double width, double height, Dimension2D dimTitle, boolean shadowing) {
|
||||
final URectangle shape = new URectangle(width, height);
|
||||
if (shadowing) {
|
||||
|
@ -33,17 +33,15 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.svek.CircleInterface2;
|
||||
|
||||
public class USymbolInterface extends USymbolSimpleAbstract {
|
||||
|
||||
public USymbolInterface() {
|
||||
super(ColorParam.interfaceBackground, ColorParam.interfaceBorder, FontParam.INTERFACE,
|
||||
FontParam.INTERFACE_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.INTERFACE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected TextBlock getDrawing(SymbolContext symbolContext) {
|
||||
return new CircleInterface2(symbolContext.getBackColor(), symbolContext.getForeColor(),
|
||||
|
@ -35,9 +35,7 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -45,10 +43,12 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolNode extends USymbol {
|
||||
|
||||
public USymbolNode() {
|
||||
super(ColorParam.nodeBackground, ColorParam.nodeBorder, FontParam.NODE, FontParam.NODE_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.NODE;
|
||||
}
|
||||
|
||||
|
||||
private void drawNode(UGraphic ug, double width, double height, boolean shadowing) {
|
||||
final UPolygon shape = new UPolygon();
|
||||
shape.addPoint(0, 10);
|
||||
@ -102,7 +102,7 @@ class USymbolNode extends USymbol {
|
||||
ug = symbolContext.apply(ug);
|
||||
drawNode(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
|
||||
ug = ug.apply(new UTranslate(-4, 11));
|
||||
|
||||
|
||||
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
|
||||
final double posStereo = (width - dimStereo.getWidth()) / 2;
|
||||
stereotype.drawU(ug.apply(new UTranslate(posStereo, 2)));
|
||||
@ -117,7 +117,7 @@ class USymbolNode extends USymbol {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int suppHeightBecauseOfShape() {
|
||||
return 5;
|
||||
@ -128,5 +128,4 @@ class USymbolNode extends USymbol {
|
||||
return 60;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -35,9 +35,7 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -47,10 +45,12 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolQueue extends USymbol {
|
||||
|
||||
public USymbolQueue() {
|
||||
super(ColorParam.queueBackground, ColorParam.queueBorder, FontParam.QUEUE, FontParam.QUEUE_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.QUEUE;
|
||||
}
|
||||
|
||||
|
||||
private final double dx = 5;
|
||||
|
||||
private void drawDatabase(UGraphic ug, double width, double height, boolean shadowing) {
|
||||
|
@ -35,19 +35,25 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolRect extends USymbol {
|
||||
|
||||
private final SkinParameter skinParameter;
|
||||
|
||||
public USymbolRect(ColorParam colorParamBack, ColorParam colorParamBorder, FontParam fontParam,
|
||||
FontParam fontParamStereotype) {
|
||||
super(colorParamBack, colorParamBorder, fontParam, fontParamStereotype);
|
||||
|
||||
public USymbolRect(SkinParameter skinParameter) {
|
||||
this.skinParameter = skinParameter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return skinParameter;
|
||||
}
|
||||
|
||||
|
||||
private void drawRect(UGraphic ug, double width, double height, boolean shadowing) {
|
||||
final URectangle shape = new URectangle(width, height);
|
||||
|
@ -35,23 +35,12 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
abstract class USymbolSimpleAbstract extends USymbol {
|
||||
|
||||
// public USymbolSimpleAbstract(ColorParam colorParamBack, ColorParam colorParamBorder) {
|
||||
// super(colorParamBack, colorParamBorder);
|
||||
// }
|
||||
|
||||
public USymbolSimpleAbstract(ColorParam colorParamBack, ColorParam colorParamBorder, FontParam fontParam,
|
||||
FontParam fontParamStereotype) {
|
||||
super(colorParamBack, colorParamBorder, fontParam, fontParamStereotype);
|
||||
}
|
||||
|
||||
public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
|
||||
if (stereotype == null) {
|
||||
throw new IllegalArgumentException();
|
||||
|
@ -35,17 +35,16 @@ package net.sourceforge.plantuml.graphic;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
class USymbolStorage extends USymbol {
|
||||
|
||||
public USymbolStorage() {
|
||||
super(ColorParam.storageBackground, ColorParam.storageBorder, FontParam.STORAGE, FontParam.STORAGE_STEREOTYPE);
|
||||
@Override
|
||||
public SkinParameter getSkinParameter() {
|
||||
return SkinParameter.STORAGE;
|
||||
}
|
||||
|
||||
private void drawStorage(UGraphic ug, double width, double height, boolean shadowing) {
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 14708 $
|
||||
* Revision $Revision: 15991 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.png;
|
||||
@ -85,7 +85,7 @@ public class PngTitler {
|
||||
new SpriteContainerEmpty());
|
||||
}
|
||||
|
||||
public double getOffsetX(double imWidth, StringBounder stringBounder) {
|
||||
private double getOffsetX(double imWidth, StringBounder stringBounder) {
|
||||
final TextBlock textBloc = getTextBlock();
|
||||
if (textBloc == null) {
|
||||
return 0;
|
||||
@ -98,7 +98,7 @@ public class PngTitler {
|
||||
return (dimText.getWidth() - imWidth) / 2;
|
||||
}
|
||||
|
||||
public double getOffsetY(StringBounder stringBounder) {
|
||||
private double getOffsetY(StringBounder stringBounder) {
|
||||
final TextBlock textBloc = getTextBlock();
|
||||
if (textBloc == null) {
|
||||
return 0;
|
||||
|
@ -44,8 +44,8 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.SimpleContext2D;
|
||||
import net.sourceforge.plantuml.skin.rose.ComponentRoseNote;
|
||||
@ -111,8 +111,9 @@ public class PostIt {
|
||||
|
||||
final SkinParam param = SkinParam.noShadowing();
|
||||
final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
|
||||
final ComponentRoseNote note = new ComponentRoseNote(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(HtmlColorUtils.BLACK, true, HtmlColorUtils.BLUE),
|
||||
text, 0, 0, new SpriteContainerEmpty(), 0, new UStroke());
|
||||
final ComponentRoseNote note = new ComponentRoseNote(
|
||||
new SymbolContext(noteBackgroundColor, borderColor).withStroke(new UStroke()), fontNote.toFont2(
|
||||
HtmlColorUtils.BLACK, true, HtmlColorUtils.BLUE), text, 0, 0, new SpriteContainerEmpty());
|
||||
return note;
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
* Original Author: Arnaud Roques
|
||||
* Modified by: Nicolas Jouanin
|
||||
*
|
||||
* Revision $Revision: 15613 $
|
||||
* Revision $Revision: 15993 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.preproc;
|
||||
@ -51,6 +51,7 @@ import net.sourceforge.plantuml.Log;
|
||||
import net.sourceforge.plantuml.OptionFlags;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.command.regex.MyPattern;
|
||||
import net.sourceforge.plantuml.utils.StartUtils;
|
||||
|
||||
class PreprocessorInclude implements ReadLine {
|
||||
|
||||
@ -88,6 +89,15 @@ class PreprocessorInclude implements ReadLine {
|
||||
}
|
||||
|
||||
public String readLine() throws IOException {
|
||||
final String result = readLineInternal();
|
||||
if (result != null && (StartUtils.isArobaseEndDiagram(result) || StartUtils.isArobaseStartDiagram(result))) {
|
||||
// http://plantuml.sourceforge.net/qa/?qa=3389/error-generating-when-same-file-included-different-diagram
|
||||
filesUsed.clear();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String readLineInternal() throws IOException {
|
||||
if (included != null) {
|
||||
final String s = included.readLine();
|
||||
if (s != null) {
|
||||
@ -113,9 +123,7 @@ class PreprocessorInclude implements ReadLine {
|
||||
if (mUrl.find()) {
|
||||
return manageUrlInclude(mUrl);
|
||||
}
|
||||
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
private String manageUrlInclude(Matcher m) throws IOException {
|
||||
|
@ -37,6 +37,8 @@ import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
@ -68,12 +70,11 @@ public abstract class AbstractMessage implements EventWithDeactivate {
|
||||
public void goParallel() {
|
||||
this.parallel = true;
|
||||
}
|
||||
|
||||
|
||||
public boolean isParallel() {
|
||||
return parallel;
|
||||
}
|
||||
|
||||
|
||||
final public Url getUrl() {
|
||||
if (url == null) {
|
||||
return urlNote;
|
||||
@ -163,10 +164,14 @@ public abstract class AbstractMessage implements EventWithDeactivate {
|
||||
return notePosition;
|
||||
}
|
||||
|
||||
public final HtmlColor getSpecificBackColor() {
|
||||
private final HtmlColor getSpecificBackColor() {
|
||||
return noteBackColor;
|
||||
}
|
||||
|
||||
public SkinParamBackcolored getSkinParamNoteBackcolored(ISkinParam skinParam) {
|
||||
return new SkinParamBackcolored(skinParam, getSpecificBackColor());
|
||||
}
|
||||
|
||||
public final NotePosition getNotePosition() {
|
||||
return notePosition;
|
||||
}
|
||||
|
@ -28,11 +28,13 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15048 $
|
||||
* Revision $Revision: 16005 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||
import net.sourceforge.plantuml.SpecificBackcolorable;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
import net.sourceforge.plantuml.UrlBuilder;
|
||||
@ -124,4 +126,8 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
|
||||
this.style = style;
|
||||
}
|
||||
|
||||
public SkinParamBackcolored getSkinParamBackcolored(ISkinParam skinParam) {
|
||||
return new SkinParamBackcolored(skinParam, getSpecificBackColor());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,12 +28,14 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 12299 $
|
||||
* Revision $Revision: 15995 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||
import net.sourceforge.plantuml.SpecificBackcolorable;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
@ -146,4 +148,14 @@ public class Participant implements SpecificBackcolorable {
|
||||
return type.getBackgroundColorParam();
|
||||
}
|
||||
|
||||
public SkinParamBackcolored getSkinParamBackcolored(ISkinParam skinParam) {
|
||||
HtmlColor specificBackColor = getSpecificBackColor();
|
||||
final boolean clickable = getUrl() != null;
|
||||
final HtmlColor stereoBackColor = skinParam.getHtmlColor(getBackgroundColorParam(), getStereotype(), clickable);
|
||||
if (stereoBackColor != null && specificBackColor == null) {
|
||||
specificBackColor = stereoBackColor;
|
||||
}
|
||||
return new SkinParamBackcolored(skinParam, specificBackColor, clickable);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 14860 $
|
||||
* Revision $Revision: 16005 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||
@ -42,7 +42,6 @@ import net.sourceforge.plantuml.OptionFlags;
|
||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||
import net.sourceforge.plantuml.SkinParamBackcoloredReference;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
|
||||
import net.sourceforge.plantuml.sequencediagram.Delay;
|
||||
@ -431,7 +430,7 @@ class DrawableSetInitializer {
|
||||
p2 = tmp;
|
||||
}
|
||||
}
|
||||
final ISkinParam skinParam = new SkinParamBackcolored(drawableSet.getSkinParam(), n.getSpecificBackColor());
|
||||
final ISkinParam skinParam = n.getSkinParamBackcolored(drawableSet.getSkinParam());
|
||||
final ComponentType type = getNoteComponentType(n.getStyle());
|
||||
final NoteBox noteBox = new NoteBox(freeY2.getFreeY(range), drawableSet.getSkin().createComponent(type, null,
|
||||
skinParam, n.getStrings()), p1, p2, n.getPosition(), n.getUrl());
|
||||
@ -581,15 +580,8 @@ class DrawableSetInitializer {
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
HtmlColor specificBackColor = p.getSpecificBackColor();
|
||||
final boolean clickable = p.getUrl() != null;
|
||||
final HtmlColor stereoBackColor = drawableSet.getSkinParam().getHtmlColor(p.getBackgroundColorParam(),
|
||||
p.getStereotype(), clickable);
|
||||
if (stereoBackColor != null && specificBackColor == null) {
|
||||
specificBackColor = stereoBackColor;
|
||||
}
|
||||
|
||||
final ISkinParam skinParam = new SkinParamBackcolored(drawableSet.getSkinParam(), specificBackColor, clickable);
|
||||
final ISkinParam skinParam = p.getSkinParamBackcolored(drawableSet.getSkinParam());
|
||||
final Display participantDisplay = p.getDisplay(skinParam.forceSequenceParticipantUnderlined());
|
||||
final Component head = drawableSet.getSkin().createComponent(headType, null, skinParam, participantDisplay);
|
||||
final Component tail = drawableSet.getSkin().createComponent(tailType, null, skinParam, participantDisplay);
|
||||
|
@ -173,7 +173,8 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker {
|
||||
// System.err.println("scale=" + scale);
|
||||
|
||||
final ImageBuilder imageBuilder = new ImageBuilder(diagram.getSkinParam().getColorMapper(), oneOf(scale,
|
||||
dpiFactor), diagram.getSkinParam().getBackgroundColor(), null, null, 3, 10, diagram.getAnimation(), diagram.getSkinParam().handwritten());
|
||||
dpiFactor), diagram.getSkinParam().getBackgroundColor(), null, null, 3, 10, diagram.getAnimation(),
|
||||
diagram.getSkinParam().handwritten());
|
||||
|
||||
imageBuilder.addUDrawable(new UDrawable() {
|
||||
public void drawU(UGraphic ug) {
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15524 $
|
||||
* Revision $Revision: 16005 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.graphic;
|
||||
@ -72,8 +72,7 @@ class Step1Message extends Step1Abstract {
|
||||
}
|
||||
|
||||
if (message.getNote() != null) {
|
||||
final ISkinParam skinParam = new SkinParamBackcolored(drawingSet.getSkinParam(),
|
||||
message.getSpecificBackColor());
|
||||
final ISkinParam skinParam = message.getSkinParamNoteBackcolored(drawingSet.getSkinParam());
|
||||
setNote(drawingSet.getSkin().createComponent(ComponentType.NOTE, null, skinParam, message.getNote()));
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,7 @@ class Step1MessageExo extends Step1Abstract {
|
||||
message.isShortArrow(), message.getArrowConfiguration());
|
||||
|
||||
if (message.getNote() != null) {
|
||||
final ISkinParam skinParam = new SkinParamBackcolored(drawingSet.getSkinParam(),
|
||||
message.getSpecificBackColor());
|
||||
final ISkinParam skinParam = message.getSkinParamNoteBackcolored(drawingSet.getSkinParam());
|
||||
setNote(drawingSet.getSkin().createComponent(ComponentType.NOTE, null, skinParam, message.getNote()));
|
||||
// throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -41,16 +41,16 @@ import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||
import net.sourceforge.plantuml.sequencediagram.MessageExo;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowComponent;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.SimpleContext2D;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class CommunicationExoTile implements Tile {
|
||||
public class CommunicationExoTile implements TileWithUpdateStairs {
|
||||
|
||||
private final LivingSpace livingSpace;
|
||||
private final MessageExo message;
|
||||
@ -58,12 +58,11 @@ public class CommunicationExoTile implements Tile {
|
||||
private final ISkinParam skinParam;
|
||||
private final Real alpha;
|
||||
private final Real omega;
|
||||
|
||||
|
||||
public Event getEvent() {
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
public CommunicationExoTile(LivingSpace livingSpace, MessageExo message, Skin skin, ISkinParam skinParam,
|
||||
Real alpha, Real omega) {
|
||||
this.livingSpace = livingSpace;
|
||||
@ -115,6 +114,15 @@ public class CommunicationExoTile implements Tile {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateStairs(StringBounder stringBounder, double y) {
|
||||
final ArrowComponent comp = (ArrowComponent) getComponent(stringBounder);
|
||||
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
|
||||
final double arrowY = comp.getStartPoint(stringBounder, dim).getY();
|
||||
|
||||
livingSpace.addStepForLivebox(getEvent(), y + arrowY);
|
||||
|
||||
}
|
||||
|
||||
private Real getPoint1(final StringBounder stringBounder) {
|
||||
if (message.getType().isRightBorder()) {
|
||||
return livingSpace.getPosC(stringBounder);
|
||||
|
@ -39,14 +39,12 @@ import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
|
||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||
import net.sourceforge.plantuml.sequencediagram.Message;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.ArrowComponent;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.SimpleContext2D;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -54,7 +52,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
public class CommunicationTileNoteLeft implements TileWithUpdateStairs {
|
||||
|
||||
private final TileWithUpdateStairs tile;
|
||||
private final Message message;
|
||||
private final AbstractMessage message;
|
||||
private final Skin skin;
|
||||
private final ISkinParam skinParam;
|
||||
private final Display notes;
|
||||
@ -66,7 +64,7 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs {
|
||||
}
|
||||
|
||||
|
||||
public CommunicationTileNoteLeft(TileWithUpdateStairs tile, Message message, Skin skin, ISkinParam skinParam,
|
||||
public CommunicationTileNoteLeft(TileWithUpdateStairs tile, AbstractMessage message, Skin skin, ISkinParam skinParam,
|
||||
LivingSpace livingSpace) {
|
||||
this.tile = tile;
|
||||
this.message = message;
|
||||
@ -83,7 +81,7 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs {
|
||||
|
||||
|
||||
private Component getComponent(StringBounder stringBounder) {
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null, skinParam, notes);
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null, message.getSkinParamNoteBackcolored(skinParam), notes);
|
||||
return comp;
|
||||
}
|
||||
|
||||
|
@ -39,13 +39,12 @@ import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
|
||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||
import net.sourceforge.plantuml.sequencediagram.Message;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.SimpleContext2D;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -53,20 +52,19 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
public class CommunicationTileNoteRight implements TileWithUpdateStairs {
|
||||
|
||||
private final TileWithUpdateStairs tile;
|
||||
private final Message message;
|
||||
private final AbstractMessage message;
|
||||
private final Skin skin;
|
||||
private final ISkinParam skinParam;
|
||||
private final Display notes;
|
||||
// private final NotePosition notePosition;
|
||||
private final LivingSpace livingSpace;
|
||||
|
||||
|
||||
public Event getEvent() {
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
public CommunicationTileNoteRight(TileWithUpdateStairs tile, Message message, Skin skin, ISkinParam skinParam,
|
||||
LivingSpace livingSpace) {
|
||||
public CommunicationTileNoteRight(TileWithUpdateStairs tile, AbstractMessage message, Skin skin,
|
||||
ISkinParam skinParam, LivingSpace livingSpace) {
|
||||
this.tile = tile;
|
||||
this.message = message;
|
||||
this.skin = skin;
|
||||
@ -75,14 +73,14 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs {
|
||||
// this.notePosition = message.getNotePosition();
|
||||
this.livingSpace = livingSpace;
|
||||
}
|
||||
|
||||
|
||||
public void updateStairs(StringBounder stringBounder, double y) {
|
||||
tile.updateStairs(stringBounder, y);
|
||||
}
|
||||
|
||||
|
||||
private Component getComponent(StringBounder stringBounder) {
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null, skinParam, notes);
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null,
|
||||
message.getSkinParamNoteBackcolored(skinParam), notes);
|
||||
return comp;
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class CommunicationTileSelfNoteRight implements TileWithUpdateStairs {
|
||||
|
||||
|
||||
private Component getComponent(StringBounder stringBounder) {
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null, skinParam, notes);
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null, message.getSkinParamNoteBackcolored(skinParam), notes);
|
||||
return comp;
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||
import net.sourceforge.plantuml.sequencediagram.LifeEvent;
|
||||
import net.sourceforge.plantuml.sequencediagram.Message;
|
||||
@ -127,6 +128,27 @@ public class EventsHistory {
|
||||
return false;
|
||||
}
|
||||
|
||||
private HtmlColor getActivateColor(Event event) {
|
||||
for (Iterator<Event> it = events.iterator(); it.hasNext();) {
|
||||
final Event current = it.next();
|
||||
if (event != current) {
|
||||
continue;
|
||||
}
|
||||
if (current instanceof Message) {
|
||||
final Event next = nextButSkippingNotes(it);
|
||||
if (next instanceof LifeEvent) {
|
||||
final LifeEvent le = (LifeEvent) next;
|
||||
if (le.isActivate()) {
|
||||
return le.getSpecificBackColor();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Event nextButSkippingNotes(Iterator<Event> it) {
|
||||
while (true) {
|
||||
if (it.hasNext() == false) {
|
||||
@ -151,11 +173,11 @@ public class EventsHistory {
|
||||
if (position != null) {
|
||||
assert position <= totalHeight : "position=" + position + " totalHeight=" + totalHeight;
|
||||
value = getLevelAt(event, EventsHistoryMode.CONSIDERE_FUTURE_DEACTIVATE);
|
||||
result.addStep(new StairsPosition(position, isNextEventADestroy(event)), value);
|
||||
result.addStep(new StairsPosition(position, isNextEventADestroy(event)), value, getActivateColor(event));
|
||||
}
|
||||
}
|
||||
System.err.println("EventsHistory::getStairs finishing totalHeight=" + totalHeight);
|
||||
result.addStep(new StairsPosition(totalHeight, false), value);
|
||||
result.addStep(new StairsPosition(totalHeight, false), value, null);
|
||||
// System.err.println("EventsHistory::getStairs " + p + " result=" + result);
|
||||
return result;
|
||||
}
|
||||
|
@ -44,7 +44,6 @@ import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.real.RealMax;
|
||||
import net.sourceforge.plantuml.real.RealMin;
|
||||
import net.sourceforge.plantuml.real.RealUtils;
|
||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||
import net.sourceforge.plantuml.sequencediagram.Grouping;
|
||||
import net.sourceforge.plantuml.sequencediagram.GroupingLeaf;
|
||||
@ -54,7 +53,6 @@ import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.SimpleContext2D;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -80,13 +78,14 @@ public class GroupingTile implements Tile {
|
||||
return start;
|
||||
}
|
||||
|
||||
public GroupingTile(Iterator<Event> it, GroupingStart start, TileArguments tileArguments) {
|
||||
final StringBounder stringBounder = tileArguments.getStringBounder();
|
||||
public GroupingTile(Iterator<Event> it, GroupingStart start, TileArguments tileArgumentsBachColorChanged,
|
||||
TileArguments tileArgumentsOriginal) {
|
||||
final StringBounder stringBounder = tileArgumentsOriginal.getStringBounder();
|
||||
this.start = start;
|
||||
this.display = start.getTitle().equals("group") ? Display.create(start.getComment()) : Display.create(
|
||||
start.getTitle(), start.getComment());
|
||||
this.skin = tileArguments.getSkin();
|
||||
this.skinParam = tileArguments.getSkinParam();
|
||||
this.skin = tileArgumentsOriginal.getSkin();
|
||||
this.skinParam = tileArgumentsBachColorChanged.getSkinParam();
|
||||
// this.max = min.addAtLeast(dim1.getWidth());
|
||||
|
||||
while (it.hasNext()) {
|
||||
@ -95,12 +94,12 @@ public class GroupingTile implements Tile {
|
||||
if (ev instanceof GroupingLeaf && ((Grouping) ev).getType() == GroupingType.END) {
|
||||
break;
|
||||
}
|
||||
final Tile tile = TileBuilder.buildOne(it, tileArguments, ev, this);
|
||||
final Tile tile = TileBuilder.buildOne(it, tileArgumentsOriginal, ev, this);
|
||||
if (tile != null) {
|
||||
tiles.add(tile);
|
||||
min.put(tile.getMinX(stringBounder).addFixed(-MARGINX));
|
||||
final Real m = tile.getMaxX(stringBounder);
|
||||
max.put(m == tileArguments.getOmega() ? m : m.addFixed(MARGINX));
|
||||
max.put(m == tileArgumentsOriginal.getOmega() ? m : m.addFixed(MARGINX));
|
||||
bodyHeight += tile.getPreferredHeight(stringBounder);
|
||||
}
|
||||
}
|
||||
@ -108,8 +107,8 @@ public class GroupingTile implements Tile {
|
||||
final double width = dim1.getWidth();
|
||||
System.err.println("width=" + width);
|
||||
if (min.size() == 0) {
|
||||
min.put(tileArguments.getOrigin());
|
||||
max.put(tileArguments.getOmega());
|
||||
min.put(tileArgumentsOriginal.getOrigin());
|
||||
max.put(tileArgumentsOriginal.getOmega());
|
||||
}
|
||||
// max.ensureBiggerThan(min.addFixed(width));
|
||||
this.max.ensureBiggerThan(getMinX(stringBounder).addFixed(width + 16));
|
||||
|
@ -28,29 +28,34 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 8151 $
|
||||
* Revision $Revision: 6054 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin;
|
||||
package net.sourceforge.plantuml.sequencediagram.teoz;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
|
||||
public class BiColor {
|
||||
public class IntegerColored {
|
||||
|
||||
private final HtmlColor yellowBack;
|
||||
private final HtmlColor redBorder;
|
||||
private final int value;
|
||||
private final HtmlColor color;
|
||||
|
||||
public BiColor(HtmlColor yellowBack, HtmlColor redBorder) {
|
||||
this.yellowBack = yellowBack;
|
||||
this.redBorder = redBorder;
|
||||
public IntegerColored(int value, HtmlColor color) {
|
||||
this.value = value;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public HtmlColor getYellowBack() {
|
||||
return yellowBack;
|
||||
@Override
|
||||
public String toString() {
|
||||
return "" + value + " " + color;
|
||||
}
|
||||
|
||||
public HtmlColor getRedBorder() {
|
||||
return redBorder;
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public HtmlColor getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
}
|
@ -37,6 +37,8 @@ import java.awt.geom.Dimension2D;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
@ -71,22 +73,31 @@ public class LiveBoxes implements UDrawable {
|
||||
}
|
||||
|
||||
private void drawOneLevel(UGraphic ug, int levelToDraw, Stairs2 stairs, Context2D context) {
|
||||
final Component comp = skin.createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam, null);
|
||||
final Component comp1 = skin.createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam, null);
|
||||
final Component cross = skin.createComponent(ComponentType.DESTROY, null, skinParam, null);
|
||||
final Dimension2D dimCross = cross.getPreferredDimension(ug.getStringBounder());
|
||||
final double width = comp.getPreferredWidth(ug.getStringBounder());
|
||||
final double width = comp1.getPreferredWidth(ug.getStringBounder());
|
||||
ug = ug.apply(new UTranslate((levelToDraw - 1) * width / 2.0, 0));
|
||||
|
||||
double y1 = Double.MAX_VALUE;
|
||||
HtmlColor color = null;
|
||||
for (Iterator<StairsPosition> it = stairs.getYs().iterator(); it.hasNext();) {
|
||||
final StairsPosition yposition = it.next();
|
||||
System.err.println("LiveBoxes::drawOneLevel " + levelToDraw + " " + yposition);
|
||||
final int level = stairs.getValue(yposition.getValue());
|
||||
final IntegerColored integerColored = stairs.getValue(yposition.getValue());
|
||||
System.err.println("integerColored=" + integerColored);
|
||||
final int level = integerColored.getValue();
|
||||
if (y1 == Double.MAX_VALUE && level == levelToDraw) {
|
||||
y1 = yposition.getValue();
|
||||
color = integerColored.getColor();
|
||||
} else if (y1 != Double.MAX_VALUE && (it.hasNext() == false || level < levelToDraw)) {
|
||||
final double y2 = yposition.getValue();
|
||||
final Area area = new Area(width, y2 - y1);
|
||||
|
||||
final ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, color);
|
||||
final Component comp = skin
|
||||
.createComponent(ComponentType.ALIVE_BOX_CLOSE_CLOSE, null, skinParam2, null);
|
||||
|
||||
comp.drawU(ug.apply(new UTranslate(-width / 2, y1)), area, context);
|
||||
System.err.println("LiveBoxes::drawOneLevel one block " + y1 + " " + y2);
|
||||
if (yposition.isDestroy()) {
|
||||
@ -101,4 +112,8 @@ public class LiveBoxes implements UDrawable {
|
||||
}
|
||||
}
|
||||
|
||||
private UGraphic withColor(UGraphic ug) {
|
||||
return ug;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
|
||||
public class LivingSpace {
|
||||
@ -60,6 +61,7 @@ public class LivingSpace {
|
||||
private final ComponentType tailType;
|
||||
private final boolean useContinueLineBecauseOfDelay;
|
||||
private final MutingLine mutingLine;
|
||||
private final Rose rose = new Rose();
|
||||
|
||||
// private final LivingSpaceImpl previous;
|
||||
// private LivingSpace next;
|
||||
@ -158,14 +160,17 @@ public class LivingSpace {
|
||||
// }
|
||||
|
||||
public void drawHead(UGraphic ug, Context2D context) {
|
||||
final Component comp = skin.createComponent(headType, null, skinParam, p.getDisplay(false));
|
||||
// final Component comp = skin.createComponent(headType, null, skinParam, p.getDisplay(false));
|
||||
final Component comp = rose.createComponent(headType, null, p.getSkinParamBackcolored(skinParam),
|
||||
p.getDisplay(false));
|
||||
final Dimension2D dim = comp.getPreferredDimension(ug.getStringBounder());
|
||||
final Area area = new Area(dim);
|
||||
comp.drawU(ug, area, context);
|
||||
}
|
||||
|
||||
public Dimension2D getHeadPreferredDimension(StringBounder stringBounder) {
|
||||
final Component comp = skin.createComponent(headType, null, skinParam, p.getDisplay(false));
|
||||
// final Component comp = skin.createComponent(headType, null, skinParam, p.getDisplay(false));
|
||||
final Component comp = rose.createComponent(headType, null, skinParam, p.getDisplay(false));
|
||||
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
|
||||
return dim;
|
||||
}
|
||||
|
@ -33,11 +33,17 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.teoz;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.VerticalAlignment;
|
||||
import net.sourceforge.plantuml.sequencediagram.Participant;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class LivingSpaces {
|
||||
|
||||
@ -55,4 +61,40 @@ public class LivingSpaces {
|
||||
return all.get(participant);
|
||||
}
|
||||
|
||||
public void drawHeads(final UGraphic ug, Context2D context, VerticalAlignment verticalAlignment) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final double headHeight = getHeadHeight(stringBounder);
|
||||
for (LivingSpace livingSpace : values()) {
|
||||
final double x = livingSpace.getPosB().getCurrentValue();
|
||||
double y = 0;
|
||||
if (verticalAlignment == VerticalAlignment.BOTTOM) {
|
||||
final Dimension2D dimHead = livingSpace.getHeadPreferredDimension(stringBounder);
|
||||
y = headHeight - dimHead.getHeight();
|
||||
}
|
||||
livingSpace.drawHead(ug.apply(new UTranslate(x, y)), context);
|
||||
}
|
||||
}
|
||||
|
||||
public double getHeadHeight(StringBounder stringBounder) {
|
||||
double headHeight = 0;
|
||||
for (LivingSpace livingSpace : values()) {
|
||||
final Dimension2D headDim = livingSpace.getHeadPreferredDimension(stringBounder);
|
||||
headHeight = Math.max(headHeight, headDim.getHeight());
|
||||
}
|
||||
return headHeight;
|
||||
}
|
||||
|
||||
public void drawLifeLines(final UGraphic ug, double height, Context2D context) {
|
||||
int i = 0;
|
||||
for (LivingSpace livingSpace : values()) {
|
||||
// if (i++ == 0) {
|
||||
// System.err.println("TEMPORARY SKIPPING OTHERS");
|
||||
// continue;
|
||||
// }
|
||||
// System.err.println("drawing lines " + livingSpace);
|
||||
final double x = livingSpace.getPosC(ug.getStringBounder()).getCurrentValue();
|
||||
livingSpace.drawLineAndLiveBoxes(ug.apply(new UTranslate(x, 0)), height, context);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -72,7 +72,8 @@ public class NoteTile implements Tile {
|
||||
}
|
||||
|
||||
private Component getComponent(StringBounder stringBounder) {
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null, skinParam, note.getStrings());
|
||||
final Component comp = skin.createComponent(ComponentType.NOTE, null, note.getSkinParamBackcolored(skinParam),
|
||||
note.getStrings());
|
||||
return comp;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,6 @@ import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.SimpleContext2D;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
|
@ -39,22 +39,33 @@ import java.io.OutputStream;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FileFormatOption;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.api.ImageDataSimple;
|
||||
import net.sourceforge.plantuml.core.ImageData;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
import net.sourceforge.plantuml.graphic.VerticalAlignment;
|
||||
import net.sourceforge.plantuml.png.PngTitler;
|
||||
import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.real.RealUtils;
|
||||
import net.sourceforge.plantuml.sequencediagram.Participant;
|
||||
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
|
||||
import net.sourceforge.plantuml.sequencediagram.graphic.FileMaker;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.SimpleContext2D;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic2;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
import net.sourceforge.plantuml.ugraphic.hand.UGraphicHandwritten;
|
||||
import net.sourceforge.plantuml.utils.MathUtils;
|
||||
|
||||
public class SequenceDiagramFileMakerTeoz implements FileMaker {
|
||||
|
||||
@ -76,7 +87,6 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
|
||||
|
||||
final Real origin = RealUtils.createOrigin();
|
||||
Real currentPos = origin.addAtLeast(0);
|
||||
double headHeight = 0;
|
||||
LivingSpace last = null;
|
||||
LivingSpaces livingSpaces = new LivingSpaces();
|
||||
for (Participant p : diagram.participants().values()) {
|
||||
@ -84,40 +94,81 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
|
||||
diagram.events());
|
||||
last = livingSpace;
|
||||
((LivingSpaces) livingSpaces).put(p, livingSpace);
|
||||
final Dimension2D headDim = livingSpace.getHeadPreferredDimension(stringBounder);
|
||||
currentPos = livingSpace.getPosD(stringBounder).addAtLeast(0);
|
||||
headHeight = Math.max(headHeight, headDim.getHeight());
|
||||
}
|
||||
// livingSpaces = new LivingSpacesDeltaSimple(livingSpaces);
|
||||
|
||||
final MainTile mainTile = new MainTile(diagram, skin, last.getPosD(stringBounder).addAtLeast(0), livingSpaces,
|
||||
origin);
|
||||
mainTile.addConstraints(stringBounder);
|
||||
origin.compile();
|
||||
|
||||
final double height = mainTile.getPreferredHeight(stringBounder) + 2 * headHeight;
|
||||
final double mainHeight = mainTile.getPreferredHeight(stringBounder) + 2
|
||||
* livingSpaces.getHeadHeight(stringBounder);
|
||||
|
||||
final Real min1 = mainTile.getMinX(stringBounder);
|
||||
final Real max1 = mainTile.getMaxX(stringBounder);
|
||||
// System.err.println("min1=" + min1.getCurrentValue());
|
||||
// System.err.println("max1=" + max1.getCurrentValue());
|
||||
|
||||
final Dimension2D dim = new Dimension2DDouble(max1.getCurrentValue() - min1.getCurrentValue(), height);
|
||||
final UGraphic2 ug = (UGraphic2) fileFormatOption.createUGraphic(dim).apply(
|
||||
final Component compTitle = getCompTitle();
|
||||
|
||||
final double mainWidth = max1.getCurrentValue() - min1.getCurrentValue();
|
||||
|
||||
Dimension2D dimTitle = new Dimension2DDouble(0, 0);
|
||||
if (compTitle != null) {
|
||||
dimTitle = compTitle.getPreferredDimension(stringBounder);
|
||||
}
|
||||
|
||||
final PngTitler footer = getFooter();
|
||||
Dimension2D dimFooter = new Dimension2DDouble(0, 0);
|
||||
if (footer != null && footer.getTextBlock() != null) {
|
||||
dimFooter = footer.getTextBlock().calculateDimension(stringBounder);
|
||||
}
|
||||
|
||||
final PngTitler header = getHeader();
|
||||
Dimension2D dimHeader = new Dimension2DDouble(0, 0);
|
||||
if (header != null && header.getTextBlock() != null) {
|
||||
dimHeader = header.getTextBlock().calculateDimension(stringBounder);
|
||||
}
|
||||
|
||||
final double totalWidth = MathUtils.max(mainWidth, dimTitle.getWidth(), dimFooter.getWidth(),
|
||||
dimHeader.getWidth());
|
||||
final double totalHeight = mainHeight + dimTitle.getHeight() + dimHeader.getHeight() + dimFooter.getHeight();
|
||||
final Dimension2D dim = new Dimension2DDouble(totalWidth, totalHeight);
|
||||
final UGraphic2 ug2 = (UGraphic2) fileFormatOption.createUGraphic(skinParam.getColorMapper(),
|
||||
diagram.getDpiFactor(fileFormatOption), dim, skinParam.getBackgroundColor(), false).apply(
|
||||
new UTranslate(-min1.getCurrentValue(), 0));
|
||||
stringBounder = ug.getStringBounder();
|
||||
|
||||
final Context2D context = new SimpleContext2D(false);
|
||||
drawHeads(ug, livingSpaces, context);
|
||||
// mainTile.beforeDrawing(ug.getStringBounder(), livingSpaces.values());
|
||||
mainTile.drawU(ug.apply(new UTranslate(0, headHeight)));
|
||||
drawLifeLines(ug.apply(new UTranslate(0, headHeight)), mainTile.getPreferredHeight(stringBounder),
|
||||
livingSpaces, context);
|
||||
drawHeads(ug.apply(new UTranslate(0, mainTile.getPreferredHeight(stringBounder) + headHeight)), livingSpaces,
|
||||
context);
|
||||
mainTile.drawForeground(ug.apply(new UTranslate(0, headHeight)));
|
||||
UGraphic ug = diagram.getSkinParam().handwritten() ? new UGraphicHandwritten(ug2) : ug2;
|
||||
|
||||
ug.writeImageTOBEMOVED(os, isWithMetadata ? diagram.getMetadata() : null, diagram.getDpi(fileFormatOption));
|
||||
if (footer != null && footer.getTextBlock() != null) {
|
||||
double dx = 0;
|
||||
if (diagram.getFooterAlignment() == HorizontalAlignment.RIGHT) {
|
||||
dx = totalWidth - dimFooter.getWidth();
|
||||
} else if (diagram.getFooterAlignment() == HorizontalAlignment.CENTER) {
|
||||
dx = (totalWidth - dimFooter.getWidth()) / 2;
|
||||
}
|
||||
footer.getTextBlock().drawU(
|
||||
ug.apply(new UTranslate(dx, mainHeight + dimTitle.getHeight() + dimHeader.getHeight())));
|
||||
}
|
||||
if (header != null && header.getTextBlock() != null) {
|
||||
double dx = 0;
|
||||
if (diagram.getHeaderAlignment() == HorizontalAlignment.RIGHT) {
|
||||
dx = totalWidth - dimHeader.getWidth();
|
||||
} else if (diagram.getHeaderAlignment() == HorizontalAlignment.CENTER) {
|
||||
dx = (totalWidth - dimHeader.getWidth()) / 2;
|
||||
}
|
||||
header.getTextBlock().drawU(ug.apply(new UTranslate(dx, 0)));
|
||||
}
|
||||
if (compTitle != null) {
|
||||
compTitle.drawU(ug.apply(new UTranslate((totalWidth - dimTitle.getWidth()) / 2, 0)), new Area(dimTitle),
|
||||
new SimpleContext2D(false));
|
||||
ug = ug.apply(new UTranslate((totalWidth - mainWidth) / 2, dimTitle.getHeight() + dimHeader.getHeight()));
|
||||
}
|
||||
|
||||
drawMainTile(ug, mainTile, livingSpaces);
|
||||
|
||||
ug2.writeImageTOBEMOVED(os, isWithMetadata ? diagram.getMetadata() : null, diagram.getDpi(fileFormatOption));
|
||||
final Dimension2D info = new Dimension2DDouble(dim.getWidth(), dim.getHeight());
|
||||
|
||||
// if (fileFormatOption.getFileFormat() == FileFormat.PNG && ug instanceof UGraphicG2d) {
|
||||
@ -133,25 +184,55 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker {
|
||||
return new ImageDataSimple(info);
|
||||
}
|
||||
|
||||
private void drawLifeLines(final UGraphic ug, double height, LivingSpaces livingSpaces, Context2D context) {
|
||||
int i = 0;
|
||||
for (LivingSpace livingSpace : livingSpaces.values()) {
|
||||
// if (i++ == 0) {
|
||||
// System.err.println("TEMPORARY SKIPPING OTHERS");
|
||||
// continue;
|
||||
// }
|
||||
// System.err.println("drawing lines " + livingSpace);
|
||||
final double x = livingSpace.getPosC(ug.getStringBounder()).getCurrentValue();
|
||||
livingSpace.drawLineAndLiveBoxes(ug.apply(new UTranslate(x, 0)), height, context);
|
||||
private Component getCompTitle() {
|
||||
final Display title = diagram.getTitle();
|
||||
|
||||
final Component compTitle;
|
||||
if (title == null) {
|
||||
compTitle = null;
|
||||
} else {
|
||||
compTitle = skin.createComponent(ComponentType.TITLE, null, diagram.getSkinParam(), title);
|
||||
}
|
||||
return compTitle;
|
||||
}
|
||||
|
||||
private void drawHeads(final UGraphic ug, LivingSpaces livingSpaces, Context2D context) {
|
||||
for (LivingSpace livingSpace : livingSpaces.values()) {
|
||||
// System.err.println("drawing heads " + livingSpace);
|
||||
final double x = livingSpace.getPosB().getCurrentValue();
|
||||
livingSpace.drawHead(ug.apply(new UTranslate(x, 0)), context);
|
||||
private PngTitler getFooter() {
|
||||
if (diagram.getFooter() == null) {
|
||||
return null;
|
||||
}
|
||||
final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
|
||||
final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.FOOTER, null);
|
||||
final String fontFamily = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getFamily(null);
|
||||
final int fontSize = diagram.getSkinParam().getFont(FontParam.FOOTER, null, false).getSize();
|
||||
final PngTitler pngTitler = new PngTitler(titleColor, diagram.getFooter(), fontSize, fontFamily,
|
||||
diagram.getFooterAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
|
||||
return pngTitler;
|
||||
}
|
||||
|
||||
private PngTitler getHeader() {
|
||||
final HtmlColor hyperlinkColor = diagram.getSkinParam().getHyperlinkColor();
|
||||
final HtmlColor titleColor = diagram.getSkinParam().getFontHtmlColor(FontParam.HEADER, null);
|
||||
final String fontFamily = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getFamily(null);
|
||||
final int fontSize = diagram.getSkinParam().getFont(FontParam.HEADER, null, false).getSize();
|
||||
final PngTitler pngTitler = new PngTitler(titleColor, diagram.getHeader(), fontSize, fontFamily,
|
||||
diagram.getHeaderAlignment(), hyperlinkColor, diagram.getSkinParam().useUnderlineForHyperlink());
|
||||
return pngTitler;
|
||||
}
|
||||
|
||||
private void drawMainTile(final UGraphic ug, final MainTile mainTile, LivingSpaces livingSpaces) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Context2D context = new SimpleContext2D(false);
|
||||
livingSpaces.drawHeads(ug, context, VerticalAlignment.BOTTOM);
|
||||
|
||||
final double headHeight = livingSpaces.getHeadHeight(stringBounder);
|
||||
|
||||
mainTile.drawU(ug.apply(new UTranslate(0, headHeight)));
|
||||
livingSpaces.drawLifeLines(ug.apply(new UTranslate(0, headHeight)), mainTile.getPreferredHeight(stringBounder),
|
||||
context);
|
||||
livingSpaces.drawHeads(ug.apply(new UTranslate(0, mainTile.getPreferredHeight(stringBounder) + headHeight)),
|
||||
context, VerticalAlignment.TOP);
|
||||
mainTile.drawForeground(ug.apply(new UTranslate(0, headHeight)));
|
||||
}
|
||||
|
||||
public int getNbPages() {
|
||||
|
@ -39,14 +39,16 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
|
||||
public class Stairs2 {
|
||||
|
||||
private final List<StairsPosition> ys = new ArrayList<StairsPosition>();
|
||||
private final List<Integer> values = new ArrayList<Integer>();
|
||||
private final Map<Double, Integer> cache = new HashMap<Double, Integer>();
|
||||
private final List<IntegerColored> values = new ArrayList<IntegerColored>();
|
||||
private final Map<Double, IntegerColored> cache = new HashMap<Double, IntegerColored>();
|
||||
|
||||
public void addStep(StairsPosition position, int value) {
|
||||
System.err.println("Stairs2::addStep " + position + " " + value);
|
||||
public void addStep(StairsPosition position, int value, HtmlColor color) {
|
||||
System.err.println("Stairs2::addStep " + position + " " + value + " color=" + color);
|
||||
assert ys.size() == values.size();
|
||||
if (ys.size() > 0) {
|
||||
final double lastY = ys.get(ys.size() - 1).getValue();
|
||||
@ -54,19 +56,20 @@ public class Stairs2 {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if (lastY == position.getValue()) {
|
||||
values.set(ys.size() - 1, value);
|
||||
values.set(ys.size() - 1, new IntegerColored(value, color));
|
||||
cache.clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
ys.add(position);
|
||||
values.add(value);
|
||||
values.add(new IntegerColored(value, color));
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
public int getMaxValue() {
|
||||
int max = Integer.MIN_VALUE;
|
||||
for (Integer v : values) {
|
||||
for (IntegerColored vc : values) {
|
||||
final int v = vc.getValue();
|
||||
if (v > max) {
|
||||
max = v;
|
||||
}
|
||||
@ -78,23 +81,23 @@ public class Stairs2 {
|
||||
return Collections.unmodifiableList(ys);
|
||||
}
|
||||
|
||||
public int getValue(double y) {
|
||||
Integer result = cache.get(y);
|
||||
if (result == null) {
|
||||
result = getValueSlow(new StairsPosition(y, false));
|
||||
cache.put(y, result);
|
||||
public IntegerColored getValue(double y) {
|
||||
IntegerColored resultc = cache.get(y);
|
||||
if (resultc == null) {
|
||||
resultc = getValueSlow(new StairsPosition(y, false));
|
||||
cache.put(y, resultc);
|
||||
}
|
||||
return result;
|
||||
return resultc;
|
||||
}
|
||||
|
||||
private int getValueSlow(StairsPosition y) {
|
||||
private IntegerColored getValueSlow(StairsPosition y) {
|
||||
final int idx = Collections.binarySearch(ys, y);
|
||||
if (idx >= 0) {
|
||||
return values.get(idx);
|
||||
}
|
||||
final int insertPoint = -idx - 1;
|
||||
if (insertPoint == 0) {
|
||||
return 0;
|
||||
return new IntegerColored(0, null);
|
||||
}
|
||||
return values.get(insertPoint - 1);
|
||||
}
|
||||
@ -104,7 +107,7 @@ public class Stairs2 {
|
||||
if (size == 0) {
|
||||
return 0;
|
||||
}
|
||||
return values.get(size - 1);
|
||||
return values.get(size - 1).getValue();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.teoz;
|
||||
|
||||
|
||||
public class StairsPosition implements Comparable<StairsPosition> {
|
||||
|
||||
private final double value;
|
||||
|
@ -33,13 +33,14 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.sequencediagram.teoz;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.SkinParamBackcolored;
|
||||
import net.sourceforge.plantuml.SkinParamBackcoloredReference;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.sequencediagram.Participant;
|
||||
import net.sourceforge.plantuml.sequencediagram.Reference;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
|
||||
public class TileArguments {
|
||||
@ -60,6 +61,17 @@ public class TileArguments {
|
||||
this.skinParam = skinParam;
|
||||
}
|
||||
|
||||
public TileArguments withBackColorGeneral(HtmlColor backColorElement, HtmlColor backColorGeneral) {
|
||||
return new TileArguments(stringBounder, omega, livingSpaces, skin, new SkinParamBackcolored(skinParam,
|
||||
backColorElement, backColorGeneral), origin);
|
||||
}
|
||||
|
||||
public TileArguments withBackColor(Reference reference) {
|
||||
final ISkinParam newSkinParam = new SkinParamBackcoloredReference(skinParam, reference.getBackColorElement(),
|
||||
reference.getBackColorGeneral());
|
||||
return new TileArguments(stringBounder, omega, livingSpaces, skin, newSkinParam, origin);
|
||||
}
|
||||
|
||||
public final StringBounder getStringBounder() {
|
||||
return stringBounder;
|
||||
}
|
||||
|
@ -39,6 +39,8 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.SkinParamBackcoloredReference;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.sequencediagram.Delay;
|
||||
import net.sourceforge.plantuml.sequencediagram.Divider;
|
||||
@ -102,6 +104,21 @@ public class TileBuilder {
|
||||
reverse ? livingSpace1 : livingSpace2);
|
||||
}
|
||||
}
|
||||
} else if (ev instanceof MessageExo) {
|
||||
final MessageExo exo = (MessageExo) ev;
|
||||
final LivingSpace livingSpace1 = livingSpaces.get(exo.getParticipant());
|
||||
tile = new CommunicationExoTile(livingSpace1, exo, skin, skinParam, tileArguments.getOrigin(),
|
||||
tileArguments.getOmega());
|
||||
if (exo.getNote() != null) {
|
||||
final NotePosition notePosition = exo.getNotePosition();
|
||||
if (notePosition == NotePosition.LEFT) {
|
||||
tile = new CommunicationTileNoteLeft((TileWithUpdateStairs) tile, exo, skin, skinParam,
|
||||
livingSpace1);
|
||||
} else if (notePosition == NotePosition.RIGHT) {
|
||||
tile = new CommunicationTileNoteRight((TileWithUpdateStairs) tile, exo, skin, skinParam,
|
||||
livingSpace1);
|
||||
}
|
||||
}
|
||||
} else if (ev instanceof Note) {
|
||||
final Note note = (Note) ev;
|
||||
final LivingSpace livingSpace1 = livingSpaces.get(note.getParticipant());
|
||||
@ -111,21 +128,17 @@ public class TileBuilder {
|
||||
} else if (ev instanceof Divider) {
|
||||
final Divider divider = (Divider) ev;
|
||||
tile = new DividerTile(divider, skin, skinParam, tileArguments.getOrigin(), tileArguments.getOmega());
|
||||
} else if (ev instanceof MessageExo) {
|
||||
final MessageExo exo = (MessageExo) ev;
|
||||
final LivingSpace livingSpace1 = livingSpaces.get(exo.getParticipant());
|
||||
tile = new CommunicationExoTile(livingSpace1, exo, skin, skinParam, tileArguments.getOrigin(),
|
||||
tileArguments.getOmega());
|
||||
} else if (ev instanceof GroupingStart) {
|
||||
final GroupingStart start = (GroupingStart) ev;
|
||||
tile = new GroupingTile(it, start, tileArguments);
|
||||
tile = new GroupingTile(it, start, tileArguments.withBackColorGeneral(start.getBackColorElement(),
|
||||
start.getBackColorGeneral()), tileArguments);
|
||||
// tile = TileUtils.withMargin(tile, 10, 10, 10, 10);
|
||||
} else if (ev instanceof GroupingLeaf && ((GroupingLeaf) ev).getType() == GroupingType.ELSE) {
|
||||
final GroupingLeaf anElse = (GroupingLeaf) ev;
|
||||
tile = new ElseTile(anElse, skin, skinParam, parent);
|
||||
} else if (ev instanceof Reference) {
|
||||
final Reference ref = (Reference) ev;
|
||||
tile = new ReferenceTile(ref, tileArguments);
|
||||
tile = new ReferenceTile(ref, tileArguments.withBackColor(ref));
|
||||
} else if (ev instanceof Delay) {
|
||||
final Delay delay = (Delay) ev;
|
||||
tile = new DelayTile(delay, tileArguments);
|
||||
@ -138,5 +151,4 @@ public class TileBuilder {
|
||||
}
|
||||
return tile;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15907 $
|
||||
* Revision $Revision: 15936 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin;
|
||||
@ -47,7 +47,6 @@ import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
|
||||
public abstract class AbstractTextualComponent extends AbstractComponent {
|
||||
|
||||
@ -62,19 +61,19 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
|
||||
private final UFont font;
|
||||
private final HtmlColor fontColor;
|
||||
|
||||
public AbstractTextualComponent(CharSequence label, UFont2 font, HorizontalAlignment horizontalAlignment, int marginX1,
|
||||
int marginX2, int marginY, ISkinSimple spriteContainer, double maxMessageSize,
|
||||
UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
public AbstractTextualComponent(CharSequence label, FontConfiguration font,
|
||||
HorizontalAlignment horizontalAlignment, int marginX1, int marginX2, int marginY,
|
||||
ISkinSimple spriteContainer, double maxMessageSize, UFont fontForStereotype,
|
||||
HtmlColor htmlColorForStereotype) {
|
||||
this(Display.getWithNewlines(label == null ? "" : label.toString()), font, horizontalAlignment, marginX1,
|
||||
marginX2, marginY, spriteContainer, maxMessageSize, false, fontForStereotype, htmlColorForStereotype);
|
||||
}
|
||||
|
||||
public AbstractTextualComponent(Display strings, UFont2 font, HorizontalAlignment horizontalAlignment, int marginX1,
|
||||
int marginX2, int marginY, ISkinSimple spriteContainer, double maxMessageSize,
|
||||
public AbstractTextualComponent(Display strings, FontConfiguration font, HorizontalAlignment horizontalAlignment,
|
||||
int marginX1, int marginX2, int marginY, ISkinSimple spriteContainer, double maxMessageSize,
|
||||
boolean enhanced, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
this.font = font.getFont();
|
||||
this.fontColor = font.getColor();
|
||||
assert fontColor.equals(font.getColor());
|
||||
this.marginX1 = marginX1;
|
||||
this.marginX2 = marginX2;
|
||||
this.marginY = marginY;
|
||||
@ -83,12 +82,10 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
|
||||
if (strings.size() == 1 && strings.get(0).length() == 0) {
|
||||
textBlock = new TextBlockEmpty();
|
||||
} else if (enhanced) {
|
||||
textBlock = new BodyEnhanced2(strings, FontParam.NOTE, spriteContainer, HorizontalAlignment.LEFT,
|
||||
font.getFont(), fontColor, font.getHyperlinkColor(), font.useUnderlineForHyperlink());
|
||||
textBlock = new BodyEnhanced2(strings, FontParam.NOTE, spriteContainer, HorizontalAlignment.LEFT, font);
|
||||
} else {
|
||||
textBlock = TextBlockUtils.create(strings, new FontConfiguration(font.getFont(), fontColor, font.getHyperlinkColor(),
|
||||
font.useUnderlineForHyperlink()), horizontalAlignment, spriteContainer, maxMessageSize, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
textBlock = TextBlockUtils.create(strings, font, horizontalAlignment, spriteContainer, maxMessageSize,
|
||||
false, fontForStereotype, htmlColorForStereotype);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 12235 $
|
||||
* Revision $Revision: 15957 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin;
|
||||
@ -38,9 +38,8 @@ import java.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UEllipse;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPath;
|
||||
@ -49,8 +48,6 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class StickMan implements TextBlock {
|
||||
|
||||
private final double thickness;
|
||||
|
||||
private final double armsY = 8;
|
||||
private final double armsLenght = 13;
|
||||
private final double bodyLenght = 27;
|
||||
@ -58,34 +55,23 @@ public class StickMan implements TextBlock {
|
||||
private final double legsY = 15;
|
||||
private final double headDiam = 16;
|
||||
|
||||
private final HtmlColor backgroundColor;
|
||||
private final HtmlColor foregroundColor;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
private double deltaShadow;
|
||||
|
||||
public void setDeltaShadow(double deltaShadow) {
|
||||
this.deltaShadow = deltaShadow;
|
||||
public StickMan(SymbolContext symbolContext) {
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
public StickMan(HtmlColor backgroundColor, HtmlColor foregroundColor, double deltaShadow, double thickness) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.foregroundColor = foregroundColor;
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.thickness = thickness;
|
||||
}
|
||||
|
||||
public StickMan(HtmlColor backgroundColor, HtmlColor foregroundColor, double deltaShadow) {
|
||||
this(backgroundColor, foregroundColor, deltaShadow, 2);
|
||||
private StickMan(HtmlColor backgroundColor, HtmlColor foregroundColor, double deltaShadow) {
|
||||
this(new SymbolContext(backgroundColor, foregroundColor).withDeltaShadow(deltaShadow).withStroke(new UStroke(2)));
|
||||
}
|
||||
|
||||
public StickMan(HtmlColor backgroundColor, HtmlColor foregroundColor) {
|
||||
this(backgroundColor, foregroundColor, 0, 2);
|
||||
this(new SymbolContext(backgroundColor, foregroundColor).withStroke(new UStroke(2)));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
ug = ug.apply(new UStroke(thickness));
|
||||
|
||||
final double startX = Math.max(armsLenght, legsX) - headDiam / 2.0 + thickness;
|
||||
final double startX = Math.max(armsLenght, legsX) - headDiam / 2.0 + thickness();
|
||||
|
||||
final UEllipse head = new UEllipse(headDiam, headDiam);
|
||||
final double centerX = startX + headDiam / 2;
|
||||
@ -99,22 +85,26 @@ public class StickMan implements TextBlock {
|
||||
path.lineTo(-legsX, bodyLenght + legsY);
|
||||
path.moveTo(0, bodyLenght);
|
||||
path.lineTo(legsX, bodyLenght + legsY);
|
||||
if (deltaShadow != 0) {
|
||||
head.setDeltaShadow(deltaShadow);
|
||||
path.setDeltaShadow(deltaShadow);
|
||||
if (symbolContext.getDeltaShadow() != 0) {
|
||||
head.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
path.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
}
|
||||
|
||||
ug = ug.apply(new UChangeBackColor(backgroundColor)).apply(new UChangeColor(foregroundColor));
|
||||
ug.apply(new UTranslate(startX, thickness)).draw(head);
|
||||
ug.apply(new UTranslate(centerX, headDiam + thickness)).draw(path);
|
||||
ug = symbolContext.apply(ug);
|
||||
ug.apply(new UTranslate(startX, thickness())).draw(head);
|
||||
ug.apply(new UTranslate(centerX, headDiam + thickness())).draw(path);
|
||||
}
|
||||
|
||||
private double thickness() {
|
||||
return symbolContext.getStroke().getThickness();
|
||||
}
|
||||
|
||||
public double getPreferredWidth() {
|
||||
return Math.max(armsLenght, legsX) * 2 + 2 * thickness;
|
||||
return Math.max(armsLenght, legsX) * 2 + 2 * thickness();
|
||||
}
|
||||
|
||||
public double getPreferredHeight() {
|
||||
return headDiam + bodyLenght + legsY + 2 * thickness + deltaShadow + 1;
|
||||
return headDiam + bodyLenght + legsY + 2 * thickness() + symbolContext.getDeltaShadow() + 1;
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
|
@ -28,19 +28,19 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.ArrowComponent;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
|
||||
public abstract class AbstractComponentBlueModernArrow extends AbstractTextualComponent implements ArrowComponent {
|
||||
|
||||
@ -52,7 +52,7 @@ public abstract class AbstractComponentBlueModernArrow extends AbstractTextualCo
|
||||
private final ArrowConfiguration arrowConfiguration;
|
||||
private final HtmlColor foregroundColor;
|
||||
|
||||
public AbstractComponentBlueModernArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
|
||||
public AbstractComponentBlueModernArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.LEFT, 17, 17, 2,
|
||||
spriteContainer, 0, false, null, null);
|
||||
this.arrowConfiguration = arrowConfiguration;
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15913 $
|
||||
* Revision $Revision: 15947 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
@ -41,8 +41,8 @@ import net.sourceforge.plantuml.LineParam;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorSet;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
@ -79,17 +79,19 @@ public class BlueModern implements Skin {
|
||||
if (type.isArrow()) {
|
||||
final HtmlColor sequenceArrow = config.getColor() == null ? HtmlColorUtils.BLACK : config.getColor();
|
||||
if (config.isSelfArrow()) {
|
||||
return new ComponentBlueModernSelfArrow(sequenceArrow, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config,
|
||||
param);
|
||||
return new ComponentBlueModernSelfArrow(sequenceArrow, normalFont.toFont2(HtmlColorUtils.BLACK,
|
||||
useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config, param);
|
||||
}
|
||||
return new ComponentBlueModernArrow(sequenceArrow, useUnderlineForHyperlink, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config,
|
||||
param);
|
||||
return new ComponentBlueModernArrow(sequenceArrow, useUnderlineForHyperlink, normalFont.toFont2(
|
||||
HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config, param);
|
||||
}
|
||||
if (type == ComponentType.PARTICIPANT_HEAD) {
|
||||
return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE,
|
||||
useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.PARTICIPANT_TAIL) {
|
||||
return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE,
|
||||
useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.PARTICIPANT_LINE) {
|
||||
return new ComponentBlueModernLine(lineColor);
|
||||
@ -98,14 +100,16 @@ public class BlueModern implements Skin {
|
||||
return new ComponentBlueModernLine(lineColor);
|
||||
}
|
||||
if (type == ComponentType.ACTOR_HEAD) {
|
||||
return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, true, param);
|
||||
return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink,
|
||||
hyperlinkColor), stringsToDisplay, true, param);
|
||||
}
|
||||
if (type == ComponentType.ACTOR_TAIL) {
|
||||
return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,false, param);
|
||||
return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink,
|
||||
hyperlinkColor), stringsToDisplay, false, param);
|
||||
}
|
||||
if (type == ComponentType.NOTE) {
|
||||
return new ComponentBlueModernNote(HtmlColorUtils.WHITE, HtmlColorUtils.BLACK, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor),
|
||||
stringsToDisplay, param);
|
||||
return new ComponentBlueModernNote(HtmlColorUtils.WHITE, HtmlColorUtils.BLACK, normalFont.toFont2(
|
||||
HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) {
|
||||
return new ComponentBlueModernActiveLine(blue1, true, true);
|
||||
@ -123,43 +127,50 @@ public class BlueModern implements Skin {
|
||||
return new ComponentBlueModernDelayLine(lineColor);
|
||||
}
|
||||
if (type == ComponentType.DELAY_TEXT) {
|
||||
return new ComponentBlueModernDelayText(param.getFont(
|
||||
FontParam.SEQUENCE_DELAY, null, false).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
return new ComponentBlueModernDelayText(param.getFont(FontParam.SEQUENCE_DELAY, null, false).toFont2(
|
||||
HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.DESTROY) {
|
||||
return new ComponentRoseDestroy(red);
|
||||
}
|
||||
if (type == ComponentType.GROUPING_HEADER) {
|
||||
return new ComponentBlueModernGroupingHeader(blue1, blue3, borderGroupColor, HtmlColorUtils.BLACK,
|
||||
normalFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), smallFont, stringsToDisplay, param);
|
||||
normalFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), smallFont,
|
||||
stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.GROUPING_ELSE) {
|
||||
return new ComponentRoseGroupingElse(HtmlColorUtils.BLACK, smallFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay.get(0), param, blue3,
|
||||
Rose.getStroke(param, LineParam.sequenceGroupBorder, 2));
|
||||
return new ComponentRoseGroupingElse(HtmlColorUtils.BLACK, smallFont.toFont2(HtmlColorUtils.BLACK,
|
||||
useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay.get(0), param, blue3);
|
||||
}
|
||||
if (type == ComponentType.GROUPING_SPACE) {
|
||||
return new ComponentRoseGroupingSpace(7);
|
||||
}
|
||||
if (type == ComponentType.TITLE) {
|
||||
return new ComponentRoseTitle(bigFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
|
||||
return new ComponentRoseTitle(bigFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
|
||||
hyperlinkColor), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.REFERENCE) {
|
||||
return new ComponentRoseReference(HtmlColorUtils.WHITE, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), blue1, borderGroupColor, blue3,
|
||||
normalFont, stringsToDisplay, HorizontalAlignment.CENTER, param, 0, Rose.getStroke(param, LineParam.sequenceDividerBorder, 2));
|
||||
return new ComponentRoseReference(normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
|
||||
hyperlinkColor), new SymbolContext(blue1, borderGroupColor).withStroke(Rose.getStroke(param,
|
||||
LineParam.sequenceDividerBorder, 2)), normalFont.toFont2(HtmlColorUtils.WHITE,
|
||||
useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, HorizontalAlignment.CENTER, param,
|
||||
blue3);
|
||||
}
|
||||
if (type == ComponentType.NEWPAGE) {
|
||||
return new ComponentBlueModernNewpage(blue1);
|
||||
}
|
||||
if (type == ComponentType.DIVIDER) {
|
||||
return new ComponentBlueModernDivider(normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), blue2, blue1, HtmlColorUtils.BLACK, stringsToDisplay, param);
|
||||
return new ComponentBlueModernDivider(normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
|
||||
hyperlinkColor), blue2, blue1, HtmlColorUtils.BLACK, stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.SIGNATURE) {
|
||||
return new ComponentRoseTitle(smallFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), Display.create(
|
||||
"This skin was created ", "in April 2009."), param);
|
||||
return new ComponentRoseTitle(smallFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
|
||||
hyperlinkColor), Display.create("This skin was created ", "in April 2009."), param);
|
||||
}
|
||||
if (type == ComponentType.ENGLOBER) {
|
||||
return new ComponentBlueModernEnglober(blue1, blue3, stringsToDisplay, param.getFont(FontParam.SEQUENCE_BOX, null, false).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor),
|
||||
param);
|
||||
return new ComponentBlueModernEnglober(blue1, blue3, stringsToDisplay, param.getFont(
|
||||
FontParam.SEQUENCE_BOX, null, false).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
|
||||
hyperlinkColor), param);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -28,13 +28,14 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -43,7 +44,6 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.StickMan;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
@ -52,7 +52,7 @@ public class ComponentBlueModernActor extends AbstractTextualComponent {
|
||||
private final StickMan stickman;
|
||||
private final boolean head;
|
||||
|
||||
public ComponentBlueModernActor(HtmlColor backgroundColor, HtmlColor foregroundColor, UFont2 font,
|
||||
public ComponentBlueModernActor(HtmlColor backgroundColor, HtmlColor foregroundColor, FontConfiguration font,
|
||||
Display stringsToDisplay, boolean head, ISkinSimple spriteContainer) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
|
||||
spriteContainer, 0, false, null, null);
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
@ -39,6 +39,7 @@ import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
@ -47,7 +48,6 @@ import net.sourceforge.plantuml.skin.ArrowDirection;
|
||||
import net.sourceforge.plantuml.skin.ArrowPart;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -56,7 +56,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
|
||||
|
||||
public ComponentBlueModernArrow(HtmlColor foregroundColor, boolean useUnderlineForHyperlink, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration,
|
||||
public ComponentBlueModernArrow(HtmlColor foregroundColor, boolean useUnderlineForHyperlink, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration,
|
||||
ISkinSimple spriteContainer) {
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
|
||||
}
|
||||
|
@ -37,18 +37,18 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentBlueModernDelayText extends AbstractTextualComponent {
|
||||
|
||||
public ComponentBlueModernDelayText(UFont2 font, Display stringsToDisplay,
|
||||
public ComponentBlueModernDelayText(FontConfiguration font, Display stringsToDisplay,
|
||||
ISkinSimple spriteContainer) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4,
|
||||
spriteContainer, 0, false, null, null);
|
||||
|
@ -37,6 +37,7 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
@ -46,7 +47,6 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
@ -59,7 +59,7 @@ public class ComponentBlueModernDivider extends AbstractTextualComponent {
|
||||
private final HtmlColor background2;
|
||||
private final HtmlColor borderColor;
|
||||
|
||||
public ComponentBlueModernDivider(UFont2 font, HtmlColor background1, HtmlColor background2,
|
||||
public ComponentBlueModernDivider(FontConfiguration font, HtmlColor background1, HtmlColor background2,
|
||||
HtmlColor borderColor, Display stringsToDisplay, ISkinSimple spriteContainer) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4,
|
||||
spriteContainer, 0, false, null, null);
|
||||
|
@ -37,6 +37,7 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -44,7 +45,6 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
@ -56,7 +56,7 @@ public class ComponentBlueModernEnglober extends AbstractTextualComponent {
|
||||
private final HtmlColor backColor;
|
||||
|
||||
public ComponentBlueModernEnglober(HtmlColor borderColor, HtmlColor backColor, Display strings,
|
||||
UFont2 font, ISkinSimple spriteContainer) {
|
||||
FontConfiguration font, ISkinSimple spriteContainer) {
|
||||
super(strings, font, HorizontalAlignment.CENTER, 4, 4, 1, spriteContainer, 0, false,
|
||||
null, null);
|
||||
this.borderColor = borderColor;
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
@ -48,7 +48,6 @@ import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -68,7 +67,7 @@ public class ComponentBlueModernGroupingHeader extends AbstractTextualComponent
|
||||
private final HtmlColor borderColor;
|
||||
|
||||
public ComponentBlueModernGroupingHeader(HtmlColor headerBackgroundColor, HtmlColor generalBackgroundColor,
|
||||
HtmlColor borderColor, HtmlColor fontColor2, UFont2 bigFont, UFont smallFont, Display strings, ISkinSimple spriteContainer) {
|
||||
HtmlColor borderColor, HtmlColor fontColor2, FontConfiguration bigFont, UFont smallFont, Display strings, ISkinSimple spriteContainer) {
|
||||
super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer, 0, null,
|
||||
null);
|
||||
this.headerBackgroundColor = headerBackgroundColor;
|
||||
|
@ -28,13 +28,14 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -42,7 +43,6 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -55,7 +55,7 @@ final public class ComponentBlueModernNote extends AbstractTextualComponent {
|
||||
private final HtmlColor back;
|
||||
private final HtmlColor foregroundColor;
|
||||
|
||||
public ComponentBlueModernNote(HtmlColor back, HtmlColor foregroundColor, UFont2 font,
|
||||
public ComponentBlueModernNote(HtmlColor back, HtmlColor foregroundColor, FontConfiguration font,
|
||||
Display strings, ISkinSimple spriteContainer) {
|
||||
super(strings, font, HorizontalAlignment.LEFT, 6, 15, 5, spriteContainer, 0, false,
|
||||
null, null);
|
||||
|
@ -28,20 +28,20 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
@ -51,7 +51,7 @@ public class ComponentBlueModernParticipant extends AbstractTextualComponent {
|
||||
private final HtmlColor blue1;
|
||||
private final HtmlColor blue2;
|
||||
|
||||
public ComponentBlueModernParticipant(HtmlColor blue1, HtmlColor blue2, UFont2 font,
|
||||
public ComponentBlueModernParticipant(HtmlColor blue1, HtmlColor blue2, FontConfiguration font,
|
||||
Display stringsToDisplay, ISkinSimple spriteContainer) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7,
|
||||
spriteContainer, 0, false, null, null);
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.bluemodern;
|
||||
@ -38,6 +38,7 @@ import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
@ -45,7 +46,6 @@ import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.skin.ArrowPart;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -56,7 +56,7 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
|
||||
|
||||
private final double arrowWidth = 45;
|
||||
|
||||
public ComponentBlueModernSelfArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
|
||||
public ComponentBlueModernSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
|
||||
}
|
||||
|
||||
|
@ -28,19 +28,19 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.ArrowComponent;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
|
||||
public abstract class AbstractComponentRoseArrow extends AbstractTextualComponent implements ArrowComponent {
|
||||
|
||||
@ -49,7 +49,7 @@ public abstract class AbstractComponentRoseArrow extends AbstractTextualComponen
|
||||
private final HtmlColor foregroundColor;
|
||||
private final ArrowConfiguration arrowConfiguration;
|
||||
|
||||
public AbstractComponentRoseArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay,
|
||||
public AbstractComponentRoseArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
|
||||
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, HorizontalAlignment textHorizontalAlignment,
|
||||
double maxMessageSize) {
|
||||
super(stringsToDisplay, font, textHorizontalAlignment, 7, 7, 1, spriteContainer,
|
||||
|
@ -28,15 +28,15 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15913 $
|
||||
* Revision $Revision: 15967 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.AbstractComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
@ -48,19 +48,14 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseActiveLine extends AbstractComponent {
|
||||
|
||||
private final HtmlColor foregroundColor;
|
||||
private final HtmlColor lifeLineBackground;
|
||||
private final SymbolContext symbolContext;
|
||||
private final boolean closeUp;
|
||||
private final boolean closeDown;
|
||||
private final boolean withShadow;
|
||||
|
||||
public ComponentRoseActiveLine(HtmlColor lifeLineBackground, HtmlColor foregroundColor, boolean closeUp,
|
||||
boolean closeDown, boolean withShadow) {
|
||||
this.foregroundColor = foregroundColor;
|
||||
this.lifeLineBackground = lifeLineBackground;
|
||||
public ComponentRoseActiveLine(SymbolContext symbolContext, boolean closeUp, boolean closeDown) {
|
||||
this.symbolContext = symbolContext;
|
||||
this.closeUp = closeUp;
|
||||
this.closeDown = closeDown;
|
||||
this.withShadow = withShadow;
|
||||
}
|
||||
|
||||
protected void drawInternalU(UGraphic ug, Area area) {
|
||||
@ -69,15 +64,16 @@ public class ComponentRoseActiveLine extends AbstractComponent {
|
||||
final int x = (int) (dimensionToUse.getWidth() - getPreferredWidth(stringBounder)) / 2;
|
||||
|
||||
final URectangle rect = new URectangle(getPreferredWidth(stringBounder), dimensionToUse.getHeight());
|
||||
if (withShadow) {
|
||||
if (symbolContext.isShadowing()) {
|
||||
rect.setDeltaShadow(1);
|
||||
}
|
||||
ug = ug.apply(new UChangeColor(foregroundColor));
|
||||
ug = ug.apply(new UChangeColor(symbolContext.getForeColor()));
|
||||
if (closeUp && closeDown) {
|
||||
ug.apply(new UChangeBackColor(lifeLineBackground)).apply(new UTranslate(x, 0)).draw(rect);
|
||||
ug.apply(new UChangeBackColor(symbolContext.getBackColor())).apply(new UTranslate(x, 0)).draw(rect);
|
||||
return;
|
||||
}
|
||||
ug.apply(new UChangeBackColor(lifeLineBackground)).apply(new UChangeColor(lifeLineBackground)).apply(new UTranslate(x, 0)).draw(rect);
|
||||
ug.apply(new UChangeBackColor(symbolContext.getBackColor())).apply(new UChangeColor(symbolContext.getBackColor()))
|
||||
.apply(new UTranslate(x, 0)).draw(rect);
|
||||
|
||||
final ULine vline = new ULine(0, dimensionToUse.getHeight());
|
||||
ug.apply(new UTranslate(x, 0)).draw(vline);
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15913 $
|
||||
* Revision $Revision: 15955 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -37,18 +37,17 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.skin.StickMan;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseActor extends AbstractTextualComponent {
|
||||
@ -56,13 +55,12 @@ public class ComponentRoseActor extends AbstractTextualComponent {
|
||||
private final TextBlock stickman;
|
||||
private final boolean head;
|
||||
|
||||
public ComponentRoseActor(BiColor biColor, UFont2 font, Display stringsToDisplay,
|
||||
boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
|
||||
UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
|
||||
spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
|
||||
public ComponentRoseActor(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay, boolean head,
|
||||
ISkinSimple spriteContainer, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0, spriteContainer, 0, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
this.head = head;
|
||||
this.stickman = new StickMan(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
|
||||
this.stickman = new StickMan(biColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,6 +38,7 @@ import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -51,7 +52,6 @@ import net.sourceforge.plantuml.skin.ArrowPart;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UEllipse;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -63,7 +63,7 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
|
||||
private final HorizontalAlignment messagePosition;
|
||||
private final boolean niceArrow;
|
||||
|
||||
public ComponentRoseArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, HorizontalAlignment messagePosition, ISkinSimple spriteContainer,
|
||||
public ComponentRoseArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, HorizontalAlignment messagePosition, ISkinSimple spriteContainer,
|
||||
HorizontalAlignment textHorizontalAlignment, double maxMessageSize, boolean niceArrow) {
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, textHorizontalAlignment, maxMessageSize);
|
||||
this.messagePosition = messagePosition;
|
||||
|
@ -37,18 +37,17 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.svek.Boundary;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseBoundary extends AbstractTextualComponent {
|
||||
@ -56,13 +55,12 @@ public class ComponentRoseBoundary extends AbstractTextualComponent {
|
||||
private final TextBlock stickman;
|
||||
private final boolean head;
|
||||
|
||||
public ComponentRoseBoundary(BiColor biColor, UFont2 font, Display stringsToDisplay,
|
||||
boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
|
||||
UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
|
||||
spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
|
||||
public ComponentRoseBoundary(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay, boolean head,
|
||||
ISkinSimple spriteContainer, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0, spriteContainer, 0, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
this.head = head;
|
||||
this.stickman = new Boundary(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
|
||||
this.stickman = new Boundary(biColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,18 +37,17 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.svek.Control;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseControl extends AbstractTextualComponent {
|
||||
@ -56,13 +55,12 @@ public class ComponentRoseControl extends AbstractTextualComponent {
|
||||
private final TextBlock stickman;
|
||||
private final boolean head;
|
||||
|
||||
public ComponentRoseControl(BiColor biColor, UFont2 font, Display stringsToDisplay,
|
||||
boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
|
||||
UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
|
||||
spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
|
||||
public ComponentRoseControl(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay, boolean head,
|
||||
ISkinSimple spriteContainer, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0, spriteContainer, 0, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
this.head = head;
|
||||
this.stickman = new Control(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
|
||||
this.stickman = new Control(biColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,6 +37,7 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -46,9 +47,7 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
import net.sourceforge.plantuml.graphic.USymbol;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -58,16 +57,14 @@ public class ComponentRoseDatabase extends AbstractTextualComponent {
|
||||
private final TextBlock stickman;
|
||||
private final boolean head;
|
||||
|
||||
public ComponentRoseDatabase(BiColor biColor, UFont2 font, Display stringsToDisplay,
|
||||
boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
|
||||
UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
|
||||
spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
|
||||
public ComponentRoseDatabase(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay, boolean head,
|
||||
ISkinSimple spriteContainer, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0, spriteContainer, 0, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
this.head = head;
|
||||
|
||||
// this.stickman = new Control(yellow, red, deltaShadow, stroke.getThickness());
|
||||
final SymbolContext symbolContext = new SymbolContext(biColor.getYellowBack(), biColor.getRedBorder()).withStroke(new UStroke(1.5)).withShadow(
|
||||
deltaShadow > 0);
|
||||
final SymbolContext symbolContext = new SymbolContext(biColor.getBackColor(), biColor.getForeColor())
|
||||
.withStroke(new UStroke(1.5)).withShadow(biColor.getDeltaShadow() > 0);
|
||||
this.stickman = USymbol.DATABASE.asSmall(TextBlockUtils.empty(16, 17), TextBlockUtils.empty(0, 0),
|
||||
symbolContext);
|
||||
}
|
||||
|
@ -37,18 +37,18 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseDelayText extends AbstractTextualComponent {
|
||||
|
||||
public ComponentRoseDelayText(UFont2 font, Display stringsToDisplay, ISkinSimple spriteContainer) {
|
||||
public ComponentRoseDelayText(FontConfiguration font, Display stringsToDisplay, ISkinSimple spriteContainer) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 0, 0, 4,
|
||||
spriteContainer, 0, false, null, null);
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
@ -46,7 +47,6 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
@ -61,7 +61,7 @@ public class ComponentRoseDivider extends AbstractTextualComponent {
|
||||
private final boolean withShadow;
|
||||
private final UStroke stroke;
|
||||
|
||||
public ComponentRoseDivider(UFont2 font, HtmlColor background, Display stringsToDisplay,
|
||||
public ComponentRoseDivider(FontConfiguration font, HtmlColor background, Display stringsToDisplay,
|
||||
ISkinSimple spriteContainer, boolean withShadow, UStroke stroke) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4,
|
||||
spriteContainer, 0, false, null, null);
|
||||
|
@ -37,35 +37,29 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseEnglober extends AbstractTextualComponent {
|
||||
|
||||
private final HtmlColor borderColor;
|
||||
private final HtmlColor backColor;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
public ComponentRoseEnglober(HtmlColor backColor, HtmlColor borderColor, Display strings, UFont2 font,
|
||||
ISkinSimple spriteContainer) {
|
||||
super(strings, font, HorizontalAlignment.CENTER, 3, 3, 1, spriteContainer, 0, false,
|
||||
null, null);
|
||||
this.borderColor = borderColor;
|
||||
this.backColor = backColor;
|
||||
public ComponentRoseEnglober(SymbolContext symbolContext, Display strings, FontConfiguration font, ISkinSimple spriteContainer) {
|
||||
super(strings, font, HorizontalAlignment.CENTER, 3, 3, 1, spriteContainer, 0, false, null, null);
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackgroundInternalU(UGraphic ug, Area area) {
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
ug = ug.apply(new UChangeBackColor(backColor)).apply(new UChangeColor(borderColor));
|
||||
ug = symbolContext.apply(ug);
|
||||
ug.draw(new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight()));
|
||||
final double xpos = (dimensionToUse.getWidth() - getPureTextWidth(ug.getStringBounder())) / 2;
|
||||
getTextBlock().drawU(ug.apply(new UTranslate(xpos, 0)));
|
||||
|
@ -37,18 +37,17 @@ import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.svek.EntityDomain;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseEntity extends AbstractTextualComponent {
|
||||
@ -56,13 +55,12 @@ public class ComponentRoseEntity extends AbstractTextualComponent {
|
||||
private final TextBlock stickman;
|
||||
private final boolean head;
|
||||
|
||||
public ComponentRoseEntity(BiColor biColor, UFont2 font, Display stringsToDisplay,
|
||||
boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
|
||||
UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
|
||||
spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
|
||||
public ComponentRoseEntity(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay, boolean head,
|
||||
ISkinSimple spriteContainer, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0, spriteContainer, 0, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
this.head = head;
|
||||
this.stickman = new EntityDomain(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
|
||||
this.stickman = new EntityDomain(biColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -36,6 +36,7 @@ package net.sourceforge.plantuml.skin.rose;
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -43,7 +44,6 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
@ -54,15 +54,16 @@ public class ComponentRoseGroupingElse extends AbstractTextualComponent {
|
||||
|
||||
private final HtmlColor groupBorder;
|
||||
private final HtmlColor backgroundColor;
|
||||
private final UStroke stroke;
|
||||
|
||||
public ComponentRoseGroupingElse(HtmlColor groupBorder, UFont2 smallFont, CharSequence comment,
|
||||
ISkinSimple spriteContainer, HtmlColor backgroundColor, UStroke stroke) {
|
||||
super(comment == null ? null : "[" + comment + "]", smallFont, HorizontalAlignment.LEFT, 5,
|
||||
5, 1, spriteContainer, 0, null, null);
|
||||
// private final UStroke stroke;
|
||||
|
||||
public ComponentRoseGroupingElse(HtmlColor groupBorder, FontConfiguration smallFont, CharSequence comment,
|
||||
ISkinSimple spriteContainer, HtmlColor backgroundColor) {
|
||||
super(comment == null ? null : "[" + comment + "]", smallFont, HorizontalAlignment.LEFT, 5, 5, 1,
|
||||
spriteContainer, 0, null, null);
|
||||
this.groupBorder = groupBorder;
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.stroke = stroke;
|
||||
// this.stroke = stroke;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15913 $
|
||||
* Revision $Revision: 15964 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -41,15 +41,14 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
@ -63,28 +62,21 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
|
||||
|
||||
private final TextBlock commentTextBlock;
|
||||
|
||||
private final HtmlColor groupBackground;
|
||||
private final HtmlColor groupBorder;
|
||||
private final HtmlColor background;
|
||||
private final double deltaShadow;
|
||||
private final UStroke stroke;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
public ComponentRoseGroupingHeader(HtmlColor background, BiColor biColor,
|
||||
UFont2 bigFont, UFont smallFont, Display strings, ISkinSimple spriteContainer, double deltaShadow,
|
||||
UStroke stroke) {
|
||||
super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1,
|
||||
spriteContainer, 0, null, null);
|
||||
this.groupBackground = biColor.getYellowBack();
|
||||
this.groupBorder = biColor.getRedBorder();
|
||||
public ComponentRoseGroupingHeader(HtmlColor background, SymbolContext symbolContext, FontConfiguration bigFont, UFont smallFont,
|
||||
Display strings, ISkinSimple spriteContainer) {
|
||||
super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer, 0, null, null);
|
||||
this.symbolContext = symbolContext;
|
||||
this.background = background;
|
||||
this.stroke = stroke;
|
||||
this.deltaShadow = deltaShadow;
|
||||
if (strings.size() == 1 || strings.get(1) == null) {
|
||||
this.commentTextBlock = null;
|
||||
} else {
|
||||
final Display display = Display.getWithNewlines("[" + strings.get(1) + "]");
|
||||
this.commentTextBlock = TextBlockUtils.create(display, new FontConfiguration(smallFont, bigFont.getColor(),
|
||||
bigFont.getHyperlinkColor(), bigFont.useUnderlineForHyperlink()), HorizontalAlignment.LEFT, spriteContainer);
|
||||
bigFont.getHyperlinkColor(), bigFont.useUnderlineForHyperlink()), HorizontalAlignment.LEFT,
|
||||
spriteContainer);
|
||||
}
|
||||
if (this.background == null) {
|
||||
throw new IllegalArgumentException();
|
||||
@ -125,16 +117,16 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
|
||||
@Override
|
||||
protected void drawBackgroundInternalU(UGraphic ug, Area area) {
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
ug = ug.apply(stroke).apply(new UChangeColor(groupBorder));
|
||||
ug = symbolContext.applyStroke(ug).apply(new UChangeColor(symbolContext.getForeColor()));
|
||||
final URectangle rect = new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight());
|
||||
rect.setDeltaShadow(deltaShadow);
|
||||
rect.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
ug.apply(new UChangeBackColor(background)).draw(rect);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawInternalU(UGraphic ug, Area area) {
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
ug = ug.apply(stroke).apply(new UChangeColor(groupBorder));
|
||||
ug = symbolContext.applyStroke(ug).apply(new UChangeColor(symbolContext.getForeColor()));
|
||||
final URectangle rect = new URectangle(dimensionToUse.getWidth(), dimensionToUse.getHeight());
|
||||
ug.draw(rect);
|
||||
|
||||
@ -152,7 +144,7 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
|
||||
polygon.addPoint(0, textHeight);
|
||||
polygon.addPoint(0, 0);
|
||||
|
||||
ug.apply(new UChangeColor(groupBorder)).apply(new UChangeBackColor(groupBackground)).draw(polygon);
|
||||
symbolContext.applyColors(ug).draw(polygon);
|
||||
|
||||
ug = ug.apply(new UStroke());
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15913 $
|
||||
* Revision $Revision: 15961 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -36,15 +36,15 @@ package net.sourceforge.plantuml.skin.rose;
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.creole.Stencil;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
@ -55,34 +55,27 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
final public class ComponentRoseNote extends AbstractTextualComponent implements Stencil {
|
||||
|
||||
private final int cornersize = 10;
|
||||
private final HtmlColor back;
|
||||
private final HtmlColor foregroundColor;
|
||||
private final double paddingX;
|
||||
private final double paddingY;
|
||||
private final double deltaShadow;
|
||||
private final UStroke stroke;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
public ComponentRoseNote(BiColor biColor, UFont2 font, Display strings,
|
||||
double paddingX, double paddingY, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
|
||||
super(strings, font, HorizontalAlignment.LEFT, 6, 15, 5, spriteContainer, 0, true,
|
||||
null, null);
|
||||
this.back = biColor.getYellowBack();
|
||||
this.foregroundColor = biColor.getRedBorder();
|
||||
public ComponentRoseNote(SymbolContext symbolContext, FontConfiguration font, Display strings, double paddingX, double paddingY,
|
||||
ISkinSimple spriteContainer) {
|
||||
super(strings, font, HorizontalAlignment.LEFT, 6, 15, 5, spriteContainer, 0, true, null, null);
|
||||
this.paddingX = paddingX;
|
||||
this.paddingY = paddingY;
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.stroke = stroke;
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
final public double getPreferredWidth(StringBounder stringBounder) {
|
||||
final double result = getTextWidth(stringBounder) + 2 * getPaddingX() + deltaShadow;
|
||||
final double result = getTextWidth(stringBounder) + 2 * getPaddingX() + symbolContext.getDeltaShadow();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
final public double getPreferredHeight(StringBounder stringBounder) {
|
||||
return getTextHeight(stringBounder) + 2 * getPaddingY() + deltaShadow;
|
||||
return getTextHeight(stringBounder) + 2 * getPaddingY() + symbolContext.getDeltaShadow();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -117,10 +110,9 @@ final public class ComponentRoseNote extends AbstractTextualComponent implements
|
||||
polygon.addPoint(x2, cornersize);
|
||||
polygon.addPoint(x2 - cornersize, 0);
|
||||
polygon.addPoint(0, 0);
|
||||
polygon.setDeltaShadow(deltaShadow);
|
||||
polygon.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
|
||||
ug = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(foregroundColor));
|
||||
ug = ug.apply(stroke);
|
||||
ug = symbolContext.apply(ug);
|
||||
ug.draw(polygon);
|
||||
|
||||
ug.apply(new UTranslate(x2 - cornersize, 0)).draw(new ULine(0, cornersize));
|
||||
|
@ -35,15 +35,12 @@ package net.sourceforge.plantuml.skin.rose;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
@ -51,19 +48,12 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
final public class ComponentRoseNoteBox extends AbstractTextualComponent {
|
||||
|
||||
private final HtmlColor back;
|
||||
private final HtmlColor foregroundColor;
|
||||
private final double deltaShadow;
|
||||
private final UStroke stroke;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
public ComponentRoseNoteBox(BiColor biColor, UFont2 font,
|
||||
Display strings, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
|
||||
super(strings, font, HorizontalAlignment.LEFT, 4, 4, 4, spriteContainer, 0, false,
|
||||
null, null);
|
||||
this.back = biColor.getYellowBack();
|
||||
this.foregroundColor = biColor.getRedBorder();
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.stroke = stroke;
|
||||
public ComponentRoseNoteBox(SymbolContext symbolContext, FontConfiguration font, Display strings,
|
||||
ISkinSimple spriteContainer) {
|
||||
super(strings, font, HorizontalAlignment.LEFT, 4, 4, 4, spriteContainer, 0, false, null, null);
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -101,10 +91,9 @@ final public class ComponentRoseNoteBox extends AbstractTextualComponent {
|
||||
x2 = (int) (area.getDimensionToUse().getWidth() - 2 * getPaddingX());
|
||||
}
|
||||
|
||||
ug = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(foregroundColor));
|
||||
ug = ug.apply(stroke);
|
||||
ug = symbolContext.apply(ug);
|
||||
final URectangle rect = new URectangle(x2, textHeight);
|
||||
rect.setDeltaShadow(deltaShadow);
|
||||
rect.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
ug.draw(rect);
|
||||
ug = ug.apply(new UStroke());
|
||||
|
||||
|
@ -35,15 +35,12 @@ package net.sourceforge.plantuml.skin.rose;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
@ -52,19 +49,13 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
final public class ComponentRoseNoteHexagonal extends AbstractTextualComponent {
|
||||
|
||||
private final int cornersize = 10;
|
||||
private final HtmlColor back;
|
||||
private final HtmlColor foregroundColor;
|
||||
private final double deltaShadow;
|
||||
private final UStroke stroke;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
|
||||
public ComponentRoseNoteHexagonal(BiColor biColor, UFont2 font,
|
||||
Display strings, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
|
||||
super(strings, font, HorizontalAlignment.LEFT, 12, 12, 4, spriteContainer, 0, false,
|
||||
null, null);
|
||||
this.back = biColor.getYellowBack();
|
||||
this.foregroundColor = biColor.getRedBorder();
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.stroke = stroke;
|
||||
public ComponentRoseNoteHexagonal(SymbolContext symbolContext, FontConfiguration font, Display strings,
|
||||
ISkinSimple spriteContainer) {
|
||||
super(strings, font, HorizontalAlignment.LEFT, 12, 12, 4, spriteContainer, 0, false, null, null);
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -111,9 +102,8 @@ final public class ComponentRoseNoteHexagonal extends AbstractTextualComponent {
|
||||
polygon.addPoint(0, textHeight / 2);
|
||||
polygon.addPoint(cornersize, 0);
|
||||
|
||||
ug = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(foregroundColor));
|
||||
polygon.setDeltaShadow(deltaShadow);
|
||||
ug = ug.apply(stroke);
|
||||
ug = symbolContext.apply(ug);
|
||||
polygon.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
ug.draw(polygon);
|
||||
ug = ug.apply(new UStroke());
|
||||
|
||||
|
@ -28,24 +28,24 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15913 $
|
||||
* Revision $Revision: 15953 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
@ -59,16 +59,16 @@ public class ComponentRoseParticipant extends AbstractTextualComponent {
|
||||
private final double roundCorner;
|
||||
private final UStroke stroke;
|
||||
|
||||
public ComponentRoseParticipant(BiColor biColor, UFont2 font,
|
||||
Display stringsToDisplay, ISkinSimple spriteContainer, double deltaShadow, double roundCorner,
|
||||
UStroke stroke, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7,
|
||||
spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
|
||||
this.back = biColor.getYellowBack();
|
||||
public ComponentRoseParticipant(SymbolContext biColor, FontConfiguration font, Display stringsToDisplay,
|
||||
ISkinSimple spriteContainer, double roundCorner, UFont fontForStereotype,
|
||||
HtmlColor htmlColorForStereotype) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7, spriteContainer, 0, false,
|
||||
fontForStereotype, htmlColorForStereotype);
|
||||
this.back = biColor.getBackColor();
|
||||
this.roundCorner = roundCorner;
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.foregroundColor = biColor.getRedBorder();
|
||||
this.stroke = stroke;
|
||||
this.deltaShadow = biColor.getDeltaShadow();
|
||||
this.foregroundColor = biColor.getForeColor();
|
||||
this.stroke = biColor.getStroke();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -41,14 +41,11 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
import net.sourceforge.plantuml.ugraphic.URectangle;
|
||||
@ -57,31 +54,23 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ComponentRoseReference extends AbstractTextualComponent {
|
||||
|
||||
private final HtmlColor backgroundHeader;
|
||||
private final HtmlColor borderColor;
|
||||
private final HtmlColor background;
|
||||
private final int cornersize = 10;
|
||||
private final TextBlock textHeader;
|
||||
private final double heightFooter = 5;
|
||||
private final double xMargin = 2;
|
||||
private final HorizontalAlignment position;
|
||||
private final double deltaShadow;
|
||||
private final UStroke stroke;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
public ComponentRoseReference(HtmlColor fontHeaderColor, UFont2 font, HtmlColor backgroundHeader,
|
||||
HtmlColor borderColor, HtmlColor background, UFont header, Display stringsToDisplay,
|
||||
HorizontalAlignment position, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
|
||||
public ComponentRoseReference(FontConfiguration font, SymbolContext symbolContext, FontConfiguration header,
|
||||
Display stringsToDisplay, HorizontalAlignment position, ISkinSimple spriteContainer, HtmlColor background) {
|
||||
super(stringsToDisplay.subList(1, stringsToDisplay.size()), font, HorizontalAlignment.LEFT, 4, 4, 4,
|
||||
spriteContainer, 0, false, null, null);
|
||||
this.position = position;
|
||||
this.backgroundHeader = backgroundHeader;
|
||||
this.symbolContext = symbolContext;
|
||||
this.background = background;
|
||||
this.borderColor = borderColor;
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.stroke = stroke;
|
||||
|
||||
textHeader = TextBlockUtils.create(stringsToDisplay.subList(0, 1), new FontConfiguration(header,
|
||||
fontHeaderColor, font.getHyperlinkColor(), font.useUnderlineForHyperlink()), HorizontalAlignment.LEFT,
|
||||
this.textHeader = TextBlockUtils.create(stringsToDisplay.subList(0, 1), header, HorizontalAlignment.LEFT,
|
||||
spriteContainer);
|
||||
|
||||
}
|
||||
@ -93,11 +82,11 @@ public class ComponentRoseReference extends AbstractTextualComponent {
|
||||
final int textHeaderWidth = (int) (getHeaderWidth(stringBounder));
|
||||
final int textHeaderHeight = (int) (getHeaderHeight(stringBounder));
|
||||
|
||||
ug = ug.apply(stroke);
|
||||
final URectangle rect = new URectangle(dimensionToUse.getWidth() - xMargin * 2 - deltaShadow,
|
||||
dimensionToUse.getHeight() - heightFooter);
|
||||
rect.setDeltaShadow(deltaShadow);
|
||||
ug = ug.apply(new UChangeBackColor(background)).apply(new UChangeColor(borderColor));
|
||||
final URectangle rect = new URectangle(
|
||||
dimensionToUse.getWidth() - xMargin * 2 - symbolContext.getDeltaShadow(), dimensionToUse.getHeight()
|
||||
- heightFooter);
|
||||
rect.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
ug = symbolContext.withBackColor(background).apply(ug);
|
||||
ug.apply(new UTranslate(xMargin, 0)).draw(rect);
|
||||
|
||||
final UPolygon polygon = new UPolygon();
|
||||
@ -110,7 +99,7 @@ public class ComponentRoseReference extends AbstractTextualComponent {
|
||||
polygon.addPoint(0, textHeaderHeight);
|
||||
polygon.addPoint(0, 0);
|
||||
|
||||
ug = ug.apply(new UChangeBackColor(backgroundHeader)).apply(new UChangeColor(borderColor));
|
||||
ug = symbolContext.apply(ug);
|
||||
ug.apply(new UTranslate(xMargin, 0)).draw(polygon);
|
||||
|
||||
ug = ug.apply(new UStroke());
|
||||
@ -146,7 +135,8 @@ public class ComponentRoseReference extends AbstractTextualComponent {
|
||||
|
||||
@Override
|
||||
public double getPreferredWidth(StringBounder stringBounder) {
|
||||
return Math.max(getTextWidth(stringBounder), getHeaderWidth(stringBounder)) + xMargin * 2 + deltaShadow;
|
||||
return Math.max(getTextWidth(stringBounder), getHeaderWidth(stringBounder)) + xMargin * 2
|
||||
+ symbolContext.getDeltaShadow();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -38,6 +38,7 @@ import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -49,7 +50,6 @@ import net.sourceforge.plantuml.skin.ArrowPart;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UEllipse;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -61,7 +61,7 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
|
||||
private final double arrowWidth = 45;
|
||||
private final boolean niceArrow;
|
||||
|
||||
public ComponentRoseSelfArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay,
|
||||
public ComponentRoseSelfArrow(HtmlColor foregroundColor, FontConfiguration font, Display stringsToDisplay,
|
||||
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize,
|
||||
boolean niceArrow) {
|
||||
super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, HorizontalAlignment.LEFT,
|
||||
|
@ -28,19 +28,19 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15908 $
|
||||
* Revision $Revision: 15934 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.AbstractTextualComponent;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
@ -48,7 +48,7 @@ public class ComponentRoseTitle extends AbstractTextualComponent {
|
||||
|
||||
private final int outMargin = 5;
|
||||
|
||||
public ComponentRoseTitle(UFont2 font, Display stringsToDisplay, ISkinSimple spriteContainer) {
|
||||
public ComponentRoseTitle(FontConfiguration font, Display stringsToDisplay, ISkinSimple spriteContainer) {
|
||||
super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7,
|
||||
spriteContainer, 0, false, null, null);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 15913 $
|
||||
* Revision $Revision: 15981 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.skin.rose;
|
||||
@ -40,17 +40,17 @@ import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineParam;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.cucadiagram.Stereotype;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.skin.ArrowDirection;
|
||||
import net.sourceforge.plantuml.skin.BiColor;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Skin;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont2;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
public class Rose implements Skin {
|
||||
@ -77,37 +77,18 @@ public class Rose implements Skin {
|
||||
return result;
|
||||
}
|
||||
|
||||
private UFont2 getUFont2(ISkinParam param, FontParam fontParam) {
|
||||
private FontConfiguration getUFont2(ISkinParam param, FontParam fontParam) {
|
||||
final UFont font = param.getFont(fontParam, null, false);
|
||||
final HtmlColor fontColor = getFontColor(param, fontParam);
|
||||
return font.toFont2(fontColor, param.useUnderlineForHyperlink(), param.getHyperlinkColor());
|
||||
return new FontConfiguration(font, fontColor, param.getHyperlinkColor(), param.useUnderlineForHyperlink());
|
||||
}
|
||||
|
||||
public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param,
|
||||
Display stringsToDisplay) {
|
||||
final HtmlColor background = param.getBackgroundColor();
|
||||
final HtmlColor hyperlinkColor = param.getHyperlinkColor();
|
||||
final boolean useUnderlineForHyperlink = param.useUnderlineForHyperlink();
|
||||
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);
|
||||
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);
|
||||
|
||||
final UFont newFontForStereotype = param.getFont(FontParam.SEQUENCE_STEREOTYPE, null, false);
|
||||
|
||||
final double deltaShadow = param.shadowing() ? 4.0 : 0;
|
||||
|
||||
if (type.isArrow()) {
|
||||
// if (param.maxMessageSize() > 0) {
|
||||
// final FontConfiguration fc = new FontConfiguration(fontArrow, HtmlColorUtils.BLACK);
|
||||
@ -128,18 +109,14 @@ public class Rose implements Skin {
|
||||
param.strictUmlStyle() == false);
|
||||
}
|
||||
if (type == ComponentType.PARTICIPANT_HEAD) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder);
|
||||
return new ComponentRoseParticipant(new BiColor(sequenceParticipantBackground, borderColor), getUFont2(
|
||||
param, FontParam.PARTICIPANT), stringsToDisplay, param, deltaShadow, param.getRoundCorner(),
|
||||
getStroke(param, LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(
|
||||
param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
||||
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.PARTICIPANT_TAIL) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder);
|
||||
return new ComponentRoseParticipant(new BiColor(sequenceParticipantBackground, borderColor), getUFont2(
|
||||
param, FontParam.PARTICIPANT), stringsToDisplay, param, deltaShadow, param.getRoundCorner(),
|
||||
getStroke(param, LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(
|
||||
param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseParticipant(getSymbolContext(param, ColorParam.participantBorder), getUFont2(param,
|
||||
FontParam.PARTICIPANT), stringsToDisplay, param, param.getRoundCorner(), newFontForStereotype,
|
||||
getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.PARTICIPANT_LINE) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
@ -150,171 +127,170 @@ public class Rose implements Skin {
|
||||
return new ComponentRoseLine(borderColor, true, getStroke(param, LineParam.sequenceLifeLineBorder, 1.5));
|
||||
}
|
||||
if (type == ComponentType.ACTOR_HEAD) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseActor(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, true, param, deltaShadow, getStroke(param,
|
||||
LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
||||
return new ComponentRoseActor(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.ACTOR_TAIL) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseActor(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, false, param, deltaShadow, getStroke(param,
|
||||
LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
||||
return new ComponentRoseActor(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.BOUNDARY_HEAD) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseBoundary(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, true, param, deltaShadow, getStroke(param,
|
||||
LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
||||
return new ComponentRoseBoundary(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.BOUNDARY_TAIL) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseBoundary(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, false, param, deltaShadow, getStroke(param,
|
||||
LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
|
||||
return new ComponentRoseBoundary(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.CONTROL_HEAD) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseControl(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
|
||||
stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
||||
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseControl(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.CONTROL_TAIL) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseControl(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
|
||||
stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
||||
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseControl(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.ENTITY_HEAD) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseEntity(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
|
||||
stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
||||
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseEntity(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.ENTITY_TAIL) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseEntity(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
|
||||
stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
||||
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseEntity(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.DATABASE_HEAD) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseDatabase(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
|
||||
stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
||||
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseDatabase(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, true, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.DATABASE_TAIL) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
|
||||
return new ComponentRoseDatabase(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
|
||||
stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
|
||||
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
|
||||
return new ComponentRoseDatabase(getSymbolContext(param, ColorParam.actorBorder), getUFont2(param,
|
||||
FontParam.ACTOR), stringsToDisplay, false, param, newFontForStereotype, getFontColor(param,
|
||||
FontParam.SEQUENCE_STEREOTYPE));
|
||||
}
|
||||
if (type == ComponentType.NOTE) {
|
||||
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
|
||||
final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
|
||||
return new ComponentRoseNote(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(
|
||||
getFontColor(param, FontParam.NOTE), useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,
|
||||
paddingX, paddingY, param, deltaShadow, getStroke(param, LineParam.noteBorder, 1));
|
||||
return new ComponentRoseNote(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
|
||||
FontParam.NOTE), stringsToDisplay, paddingX, paddingY, param);
|
||||
}
|
||||
if (type == ComponentType.NOTE_HEXAGONAL) {
|
||||
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
|
||||
final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
|
||||
return new ComponentRoseNoteHexagonal(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(
|
||||
getFontColor(param, FontParam.NOTE), useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,
|
||||
param, deltaShadow, getStroke(param, LineParam.noteBorder, 1));
|
||||
return new ComponentRoseNoteHexagonal(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
|
||||
FontParam.NOTE), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.NOTE_BOX) {
|
||||
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
|
||||
final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
|
||||
return new ComponentRoseNoteBox(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(
|
||||
getFontColor(param, FontParam.NOTE), useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,
|
||||
param, deltaShadow, getStroke(param, LineParam.noteBorder, 1));
|
||||
return new ComponentRoseNoteBox(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
|
||||
FontParam.NOTE), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.GROUPING_HEADER) {
|
||||
return new ComponentRoseGroupingHeader(background, new BiColor(groupBackground, groupBorder), getUFont2(param,
|
||||
FontParam.SEQUENCE_GROUP_HEADER), fontGrouping, stringsToDisplay, param, deltaShadow, getStroke(
|
||||
param, LineParam.sequenceGroupBorder, 2));
|
||||
return new ComponentRoseGroupingHeader(param.getBackgroundColor(), getSymbolContext(param,
|
||||
ColorParam.sequenceGroupBorder), getUFont2(param, FontParam.SEQUENCE_GROUP_HEADER), fontGrouping,
|
||||
stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.GROUPING_ELSE) {
|
||||
return new ComponentRoseGroupingElse(groupBorder, getUFont2(param, FontParam.SEQUENCE_GROUP),
|
||||
stringsToDisplay.get(0), param, background, getStroke(param, LineParam.sequenceGroupBorder, 2));
|
||||
return new ComponentRoseGroupingElse(getHtmlColor(param, ColorParam.sequenceGroupBorder), getUFont2(param,
|
||||
FontParam.SEQUENCE_GROUP), stringsToDisplay.get(0), param, param.getBackgroundColor());
|
||||
}
|
||||
if (type == ComponentType.GROUPING_SPACE) {
|
||||
return new ComponentRoseGroupingSpace(7);
|
||||
}
|
||||
if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, true, true, deltaShadow > 0);
|
||||
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), true, true);
|
||||
}
|
||||
if (type == ComponentType.ALIVE_BOX_CLOSE_OPEN) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, true, false, deltaShadow > 0);
|
||||
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), true, false);
|
||||
}
|
||||
if (type == ComponentType.ALIVE_BOX_OPEN_CLOSE) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, false, true, deltaShadow > 0);
|
||||
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), false, true);
|
||||
}
|
||||
if (type == ComponentType.ALIVE_BOX_OPEN_OPEN) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, false, false, deltaShadow > 0);
|
||||
return new ComponentRoseActiveLine(getSymbolContext(param, ColorParam.sequenceLifeLineBorder), false, false);
|
||||
}
|
||||
if (type == ComponentType.DELAY_LINE) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
return new ComponentRoseDelayLine(borderColor);
|
||||
return new ComponentRoseDelayLine(getHtmlColor(param, ColorParam.sequenceLifeLineBorder));
|
||||
}
|
||||
if (type == ComponentType.DELAY_TEXT) {
|
||||
return new ComponentRoseDelayText(param.getFont(FontParam.SEQUENCE_DELAY, null, false).toFont2(
|
||||
getFontColor(param, FontParam.SEQUENCE_DELAY), useUnderlineForHyperlink, hyperlinkColor),
|
||||
stringsToDisplay, param);
|
||||
return new ComponentRoseDelayText(getUFont2(param, FontParam.SEQUENCE_DELAY), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.DESTROY) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
|
||||
return new ComponentRoseDestroy(borderColor);
|
||||
return new ComponentRoseDestroy(getHtmlColor(param, ColorParam.sequenceLifeLineBorder));
|
||||
}
|
||||
if (type == ComponentType.NEWPAGE) {
|
||||
return new ComponentRoseNewpage(getFontColor(param, FontParam.SEQUENCE_GROUP));
|
||||
}
|
||||
if (type == ComponentType.DIVIDER) {
|
||||
return new ComponentRoseDivider(param.getFont(FontParam.SEQUENCE_DIVIDER, null, false).toFont2(
|
||||
getFontColor(param, FontParam.SEQUENCE_DIVIDER), useUnderlineForHyperlink, hyperlinkColor),
|
||||
sequenceDividerBackground, stringsToDisplay, param, deltaShadow > 0, getStroke(param,
|
||||
LineParam.sequenceDividerBorder, 2));
|
||||
return new ComponentRoseDivider(getUFont2(param, FontParam.SEQUENCE_DIVIDER), getHtmlColor(param,
|
||||
ColorParam.sequenceDividerBackground), stringsToDisplay, param, deltaShadow(param) > 0, getStroke(
|
||||
param, LineParam.sequenceDividerBorder, 2));
|
||||
}
|
||||
if (type == ComponentType.REFERENCE) {
|
||||
final UFont fontGroupingHeader = param.getFont(FontParam.SEQUENCE_GROUP_HEADER, null, false);
|
||||
return new ComponentRoseReference(getFontColor(param, FontParam.SEQUENCE_GROUP), getUFont2(param,
|
||||
FontParam.SEQUENCE_REFERENCE), sequenceReferenceHeaderBackground, sequenceReferenceBorder,
|
||||
sequenceReferenceBackground, fontGroupingHeader, stringsToDisplay,
|
||||
param.getHorizontalAlignment(AlignParam.SEQUENCE_REFERENCE_ALIGN), param, deltaShadow, getStroke(
|
||||
param, LineParam.sequenceReferenceBorder, 2));
|
||||
return new ComponentRoseReference(getUFont2(param, FontParam.SEQUENCE_REFERENCE), getSymbolContext(param,
|
||||
ColorParam.sequenceReferenceBorder), getUFont2(param, FontParam.SEQUENCE_GROUP_HEADER),
|
||||
stringsToDisplay, param.getHorizontalAlignment(AlignParam.SEQUENCE_REFERENCE_ALIGN), param,
|
||||
getHtmlColor(param, ColorParam.sequenceReferenceBackground));
|
||||
}
|
||||
if (type == ComponentType.TITLE) {
|
||||
return new ComponentRoseTitle(param.getFont(FontParam.SEQUENCE_TITLE, null, false).toFont2(
|
||||
getFontColor(param, FontParam.SEQUENCE_TITLE), useUnderlineForHyperlink, hyperlinkColor),
|
||||
stringsToDisplay, param);
|
||||
return new ComponentRoseTitle(getUFont2(param, FontParam.SEQUENCE_TITLE), stringsToDisplay, param);
|
||||
}
|
||||
if (type == ComponentType.SIGNATURE) {
|
||||
return new ComponentRoseTitle(fontGrouping.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
|
||||
hyperlinkColor), Display.create("This skin was created ", "in April 2009."), param);
|
||||
return new ComponentRoseTitle(fontGrouping.toFont2(HtmlColorUtils.BLACK, param.useUnderlineForHyperlink(),
|
||||
param.getHyperlinkColor()), Display.create("This skin was created ", "in April 2009."), param);
|
||||
}
|
||||
if (type == ComponentType.ENGLOBER) {
|
||||
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceBoxBorder);
|
||||
final HtmlColor backColor = getHtmlColor(param, ColorParam.sequenceBoxBackground);
|
||||
return new ComponentRoseEnglober(backColor, borderColor, stringsToDisplay, param.getFont(
|
||||
FontParam.SEQUENCE_BOX, null, false).toFont2(getFontColor(param, FontParam.SEQUENCE_BOX),
|
||||
useUnderlineForHyperlink, hyperlinkColor), param);
|
||||
return new ComponentRoseEnglober(getSymbolContext(param, ColorParam.sequenceBoxBorder), stringsToDisplay,
|
||||
getUFont2(param, FontParam.SEQUENCE_BOX), param);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private double deltaShadow(ISkinParam param) {
|
||||
return param.shadowing() ? 4.0 : 0;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
static public UStroke getStroke(ISkinParam param, LineParam lineParam, double defaultValue) {
|
||||
final UStroke result = param.getThickness(lineParam, null);
|
||||
if (result == null) {
|
||||
|
@ -38,12 +38,12 @@ import java.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UEllipse;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPath;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -54,17 +54,11 @@ public class Boundary implements TextBlock {
|
||||
|
||||
private final double radius = 12;
|
||||
private final double left = 17;
|
||||
private final HtmlColor backgroundColor;
|
||||
private final HtmlColor foregroundColor;
|
||||
private final double thickness;
|
||||
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
private final double deltaShadow;
|
||||
|
||||
public Boundary(HtmlColor backgroundColor, HtmlColor foregroundColor, double deltaShadow, double thickness) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.foregroundColor = foregroundColor;
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.thickness = thickness;
|
||||
public Boundary(SymbolContext symbolContext) {
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -72,22 +66,21 @@ public class Boundary implements TextBlock {
|
||||
double y = 0;
|
||||
x += margin;
|
||||
y += margin;
|
||||
ug = ug.apply(new UStroke(thickness)).apply(new UChangeBackColor(backgroundColor))
|
||||
.apply(new UChangeColor(foregroundColor));
|
||||
ug = symbolContext.apply(ug);
|
||||
final UEllipse circle = new UEllipse(radius * 2, radius * 2);
|
||||
circle.setDeltaShadow(deltaShadow);
|
||||
circle.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
|
||||
final UPath path1 = new UPath();
|
||||
path1.moveTo(0, 0);
|
||||
path1.lineTo(0, radius * 2);
|
||||
path1.setDeltaShadow(deltaShadow);
|
||||
path1.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
|
||||
final UPath path = new UPath();
|
||||
path.moveTo(0, 0);
|
||||
path.lineTo(0, radius * 2);
|
||||
path.moveTo(0, radius);
|
||||
path.lineTo(left, radius);
|
||||
path.setDeltaShadow(deltaShadow);
|
||||
path.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
ug.apply(new UTranslate(x, y)).draw(path);
|
||||
|
||||
// final ULine line1 = new ULine(0, radius * 2);
|
||||
|
@ -38,6 +38,7 @@ import java.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
@ -52,17 +53,10 @@ public class Control implements TextBlock {
|
||||
private final double margin = 4;
|
||||
|
||||
private final double radius = 12;
|
||||
private final HtmlColor backgroundColor;
|
||||
private final HtmlColor foregroundColor;
|
||||
private final double thickness;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
private final double deltaShadow;
|
||||
|
||||
public Control(HtmlColor backgroundColor, HtmlColor foregroundColor, double deltaShadow, double thickness) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.foregroundColor = foregroundColor;
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.thickness = thickness;
|
||||
public Control(SymbolContext symbolContext) {
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -70,14 +64,13 @@ public class Control implements TextBlock {
|
||||
double y = 0;
|
||||
x += margin;
|
||||
y += margin;
|
||||
ug = ug.apply(new UStroke(thickness));
|
||||
ug = ug.apply(new UChangeBackColor(backgroundColor)).apply(new UChangeColor(foregroundColor));
|
||||
ug = symbolContext.apply(ug);
|
||||
final UEllipse circle = new UEllipse(radius * 2, radius * 2);
|
||||
circle.setDeltaShadow(deltaShadow);
|
||||
circle.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
ug.apply(new UTranslate(x, y)).draw(circle);
|
||||
ug = ug.apply(new UStroke());
|
||||
|
||||
ug = ug.apply(new UChangeBackColor(foregroundColor));
|
||||
ug = ug.apply(new UChangeBackColor(symbolContext.getForeColor()));
|
||||
final UPolygon polygon = new UPolygon();
|
||||
polygon.addPoint(0, 0);
|
||||
final int xAile = 6;
|
||||
|
@ -36,15 +36,12 @@ package net.sourceforge.plantuml.svek;
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.SymbolContext;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UEllipse;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class EntityDomain implements TextBlock {
|
||||
@ -53,17 +50,10 @@ public class EntityDomain implements TextBlock {
|
||||
|
||||
private final double radius = 12;
|
||||
private final double suppY = 2;
|
||||
private final HtmlColor backgroundColor;
|
||||
private final HtmlColor foregroundColor;
|
||||
private final double thickness;
|
||||
private final SymbolContext symbolContext;
|
||||
|
||||
private final double deltaShadow;
|
||||
|
||||
public EntityDomain(HtmlColor backgroundColor, HtmlColor foregroundColor, double deltaShadow, double thickness) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
this.foregroundColor = foregroundColor;
|
||||
this.deltaShadow = deltaShadow;
|
||||
this.thickness = thickness;
|
||||
public EntityDomain(SymbolContext symbolContext) {
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -71,10 +61,9 @@ public class EntityDomain implements TextBlock {
|
||||
double y = 0;
|
||||
x += margin;
|
||||
y += margin;
|
||||
ug = ug.apply(new UStroke(thickness)).apply(new UChangeBackColor(backgroundColor))
|
||||
.apply(new UChangeColor(foregroundColor));
|
||||
ug = symbolContext.apply(ug);
|
||||
final UEllipse circle = new UEllipse(radius * 2, radius * 2);
|
||||
circle.setDeltaShadow(deltaShadow);
|
||||
circle.setDeltaShadow(symbolContext.getDeltaShadow());
|
||||
ug.apply(new UTranslate(x, y)).draw(circle);
|
||||
ug.apply(new UTranslate(x, y + 2 * radius + suppY)).draw(new ULine(2 * radius, 0));
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class EntityImageComponent extends AbstractEntityImage {
|
||||
// backcolor = HtmlColorUtils.BLUE;
|
||||
final HtmlColor forecolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBorder(), getStereo());
|
||||
final SymbolContext ctx = new SymbolContext(backcolor, forecolor).withStroke(new UStroke(1.5)).withShadow(
|
||||
getSkinParam().shadowing());
|
||||
getSkinParam().shadowing2(symbol.getSkinParameter()));
|
||||
|
||||
TextBlock stereo = TextBlockUtils.empty(0, 0);
|
||||
|
||||
|
@ -51,6 +51,7 @@ import net.sourceforge.plantuml.cucadiagram.IEntity;
|
||||
import net.sourceforge.plantuml.cucadiagram.ILeaf;
|
||||
import net.sourceforge.plantuml.cucadiagram.Stereotype;
|
||||
import net.sourceforge.plantuml.graph2.GeomUtils;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -106,8 +107,9 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
|
||||
if (strings.size() == 1 && strings.get(0).length() == 0) {
|
||||
textBlock = new TextBlockEmpty();
|
||||
} else {
|
||||
textBlock = new BodyEnhanced2(strings, FontParam.NOTE, skinParam, HorizontalAlignment.LEFT, fontNote,
|
||||
fontColor, skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink());
|
||||
textBlock = new BodyEnhanced2(strings, FontParam.NOTE, skinParam, HorizontalAlignment.LEFT,
|
||||
new FontConfiguration(fontNote, fontColor, skinParam.getHyperlinkColor(),
|
||||
skinParam.useUnderlineForHyperlink()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class TikzGraphics {
|
||||
out(os, "\\usepackage{aeguill}");
|
||||
// out(os, "\\usetikzlibrary{trees}");
|
||||
out(os, "\\begin{document}");
|
||||
out(os, "% generated by Plantuml " + Version.versionString());
|
||||
out(os, "% generated by Plantuml " + Version.versionString(10));
|
||||
for (Map.Entry<Color, String> ent : colornames.entrySet()) {
|
||||
out(os, definecolor(ent.getValue(), ent.getKey()));
|
||||
|
||||
|
@ -39,6 +39,7 @@ import java.awt.Graphics2D;
|
||||
import java.awt.font.FontRenderContext;
|
||||
import java.awt.font.LineMetrics;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
|
||||
@ -60,8 +61,8 @@ public class UFont {
|
||||
return font;
|
||||
}
|
||||
|
||||
public UFont2 toFont2(HtmlColor color, boolean useUnderlineForHyperlink, HtmlColor hyperlinkColor) {
|
||||
return new UFont2(this, color, useUnderlineForHyperlink, hyperlinkColor);
|
||||
public FontConfiguration toFont2(HtmlColor color, boolean useUnderlineForHyperlink, HtmlColor hyperlinkColor) {
|
||||
return new FontConfiguration(this, color, hyperlinkColor, useUnderlineForHyperlink);
|
||||
}
|
||||
|
||||
public UFont scaled(double scale) {
|
||||
|
@ -1,69 +0,0 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2014, 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 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: 3837 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.ugraphic;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
|
||||
public class UFont2 {
|
||||
|
||||
private final UFont font;
|
||||
|
||||
private final HtmlColor color;
|
||||
private final HtmlColor hyperlinkColor;
|
||||
private final boolean useUnderlineForHyperlink;
|
||||
|
||||
public UFont2(UFont font, HtmlColor color, boolean useUnderlineForHyperlink, HtmlColor hyperlinkColor) {
|
||||
this.font = font;
|
||||
this.color = color;
|
||||
this.hyperlinkColor = hyperlinkColor;
|
||||
this.useUnderlineForHyperlink = useUnderlineForHyperlink;
|
||||
}
|
||||
|
||||
public final UFont getFont() {
|
||||
return font;
|
||||
}
|
||||
|
||||
public boolean useUnderlineForHyperlink() {
|
||||
return useUnderlineForHyperlink;
|
||||
}
|
||||
|
||||
public HtmlColor getHyperlinkColor() {
|
||||
return hyperlinkColor;
|
||||
}
|
||||
|
||||
public HtmlColor getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
}
|
@ -43,6 +43,10 @@ public class MathUtils {
|
||||
return Math.max(Math.max(a, b), c);
|
||||
}
|
||||
|
||||
public static double max(double a, double b, double c, double d) {
|
||||
return Math.max(Math.max(a, b), Math.max(c, d));
|
||||
}
|
||||
|
||||
public static double limitation(double v, double min, double max) {
|
||||
if (min >= max) {
|
||||
// assert false : "min="+min+" max="+max+" v="+v;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user