1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00

version 8023

This commit is contained in:
Arnaud Roques 2015-04-20 21:45:13 +02:00
parent 3e922a6f3c
commit 4fff158089
69 changed files with 857 additions and 456 deletions

View File

@ -36,7 +36,7 @@
<groupId>net.sourceforge.plantuml</groupId> <groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId> <artifactId>plantuml</artifactId>
<version>8022-SNAPSHOT</version> <version>8023-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>PlantUML</name> <name>PlantUML</name>

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 13975 $ * Revision $Revision: 15877 $
* *
*/ */
package net.sourceforge.plantuml; package net.sourceforge.plantuml;
@ -56,6 +56,7 @@ public enum ColorParam {
objectBorder(HtmlColorUtils.MY_RED), objectBorder(HtmlColorUtils.MY_RED),
objectArrow(HtmlColorUtils.MY_RED), objectArrow(HtmlColorUtils.MY_RED),
classHeaderBackground(null),
classBackground(HtmlColorUtils.MY_YELLOW), classBackground(HtmlColorUtils.MY_YELLOW),
classBorder(HtmlColorUtils.MY_RED), classBorder(HtmlColorUtils.MY_RED),
stereotypeCBackground(HtmlColorUtils.COL_ADD1B2), stereotypeCBackground(HtmlColorUtils.COL_ADD1B2),
@ -108,6 +109,8 @@ public enum ColorParam {
artifactBorder(HtmlColorUtils.MY_RED), artifactBorder(HtmlColorUtils.MY_RED),
cloudBackground(HtmlColorUtils.MY_YELLOW), cloudBackground(HtmlColorUtils.MY_YELLOW),
cloudBorder(HtmlColorUtils.MY_RED), cloudBorder(HtmlColorUtils.MY_RED),
queueBackground(HtmlColorUtils.MY_YELLOW),
queueBorder(HtmlColorUtils.MY_RED),
databaseBackground(HtmlColorUtils.MY_YELLOW), databaseBackground(HtmlColorUtils.MY_YELLOW),
databaseBorder(HtmlColorUtils.MY_RED), databaseBorder(HtmlColorUtils.MY_RED),
folderBackground(HtmlColorUtils.MY_YELLOW), folderBackground(HtmlColorUtils.MY_YELLOW),

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15799 $ * Revision $Revision: 15877 $
* *
*/ */
package net.sourceforge.plantuml; package net.sourceforge.plantuml;
@ -71,6 +71,7 @@ public enum FontParam {
RECTANGLE(14, Font.PLAIN), // RECTANGLE(14, Font.PLAIN), //
NODE(14, Font.PLAIN), // NODE(14, Font.PLAIN), //
DATABASE(14, Font.PLAIN), // DATABASE(14, Font.PLAIN), //
QUEUE(14, Font.PLAIN), //
SEQUENCE_ARROW(13, Font.PLAIN), // SEQUENCE_ARROW(13, Font.PLAIN), //
SEQUENCE_BOX(13, Font.BOLD), // SEQUENCE_BOX(13, Font.BOLD), //
SEQUENCE_DIVIDER(13, Font.BOLD), // SEQUENCE_DIVIDER(13, Font.BOLD), //
@ -100,6 +101,7 @@ public enum FontParam {
FOLDER_STEREOTYPE(14, Font.ITALIC), // FOLDER_STEREOTYPE(14, Font.ITALIC), //
FRAME_STEREOTYPE(14, Font.ITALIC), // FRAME_STEREOTYPE(14, Font.ITALIC), //
DATABASE_STEREOTYPE(14, Font.ITALIC), // DATABASE_STEREOTYPE(14, Font.ITALIC), //
QUEUE_STEREOTYPE(14, Font.ITALIC), //
ACTOR_STEREOTYPE(14, Font.ITALIC), // ACTOR_STEREOTYPE(14, Font.ITALIC), //
SEQUENCE_STEREOTYPE(14, Font.ITALIC); // SEQUENCE_STEREOTYPE(14, Font.ITALIC); //

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15087 $ * Revision $Revision: 15892 $
* *
*/ */
package net.sourceforge.plantuml; package net.sourceforge.plantuml;
@ -58,7 +58,7 @@ public class OptionFlags {
static public final boolean USE_INTERFACE_EYE2 = false; static public final boolean USE_INTERFACE_EYE2 = false;
static public final boolean SWI2 = false; static public final boolean SWI2 = false;
void reset() { public void reset() {
reset(false); reset(false);
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 14871 $ * Revision $Revision: 15892 $
* *
*/ */
package net.sourceforge.plantuml; package net.sourceforge.plantuml;
@ -201,7 +201,7 @@ public class Run {
ftpServer.go(); ftpServer.go();
} }
static void printFonts() { public static void printFonts() {
final Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); final Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (Font f : fonts) { for (Font f : fonts) {
System.out.println("f=" + f + "/" + f.getPSName() + "/" + f.getName() + "/" + f.getFontName() + "/" System.out.println("f=" + f + "/" + f.getPSName() + "/" + f.getName() + "/" + f.getFontName() + "/"
@ -244,7 +244,7 @@ public class Run {
managePipe(option, br, System.out); managePipe(option, br, System.out);
} }
static void managePipe(Option option, final BufferedReader br, final PrintStream ps) throws IOException { public static void managePipe(Option option, final BufferedReader br, final PrintStream ps) throws IOException {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
String s = null; String s = null;
while ((s = br.readLine()) != null) { while ((s = br.readLine()) != null) {

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15850 $ * Revision $Revision: 15870 $
* *
*/ */
package net.sourceforge.plantuml; package net.sourceforge.plantuml;

View File

@ -73,10 +73,7 @@ public class CommandCreateElementFull2 extends SingleLineCommand2<ClassDiagram>
regex = "mix_" + regex; regex = "mix_" + regex;
} }
return new RegexConcat(new RegexLeaf("^"), // return new RegexConcat(new RegexLeaf("^"), //
new RegexLeaf("SYMBOL", new RegexLeaf("SYMBOL", regex), //
// "(?:(artifact|actor|folder|package|rectangle|node|frame|cloud|database|storage|agent|usecase|component|boundary|control|entity|interface|\\(\\))[%s]+)?"),
// //
regex), //
new RegexLeaf("[%s]*"), // new RegexLeaf("[%s]*"), //
new RegexOr(// new RegexOr(//
new RegexLeaf("CODE1", CODE_WITH_QUOTE) // new RegexLeaf("CODE1", CODE_WITH_QUOTE) //

View File

@ -108,6 +108,9 @@ public final class FactoryNoteCommand implements SingleMultiFactoryCommand<Abstr
private CommandExecutionResult executeInternal(AbstractEntityDiagram diagram, RegexResult arg, private CommandExecutionResult executeInternal(AbstractEntityDiagram diagram, RegexResult arg,
final List<? extends CharSequence> display) { final List<? extends CharSequence> display) {
final Code code = Code.of(arg.get("CODE", 0)); final Code code = Code.of(arg.get("CODE", 0));
if (diagram.leafExist(code)) {
return CommandExecutionResult.error("Note already created: " + code.getFullName());
}
final IEntity entity = diagram.createLeaf(code, Display.create(display), LeafType.NOTE, null); final IEntity entity = diagram.createLeaf(code, Display.create(display), LeafType.NOTE, null);
assert entity != null; assert entity != null;
entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0))); entity.setSpecificBackcolor(diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0)));

View File

@ -63,7 +63,7 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
return new RegexConcat(new RegexLeaf("^"), // return new RegexConcat(new RegexLeaf("^"), //
new RegexLeaf( new RegexLeaf(
"SYMBOL", "SYMBOL",
"(?:(artifact|actor|folder|package|rectangle|node|frame|cloud|database|storage|agent|usecase|component|boundary|control|entity|interface|\\(\\))[%s]+)?"), // "(?:(artifact|actor|folder|package|rectangle|node|frame|cloud|database|queue|storage|agent|usecase|component|boundary|control|entity|interface|\\(\\))[%s]+)?"), //
new RegexLeaf("[%s]*"), // new RegexLeaf("[%s]*"), //
new RegexOr(// new RegexOr(//
new RegexLeaf("CODE1", CODE_WITH_QUOTE), // new RegexLeaf("CODE1", CODE_WITH_QUOTE), //
@ -157,6 +157,9 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
} else if (symbol.equalsIgnoreCase("database")) { } else if (symbol.equalsIgnoreCase("database")) {
type = LeafType.DESCRIPTION; type = LeafType.DESCRIPTION;
usymbol = USymbol.DATABASE; usymbol = USymbol.DATABASE;
} else if (symbol.equalsIgnoreCase("queue")) {
type = LeafType.DESCRIPTION;
usymbol = USymbol.QUEUE;
} else if (symbol.equalsIgnoreCase("storage")) { } else if (symbol.equalsIgnoreCase("storage")) {
type = LeafType.DESCRIPTION; type = LeafType.DESCRIPTION;
usymbol = USymbol.STORAGE; usymbol = USymbol.STORAGE;

View File

@ -58,7 +58,7 @@ import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemDonors extends AbstractPSystem { public class PSystemDonors extends AbstractPSystem {
public static final String DONORS = "UDfTaSjomZ0CHVVw2gypquz8IOTEU7MWqqLt8X74O2HgEqoJhwze6npGodVqEbVENVOVvE6D8dcJSnIsMC4xPIda17D9qWV8XrRSmjId57MmeIs6Q97DKXg6d6lnPYeKUxe-Tpkj6CgHOOwZHHoXi8Em3l8qMYwmQHD21rERtGSBb0Db6s0JwTmGcud8MVqLmnuAC3izj8g7YJZBPYrj82ZRXtns43KoYBE5nOWQJsEfgt97tyYrddFIM9swHz-fq_NDDkzXEQQFFQoSlMX3OQkZajyobk4bt4Rp22AZ2nJzoKRVcJasKYEKrwD_DgZZHtKPkVHT6iTEpyGOjKxvbAlyWwVZdIkkx-HlfzL1JjjMFjeUNbEw5bZOgY5ddj6wRkp0zMEO41xHIa9-Ah7wQYcOejrwrAzroVw7729LZPbv30W_obUoq000"; public static final String DONORS = "UDfTaajImp0CXlSwXTUPuH2XOSg4yfYMOS5EJKJZrfMAxHIIqwC2gTrgPOrUto-vTCM_aOSNYkHDoL7OOWElL2IJFImakJv0EPNY6kO-XMY05QqnH8jidgHZABaLR-P2SQJJy-D3CwPqP5XWDeWZL7Poh8CojPOZhFg4CC3S5fV60lL4sGTOHJfqn6OcSb1zrJI70Zpihqh5mqoSPREKFX3K_LMys8eAcPo3XSUC6lUvgwDAHz_8hQvprbdjka4_gDBbMJPlu2cdZoCyEtlKWiesEoK_Hop3NJYtvWoYe2DKuzv6FvW5Tj8YrAUbltUexREyWbmwbzfkq3KnHirJFkMg_-1fTw6Asmltjz9g8wTbppxQ4UvJk1Luj4r7pjoYTKEkm8qvJ0ZNQ3KXtzJOVFOKJDMlFUffNPB_9jj8JMSUF0PCI1lI7viTy0j-0FkXkCC0";
// public ImageData exportDiagram(OutputStream os, int num, FileFormatOption // public ImageData exportDiagram(OutputStream os, int num, FileFormatOption
// fileFormat) throws IOException { // fileFormat) throws IOException {

View File

@ -311,6 +311,11 @@ public class EpsGraphics {
} }
public void epsPolygon(HtmlColorGradient gr, ColorMapper mapper, double... points) {
setFillColor(mapper.getMappedColor(gr.getColor1()));
epsPolygon(points);
}
public void epsPolygon(double... points) { public void epsPolygon(double... points) {
checkCloseDone(); checkCloseDone();
double lastX = 0; double lastX = 0;
@ -370,14 +375,6 @@ public class EpsGraphics {
} }
} }
public void epsUrlLink(int x, int y, int width, int height, String url) {
append("[ /Rect [ " + x + " " + y + " " + (x + width) + " " + (y + height) + " ]", true);
append("/Border [ 0 0 0 ]", true);
append("/Action << /Subtype /URI /URI (" + url + ") >>", true);
append("/Subtype /Link", true);
append("/ANN pdfmark", true);
}
public void epsRectangle(double x, double y, double width, double height, double rx, double ry, public void epsRectangle(double x, double y, double width, double height, double rx, double ry,
HtmlColorGradient gr, ColorMapper mapper) { HtmlColorGradient gr, ColorMapper mapper) {
checkCloseDone(); checkCloseDone();
@ -719,6 +716,14 @@ public class EpsGraphics {
this.urlArea = null; this.urlArea = null;
} }
public void epsUrlLink(int x, int y, int width, int height, String url) {
append("[ /Rect [ " + x + " " + y + " " + (x + width) + " " + (y + height) + " ]", true);
append("/Border [ 0 0 0 ]", true);
append("/Action << /Subtype /URI /URI (" + url + ") >>", true);
append("/Subtype /Link", true);
append("/ANN pdfmark", true);
}
public void openLink(String url) { public void openLink(String url) {
this.urlArea = new UrlArea(url); this.urlArea = new UrlArea(url);
} }

View File

@ -70,6 +70,7 @@ public abstract class USymbol {
public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", new USymbolEntityDomain(2)); 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 CONTROL = record("CONTROL", new USymbolControl(2));
public final static USymbol INTERFACE = record("INTERFACE", new USymbolInterface()); public final static USymbol INTERFACE = record("INTERFACE", new USymbolInterface());
public final static USymbol QUEUE = record("QUEUE", new USymbolQueue());
private final ColorParam colorParamBorder; private final ColorParam colorParamBorder;
private final ColorParam colorParamBack; private final ColorParam colorParamBack;

View File

@ -0,0 +1,171 @@
/* ========================================================================
* 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 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;
import net.sourceforge.plantuml.ugraphic.UHorizontalLine;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UTranslate;
class USymbolQueue extends USymbol {
public USymbolQueue() {
super(ColorParam.queueBackground, ColorParam.queueBorder, FontParam.QUEUE, FontParam.QUEUE_STEREOTYPE);
}
private final double dx = 5;
private void drawDatabase(UGraphic ug, double width, double height, boolean shadowing) {
final UPath shape = new UPath();
if (shadowing) {
shape.setDeltaShadow(3.0);
}
shape.moveTo(dx, 0);
shape.lineTo(width - dx, 0);
shape.cubicTo(width, 0, width, height / 2, width, height / 2);
shape.cubicTo(width, height / 2, width, height, width - dx, height);
shape.lineTo(dx, height);
shape.cubicTo(0, height, 0, height / 2, 0, height / 2);
shape.cubicTo(0, height / 2, 0, 0, dx, 0);
ug.draw(shape);
final UPath closing = getClosingPath(width, height);
ug.apply(new UChangeBackColor(null)).draw(closing);
}
private UPath getClosingPath(double width, double height) {
final UPath closing = new UPath();
closing.moveTo(width - dx, 0);
closing.cubicTo(width - dx * 2, 0, width - dx * 2, height / 2, width - dx * 2, height / 2);
closing.cubicTo(width - dx * 2, height, width - dx, height, width - dx, height);
return closing;
}
class MyUGraphicDatabase extends AbstractUGraphicHorizontalLine {
private final double endingX;
@Override
protected AbstractUGraphicHorizontalLine copy(UGraphic ug) {
return new MyUGraphicDatabase(ug, endingX);
}
public MyUGraphicDatabase(UGraphic ug, double endingX) {
super(ug);
this.endingX = endingX;
}
@Override
protected void drawHline(UGraphic ug, UHorizontalLine line, UTranslate translate) {
// final UPath closing = getClosingPath(endingX);
// ug = ug.apply(translate);
// ug.apply(line.getStroke()).apply(new UChangeBackColor(null)).apply(new UTranslate(0, -15)).draw(closing);
// if (line.isDouble()) {
// ug.apply(line.getStroke()).apply(new UChangeBackColor(null)).apply(new UTranslate(0, -15 + 2))
// .draw(closing);
// }
line.drawTitleInternal(ug, 0, endingX, 0, true);
}
}
private Margin getMargin() {
return new Margin(5, 15, 5, 5);
}
public TextBlock asSmall(final TextBlock label, final TextBlock stereotype, final SymbolContext symbolContext) {
return new TextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
drawDatabase(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
final UGraphic ug2 = new MyUGraphicDatabase(ug, dim.getWidth());
tb.drawU(ug2.apply(new UTranslate(margin.getX1(), margin.getY1())));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
return getMargin().addDimension(Dimension2DDouble.mergeTB(dimStereo, dimLabel));
}
};
}
public TextBlock asBig(final TextBlock title, final TextBlock stereotype, final double width, final double height,
final SymbolContext symbolContext) {
throw new UnsupportedOperationException();
// return new TextBlock() {
//
// public void drawU(UGraphic ug) {
// final Dimension2D dim = calculateDimension(ug.getStringBounder());
// ug = symbolContext.apply(ug);
// drawDatabase(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing());
// final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
// final double posStereo = (width - dimStereo.getWidth()) / 2;
// stereotype.drawU(ug.apply(new UTranslate(posStereo, 0)));
//
// final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
// final double posTitle = (width - dimTitle.getWidth()) / 2;
// title.drawU(ug.apply(new UTranslate(posTitle, 21)));
// }
//
// public Dimension2D calculateDimension(StringBounder stringBounder) {
// return new Dimension2DDouble(width, height);
// }
// };
}
public boolean manageHorizontalLine() {
return true;
}
// @Override
// public int suppHeightBecauseOfShape() {
// return 15;
// }
}

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.SimpleContext2D; import net.sourceforge.plantuml.skin.SimpleContext2D;
import net.sourceforge.plantuml.skin.rose.ComponentRoseNote; import net.sourceforge.plantuml.skin.rose.ComponentRoseNote;
@ -110,8 +111,8 @@ public class PostIt {
final SkinParam param = SkinParam.noShadowing(); final SkinParam param = SkinParam.noShadowing();
final UFont fontNote = param.getFont(FontParam.NOTE, null, false); final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
final ComponentRoseNote note = new ComponentRoseNote(noteBackgroundColor, borderColor, HtmlColorUtils.BLACK, final ComponentRoseNote note = new ComponentRoseNote(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(HtmlColorUtils.BLACK, true, HtmlColorUtils.BLUE),
HtmlColorUtils.BLUE, true, fontNote, text, 0, 0, new SpriteContainerEmpty(), 0, new UStroke()); text, 0, 0, new SpriteContainerEmpty(), 0, new UStroke());
return note; return note;
} }
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 14823 $ * Revision $Revision: 15886 $
* *
*/ */
package net.sourceforge.plantuml.sequencediagram.graphic; package net.sourceforge.plantuml.sequencediagram.graphic;
@ -238,7 +238,7 @@ public class DrawableSet {
return dimension; return dimension;
} }
void drawU(UGraphic ug, final double delta, double width, Page page, boolean showTail) { void drawU_REMOVEDME_4243(UGraphic ug, final double delta, double width, Page page, boolean showTail) {
final UGraphic ugOrig = ug; final UGraphic ugOrig = ug;
@ -251,7 +251,7 @@ public class DrawableSet {
this.drawEnglobers(ug, height - MARGIN_FOR_ENGLOBERS1, context); this.drawEnglobers(ug, height - MARGIN_FOR_ENGLOBERS1, context);
this.drawLineU(ug, showTail, page); this.drawLineU_REMOVEDME_4243(ug, showTail, page);
this.drawHeadTailU(ug, page, showTail ? height - getTailHeight(ug.getStringBounder(), true) : 0); this.drawHeadTailU(ug, page, showTail ? height - getTailHeight(ug.getStringBounder(), true) : 0);
ug = clipAndTranslate2(delta, width, page, ug); ug = clipAndTranslate2(delta, width, page, ug);
@ -303,7 +303,7 @@ public class DrawableSet {
} }
} }
private void drawLineU(UGraphic ug, boolean showTail, Page page) { private void drawLineU_REMOVEDME_4243(UGraphic ug, boolean showTail, Page page) {
for (LivingParticipantBox box : getAllLivingParticipantBox()) { for (LivingParticipantBox box : getAllLivingParticipantBox()) {
final double create = box.getCreate(); final double create = box.getCreate();
final double startMin = page.getBodyRelativePosition() - box.magicMargin(ug.getStringBounder()); final double startMin = page.getBodyRelativePosition() - box.magicMargin(ug.getStringBounder());
@ -319,7 +319,7 @@ public class DrawableSet {
} }
} }
final double myDelta = page.getNewpage1() - page.getHeaderHeight(); final double myDelta = page.getNewpage1() - page.getHeaderHeight();
box.drawLineU(ug, start, endMax, showTail, myDelta); box.drawLineUTOBEREMOVED_4243(ug, start, endMax, showTail, myDelta);
} }
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 13828 $ * Revision $Revision: 15886 $
* *
*/ */
package net.sourceforge.plantuml.sequencediagram.graphic; package net.sourceforge.plantuml.sequencediagram.graphic;
@ -72,7 +72,7 @@ public class LivingParticipantBox implements InGroupable {
return new SegmentColored(centerX - left, centerX + right, null, lifeLine.shadowing()); return new SegmentColored(centerX - left, centerX + right, null, lifeLine.shadowing());
} }
public void drawLineU(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) { public void drawLineUTOBEREMOVED_4243(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) {
if (endingY <= startingY) { if (endingY <= startingY) {
return; return;
} }
@ -80,7 +80,7 @@ public class LivingParticipantBox implements InGroupable {
if (destroy != 0 && destroy > startingY && destroy < endingY) { if (destroy != 0 && destroy > startingY && destroy < endingY) {
endingY = destroy; endingY = destroy;
} }
participantBox.drawLineU(ug, startingY, endingY, showTail, myDelta); participantBox.drawLineUTOBEREMOVED_4243(ug, startingY, endingY, showTail, myDelta);
} }
public void drawLineU22(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) { public void drawLineU22(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) {

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 13828 $ * Revision $Revision: 15886 $
* *
*/ */
package net.sourceforge.plantuml.sequencediagram.graphic; package net.sourceforge.plantuml.sequencediagram.graphic;
@ -152,22 +152,23 @@ public class ParticipantBox implements Pushable {
// ug.translate(-outMargin, 0); // ug.translate(-outMargin, 0);
} }
public void drawLineU(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) { public void drawLineUTOBEREMOVED_4243(UGraphic ug, double startingY, double endingY, boolean showTail, double myDelta) {
ug = ug.apply(new UTranslate(startingX, 0)); throw new UnsupportedOperationException();
if (delays.size() > 0) { // ug = ug.apply(new UTranslate(startingX, 0));
final StringBounder stringBounder = ug.getStringBounder(); // if (delays.size() > 0) {
for (GraphicalDelayText delay : delays) { // final StringBounder stringBounder = ug.getStringBounder();
if (delay.getStartingY() - myDelta >= startingY) { // for (GraphicalDelayText delay : delays) {
drawLine(ug, startingY, delay.getStartingY() - myDelta, line); // if (delay.getStartingY() - myDelta >= startingY) {
drawLine(ug, delay.getStartingY() - myDelta, delay.getEndingY(stringBounder) - myDelta, delayLine); // drawLine(ug, startingY, delay.getStartingY() - myDelta, line);
startingY = delay.getEndingY(stringBounder) - myDelta; // drawLine(ug, delay.getStartingY() - myDelta, delay.getEndingY(stringBounder) - myDelta, delayLine);
} // startingY = delay.getEndingY(stringBounder) - myDelta;
} // }
if (delays.get(delays.size() - 1).getEndingY(stringBounder) - myDelta > startingY) { // }
startingY = delays.get(delays.size() - 1).getEndingY(stringBounder) - myDelta; // if (delays.get(delays.size() - 1).getEndingY(stringBounder) - myDelta > startingY) {
} // startingY = delays.get(delays.size() - 1).getEndingY(stringBounder) - myDelta;
} // }
drawLine(ug, startingY, endingY, line); // }
// drawLine(ug, startingY, endingY, line);
} }
public void drawLineU22(UGraphic ug, double startingY, final double endingY, boolean showTail, double myDelta) { public void drawLineU22(UGraphic ug, double startingY, final double endingY, boolean showTail, double myDelta) {
@ -190,7 +191,9 @@ public class ParticipantBox implements Pushable {
} }
private void drawLineIfLowerThan(UGraphic ug, double startingY, double endingY, Component comp, double limitY) { private void drawLineIfLowerThan(UGraphic ug, double startingY, double endingY, Component comp, double limitY) {
if (startingY <= limitY && endingY <= limitY) { startingY = Math.min(startingY, limitY);
endingY = Math.min(endingY, limitY);
if (startingY < limitY || endingY < limitY) {
drawLine(ug, startingY, endingY, comp); drawLine(ug, startingY, endingY, comp);
} }

View File

@ -101,7 +101,8 @@ public class SequenceDiagramTxtMaker implements FileMaker {
final double tailHeight = drawableSet.getTailHeight(dummyStringBounder, diagram.isShowFootbox()); final double tailHeight = drawableSet.getTailHeight(dummyStringBounder, diagram.isShowFootbox());
final double newpage2 = fullDimension.getHeight() - (diagram.isShowFootbox() ? tailHeight : 0) - headerHeight; final double newpage2 = fullDimension.getHeight() - (diagram.isShowFootbox() ? tailHeight : 0) - headerHeight;
final Page page = new Page(headerHeight, 0, newpage2, tailHeight, 0, null); final Page page = new Page(headerHeight, 0, newpage2, tailHeight, 0, null);
drawableSet.drawU(ug, 0, fullDimension.getWidth(), page, diagram.isShowFootbox()); //drawableSet.drawU_REMOVEDME_4243(ug, 0, fullDimension.getWidth(), page, diagram.isShowFootbox());
drawableSet.drawU22(ug, 0, fullDimension.getWidth(), page, diagram.isShowFootbox());
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15812 $ * Revision $Revision: 15907 $
* *
*/ */
package net.sourceforge.plantuml.skin; package net.sourceforge.plantuml.skin;
@ -47,6 +47,7 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockEmpty; import net.sourceforge.plantuml.graphic.TextBlockEmpty;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
public abstract class AbstractTextualComponent extends AbstractComponent { public abstract class AbstractTextualComponent extends AbstractComponent {
@ -61,21 +62,19 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
private final UFont font; private final UFont font;
private final HtmlColor fontColor; private final HtmlColor fontColor;
public AbstractTextualComponent(CharSequence label, HtmlColor fontColor, HtmlColor hyperlinkColor, public AbstractTextualComponent(CharSequence label, UFont2 font, HorizontalAlignment horizontalAlignment, int marginX1,
boolean useUnderlineForHyperlink, UFont font, HorizontalAlignment horizontalAlignment, int marginX1, int marginX2, int marginY, ISkinSimple spriteContainer, double maxMessageSize,
int marginX2, int marginY, ISkinSimple spriteContainer, double maxMessageSize, UFont fontForStereotype, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
HtmlColor htmlColorForStereotype) { this(Display.getWithNewlines(label == null ? "" : label.toString()), font, horizontalAlignment, marginX1,
this(Display.getWithNewlines(label == null ? "" : label.toString()), fontColor, hyperlinkColor, marginX2, marginY, spriteContainer, maxMessageSize, false, fontForStereotype, htmlColorForStereotype);
useUnderlineForHyperlink, font, horizontalAlignment, marginX1, marginX2, marginY, spriteContainer,
maxMessageSize, false, fontForStereotype, htmlColorForStereotype);
} }
public AbstractTextualComponent(Display strings, HtmlColor fontColor, HtmlColor hyperlinkColor, public AbstractTextualComponent(Display strings, UFont2 font, HorizontalAlignment horizontalAlignment, int marginX1,
boolean useUnderlineForHyperlink, UFont font, HorizontalAlignment horizontalAlignment, int marginX1, int marginX2, int marginY, ISkinSimple spriteContainer, double maxMessageSize,
int marginX2, int marginY, ISkinSimple spriteContainer, double maxMessageSize, boolean enhanced, boolean enhanced, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
UFont fontForStereotype, HtmlColor htmlColorForStereotype) { this.font = font.getFont();
this.font = font; this.fontColor = font.getColor();
this.fontColor = fontColor; assert fontColor.equals(font.getColor());
this.marginX1 = marginX1; this.marginX1 = marginX1;
this.marginX2 = marginX2; this.marginX2 = marginX2;
this.marginY = marginY; this.marginY = marginY;
@ -84,11 +83,11 @@ public abstract class AbstractTextualComponent extends AbstractComponent {
if (strings.size() == 1 && strings.get(0).length() == 0) { if (strings.size() == 1 && strings.get(0).length() == 0) {
textBlock = new TextBlockEmpty(); textBlock = new TextBlockEmpty();
} else if (enhanced) { } else if (enhanced) {
textBlock = new BodyEnhanced2(strings, FontParam.NOTE, spriteContainer, HorizontalAlignment.LEFT, font, textBlock = new BodyEnhanced2(strings, FontParam.NOTE, spriteContainer, HorizontalAlignment.LEFT,
fontColor, hyperlinkColor, useUnderlineForHyperlink); font.getFont(), fontColor, font.getHyperlinkColor(), font.useUnderlineForHyperlink());
} else { } else {
textBlock = TextBlockUtils.create(strings, new FontConfiguration(font, fontColor, hyperlinkColor, textBlock = TextBlockUtils.create(strings, new FontConfiguration(font.getFont(), fontColor, font.getHyperlinkColor(),
useUnderlineForHyperlink), horizontalAlignment, spriteContainer, maxMessageSize, false, font.useUnderlineForHyperlink()), horizontalAlignment, spriteContainer, maxMessageSize, false,
fontForStereotype, htmlColorForStereotype); fontForStereotype, htmlColorForStereotype);
} }
} }

View File

@ -0,0 +1,56 @@
/* ========================================================================
* 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: 8151 $
*
*/
package net.sourceforge.plantuml.skin;
import net.sourceforge.plantuml.graphic.HtmlColor;
public class BiColor {
private final HtmlColor yellowBack;
private final HtmlColor redBorder;
public BiColor(HtmlColor yellowBack, HtmlColor redBorder) {
this.yellowBack = yellowBack;
this.redBorder = redBorder;
}
public HtmlColor getYellowBack() {
return yellowBack;
}
public HtmlColor getRedBorder() {
return redBorder;
}
}

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -40,7 +40,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.ArrowComponent; import net.sourceforge.plantuml.skin.ArrowComponent;
import net.sourceforge.plantuml.skin.ArrowConfiguration; import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont2;
public abstract class AbstractComponentBlueModernArrow extends AbstractTextualComponent implements ArrowComponent { public abstract class AbstractComponentBlueModernArrow extends AbstractTextualComponent implements ArrowComponent {
@ -52,10 +52,9 @@ public abstract class AbstractComponentBlueModernArrow extends AbstractTextualCo
private final ArrowConfiguration arrowConfiguration; private final ArrowConfiguration arrowConfiguration;
private final HtmlColor foregroundColor; private final HtmlColor foregroundColor;
public AbstractComponentBlueModernArrow(HtmlColor foregroundColor, HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, public AbstractComponentBlueModernArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) { super(stringsToDisplay, font, HorizontalAlignment.LEFT, 17, 17, 2,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.LEFT, spriteContainer, 0, false, null, null);
17, 17, 2, spriteContainer, 0, false, null, null);
this.arrowConfiguration = arrowConfiguration; this.arrowConfiguration = arrowConfiguration;
this.foregroundColor = foregroundColor; this.foregroundColor = foregroundColor;
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 14712 $ * Revision $Revision: 15913 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -79,19 +79,17 @@ public class BlueModern implements Skin {
if (type.isArrow()) { if (type.isArrow()) {
final HtmlColor sequenceArrow = config.getColor() == null ? HtmlColorUtils.BLACK : config.getColor(); final HtmlColor sequenceArrow = config.getColor() == null ? HtmlColorUtils.BLACK : config.getColor();
if (config.isSelfArrow()) { if (config.isSelfArrow()) {
return new ComponentBlueModernSelfArrow(sequenceArrow, HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, return new ComponentBlueModernSelfArrow(sequenceArrow, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config,
normalFont, stringsToDisplay, config, param); param);
} }
return new ComponentBlueModernArrow(sequenceArrow, HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, normalFont, return new ComponentBlueModernArrow(sequenceArrow, useUnderlineForHyperlink, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, config,
stringsToDisplay, config, param); param);
} }
if (type == ComponentType.PARTICIPANT_HEAD) { if (type == ComponentType.PARTICIPANT_HEAD) {
return new ComponentBlueModernParticipant(blue1, blue2, HtmlColorUtils.WHITE, hyperlinkColor, useUnderlineForHyperlink, return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
participantFont, stringsToDisplay, param);
} }
if (type == ComponentType.PARTICIPANT_TAIL) { if (type == ComponentType.PARTICIPANT_TAIL) {
return new ComponentBlueModernParticipant(blue1, blue2, HtmlColorUtils.WHITE, hyperlinkColor, useUnderlineForHyperlink, return new ComponentBlueModernParticipant(blue1, blue2, participantFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
participantFont, stringsToDisplay, param);
} }
if (type == ComponentType.PARTICIPANT_LINE) { if (type == ComponentType.PARTICIPANT_LINE) {
return new ComponentBlueModernLine(lineColor); return new ComponentBlueModernLine(lineColor);
@ -100,16 +98,14 @@ public class BlueModern implements Skin {
return new ComponentBlueModernLine(lineColor); return new ComponentBlueModernLine(lineColor);
} }
if (type == ComponentType.ACTOR_HEAD) { if (type == ComponentType.ACTOR_HEAD) {
return new ComponentBlueModernActor(blue2, blue1, blue1, hyperlinkColor, useUnderlineForHyperlink, participantFont, stringsToDisplay, return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, true, param);
true, param);
} }
if (type == ComponentType.ACTOR_TAIL) { if (type == ComponentType.ACTOR_TAIL) {
return new ComponentBlueModernActor(blue2, blue1, blue1, hyperlinkColor,useUnderlineForHyperlink, participantFont, stringsToDisplay, return new ComponentBlueModernActor(blue2, blue1, participantFont.toFont2(blue1, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,false, param);
false, param);
} }
if (type == ComponentType.NOTE) { if (type == ComponentType.NOTE) {
return new ComponentBlueModernNote(HtmlColorUtils.WHITE, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, return new ComponentBlueModernNote(HtmlColorUtils.WHITE, HtmlColorUtils.BLACK, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor),
hyperlinkColor, useUnderlineForHyperlink, normalFont, stringsToDisplay, param); stringsToDisplay, param);
} }
if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) { if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) {
return new ComponentBlueModernActiveLine(blue1, true, true); return new ComponentBlueModernActiveLine(blue1, true, true);
@ -127,45 +123,43 @@ public class BlueModern implements Skin {
return new ComponentBlueModernDelayLine(lineColor); return new ComponentBlueModernDelayLine(lineColor);
} }
if (type == ComponentType.DELAY_TEXT) { if (type == ComponentType.DELAY_TEXT) {
return new ComponentBlueModernDelayText(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, param.getFont( return new ComponentBlueModernDelayText(param.getFont(
FontParam.SEQUENCE_DELAY, null, false), stringsToDisplay, param); FontParam.SEQUENCE_DELAY, null, false).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
} }
if (type == ComponentType.DESTROY) { if (type == ComponentType.DESTROY) {
return new ComponentRoseDestroy(red); return new ComponentRoseDestroy(red);
} }
if (type == ComponentType.GROUPING_HEADER) { if (type == ComponentType.GROUPING_HEADER) {
return new ComponentBlueModernGroupingHeader(blue1, blue3, borderGroupColor, HtmlColorUtils.WHITE, return new ComponentBlueModernGroupingHeader(blue1, blue3, borderGroupColor, HtmlColorUtils.BLACK,
HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, normalFont, smallFont, stringsToDisplay, param); normalFont.toFont2(HtmlColorUtils.WHITE, useUnderlineForHyperlink, hyperlinkColor), smallFont, stringsToDisplay, param);
} }
if (type == ComponentType.GROUPING_ELSE) { if (type == ComponentType.GROUPING_ELSE) {
return new ComponentRoseGroupingElse(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, HtmlColorUtils.BLACK, smallFont, return new ComponentRoseGroupingElse(HtmlColorUtils.BLACK, smallFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay.get(0), param, blue3,
stringsToDisplay.get(0), param, blue3, Rose.getStroke(param, LineParam.sequenceGroupBorder, 2)); Rose.getStroke(param, LineParam.sequenceGroupBorder, 2));
} }
if (type == ComponentType.GROUPING_SPACE) { if (type == ComponentType.GROUPING_SPACE) {
return new ComponentRoseGroupingSpace(7); return new ComponentRoseGroupingSpace(7);
} }
if (type == ComponentType.TITLE) { if (type == ComponentType.TITLE) {
return new ComponentRoseTitle(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, bigFont, stringsToDisplay, param); return new ComponentRoseTitle(bigFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay, param);
} }
if (type == ComponentType.REFERENCE) { if (type == ComponentType.REFERENCE) {
return new ComponentRoseReference(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, HtmlColorUtils.WHITE, normalFont, return new ComponentRoseReference(HtmlColorUtils.WHITE, normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), blue1, borderGroupColor, blue3,
borderGroupColor, blue1, blue3, normalFont, stringsToDisplay, HorizontalAlignment.CENTER, param, 0, normalFont, stringsToDisplay, HorizontalAlignment.CENTER, param, 0, Rose.getStroke(param, LineParam.sequenceDividerBorder, 2));
Rose.getStroke(param, LineParam.sequenceDividerBorder, 2));
} }
if (type == ComponentType.NEWPAGE) { if (type == ComponentType.NEWPAGE) {
return new ComponentBlueModernNewpage(blue1); return new ComponentBlueModernNewpage(blue1);
} }
if (type == ComponentType.DIVIDER) { if (type == ComponentType.DIVIDER) {
return new ComponentBlueModernDivider(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, normalFont, blue2, blue1, return new ComponentBlueModernDivider(normalFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), blue2, blue1, HtmlColorUtils.BLACK, stringsToDisplay, param);
HtmlColorUtils.BLACK, stringsToDisplay, param);
} }
if (type == ComponentType.SIGNATURE) { if (type == ComponentType.SIGNATURE) {
return new ComponentRoseTitle(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, smallFont, Display.create( return new ComponentRoseTitle(smallFont.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor), Display.create(
"This skin was created ", "in April 2009."), param); "This skin was created ", "in April 2009."), param);
} }
if (type == ComponentType.ENGLOBER) { if (type == ComponentType.ENGLOBER) {
return new ComponentBlueModernEnglober(blue1, blue3, stringsToDisplay, HtmlColorUtils.BLACK, return new ComponentBlueModernEnglober(blue1, blue3, stringsToDisplay, param.getFont(FontParam.SEQUENCE_BOX, null, false).toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink, hyperlinkColor),
hyperlinkColor, useUnderlineForHyperlink, param.getFont(FontParam.SEQUENCE_BOX, null, false), param); param);
} }
return null; return null;

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -43,7 +43,7 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.StickMan; import net.sourceforge.plantuml.skin.StickMan;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -52,11 +52,10 @@ public class ComponentBlueModernActor extends AbstractTextualComponent {
private final StickMan stickman; private final StickMan stickman;
private final boolean head; private final boolean head;
public ComponentBlueModernActor(HtmlColor backgroundColor, HtmlColor foregroundColor, HtmlColor fontColor, public ComponentBlueModernActor(HtmlColor backgroundColor, HtmlColor foregroundColor, UFont2 font,
HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, Display stringsToDisplay, boolean head, ISkinSimple spriteContainer) {
boolean head, ISkinSimple spriteContainer) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, null, null);
3, 3, 0, spriteContainer, 0, false, null, null);
this.head = head; this.head = head;
stickman = new StickMan(backgroundColor, foregroundColor); stickman = new StickMan(backgroundColor, foregroundColor);
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 14712 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -38,7 +38,6 @@ import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.SpriteContainer;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor; import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
@ -48,7 +47,7 @@ import net.sourceforge.plantuml.skin.ArrowDirection;
import net.sourceforge.plantuml.skin.ArrowPart; import net.sourceforge.plantuml.skin.ArrowPart;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -57,9 +56,9 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow { public class ComponentBlueModernArrow extends AbstractComponentBlueModernArrow {
public ComponentBlueModernArrow(HtmlColor foregroundColor, HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, public ComponentBlueModernArrow(HtmlColor foregroundColor, boolean useUnderlineForHyperlink, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration,
Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) { ISkinSimple spriteContainer) {
super(foregroundColor, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, stringsToDisplay, arrowConfiguration, spriteContainer); super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
} }
@Override @Override

View File

@ -38,21 +38,20 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
public class ComponentBlueModernDelayText extends AbstractTextualComponent { public class ComponentBlueModernDelayText extends AbstractTextualComponent {
public ComponentBlueModernDelayText(HtmlColor fontColor, HtmlColor hyperlinkColor, public ComponentBlueModernDelayText(UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, ISkinSimple spriteContainer) { ISkinSimple spriteContainer) {
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4,
4, 4, 4, spriteContainer, 0, false, null, null); spriteContainer, 0, false, null, null);
} }
@Override @Override

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
@ -59,11 +59,10 @@ public class ComponentBlueModernDivider extends AbstractTextualComponent {
private final HtmlColor background2; private final HtmlColor background2;
private final HtmlColor borderColor; private final HtmlColor borderColor;
public ComponentBlueModernDivider(HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, public ComponentBlueModernDivider(UFont2 font, HtmlColor background1, HtmlColor background2,
UFont font, HtmlColor background1, HtmlColor background2, HtmlColor borderColor, Display stringsToDisplay, HtmlColor borderColor, Display stringsToDisplay, ISkinSimple spriteContainer) {
ISkinSimple spriteContainer) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, null, null);
4, 4, 4, spriteContainer, 0, false, null, null);
this.background1 = background1; this.background1 = background1;
this.background2 = background2; this.background2 = background2;
this.borderColor = borderColor; this.borderColor = borderColor;

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
@ -56,10 +56,9 @@ public class ComponentBlueModernEnglober extends AbstractTextualComponent {
private final HtmlColor backColor; private final HtmlColor backColor;
public ComponentBlueModernEnglober(HtmlColor borderColor, HtmlColor backColor, Display strings, public ComponentBlueModernEnglober(HtmlColor borderColor, HtmlColor backColor, Display strings,
HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, UFont2 font, ISkinSimple spriteContainer) {
ISkinSimple spriteContainer) { super(strings, font, HorizontalAlignment.CENTER, 4, 4, 1, spriteContainer, 0, false,
super(strings, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, 4, 4, 1, null, null);
spriteContainer, 0, false, null, null);
this.borderColor = borderColor; this.borderColor = borderColor;
this.backColor = backColor; this.backColor = backColor;
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -48,6 +48,7 @@ import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -67,10 +68,9 @@ public class ComponentBlueModernGroupingHeader extends AbstractTextualComponent
private final HtmlColor borderColor; private final HtmlColor borderColor;
public ComponentBlueModernGroupingHeader(HtmlColor headerBackgroundColor, HtmlColor generalBackgroundColor, public ComponentBlueModernGroupingHeader(HtmlColor headerBackgroundColor, HtmlColor generalBackgroundColor,
HtmlColor borderColor, HtmlColor fontColor1, HtmlColor fontColor2, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont bigFont, HtmlColor borderColor, HtmlColor fontColor2, UFont2 bigFont, UFont smallFont, Display strings, ISkinSimple spriteContainer) {
UFont smallFont, Display strings, ISkinSimple spriteContainer) { super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1, spriteContainer, 0, null,
super(strings.get(0), fontColor1, hyperlinkColor, useUnderlineForHyperlink, bigFont, HorizontalAlignment.LEFT, 15, 30, 1, null);
spriteContainer, 0, null, null);
this.headerBackgroundColor = headerBackgroundColor; this.headerBackgroundColor = headerBackgroundColor;
this.generalBackgroundColor = generalBackgroundColor; this.generalBackgroundColor = generalBackgroundColor;
this.borderColor = borderColor; this.borderColor = borderColor;
@ -78,7 +78,7 @@ public class ComponentBlueModernGroupingHeader extends AbstractTextualComponent
this.commentTextBlock = null; this.commentTextBlock = null;
} else { } else {
this.commentTextBlock = TextBlockUtils.create(Display.create("[" + strings.get(1) + "]"), this.commentTextBlock = TextBlockUtils.create(Display.create("[" + strings.get(1) + "]"),
new FontConfiguration(smallFont, fontColor2, hyperlinkColor, useUnderlineForHyperlink), HorizontalAlignment.LEFT, new FontConfiguration(smallFont, fontColor2, bigFont.getHyperlinkColor(), bigFont.useUnderlineForHyperlink()), HorizontalAlignment.LEFT,
spriteContainer); spriteContainer);
} }
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -42,7 +42,7 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -55,11 +55,10 @@ final public class ComponentBlueModernNote extends AbstractTextualComponent {
private final HtmlColor back; private final HtmlColor back;
private final HtmlColor foregroundColor; private final HtmlColor foregroundColor;
public ComponentBlueModernNote(HtmlColor back, HtmlColor foregroundColor, HtmlColor fontColor, public ComponentBlueModernNote(HtmlColor back, HtmlColor foregroundColor, UFont2 font,
HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, Display strings, Display strings, ISkinSimple spriteContainer) {
ISkinSimple spriteContainer) { super(strings, font, HorizontalAlignment.LEFT, 6, 15, 5, spriteContainer, 0, false,
super(strings, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.LEFT, 6, 15, 5, null, null);
spriteContainer, 0, false, null, null);
this.back = back; this.back = back;
this.foregroundColor = foregroundColor; this.foregroundColor = foregroundColor;
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -41,7 +41,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -51,11 +51,10 @@ public class ComponentBlueModernParticipant extends AbstractTextualComponent {
private final HtmlColor blue1; private final HtmlColor blue1;
private final HtmlColor blue2; private final HtmlColor blue2;
public ComponentBlueModernParticipant(HtmlColor blue1, HtmlColor blue2, HtmlColor fontColor, public ComponentBlueModernParticipant(HtmlColor blue1, HtmlColor blue2, UFont2 font,
HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, Display stringsToDisplay, ISkinSimple spriteContainer) {
ISkinSimple spriteContainer) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, null, null);
7, 7, 7, spriteContainer, 0, false, null, null);
this.blue1 = blue1; this.blue1 = blue1;
this.blue2 = blue2; this.blue2 = blue2;
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 14712 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.bluemodern; package net.sourceforge.plantuml.skin.bluemodern;
@ -45,7 +45,7 @@ import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowPart; import net.sourceforge.plantuml.skin.ArrowPart;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -56,9 +56,8 @@ public class ComponentBlueModernSelfArrow extends AbstractComponentBlueModernArr
private final double arrowWidth = 45; private final double arrowWidth = 45;
public ComponentBlueModernSelfArrow(HtmlColor foregroundColor, HtmlColor colorFont, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, public ComponentBlueModernSelfArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) {
Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer) { super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer);
super(foregroundColor, colorFont, hyperlinkColor, useUnderlineForHyperlink, font, stringsToDisplay, arrowConfiguration, spriteContainer);
} }
@Override @Override

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -40,7 +40,7 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.ArrowComponent; import net.sourceforge.plantuml.skin.ArrowComponent;
import net.sourceforge.plantuml.skin.ArrowConfiguration; import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont2;
public abstract class AbstractComponentRoseArrow extends AbstractTextualComponent implements ArrowComponent { public abstract class AbstractComponentRoseArrow extends AbstractTextualComponent implements ArrowComponent {
@ -49,12 +49,11 @@ public abstract class AbstractComponentRoseArrow extends AbstractTextualComponen
private final HtmlColor foregroundColor; private final HtmlColor foregroundColor;
private final ArrowConfiguration arrowConfiguration; private final ArrowConfiguration arrowConfiguration;
public AbstractComponentRoseArrow(HtmlColor foregroundColor, HtmlColor fontColor, HtmlColor hyperlinkColor, public AbstractComponentRoseArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, HorizontalAlignment textHorizontalAlignment,
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize) {
HorizontalAlignment textHorizontalAlignment, double maxMessageSize) { super(stringsToDisplay, font, textHorizontalAlignment, 7, 7, 1, spriteContainer,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, textHorizontalAlignment, 7, maxMessageSize, false, null, null);
7, 1, spriteContainer, maxMessageSize, false, null, null);
this.arrowConfiguration = arrowConfiguration; this.arrowConfiguration = arrowConfiguration;
this.foregroundColor = foregroundColor; this.foregroundColor = foregroundColor;
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 12235 $ * Revision $Revision: 15913 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -54,7 +54,7 @@ public class ComponentRoseActiveLine extends AbstractComponent {
private final boolean closeDown; private final boolean closeDown;
private final boolean withShadow; private final boolean withShadow;
public ComponentRoseActiveLine(HtmlColor foregroundColor, HtmlColor lifeLineBackground, boolean closeUp, public ComponentRoseActiveLine(HtmlColor lifeLineBackground, HtmlColor foregroundColor, boolean closeUp,
boolean closeDown, boolean withShadow) { boolean closeDown, boolean withShadow) {
this.foregroundColor = foregroundColor; this.foregroundColor = foregroundColor;
this.lifeLineBackground = lifeLineBackground; this.lifeLineBackground = lifeLineBackground;

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15913 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -43,8 +43,10 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.skin.StickMan; import net.sourceforge.plantuml.skin.StickMan;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -54,14 +56,13 @@ public class ComponentRoseActor extends AbstractTextualComponent {
private final TextBlock stickman; private final TextBlock stickman;
private final boolean head; private final boolean head;
public ComponentRoseActor(HtmlColor yellow, HtmlColor red, HtmlColor fontColor, HtmlColor hyperlinkColor, public ComponentRoseActor(BiColor biColor, UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, boolean head, boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke, UFont fontForStereotype, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
HtmlColor htmlColorForStereotype) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
3, 3, 0, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
this.head = head; this.head = head;
this.stickman = new StickMan(yellow, red, deltaShadow, stroke.getThickness()); this.stickman = new StickMan(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
} }
@Override @Override

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.skin.ArrowPart;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -63,11 +63,9 @@ public class ComponentRoseArrow extends AbstractComponentRoseArrow {
private final HorizontalAlignment messagePosition; private final HorizontalAlignment messagePosition;
private final boolean niceArrow; private final boolean niceArrow;
public ComponentRoseArrow(HtmlColor foregroundColor, HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, public ComponentRoseArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, HorizontalAlignment messagePosition, ISkinSimple spriteContainer,
ArrowConfiguration arrowConfiguration, HorizontalAlignment messagePosition, ISkinSimple spriteContainer,
HorizontalAlignment textHorizontalAlignment, double maxMessageSize, boolean niceArrow) { HorizontalAlignment textHorizontalAlignment, double maxMessageSize, boolean niceArrow) {
super(foregroundColor, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, stringsToDisplay, arrowConfiguration, spriteContainer, super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, textHorizontalAlignment, maxMessageSize);
textHorizontalAlignment, maxMessageSize);
this.messagePosition = messagePosition; this.messagePosition = messagePosition;
this.niceArrow = niceArrow; this.niceArrow = niceArrow;
} }

View File

@ -43,8 +43,10 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.svek.Boundary; import net.sourceforge.plantuml.svek.Boundary;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -54,14 +56,13 @@ public class ComponentRoseBoundary extends AbstractTextualComponent {
private final TextBlock stickman; private final TextBlock stickman;
private final boolean head; private final boolean head;
public ComponentRoseBoundary(HtmlColor yellow, HtmlColor red, HtmlColor fontColor, HtmlColor hyperlinkColor, public ComponentRoseBoundary(BiColor biColor, UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, boolean head, boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke, UFont fontForStereotype, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
HtmlColor htmlColorForStereotype) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
3, 3, 0, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
this.head = head; this.head = head;
this.stickman = new Boundary(yellow, red, deltaShadow, stroke.getThickness()); this.stickman = new Boundary(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
} }
@Override @Override

View File

@ -43,8 +43,10 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.svek.Control; import net.sourceforge.plantuml.svek.Control;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -54,14 +56,13 @@ public class ComponentRoseControl extends AbstractTextualComponent {
private final TextBlock stickman; private final TextBlock stickman;
private final boolean head; private final boolean head;
public ComponentRoseControl(HtmlColor yellow, HtmlColor red, HtmlColor fontColor, HtmlColor hyperlinkColor, public ComponentRoseControl(BiColor biColor, UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, boolean head, boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke, UFont fontForStereotype, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
HtmlColor htmlColorForStereotype) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
3, 3, 0, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
this.head = head; this.head = head;
this.stickman = new Control(yellow, red, deltaShadow, stroke.getThickness()); this.stickman = new Control(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
} }
@Override @Override

View File

@ -46,7 +46,9 @@ import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -56,16 +58,15 @@ public class ComponentRoseDatabase extends AbstractTextualComponent {
private final TextBlock stickman; private final TextBlock stickman;
private final boolean head; private final boolean head;
public ComponentRoseDatabase(HtmlColor yellow, HtmlColor red, HtmlColor fontColor, HtmlColor hyperlinkColor, public ComponentRoseDatabase(BiColor biColor, UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, boolean head, boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke, UFont fontForStereotype, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
HtmlColor htmlColorForStereotype) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
3, 3, 0, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
this.head = head; this.head = head;
// this.stickman = new Control(yellow, red, deltaShadow, stroke.getThickness()); // this.stickman = new Control(yellow, red, deltaShadow, stroke.getThickness());
final SymbolContext symbolContext = new SymbolContext(yellow, red).withStroke(new UStroke(1.5)).withShadow( final SymbolContext symbolContext = new SymbolContext(biColor.getYellowBack(), biColor.getRedBorder()).withStroke(new UStroke(1.5)).withShadow(
deltaShadow > 0); deltaShadow > 0);
this.stickman = USymbol.DATABASE.asSmall(TextBlockUtils.empty(16, 17), TextBlockUtils.empty(0, 0), this.stickman = USymbol.DATABASE.asSmall(TextBlockUtils.empty(16, 17), TextBlockUtils.empty(0, 0),
symbolContext); symbolContext);

View File

@ -38,21 +38,19 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
public class ComponentRoseDelayText extends AbstractTextualComponent { public class ComponentRoseDelayText extends AbstractTextualComponent {
public ComponentRoseDelayText(HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, public ComponentRoseDelayText(UFont2 font, Display stringsToDisplay, ISkinSimple spriteContainer) {
UFont font, Display stringsToDisplay, ISkinSimple spriteContainer) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 0, 0, 4,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, null, null);
0, 0, 4, spriteContainer, 0, false, null, null);
} }
@Override @Override

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
@ -61,11 +61,10 @@ public class ComponentRoseDivider extends AbstractTextualComponent {
private final boolean withShadow; private final boolean withShadow;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseDivider(HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, public ComponentRoseDivider(UFont2 font, HtmlColor background, Display stringsToDisplay,
UFont font, HtmlColor background, Display stringsToDisplay, ISkinSimple spriteContainer, ISkinSimple spriteContainer, boolean withShadow, UStroke stroke) {
boolean withShadow, UStroke stroke) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 4, 4, 4,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, null, null);
4, 4, 4, spriteContainer, 0, false, null, null);
this.background = background; this.background = background;
this.empty = stringsToDisplay.get(0).length() == 0; this.empty = stringsToDisplay.get(0).length() == 0;
this.withShadow = withShadow; this.withShadow = withShadow;

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -54,10 +54,10 @@ public class ComponentRoseEnglober extends AbstractTextualComponent {
private final HtmlColor borderColor; private final HtmlColor borderColor;
private final HtmlColor backColor; private final HtmlColor backColor;
public ComponentRoseEnglober(HtmlColor borderColor, HtmlColor backColor, Display strings, HtmlColor fontColor, public ComponentRoseEnglober(HtmlColor backColor, HtmlColor borderColor, Display strings, UFont2 font,
HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, ISkinSimple spriteContainer) { ISkinSimple spriteContainer) {
super(strings, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, 3, 3, 1, super(strings, font, HorizontalAlignment.CENTER, 3, 3, 1, spriteContainer, 0, false,
spriteContainer, 0, false, null, null); null, null);
this.borderColor = borderColor; this.borderColor = borderColor;
this.backColor = backColor; this.backColor = backColor;
} }

View File

@ -43,8 +43,10 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.svek.EntityDomain; import net.sourceforge.plantuml.svek.EntityDomain;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -54,14 +56,13 @@ public class ComponentRoseEntity extends AbstractTextualComponent {
private final TextBlock stickman; private final TextBlock stickman;
private final boolean head; private final boolean head;
public ComponentRoseEntity(HtmlColor yellow, HtmlColor red, HtmlColor fontColor, HtmlColor hyperlinkColor, public ComponentRoseEntity(BiColor biColor, UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, boolean head, boolean head, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke,
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke, UFont fontForStereotype, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
HtmlColor htmlColorForStereotype) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 3, 3, 0,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
3, 3, 0, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
this.head = head; this.head = head;
this.stickman = new EntityDomain(yellow, red, deltaShadow, stroke.getThickness()); this.stickman = new EntityDomain(biColor.getYellowBack(), biColor.getRedBorder(), deltaShadow, stroke.getThickness());
} }
@Override @Override

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -43,7 +43,7 @@ import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
@ -56,11 +56,10 @@ public class ComponentRoseGroupingElse extends AbstractTextualComponent {
private final HtmlColor backgroundColor; private final HtmlColor backgroundColor;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseGroupingElse(HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, public ComponentRoseGroupingElse(HtmlColor groupBorder, UFont2 smallFont, CharSequence comment,
HtmlColor groupBorder, UFont smallFont, CharSequence comment, ISkinSimple spriteContainer, ISkinSimple spriteContainer, HtmlColor backgroundColor, UStroke stroke) {
HtmlColor backgroundColor, UStroke stroke) { super(comment == null ? null : "[" + comment + "]", smallFont, HorizontalAlignment.LEFT, 5,
super(comment == null ? null : "[" + comment + "]", fontColor, hyperlinkColor, useUnderlineForHyperlink, 5, 1, spriteContainer, 0, null, null);
smallFont, HorizontalAlignment.LEFT, 5, 5, 1, spriteContainer, 0, null, null);
this.groupBorder = groupBorder; this.groupBorder = groupBorder;
this.backgroundColor = backgroundColor; this.backgroundColor = backgroundColor;
this.stroke = stroke; this.stroke = stroke;

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15913 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -45,9 +45,11 @@ import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
@ -67,13 +69,13 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
private final double deltaShadow; private final double deltaShadow;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseGroupingHeader(HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, public ComponentRoseGroupingHeader(HtmlColor background, BiColor biColor,
HtmlColor background, HtmlColor groupBackground, HtmlColor groupBorder, UFont bigFont, UFont smallFont, UFont2 bigFont, UFont smallFont, Display strings, ISkinSimple spriteContainer, double deltaShadow,
Display strings, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) { UStroke stroke) {
super(strings.get(0), fontColor, hyperlinkColor, useUnderlineForHyperlink, bigFont, HorizontalAlignment.LEFT, super(strings.get(0), bigFont, HorizontalAlignment.LEFT, 15, 30, 1,
15, 30, 1, spriteContainer, 0, null, null); spriteContainer, 0, null, null);
this.groupBackground = groupBackground; this.groupBackground = biColor.getYellowBack();
this.groupBorder = groupBorder; this.groupBorder = biColor.getRedBorder();
this.background = background; this.background = background;
this.stroke = stroke; this.stroke = stroke;
this.deltaShadow = deltaShadow; this.deltaShadow = deltaShadow;
@ -81,8 +83,8 @@ public class ComponentRoseGroupingHeader extends AbstractTextualComponent {
this.commentTextBlock = null; this.commentTextBlock = null;
} else { } else {
final Display display = Display.getWithNewlines("[" + strings.get(1) + "]"); final Display display = Display.getWithNewlines("[" + strings.get(1) + "]");
this.commentTextBlock = TextBlockUtils.create(display, new FontConfiguration(smallFont, fontColor, this.commentTextBlock = TextBlockUtils.create(display, new FontConfiguration(smallFont, bigFont.getColor(),
hyperlinkColor, useUnderlineForHyperlink), HorizontalAlignment.LEFT, spriteContainer); bigFont.getHyperlinkColor(), bigFont.useUnderlineForHyperlink()), HorizontalAlignment.LEFT, spriteContainer);
} }
if (this.background == null) { if (this.background == null) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15913 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -41,9 +41,10 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil; import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
@ -61,13 +62,12 @@ final public class ComponentRoseNote extends AbstractTextualComponent implements
private final double deltaShadow; private final double deltaShadow;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseNote(HtmlColor back, HtmlColor foregroundColor, HtmlColor fontColor, HtmlColor hyperlinkColor, public ComponentRoseNote(BiColor biColor, UFont2 font, Display strings,
boolean useUnderlineForHyperlink, UFont font, Display strings, double paddingX, double paddingY, double paddingX, double paddingY, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) { super(strings, font, HorizontalAlignment.LEFT, 6, 15, 5, spriteContainer, 0, true,
super(strings, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.LEFT, 6, 15, 5, null, null);
spriteContainer, 0, true, null, null); this.back = biColor.getYellowBack();
this.back = back; this.foregroundColor = biColor.getRedBorder();
this.foregroundColor = foregroundColor;
this.paddingX = paddingX; this.paddingX = paddingX;
this.paddingY = paddingY; this.paddingY = paddingY;
this.deltaShadow = deltaShadow; this.deltaShadow = deltaShadow;

View File

@ -40,9 +40,10 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
@ -55,13 +56,12 @@ final public class ComponentRoseNoteBox extends AbstractTextualComponent {
private final double deltaShadow; private final double deltaShadow;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseNoteBox(HtmlColor back, HtmlColor foregroundColor, HtmlColor fontColor, public ComponentRoseNoteBox(BiColor biColor, UFont2 font,
HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, Display strings, Display strings, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) { super(strings, font, HorizontalAlignment.LEFT, 4, 4, 4, spriteContainer, 0, false,
super(strings, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.LEFT, 4, 4, 4, null, null);
spriteContainer, 0, false, null, null); this.back = biColor.getYellowBack();
this.back = back; this.foregroundColor = biColor.getRedBorder();
this.foregroundColor = foregroundColor;
this.deltaShadow = deltaShadow; this.deltaShadow = deltaShadow;
this.stroke = stroke; this.stroke = stroke;
} }

View File

@ -40,9 +40,10 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; 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.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
@ -56,13 +57,12 @@ final public class ComponentRoseNoteHexagonal extends AbstractTextualComponent {
private final double deltaShadow; private final double deltaShadow;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseNoteHexagonal(HtmlColor back, HtmlColor foregroundColor, HtmlColor fontColor, public ComponentRoseNoteHexagonal(BiColor biColor, UFont2 font,
HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, Display strings, Display strings, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) { super(strings, font, HorizontalAlignment.LEFT, 12, 12, 4, spriteContainer, 0, false,
super(strings, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.LEFT, 12, 12, 4, null, null);
spriteContainer, 0, false, null, null); this.back = biColor.getYellowBack();
this.back = back; this.foregroundColor = biColor.getRedBorder();
this.foregroundColor = foregroundColor;
this.deltaShadow = deltaShadow; this.deltaShadow = deltaShadow;
this.stroke = stroke; this.stroke = stroke;
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15913 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -41,9 +41,11 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
@ -57,16 +59,15 @@ public class ComponentRoseParticipant extends AbstractTextualComponent {
private final double roundCorner; private final double roundCorner;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseParticipant(HtmlColor back, HtmlColor foregroundColor, HtmlColor fontColor, public ComponentRoseParticipant(BiColor biColor, UFont2 font,
HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, Display stringsToDisplay, ISkinSimple spriteContainer, double deltaShadow, double roundCorner,
ISkinSimple spriteContainer, double deltaShadow, double roundCorner, UStroke stroke, UStroke stroke, UFont fontForStereotype, HtmlColor htmlColorForStereotype) {
UFont fontForStereotype, HtmlColor htmlColorForStereotype) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype);
7, 7, 7, spriteContainer, 0, false, fontForStereotype, htmlColorForStereotype); this.back = biColor.getYellowBack();
this.back = back;
this.roundCorner = roundCorner; this.roundCorner = roundCorner;
this.deltaShadow = deltaShadow; this.deltaShadow = deltaShadow;
this.foregroundColor = foregroundColor; this.foregroundColor = biColor.getRedBorder();
this.stroke = stroke; this.stroke = stroke;
} }

View File

@ -48,6 +48,7 @@ import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
@ -67,11 +68,11 @@ public class ComponentRoseReference extends AbstractTextualComponent {
private final double deltaShadow; private final double deltaShadow;
private final UStroke stroke; private final UStroke stroke;
public ComponentRoseReference(HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, HtmlColor fontHeaderColor, UFont font, HtmlColor borderColor, public ComponentRoseReference(HtmlColor fontHeaderColor, UFont2 font, HtmlColor backgroundHeader,
HtmlColor backgroundHeader, HtmlColor background, UFont header, Display stringsToDisplay, HtmlColor borderColor, HtmlColor background, UFont header, Display stringsToDisplay,
HorizontalAlignment position, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) { HorizontalAlignment position, ISkinSimple spriteContainer, double deltaShadow, UStroke stroke) {
super(stringsToDisplay.subList(1, stringsToDisplay.size()), fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.LEFT, 4, 4, super(stringsToDisplay.subList(1, stringsToDisplay.size()), font, HorizontalAlignment.LEFT, 4, 4, 4,
4, spriteContainer, 0, false, null, null); spriteContainer, 0, false, null, null);
this.position = position; this.position = position;
this.backgroundHeader = backgroundHeader; this.backgroundHeader = backgroundHeader;
this.background = background; this.background = background;
@ -79,8 +80,9 @@ public class ComponentRoseReference extends AbstractTextualComponent {
this.deltaShadow = deltaShadow; this.deltaShadow = deltaShadow;
this.stroke = stroke; this.stroke = stroke;
textHeader = TextBlockUtils.create(stringsToDisplay.subList(0, 1), new FontConfiguration(header, fontHeaderColor, textHeader = TextBlockUtils.create(stringsToDisplay.subList(0, 1), new FontConfiguration(header,
hyperlinkColor, useUnderlineForHyperlink), HorizontalAlignment.LEFT, spriteContainer); fontHeaderColor, font.getHyperlinkColor(), font.useUnderlineForHyperlink()), HorizontalAlignment.LEFT,
spriteContainer);
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15531 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -44,13 +44,12 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.ArrowConfiguration; import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowDecoration; import net.sourceforge.plantuml.skin.ArrowDecoration;
import net.sourceforge.plantuml.skin.ArrowDressing;
import net.sourceforge.plantuml.skin.ArrowHead; import net.sourceforge.plantuml.skin.ArrowHead;
import net.sourceforge.plantuml.skin.ArrowPart; import net.sourceforge.plantuml.skin.ArrowPart;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
@ -62,11 +61,11 @@ public class ComponentRoseSelfArrow extends AbstractComponentRoseArrow {
private final double arrowWidth = 45; private final double arrowWidth = 45;
private final boolean niceArrow; private final boolean niceArrow;
public ComponentRoseSelfArrow(HtmlColor foregroundColor, HtmlColor colorFont, HtmlColor hyperlinkColor, public ComponentRoseSelfArrow(HtmlColor foregroundColor, UFont2 font, Display stringsToDisplay,
boolean useUnderlineForHyperlink, UFont font, Display stringsToDisplay, ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize,
ArrowConfiguration arrowConfiguration, ISkinSimple spriteContainer, double maxMessageSize, boolean niceArrow) { boolean niceArrow) {
super(foregroundColor, colorFont, hyperlinkColor, useUnderlineForHyperlink, font, stringsToDisplay, super(foregroundColor, font, stringsToDisplay, arrowConfiguration, spriteContainer, HorizontalAlignment.LEFT,
arrowConfiguration, spriteContainer, HorizontalAlignment.LEFT, maxMessageSize); maxMessageSize);
this.niceArrow = niceArrow; this.niceArrow = niceArrow;
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15811 $ * Revision $Revision: 15908 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -36,12 +36,11 @@ package net.sourceforge.plantuml.skin.rose;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.AbstractTextualComponent; import net.sourceforge.plantuml.skin.AbstractTextualComponent;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -49,10 +48,9 @@ public class ComponentRoseTitle extends AbstractTextualComponent {
private final int outMargin = 5; private final int outMargin = 5;
public ComponentRoseTitle(HtmlColor fontColor, HtmlColor hyperlinkColor, boolean useUnderlineForHyperlink, public ComponentRoseTitle(UFont2 font, Display stringsToDisplay, ISkinSimple spriteContainer) {
UFont font, Display stringsToDisplay, ISkinSimple spriteContainer) { super(stringsToDisplay, font, HorizontalAlignment.CENTER, 7, 7, 7,
super(stringsToDisplay, fontColor, hyperlinkColor, useUnderlineForHyperlink, font, HorizontalAlignment.CENTER, spriteContainer, 0, false, null, null);
7, 7, 7, spriteContainer, 0, false, null, null);
} }
@Override @Override

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15812 $ * Revision $Revision: 15913 $
* *
*/ */
package net.sourceforge.plantuml.skin.rose; package net.sourceforge.plantuml.skin.rose;
@ -45,10 +45,12 @@ import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.skin.ArrowConfiguration; import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.ArrowDirection; import net.sourceforge.plantuml.skin.ArrowDirection;
import net.sourceforge.plantuml.skin.BiColor;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.ComponentType;
import net.sourceforge.plantuml.skin.Skin; import net.sourceforge.plantuml.skin.Skin;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UFont2;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;
public class Rose implements Skin { public class Rose implements Skin {
@ -75,6 +77,12 @@ public class Rose implements Skin {
return result; return result;
} }
private UFont2 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());
}
public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param, public Component createComponent(ComponentType type, ArrowConfiguration config, ISkinParam param,
Display stringsToDisplay) { Display stringsToDisplay) {
final HtmlColor background = param.getBackgroundColor(); final HtmlColor background = param.getBackgroundColor();
@ -91,10 +99,10 @@ public class Rose implements Skin {
final HtmlColor sequenceActorBackground = getHtmlColor(param, ColorParam.actorBackground); final HtmlColor sequenceActorBackground = getHtmlColor(param, ColorParam.actorBackground);
final HtmlColor sequenceParticipantBackground = getHtmlColor(param, ColorParam.participantBackground); final HtmlColor sequenceParticipantBackground = getHtmlColor(param, ColorParam.participantBackground);
final UFont fontArrow = param.getFont(FontParam.SEQUENCE_ARROW, null, false); // final UFont fontArrow = param.getFont(FontParam.SEQUENCE_ARROW, null, false);
final UFont fontGrouping = param.getFont(FontParam.SEQUENCE_GROUP, null, false); final UFont fontGrouping = param.getFont(FontParam.SEQUENCE_GROUP, null, false);
final UFont fontParticipant = param.getFont(FontParam.PARTICIPANT, null, false); // final UFont fontParticipant = param.getFont(FontParam.PARTICIPANT, null, false);
final UFont fontActor = param.getFont(FontParam.ACTOR, null, false); // final UFont fontActor = param.getFont(FontParam.ACTOR, null, false);
final UFont newFontForStereotype = param.getFont(FontParam.SEQUENCE_STEREOTYPE, null, false); final UFont newFontForStereotype = param.getFont(FontParam.SEQUENCE_STEREOTYPE, null, false);
@ -108,33 +116,30 @@ public class Rose implements Skin {
final HtmlColor sequenceArrow = config.getColor() == null ? getHtmlColor(param, ColorParam.sequenceArrow) final HtmlColor sequenceArrow = config.getColor() == null ? getHtmlColor(param, ColorParam.sequenceArrow)
: config.getColor(); : config.getColor();
if (config.getArrowDirection() == ArrowDirection.SELF) { if (config.getArrowDirection() == ArrowDirection.SELF) {
return new ComponentRoseSelfArrow(sequenceArrow, getFontColor(param, FontParam.SEQUENCE_ARROW), return new ComponentRoseSelfArrow(sequenceArrow, getUFont2(param, FontParam.SEQUENCE_ARROW),
hyperlinkColor, useUnderlineForHyperlink, fontArrow, stringsToDisplay, config, param, stringsToDisplay, config, param, param.maxMessageSize(), param.strictUmlStyle() == false);
param.maxMessageSize(), param.strictUmlStyle() == false);
} }
final HorizontalAlignment messageHorizontalAlignment = param final HorizontalAlignment messageHorizontalAlignment = param
.getHorizontalAlignment(AlignParam.SEQUENCE_MESSAGE_ALIGN); .getHorizontalAlignment(AlignParam.SEQUENCE_MESSAGE_ALIGN);
final HorizontalAlignment textHorizontalAlignment = param final HorizontalAlignment textHorizontalAlignment = param
.getHorizontalAlignment(AlignParam.SEQUENCE_MESSAGETEXT_ALIGN); .getHorizontalAlignment(AlignParam.SEQUENCE_MESSAGETEXT_ALIGN);
return new ComponentRoseArrow(sequenceArrow, getFontColor(param, FontParam.SEQUENCE_ARROW), hyperlinkColor, return new ComponentRoseArrow(sequenceArrow, getUFont2(param, FontParam.SEQUENCE_ARROW), stringsToDisplay,
useUnderlineForHyperlink, fontArrow, stringsToDisplay, config, messageHorizontalAlignment, param, config, messageHorizontalAlignment, param, textHorizontalAlignment, param.maxMessageSize(),
textHorizontalAlignment, param.maxMessageSize(), param.strictUmlStyle() == false); param.strictUmlStyle() == false);
} }
if (type == ComponentType.PARTICIPANT_HEAD) { if (type == ComponentType.PARTICIPANT_HEAD) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder);
return new ComponentRoseParticipant(sequenceParticipantBackground, borderColor, getFontColor(param, return new ComponentRoseParticipant(new BiColor(sequenceParticipantBackground, borderColor), getUFont2(
FontParam.PARTICIPANT), hyperlinkColor, useUnderlineForHyperlink, fontParticipant, param, FontParam.PARTICIPANT), stringsToDisplay, param, deltaShadow, param.getRoundCorner(),
stringsToDisplay, param, deltaShadow, param.getRoundCorner(), getStroke(param, getStroke(param, LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(
LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(param, param, FontParam.SEQUENCE_STEREOTYPE));
FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.PARTICIPANT_TAIL) { if (type == ComponentType.PARTICIPANT_TAIL) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.participantBorder);
return new ComponentRoseParticipant(sequenceParticipantBackground, borderColor, getFontColor(param, return new ComponentRoseParticipant(new BiColor(sequenceParticipantBackground, borderColor), getUFont2(
FontParam.PARTICIPANT), hyperlinkColor, useUnderlineForHyperlink, fontParticipant, param, FontParam.PARTICIPANT), stringsToDisplay, param, deltaShadow, param.getRoundCorner(),
stringsToDisplay, param, deltaShadow, param.getRoundCorner(), getStroke(param, getStroke(param, LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(
LineParam.sequenceParticipantBorder, 1.5), newFontForStereotype, getFontColor(param, param, FontParam.SEQUENCE_STEREOTYPE));
FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.PARTICIPANT_LINE) { if (type == ComponentType.PARTICIPANT_LINE) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
@ -146,71 +151,65 @@ public class Rose implements Skin {
} }
if (type == ComponentType.ACTOR_HEAD) { if (type == ComponentType.ACTOR_HEAD) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseActor(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR), return new ComponentRoseActor(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, true, param, deltaShadow, FontParam.ACTOR), stringsToDisplay, true, param, deltaShadow, getStroke(param,
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
FontParam.SEQUENCE_STEREOTYPE)); FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.ACTOR_TAIL) { if (type == ComponentType.ACTOR_TAIL) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseActor(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR), return new ComponentRoseActor(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, false, param, deltaShadow, FontParam.ACTOR), stringsToDisplay, false, param, deltaShadow, getStroke(param,
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
FontParam.SEQUENCE_STEREOTYPE)); FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.BOUNDARY_HEAD) { if (type == ComponentType.BOUNDARY_HEAD) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseBoundary(sequenceActorBackground, borderColor, return new ComponentRoseBoundary(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor, FontParam.ACTOR), stringsToDisplay, true, param, deltaShadow, getStroke(param,
stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2), LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE)); FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.BOUNDARY_TAIL) { if (type == ComponentType.BOUNDARY_TAIL) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseBoundary(sequenceActorBackground, borderColor, return new ComponentRoseBoundary(new BiColor(sequenceActorBackground, borderColor), getUFont2(param,
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor, FontParam.ACTOR), stringsToDisplay, false, param, deltaShadow, getStroke(param,
stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2), LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param,
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE)); FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.CONTROL_HEAD) { if (type == ComponentType.CONTROL_HEAD) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseControl(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR), return new ComponentRoseControl(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, true, param, deltaShadow, stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param, newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.CONTROL_TAIL) { if (type == ComponentType.CONTROL_TAIL) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseControl(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR), return new ComponentRoseControl(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, false, param, deltaShadow, stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param, newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.ENTITY_HEAD) { if (type == ComponentType.ENTITY_HEAD) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseEntity(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR), return new ComponentRoseEntity(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, true, param, deltaShadow, stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param, newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.ENTITY_TAIL) { if (type == ComponentType.ENTITY_TAIL) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseEntity(sequenceActorBackground, borderColor, getFontColor(param, FontParam.ACTOR), return new ComponentRoseEntity(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
hyperlinkColor, useUnderlineForHyperlink, fontActor, stringsToDisplay, false, param, deltaShadow, stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
getStroke(param, LineParam.sequenceActorBorder, 2), newFontForStereotype, getFontColor(param, newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.DATABASE_HEAD) { if (type == ComponentType.DATABASE_HEAD) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseDatabase(sequenceActorBackground, borderColor, return new ComponentRoseDatabase(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor,
stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2), stringsToDisplay, true, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE)); newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
} }
if (type == ComponentType.DATABASE_TAIL) { if (type == ComponentType.DATABASE_TAIL) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.actorBorder);
return new ComponentRoseDatabase(sequenceActorBackground, borderColor, return new ComponentRoseDatabase(new BiColor(sequenceActorBackground, borderColor), getUFont2(param, FontParam.ACTOR),
getFontColor(param, FontParam.ACTOR), hyperlinkColor, useUnderlineForHyperlink, fontActor,
stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2), stringsToDisplay, false, param, deltaShadow, getStroke(param, LineParam.sequenceActorBorder, 2),
newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE)); newFontForStereotype, getFontColor(param, FontParam.SEQUENCE_STEREOTYPE));
} }
@ -218,65 +217,62 @@ public class Rose implements Skin {
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground); final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
final UFont fontNote = param.getFont(FontParam.NOTE, null, false); final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
return new ComponentRoseNote(noteBackgroundColor, borderColor, getFontColor(param, FontParam.NOTE), return new ComponentRoseNote(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(
hyperlinkColor, useUnderlineForHyperlink, fontNote, stringsToDisplay, paddingX, paddingY, param, getFontColor(param, FontParam.NOTE), useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,
deltaShadow, getStroke(param, LineParam.noteBorder, 1)); paddingX, paddingY, param, deltaShadow, getStroke(param, LineParam.noteBorder, 1));
} }
if (type == ComponentType.NOTE_HEXAGONAL) { if (type == ComponentType.NOTE_HEXAGONAL) {
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground); final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
final UFont fontNote = param.getFont(FontParam.NOTE, null, false); final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
return new ComponentRoseNoteHexagonal(noteBackgroundColor, borderColor, return new ComponentRoseNoteHexagonal(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(
getFontColor(param, FontParam.NOTE), hyperlinkColor, useUnderlineForHyperlink, fontNote, getFontColor(param, FontParam.NOTE), useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,
stringsToDisplay, param, deltaShadow, getStroke(param, LineParam.noteBorder, 1)); param, deltaShadow, getStroke(param, LineParam.noteBorder, 1));
} }
if (type == ComponentType.NOTE_BOX) { if (type == ComponentType.NOTE_BOX) {
final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground); final HtmlColor noteBackgroundColor = getHtmlColor(param, ColorParam.noteBackground);
final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.noteBorder);
final UFont fontNote = param.getFont(FontParam.NOTE, null, false); final UFont fontNote = param.getFont(FontParam.NOTE, null, false);
return new ComponentRoseNoteBox(noteBackgroundColor, borderColor, getFontColor(param, FontParam.NOTE), return new ComponentRoseNoteBox(new BiColor(noteBackgroundColor, borderColor), fontNote.toFont2(
hyperlinkColor, useUnderlineForHyperlink, fontNote, stringsToDisplay, param, deltaShadow, getFontColor(param, FontParam.NOTE), useUnderlineForHyperlink, hyperlinkColor), stringsToDisplay,
getStroke(param, LineParam.noteBorder, 1)); param, deltaShadow, getStroke(param, LineParam.noteBorder, 1));
} }
if (type == ComponentType.GROUPING_HEADER) { if (type == ComponentType.GROUPING_HEADER) {
final UFont fontGroupingHeader = param.getFont(FontParam.SEQUENCE_GROUP_HEADER, null, false); return new ComponentRoseGroupingHeader(background, new BiColor(groupBackground, groupBorder), getUFont2(param,
return new ComponentRoseGroupingHeader(getFontColor(param, FontParam.SEQUENCE_GROUP_HEADER), FontParam.SEQUENCE_GROUP_HEADER), fontGrouping, stringsToDisplay, param, deltaShadow, getStroke(
hyperlinkColor, useUnderlineForHyperlink, background, groupBackground, groupBorder, param, LineParam.sequenceGroupBorder, 2));
fontGroupingHeader, fontGrouping, stringsToDisplay, param, deltaShadow, getStroke(param,
LineParam.sequenceGroupBorder, 2));
} }
if (type == ComponentType.GROUPING_ELSE) { if (type == ComponentType.GROUPING_ELSE) {
return new ComponentRoseGroupingElse(getFontColor(param, FontParam.SEQUENCE_GROUP), hyperlinkColor, return new ComponentRoseGroupingElse(groupBorder, getUFont2(param, FontParam.SEQUENCE_GROUP),
useUnderlineForHyperlink, groupBorder, fontGrouping, stringsToDisplay.get(0), param, background, stringsToDisplay.get(0), param, background, getStroke(param, LineParam.sequenceGroupBorder, 2));
getStroke(param, LineParam.sequenceGroupBorder, 2));
} }
if (type == ComponentType.GROUPING_SPACE) { if (type == ComponentType.GROUPING_SPACE) {
return new ComponentRoseGroupingSpace(7); return new ComponentRoseGroupingSpace(7);
} }
if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) { if (type == ComponentType.ALIVE_BOX_CLOSE_CLOSE) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, true, true, deltaShadow > 0); return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, true, true, deltaShadow > 0);
} }
if (type == ComponentType.ALIVE_BOX_CLOSE_OPEN) { if (type == ComponentType.ALIVE_BOX_CLOSE_OPEN) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, true, false, deltaShadow > 0); return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, true, false, deltaShadow > 0);
} }
if (type == ComponentType.ALIVE_BOX_OPEN_CLOSE) { if (type == ComponentType.ALIVE_BOX_OPEN_CLOSE) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, false, true, deltaShadow > 0); return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, false, true, deltaShadow > 0);
} }
if (type == ComponentType.ALIVE_BOX_OPEN_OPEN) { if (type == ComponentType.ALIVE_BOX_OPEN_OPEN) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
return new ComponentRoseActiveLine(borderColor, lifeLineBackgroundColor, false, false, deltaShadow > 0); return new ComponentRoseActiveLine(lifeLineBackgroundColor, borderColor, false, false, deltaShadow > 0);
} }
if (type == ComponentType.DELAY_LINE) { if (type == ComponentType.DELAY_LINE) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
return new ComponentRoseDelayLine(borderColor); return new ComponentRoseDelayLine(borderColor);
} }
if (type == ComponentType.DELAY_TEXT) { if (type == ComponentType.DELAY_TEXT) {
return new ComponentRoseDelayText(getFontColor(param, FontParam.SEQUENCE_DELAY), hyperlinkColor, return new ComponentRoseDelayText(param.getFont(FontParam.SEQUENCE_DELAY, null, false).toFont2(
useUnderlineForHyperlink, param.getFont(FontParam.SEQUENCE_DELAY, null, false), stringsToDisplay, getFontColor(param, FontParam.SEQUENCE_DELAY), useUnderlineForHyperlink, hyperlinkColor),
param); stringsToDisplay, param);
} }
if (type == ComponentType.DESTROY) { if (type == ComponentType.DESTROY) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceLifeLineBorder);
@ -286,35 +282,34 @@ public class Rose implements Skin {
return new ComponentRoseNewpage(getFontColor(param, FontParam.SEQUENCE_GROUP)); return new ComponentRoseNewpage(getFontColor(param, FontParam.SEQUENCE_GROUP));
} }
if (type == ComponentType.DIVIDER) { if (type == ComponentType.DIVIDER) {
return new ComponentRoseDivider(getFontColor(param, FontParam.SEQUENCE_DIVIDER), hyperlinkColor, return new ComponentRoseDivider(param.getFont(FontParam.SEQUENCE_DIVIDER, null, false).toFont2(
useUnderlineForHyperlink, param.getFont(FontParam.SEQUENCE_DIVIDER, null, false), getFontColor(param, FontParam.SEQUENCE_DIVIDER), useUnderlineForHyperlink, hyperlinkColor),
sequenceDividerBackground, stringsToDisplay, param, deltaShadow > 0, getStroke(param, sequenceDividerBackground, stringsToDisplay, param, deltaShadow > 0, getStroke(param,
LineParam.sequenceDividerBorder, 2)); LineParam.sequenceDividerBorder, 2));
} }
if (type == ComponentType.REFERENCE) { if (type == ComponentType.REFERENCE) {
final UFont fontGroupingHeader = param.getFont(FontParam.SEQUENCE_GROUP_HEADER, null, false); final UFont fontGroupingHeader = param.getFont(FontParam.SEQUENCE_GROUP_HEADER, null, false);
return new ComponentRoseReference(getFontColor(param, FontParam.SEQUENCE_REFERENCE), hyperlinkColor, return new ComponentRoseReference(getFontColor(param, FontParam.SEQUENCE_GROUP), getUFont2(param,
useUnderlineForHyperlink, getFontColor(param, FontParam.SEQUENCE_GROUP), param.getFont( FontParam.SEQUENCE_REFERENCE), sequenceReferenceHeaderBackground, sequenceReferenceBorder,
FontParam.SEQUENCE_REFERENCE, null, false), sequenceReferenceBorder, sequenceReferenceBackground, fontGroupingHeader, stringsToDisplay,
sequenceReferenceHeaderBackground, sequenceReferenceBackground, fontGroupingHeader, param.getHorizontalAlignment(AlignParam.SEQUENCE_REFERENCE_ALIGN), param, deltaShadow, getStroke(
stringsToDisplay, param.getHorizontalAlignment(AlignParam.SEQUENCE_REFERENCE_ALIGN), param, param, LineParam.sequenceReferenceBorder, 2));
deltaShadow, getStroke(param, LineParam.sequenceReferenceBorder, 2));
} }
if (type == ComponentType.TITLE) { if (type == ComponentType.TITLE) {
return new ComponentRoseTitle(getFontColor(param, FontParam.SEQUENCE_TITLE), hyperlinkColor, return new ComponentRoseTitle(param.getFont(FontParam.SEQUENCE_TITLE, null, false).toFont2(
useUnderlineForHyperlink, param.getFont(FontParam.SEQUENCE_TITLE, null, false), stringsToDisplay, getFontColor(param, FontParam.SEQUENCE_TITLE), useUnderlineForHyperlink, hyperlinkColor),
param); stringsToDisplay, param);
} }
if (type == ComponentType.SIGNATURE) { if (type == ComponentType.SIGNATURE) {
return new ComponentRoseTitle(HtmlColorUtils.BLACK, hyperlinkColor, useUnderlineForHyperlink, fontGrouping, return new ComponentRoseTitle(fontGrouping.toFont2(HtmlColorUtils.BLACK, useUnderlineForHyperlink,
Display.create("This skin was created ", "in April 2009."), param); hyperlinkColor), Display.create("This skin was created ", "in April 2009."), param);
} }
if (type == ComponentType.ENGLOBER) { if (type == ComponentType.ENGLOBER) {
final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceBoxBorder); final HtmlColor borderColor = getHtmlColor(param, ColorParam.sequenceBoxBorder);
final HtmlColor backColor = getHtmlColor(param, ColorParam.sequenceBoxBackground); final HtmlColor backColor = getHtmlColor(param, ColorParam.sequenceBoxBackground);
return new ComponentRoseEnglober(borderColor, backColor, stringsToDisplay, getFontColor(param, return new ComponentRoseEnglober(backColor, borderColor, stringsToDisplay, param.getFont(
FontParam.SEQUENCE_BOX), hyperlinkColor, useUnderlineForHyperlink, param.getFont( FontParam.SEQUENCE_BOX, null, false).toFont2(getFontColor(param, FontParam.SEQUENCE_BOX),
FontParam.SEQUENCE_BOX, null, false), param); useUnderlineForHyperlink, hyperlinkColor), param);
} }
return null; return null;

View File

@ -144,7 +144,7 @@ public final class GroupPngMakerState {
} else if (group.getGroupType() == GroupType.STATE) { } else if (group.getGroupType() == GroupType.STATE) {
HtmlColor borderColor = group.getSpecificLineColor(); HtmlColor borderColor = group.getSpecificLineColor();
if (borderColor == null) { if (borderColor == null) {
borderColor = getColor(ColorParam.stateBorder, null); borderColor = getColor(ColorParam.stateBorder, group.getStereotype());
} }
final Stereotype stereo = group.getStereotype(); final Stereotype stereo = group.getStereotype();
final HtmlColor backColor = group.getSpecificBackColor() == null ? getColor(ColorParam.stateBackground, final HtmlColor backColor = group.getSpecificBackColor() == null ? getColor(ColorParam.stateBackground,

View File

@ -48,6 +48,7 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.PortionShower; import net.sourceforge.plantuml.cucadiagram.PortionShower;
import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion; import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
import net.sourceforge.plantuml.graphic.HtmlColor; import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.svek.AbstractEntityImage; import net.sourceforge.plantuml.svek.AbstractEntityImage;
@ -164,6 +165,11 @@ public class EntityImageClass extends AbstractEntityImage implements Stencil {
final UStroke stroke = getStroke(); final UStroke stroke = getStroke();
ug.apply(stroke).draw(rect); ug.apply(stroke).draw(rect);
final HtmlColor headerBackcolor = getSkinParam().getHtmlColor(ColorParam.classHeaderBackground, getStereo(), false);
if (headerBackcolor != null) {
final Shadowable rect2 = new URectangle(widthTotal, dimHeader.getHeight());
ug.apply(new UChangeBackColor(headerBackcolor)).apply(stroke).draw(rect2);
}
header.drawU(ug, dimTotal.getWidth(), dimHeader.getHeight()); header.drawU(ug, dimTotal.getWidth(), dimHeader.getHeight());
if (body != null) { if (body != null) {

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15532 $ * Revision $Revision: 15883 $
* *
*/ */
package net.sourceforge.plantuml.svg; package net.sourceforge.plantuml.svg;
@ -495,8 +495,8 @@ public class SvgGraphics {
style += "background:" + backcolor + ";"; style += "background:" + backcolor + ";";
} }
root.setAttribute("style", style); root.setAttribute("style", style);
root.setAttribute("width", format(maxX) + "pt"); root.setAttribute("width", format(maxX) + "px");
root.setAttribute("height", format(maxY) + "pt"); root.setAttribute("height", format(maxY) + "px");
root.setAttribute("viewBox", "0 0 " + maxXscaled + " " + maxYscaled); root.setAttribute("viewBox", "0 0 " + maxXscaled + " " + maxYscaled);
if (pendingBackground != null) { if (pendingBackground != null) {

View File

@ -143,7 +143,7 @@ public class FontChecker {
} }
protected void printChar(final PrintWriter pw, char c) throws IOException, TransformerException { public void printChar(final PrintWriter pw, char c) throws IOException, TransformerException {
pw.println("<p>"); pw.println("<p>");
final int ascii = (int) c; final int ascii = (int) c;
pw.println(ascii + " - " + Integer.toHexString(ascii) + " - "); pw.println(ascii + " - " + Integer.toHexString(ascii) + " - ");

View File

@ -39,6 +39,7 @@ import java.awt.Graphics2D;
import java.awt.font.FontRenderContext; import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics; import java.awt.font.LineMetrics;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
public class UFont { public class UFont {
@ -59,6 +60,10 @@ public class UFont {
return font; return font;
} }
public UFont2 toFont2(HtmlColor color, boolean useUnderlineForHyperlink, HtmlColor hyperlinkColor) {
return new UFont2(this, color, useUnderlineForHyperlink, hyperlinkColor);
}
public UFont scaled(double scale) { public UFont scaled(double scale) {
if (scale == 1) { if (scale == 1) {
return this; return this;
@ -127,7 +132,6 @@ public class UFont {
return false; return false;
} }
return this.font.equals(((UFont) obj).font); return this.font.equals(((UFont) obj).font);
} }
@Deprecated @Deprecated

View File

@ -0,0 +1,69 @@
/* ========================================================================
* 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;
}
}

View File

@ -34,6 +34,8 @@ package net.sourceforge.plantuml.ugraphic.eps;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import net.sourceforge.plantuml.eps.EpsGraphics; import net.sourceforge.plantuml.eps.EpsGraphics;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorGradient;
import net.sourceforge.plantuml.ugraphic.ClipContainer; import net.sourceforge.plantuml.ugraphic.ClipContainer;
import net.sourceforge.plantuml.ugraphic.ColorMapper; import net.sourceforge.plantuml.ugraphic.ColorMapper;
import net.sourceforge.plantuml.ugraphic.UClip; import net.sourceforge.plantuml.ugraphic.UClip;
@ -43,9 +45,9 @@ import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.UShape;
public class DriverPolygonEps implements UDriver<EpsGraphics> { public class DriverPolygonEps implements UDriver<EpsGraphics> {
private final ClipContainer clipContainer; private final ClipContainer clipContainer;
public DriverPolygonEps(ClipContainer clipContainer) { public DriverPolygonEps(ClipContainer clipContainer) {
this.clipContainer = clipContainer; this.clipContainer = clipContainer;
} }
@ -60,7 +62,7 @@ public class DriverPolygonEps implements UDriver<EpsGraphics> {
points[i++] = pt.getX() + x; points[i++] = pt.getX() + x;
points[i++] = pt.getY() + y; points[i++] = pt.getY() + y;
} }
final UClip clip = clipContainer.getClip(); final UClip clip = clipContainer.getClip();
if (clip != null) { if (clip != null) {
for (int j = 0; j < points.length; j += 2) { for (int j = 0; j < points.length; j += 2) {
@ -69,15 +71,20 @@ public class DriverPolygonEps implements UDriver<EpsGraphics> {
} }
} }
} }
if (shape.getDeltaShadow() != 0) { if (shape.getDeltaShadow() != 0) {
eps.epsPolygonShadow(shape.getDeltaShadow(), points); eps.epsPolygonShadow(shape.getDeltaShadow(), points);
} }
final HtmlColor back = param.getBackcolor();
if (back instanceof HtmlColorGradient) {
eps.setStrokeColor(mapper.getMappedColor(param.getColor()));
eps.epsPolygon((HtmlColorGradient) back, mapper, points);
} else {
eps.setFillColor(mapper.getMappedColor(param.getBackcolor())); eps.setFillColor(mapper.getMappedColor(back));
eps.setStrokeColor(mapper.getMappedColor(param.getColor())); eps.setStrokeColor(mapper.getMappedColor(param.getColor()));
eps.epsPolygon(points);
eps.epsPolygon(points); }
} }
} }

View File

@ -57,11 +57,23 @@ public class HandJiggle {
this(start.getX(), start.getY(), defaultVariation); this(start.getX(), start.getY(), defaultVariation);
} }
public void addPoints(Point2D end) { public void lineTo(Point2D end) {
addPoints(end.getX(), end.getY()); lineTo(end.getX(), end.getY());
} }
public void addPoints(final double endX, final double endY) { public void arcTo(double angle0, double angle1, double centerX, double centerY, double rx, double ry) {
lineTo(pointOnCircle(centerX, centerY, (angle0 + angle1) / 2, rx, ry));
lineTo(pointOnCircle(centerX, centerY, angle1, rx, ry));
}
private static Point2D pointOnCircle(double centerX, double centerY, double angle, double rx, double ry) {
final double x = centerX + Math.cos(angle) * rx;
final double y = centerY + Math.sin(angle) * ry;
return new Point2D.Double(x, y);
}
public void lineTo(final double endX, final double endY) {
final double diffX = Math.abs(endX - startX); final double diffX = Math.abs(endX - startX);
final double diffY = Math.abs(endY - startY); final double diffY = Math.abs(endY - startY);
@ -96,6 +108,20 @@ public class HandJiggle {
this.startY = endY; this.startY = endY;
} }
public void curveTo(CubicCurve2D curve) {
final double flatness = curve.getFlatness();
final double dist = curve.getP1().distance(curve.getP2());
if (flatness > 0.1 && dist > 20) {
final CubicCurve2D left = new CubicCurve2D.Double();
final CubicCurve2D right = new CubicCurve2D.Double();
curve.subdivide(left, right);
curveTo(left);
curveTo(right);
return;
}
lineTo(curve.getP2());
}
public UPolygon toUPolygon() { public UPolygon toUPolygon() {
final UPolygon result = new UPolygon(); final UPolygon result = new UPolygon();
for (Point2D p : points) { for (Point2D p : points) {
@ -120,17 +146,4 @@ public class HandJiggle {
return path; return path;
} }
public void addCurve(CubicCurve2D curve) {
final double flatness = curve.getFlatness();
final double dist = curve.getP1().distance(curve.getP2());
if (flatness > 0.1 && dist > 20) {
final CubicCurve2D left = new CubicCurve2D.Double();
final CubicCurve2D right = new CubicCurve2D.Double();
curve.subdivide(left, right);
addCurve(left);
addCurve(right);
return;
}
addPoints(curve.getP2());
}
} }

View File

@ -42,9 +42,9 @@ public class UDotPathHand {
public UDotPathHand(DotPath source) { public UDotPathHand(DotPath source) {
final HandJiggle jiggle = new HandJiggle(source.getStartPoint(), 3.0); final HandJiggle jiggle = new HandJiggle(source.getStartPoint(), 2.0);
for (CubicCurve2D curve : source.getBeziers()) { for (CubicCurve2D curve : source.getBeziers()) {
jiggle.addCurve(curve); jiggle.curveTo(curve);
} }
this.path = jiggle.toUPath(); this.path = jiggle.toUPath();

View File

@ -31,13 +31,15 @@
*/ */
package net.sourceforge.plantuml.ugraphic.hand; package net.sourceforge.plantuml.ugraphic.hand;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
public class UEllipseHand { public class UEllipseHand {
private final Shadowable poly; private Shadowable poly;
public UEllipseHand(UEllipse source) { public UEllipseHand(UEllipse source) {
@ -45,23 +47,39 @@ public class UEllipseHand {
this.poly = source; this.poly = source;
return; return;
} }
final UPolygon result = new UPolygon(); poly = new UPolygon();
final double width = source.getWidth(); final double width = source.getWidth();
final double height = source.getHeight(); final double height = source.getHeight();
double angle = 0; double angle = 0;
while (angle < Math.PI * 2) { if (width == height) {
angle += (10 + Math.random() * 10) * Math.PI / 180; while (angle < Math.PI * 2) {
final double variation = 1 + (Math.random() - 0.5) / 8; angle += (10 + Math.random() * 10) * Math.PI / 180;
final double x = width / 2 + Math.cos(angle) * width * variation / 2; final double variation = 1 + (Math.random() - 0.5) / 8;
final double y = height / 2 + Math.sin(angle) * height * variation / 2; final double x = width / 2 + Math.cos(angle) * width * variation / 2;
// final Point2D.Double p = new Point2D.Double(x, y); final double y = height / 2 + Math.sin(angle) * height * variation / 2;
result.addPoint(x, y); // final Point2D.Double p = new Point2D.Double(x, y);
((UPolygon) poly).addPoint(x, y);
}
} else {
while (angle < Math.PI * 2) {
angle += Math.PI / 20;
final Point2D pt = getPoint(width, height, angle);
((UPolygon) poly).addPoint(pt.getX(), pt.getY());
}
} }
this.poly = result;
this.poly.setDeltaShadow(source.getDeltaShadow()); this.poly.setDeltaShadow(source.getDeltaShadow());
} }
private Point2D getPoint(double width, double height, double angle) {
final double x = width / 2 + Math.cos(angle) * width / 2;
final double y = height / 2 + Math.sin(angle) * height / 2;
final double variation = (Math.random() - 0.5) / 50;
return new Point2D.Double(x + variation * width, y + variation * height);
}
public Shadowable getHanddrawn() { public Shadowable getHanddrawn() {
return this.poly; return this.poly;
} }

View File

@ -40,6 +40,7 @@ import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UParam; import net.sourceforge.plantuml.ugraphic.UParam;
import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.UShape;
@ -73,11 +74,18 @@ public class UGraphicHandwritten implements UGraphic {
drawHand((UEllipse) shape); drawHand((UEllipse) shape);
} else if (shape instanceof DotPath) { } else if (shape instanceof DotPath) {
drawHand((DotPath) shape); drawHand((DotPath) shape);
} else if (shape instanceof UPath) {
drawHand((UPath) shape);
} else { } else {
ug.draw(shape); ug.draw(shape);
} }
} }
private void drawHand(UPath shape) {
final UPathHand uline = new UPathHand(shape);
ug.draw(uline.getHanddrawn());
}
private void drawHand(DotPath shape) { private void drawHand(DotPath shape) {
final UDotPathHand uline = new UDotPathHand(shape); final UDotPathHand uline = new UDotPathHand(shape);
ug.draw(uline.getHanddrawn()); ug.draw(uline.getHanddrawn());
@ -93,8 +101,8 @@ public class UGraphicHandwritten implements UGraphic {
ug.draw(hand.getHanddrawn()); ug.draw(hand.getHanddrawn());
} }
private void drawHand(ULine line) { private void drawHand(ULine shape) {
final ULineHand uline = new ULineHand(line); final ULineHand uline = new ULineHand(shape);
ug.draw(uline.getHanddrawn()); ug.draw(uline.getHanddrawn());
} }

View File

@ -42,7 +42,7 @@ public class ULineHand {
final double endX = line.getDX(); final double endX = line.getDX();
final double endY = line.getDY(); final double endY = line.getDY();
final HandJiggle jiggle = new HandJiggle(0, 0, 2.0); final HandJiggle jiggle = new HandJiggle(0, 0, 2.0);
jiggle.addPoints(endX, endY); jiggle.lineTo(endX, endY);
this.path = jiggle.toUPath(); this.path = jiggle.toUPath();

View File

@ -31,16 +31,48 @@
*/ */
package net.sourceforge.plantuml.ugraphic.hand; package net.sourceforge.plantuml.ugraphic.hand;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.ugraphic.UPath; import net.sourceforge.plantuml.ugraphic.UPath;
import net.sourceforge.plantuml.ugraphic.USegment;
import net.sourceforge.plantuml.ugraphic.USegmentType;
public class UPathHand { public class UPathHand {
private final UPath path; private final UPath path;
private final double defaultVariation = 4.0;
public UPathHand(UPath source) { public UPathHand(UPath source) {
final PathJiggle jiggle = new PathJiggle(source, 3.0); final UPath jigglePath = new UPath();
this.path = jiggle.toUPath();
Point2D last = new Point2D.Double();
for (USegment segment : source) {
final USegmentType type = segment.getSegmentType();
if (type == USegmentType.SEG_MOVETO) {
final double x = segment.getCoord()[0];
final double y = segment.getCoord()[1];
jigglePath.moveTo(x, y);
last = new Point2D.Double(x, y);
} else if (type == USegmentType.SEG_LINETO) {
final double x = segment.getCoord()[0];
final double y = segment.getCoord()[1];
final HandJiggle jiggle = new HandJiggle(last.getX(), last.getY(), defaultVariation);
jiggle.lineTo(x, y);
for (USegment seg2 : jiggle.toUPath()) {
if (seg2.getSegmentType() == USegmentType.SEG_LINETO) {
jigglePath.lineTo(seg2.getCoord()[0], seg2.getCoord()[1]);
}
}
last = new Point2D.Double(x, y);
} else {
this.path = source;
return;
}
}
this.path = jigglePath;
} }
public UPath getHanddrawn() { public UPath getHanddrawn() {

View File

@ -42,13 +42,16 @@ public class UPolygonHand {
private final UPolygon poly; private final UPolygon poly;
public UPolygonHand(UPolygon source) { public UPolygonHand(UPolygon source) {
final List<Point2D.Double> pt = source.getPoints(); final List<Point2D.Double> pt = source.getPoints();
if (pt.size() == 0) {
poly = new UPolygon();
return;
}
final HandJiggle jiggle = new HandJiggle(pt.get(0), 1.5); final HandJiggle jiggle = new HandJiggle(pt.get(0), 1.5);
for (int i = 1; i < pt.size(); i++) { for (int i = 1; i < pt.size(); i++) {
jiggle.addPoints(pt.get(i)); jiggle.lineTo(pt.get(i));
} }
jiggle.addPoints(pt.get(0)); jiggle.lineTo(pt.get(0));
this.poly = jiggle.toUPolygon(); this.poly = jiggle.toUPolygon();
this.poly.setDeltaShadow(source.getDeltaShadow()); this.poly.setDeltaShadow(source.getDeltaShadow());

View File

@ -42,11 +42,27 @@ public class URectangleHand {
public URectangleHand(URectangle rectangle) { public URectangleHand(URectangle rectangle) {
final double width = rectangle.getWidth(); final double width = rectangle.getWidth();
final double height = rectangle.getHeight(); final double height = rectangle.getHeight();
final HandJiggle jiggle = new HandJiggle(0, 0, 1.5); final HandJiggle jiggle;
jiggle.addPoints(width, 0); final double rx = Math.min(rectangle.getRx() / 2, width / 2);
jiggle.addPoints(width, height); final double ry = Math.min(rectangle.getRy() / 2, height / 2);
jiggle.addPoints(0, height); System.err.println("rx=" + rx + " ry=" + ry);
jiggle.addPoints(0, 0); if (rx == 0 && ry == 0) {
jiggle = new HandJiggle(0, 0, 1.5);
jiggle.lineTo(width, 0);
jiggle.lineTo(width, height);
jiggle.lineTo(0, height);
jiggle.lineTo(0, 0);
} else {
jiggle = new HandJiggle(rx, 0, 1.5);
jiggle.lineTo(width - rx, 0);
jiggle.arcTo(-Math.PI / 2, 0, width - rx, ry, rx, ry);
jiggle.lineTo(width, height - ry);
jiggle.arcTo(0, Math.PI / 2, width - rx, height - ry, rx, ry);
jiggle.lineTo(rx, height);
jiggle.arcTo(Math.PI / 2, Math.PI, rx, height - ry, rx, ry);
jiggle.lineTo(0, ry);
jiggle.arcTo(Math.PI, 3 * Math.PI / 2, rx, ry, rx, ry);
}
this.poly = jiggle.toUPolygon(); this.poly = jiggle.toUPolygon();
this.poly.setDeltaShadow(rectangle.getDeltaShadow()); this.poly.setDeltaShadow(rectangle.getDeltaShadow());

View File

@ -45,7 +45,7 @@ public class MathUtils {
public static double limitation(double v, double min, double max) { public static double limitation(double v, double min, double max) {
if (min >= max) { if (min >= max) {
assert false : "min="+min+" max="+max+" v="+v; // assert false : "min="+min+" max="+max+" v="+v;
return v; return v;
// throw new IllegalArgumentException("min="+min+" max="+max+" v="+v); // throw new IllegalArgumentException("min="+min+" max="+max+" v="+v);
} }

View File

@ -28,7 +28,7 @@
* *
* Original Author: Arnaud Roques * Original Author: Arnaud Roques
* *
* Revision $Revision: 15853 $ * Revision $Revision: 15915 $
* *
*/ */
package net.sourceforge.plantuml.version; package net.sourceforge.plantuml.version;
@ -38,7 +38,7 @@ import java.util.Date;
public class Version { public class Version {
public static int version() { public static int version() {
return 8022; return 8023;
} }
public static String versionString() { public static String versionString() {
@ -54,7 +54,7 @@ public class Version {
} }
private static long compileTime() { private static long compileTime() {
return 1428429242162L; return 1429551104146L;
} }
public static String compileTimeString() { public static String compileTimeString() {