1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-15 06:32:24 +00:00
This commit is contained in:
Arnaud Roques 2021-12-14 19:03:11 +01:00
parent 40aab019ec
commit 442d313a30
80 changed files with 2283 additions and 1213 deletions

View File

@ -16,8 +16,6 @@
package ext.plantuml.com.google.zxing.common;
import ext.plantuml.com.google.zxing.WriterException;
/**
* <p>A simple, fast array of bits, represented compactly by an array of ints internally.</p>
*

View File

@ -37,11 +37,15 @@ package net.sourceforge.plantuml.activitydiagram3;
import java.util.Objects;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileBreak;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileBreak;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
public class InstructionBreak extends MonoSwimable implements Instruction {
@ -52,14 +56,22 @@ public class InstructionBreak extends MonoSwimable implements Instruction {
this.inlinkRendering = Objects.requireNonNull(inlinkRendering);
}
@Override
public Ftile createFtile(FtileFactory factory) {
return new FtileBreak(factory.skinParam(), getSwimlaneIn());
}
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileBreak(stringBounder, skinParam, getSwimlaneIn());
}
@Override
public CommandExecutionResult add(Instruction other) {
throw new UnsupportedOperationException();
}
@Override
final public boolean kill() {
return false;
}

View File

@ -58,7 +58,7 @@ public class InstructionEnd extends MonoSwimable implements Instruction {
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn(), null);
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn());
}
@Override

View File

@ -35,11 +35,15 @@
*/
package net.sourceforge.plantuml.activitydiagram3;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGoto;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileEmpty;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
public class InstructionGoto extends MonoSwimable implements Instruction {
@ -50,22 +54,32 @@ public class InstructionGoto extends MonoSwimable implements Instruction {
this.name = name;
}
@Override
public Ftile createFtile(FtileFactory factory) {
return new FtileGoto(factory.skinParam(), getSwimlaneIn(), name);
}
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileEmpty(stringBounder, skinParam);
}
@Override
public CommandExecutionResult add(Instruction other) {
throw new UnsupportedOperationException();
}
@Override
final public boolean kill() {
return false;
}
@Override
public LinkRendering getInLinkRendering() {
return LinkRendering.none();
}
@Override
public boolean containsBreak() {
return false;
}

View File

@ -126,7 +126,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
if (branches.size() == 1)
return new GtileIfAlone(swimlane, gtiles.get(0), branches.get(0));
return new GtileIfHexagon(swimlane, gtiles, branches);
return GtileIfHexagon.build(swimlane, gtiles, branches);
}
@Override

View File

@ -35,11 +35,15 @@
*/
package net.sourceforge.plantuml.activitydiagram3;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileLabel;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileEmpty;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
public class InstructionLabel extends MonoSwimable implements Instruction {
@ -50,22 +54,32 @@ public class InstructionLabel extends MonoSwimable implements Instruction {
this.name = name;
}
@Override
public Ftile createFtile(FtileFactory factory) {
return new FtileLabel(factory.skinParam(), getSwimlaneIn(), name);
}
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileEmpty(stringBounder, skinParam);
}
@Override
public CommandExecutionResult add(Instruction other) {
throw new UnsupportedOperationException();
}
@Override
final public boolean kill() {
return false;
}
@Override
public LinkRendering getInLinkRendering() {
return LinkRendering.none();
}
@Override
public boolean containsBreak() {
return false;
}

View File

@ -48,6 +48,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileBox;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileWithNoteOpale;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileWithNotes;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
@ -86,8 +87,11 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
stereotype);
if (hasNotes()) {
final Collection<PositionedNote> notes = getPositionedNotes();
if (notes.size() != 1)
if (notes.size() == 0)
throw new UnsupportedOperationException("wip");
if (notes.size() > 0)
return new GtileWithNotes(result, notes, skinParam);
return new GtileWithNoteOpale(result, notes.iterator().next(), skinParam, false);
}

View File

@ -37,11 +37,17 @@ package net.sourceforge.plantuml.activitydiagram3;
import java.util.Objects;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleSpot;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class InstructionSpot extends MonoSwimable implements Instruction {
@ -51,6 +57,7 @@ public class InstructionSpot extends MonoSwimable implements Instruction {
private final String spot;
private final HColor color;
@Override
public boolean containsBreak() {
return false;
}
@ -62,24 +69,35 @@ public class InstructionSpot extends MonoSwimable implements Instruction {
this.color = color;
}
@Override
public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.spot(getSwimlaneIn(), spot, color);
result = eventuallyAddNote(factory, result, result.getSwimlaneIn());
if (killed) {
if (killed)
return new FtileKilled(result);
}
return result;
}
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
return new GtileCircleSpot(stringBounder, skinParam, color, getSwimlaneIn(), spot, font);
}
@Override
public CommandExecutionResult add(Instruction other) {
throw new UnsupportedOperationException();
}
@Override
final public boolean kill() {
this.killed = true;
return true;
}
@Override
public LinkRendering getInLinkRendering() {
return inlinkRendering;
}

View File

@ -63,7 +63,7 @@ public class InstructionStart extends MonoSwimable implements Instruction {
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn(), null);
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn());
}
@Override

View File

@ -63,7 +63,7 @@ public class InstructionStop extends MonoSwimable implements Instruction {
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn(), null);
return new GtileCircleStart(stringBounder, skinParam, HColorUtils.BLACK, getSwimlaneIn());
}
@Override

View File

@ -109,13 +109,13 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
branches.add(branch);
}
return new GtileIfHexagon(swimlane, gtiles, switches);
return GtileIfHexagon.build(swimlane, gtiles, switches);
}
public Ftile createFtile(FtileFactory factory) {
for (Branch branch : switches)
branch.updateFtile(factory);
return factory.createSwitch(swimlane, switches, afterEndwhile, topInlinkRendering, labelTest);
}

View File

@ -46,6 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileWithNoteOpale;
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileWhile;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.Rainbow;
@ -103,7 +104,10 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi
@Override
public Gtile createGtile(ISkinParam skinParam, StringBounder stringBounder) {
return repeatList.createGtile(skinParam, stringBounder);
final Gtile back = null;
Gtile tmp = repeatList.createGtile(skinParam, stringBounder);
tmp = GtileWhile.createWhile(swimlane, tmp, test, yes, specialOut, back);
return tmp;
}
@Override

View File

@ -226,10 +226,11 @@ public class Snake implements UShape {
}
private void drawInternalLabel(UGraphic ug) {
for (Text text : texts) {
final Point2D position = getTextBlockPosition(ug.getStringBounder(), text);
text.textBlock.drawU(ug.apply(new UTranslate(position)));
}
for (Text text : texts)
if (text.hasText(ug.getStringBounder())) {
final Point2D position = getTextBlockPosition(ug.getStringBounder(), text);
text.textBlock.drawU(ug.apply(new UTranslate(position)));
}
}
public double getMaxX(StringBounder stringBounder) {

View File

@ -65,14 +65,10 @@ public class FtileCircleStart extends AbstractFtile {
super(skinParam);
this.backColor = backColor;
this.swimlane = swimlane;
if (UseStyle.useBetaStyle()) {
if (UseStyle.useBetaStyle())
this.shadowing = style.value(PName.Shadowing).asDouble();
} else {
if (skinParam().shadowing(null)) {
this.shadowing = 3;
}
}
else if (skinParam().shadowing(null))
this.shadowing = 3;
}
@Override

View File

@ -38,7 +38,13 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.util.Arrays;
import java.util.List;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -80,5 +86,45 @@ public abstract class GAbstractConnection implements GConnection {
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
throw new UnsupportedOperationException();
}
private final StyleSignature getDefaultStyleDefinitionArrow() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
}
// DUPLICATE 4561
final protected Rainbow getInLinkRenderingColor() {
Rainbow color;
final ISkinParam skinParam = gpoint1.getGtile().skinParam();
if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
} else
color = Rainbow.build(skinParam);
// final LinkRendering linkRendering = tile.getInLinkRendering();
// if (linkRendering == null) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// } else {
// color = linkRendering.getRainbow();
// }
// if (color.size() == 0) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// }
return color;
}
}

View File

@ -40,6 +40,8 @@ import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
@ -47,6 +49,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -63,6 +66,9 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
this.textBlock = textBlock;
this.pos1 = pos1;
this.pos2 = pos2;
if (pos1.getTranslated(gpoint1.getPoint2D()).getX() == pos2.getTranslated(gpoint2.getPoint2D()).getX())
throw new IllegalArgumentException();
// See FtileFactoryDelegatorAssembly
}
@ -116,32 +122,38 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
// return getSimpleSnake().getMaxX(stringBounder);
// }
private Rainbow getInLinkRenderingColor() {
Rainbow color;
color = Rainbow.build(gpoint1.getGtile().skinParam());
// final LinkRendering linkRendering = tile.getInLinkRendering();
// if (linkRendering == null) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// } else {
// color = linkRendering.getRainbow();
// }
// if (color.size() == 0) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// }
return color;
}
// // DUPLICATE 4561
// private Rainbow getInLinkRenderingColor() {
// Rainbow color;
// final ISkinParam skinParam = gpoint1.getGtile().skinParam();
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
// color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
// } else
// color = Rainbow.build(skinParam);
//// final LinkRendering linkRendering = tile.getInLinkRendering();
//// if (linkRendering == null) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// } else {
//// color = linkRendering.getRainbow();
//// }
//// if (color.size() == 0) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// }
// return color;
// }
// @Override
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {

View File

@ -90,32 +90,32 @@ public class GConnectionLeftThenVerticalThenRight extends GAbstractConnection {
// return getSimpleSnake().getMaxX(stringBounder);
// }
private Rainbow getInLinkRenderingColor() {
Rainbow color;
color = Rainbow.build(gpoint1.getGtile().skinParam());
// final LinkRendering linkRendering = tile.getInLinkRendering();
// if (linkRendering == null) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// } else {
// color = linkRendering.getRainbow();
// }
// if (color.size() == 0) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// }
return color;
}
// private Rainbow getInLinkRenderingColor() {
// Rainbow color;
// color = Rainbow.build(gpoint1.getGtile().skinParam());
//// final LinkRendering linkRendering = tile.getInLinkRendering();
//// if (linkRendering == null) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// } else {
//// color = linkRendering.getRainbow();
//// }
//// if (color.size() == 0) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// }
// return color;
// }
// @Override
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {

View File

@ -37,11 +37,14 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -88,32 +91,38 @@ public class GConnectionVerticalDown extends GAbstractConnection {
ug.draw(snake);
}
private Rainbow getInLinkRenderingColor() {
Rainbow color;
color = Rainbow.build(gpoint1.getGtile().skinParam());
// final LinkRendering linkRendering = tile.getInLinkRendering();
// if (linkRendering == null) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// } else {
// color = linkRendering.getRainbow();
// }
// if (color.size() == 0) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// }
return color;
}
// // DUPLICATE 4561
// private Rainbow getInLinkRenderingColor() {
// Rainbow color;
// final ISkinParam skinParam = gpoint1.getGtile().skinParam();
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
// color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
// } else
// color = Rainbow.build(skinParam);
//// final LinkRendering linkRendering = tile.getInLinkRendering();
//// if (linkRendering == null) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// } else {
//// color = linkRendering.getRainbow();
//// }
//// if (color.size() == 0) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// }
// return color;
// }
// @Override
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {

View File

@ -0,0 +1,188 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
public class GConnectionVerticalDownThenBack extends GAbstractConnection {
private final TextBlock textBlock;
private final UTranslate pos1;
private final UTranslate pos2;
public GConnectionVerticalDownThenBack(UTranslate pos1, GPoint gpoint1, UTranslate pos2, GPoint gpoint2,
TextBlock textBlock) {
super(gpoint1, gpoint2);
this.textBlock = textBlock;
this.pos1 = pos1;
this.pos2 = pos2;
// See FtileFactoryDelegatorAssembly
}
@Override
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
throw new UnsupportedOperationException("wip");
// Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
// Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
//
// final Direction originalDirection = Direction.leftOrRight(p1, p2);
//
//// p1 = translate1.getTranslated(p1);
//// p2 = translate2.getTranslated(p2);
//
// final double x1 = p1.getX();
// final double x2 = p2.getX();
// final Point2D mp1a = translate1.getTranslated(p1);
// final Point2D mp2b = translate2.getTranslated(p2);
// final Direction newDirection = Direction.leftOrRight(mp1a, mp2b);
// final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft();
// if (originalDirection == newDirection) {
// final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
// final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY());
// final Snake snake = Snake.create(getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED);
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
// snake.addPoint(mp1a);
// snake.addPoint(mp1a.getX(), middle);
// snake.addPoint(mp2bc.getX(), middle);
// snake.addPoint(mp2bc);
// ug.draw(snake);
// final Snake small = Snake.create(getInLinkRenderingColor(), arrow).withMerge(MergeStrategy.LIMITED);
// small.addPoint(mp2bc);
// small.addPoint(mp2bc.getX(), mp2b.getY());
// small.addPoint(mp2b);
// ug.draw(small);
// } else {
// final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
// final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize);
// final Snake snake = Snake.create(getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED);
// snake.addPoint(mp1a);
// snake.addPoint(mp1a.getX(), mp2bb.getY());
// snake.addPoint(mp2bb);
// ug.draw(snake);
// final Snake small = Snake.create(getInLinkRenderingColor(), arrow).withMerge(MergeStrategy.LIMITED);
// small.addPoint(mp2bb);
// small.addPoint(mp2bb.getX(), mp2b.getY());
// small.addPoint(mp2b);
// ug.draw(small);
//
// }
}
@Override
public void drawU(UGraphic ug) {
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
final UPolygon arrow = Arrows.asToLeft();
final Snake snake = Snake.create(getInLinkRenderingColor(), arrow).withLabel(textBlock,
HorizontalAlignment.LEFT).emphasizeDirection(Direction.UP);
snake.addPoint(p1);
final Point2D p1bis = UTranslate.dy(10).getTranslated(p1);
snake.addPoint(p1bis);
snake.addPoint(new Point2D.Double(p2.getX() + 20, p1bis.getY()));
snake.addPoint(new Point2D.Double(p2.getX() + 20, p2.getY()));
snake.addPoint(p2);
ug.draw(snake);
}
// public double getMaxX(StringBounder stringBounder) {
// return getSimpleSnake().getMaxX(stringBounder);
// }
// // DUPLICATE 4561
// private Rainbow getInLinkRenderingColor() {
// Rainbow color;
// final ISkinParam skinParam = gpoint1.getGtile().skinParam();
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
// color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
// } else
// color = Rainbow.build(skinParam);
//// final LinkRendering linkRendering = tile.getInLinkRendering();
//// if (linkRendering == null) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// } else {
//// color = linkRendering.getRainbow();
//// }
//// if (color.size() == 0) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// }
// return color;
// }
// @Override
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
// final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT);
// final Point2D mp1a = translate1.getTranslated(p1);
// final Point2D mp2b = translate2.getTranslated(p2);
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
// snake.addPoint(mp1a);
// snake.addPoint(mp1a.getX(), middle);
// snake.addPoint(mp2b.getX(), middle);
// snake.addPoint(mp2b);
// ug.draw(snake);
//
// }
}

View File

@ -38,6 +38,8 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
@ -45,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate;
@ -130,32 +133,38 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
// return getSimpleSnake().getMaxX(stringBounder);
// }
private Rainbow getInLinkRenderingColor() {
Rainbow color;
color = Rainbow.build(gpoint1.getGtile().skinParam());
// final LinkRendering linkRendering = tile.getInLinkRendering();
// if (linkRendering == null) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// } else {
// color = linkRendering.getRainbow();
// }
// if (color.size() == 0) {
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow()
// .getMergedStyle(skinParam().getCurrentStyleBuilder());
// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
// } else {
// color = Rainbow.build(skinParam());
// }
// }
return color;
}
// // DUPLICATE 4561
// private Rainbow getInLinkRenderingColor() {
// Rainbow color;
// final ISkinParam skinParam = gpoint1.getGtile().skinParam();
// if (UseStyle.useBetaStyle()) {
// final Style style = getDefaultStyleDefinitionArrow().getMergedStyle(skinParam.getCurrentStyleBuilder());
// color = Rainbow.build(style, skinParam.getIHtmlColorSet(), skinParam.getThemeStyle());
// } else
// color = Rainbow.build(skinParam);
//// final LinkRendering linkRendering = tile.getInLinkRendering();
//// if (linkRendering == null) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// } else {
//// color = linkRendering.getRainbow();
//// }
//// if (color.size() == 0) {
//// if (UseStyle.useBetaStyle()) {
//// final Style style = getDefaultStyleDefinitionArrow()
//// .getMergedStyle(skinParam().getCurrentStyleBuilder());
//// return Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
//// } else {
//// color = Rainbow.build(skinParam());
//// }
//// }
// return color;
// }
// @Override
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {

View File

@ -58,6 +58,10 @@ public class GPoint {
private final LinkRendering linkRendering;
public GPoint(Gtile gtile, String name, LinkRendering linkRendering) {
if (gtile instanceof GtileEmpty) {
System.err.println("Warning 1");
}
this.gtile = gtile;
this.name = name;
this.linkRendering = linkRendering;

View File

@ -35,9 +35,11 @@
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.awt.geom.Dimension2D;
import java.util.Collection;
import java.util.Collections;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
@ -45,6 +47,7 @@ import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.style.SName;
@ -72,6 +75,14 @@ public class GtileAssembly extends GtileTopDown {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
}
@Override
public Dimension2D calculateDimension(StringBounder stringBounder) {
final Dimension2D raw = super.calculateDimension(stringBounder);
final double textBlockWidth = textBlock.calculateDimension(stringBounder).getWidth();
final double pos1 = tile1.getCoord(GPoint.SOUTH_HOOK).compose(getPos1()).getDx();
return Dimension2DDouble.atLeast(raw, pos1 + textBlockWidth, 0);
}
protected final TextBlock getTextBlock(Display display) {
// DUP3945
if (Display.isNull(display)) {

View File

@ -0,0 +1,54 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
import net.sourceforge.plantuml.graphic.StringBounder;
public class GtileBreak extends GtileEmpty implements WeldingPoint {
public GtileBreak(StringBounder stringBounder, ISkinParam skinParam, Swimlane swimlane) {
super(stringBounder, skinParam, swimlane);
}
// @Override
// public List<WeldingPoint> getWeldingPoints() {
// return Collections.singletonList((WeldingPoint) this);
// }
}

View File

@ -0,0 +1,109 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class GtileCircleSpot extends AbstractGtile {
private static final int SIZE = 20;
private final String spot;
private final FontConfiguration fc;
private final HColor backColor;
private double shadowing;
private StyleSignature getDefaultStyleDefinitionCircle() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle);
}
public GtileCircleSpot(StringBounder stringBounder, ISkinParam skinParam, HColor backColor, Swimlane swimlane,
String spot, UFont font) {
super(stringBounder, skinParam, swimlane);
this.spot = spot;
this.backColor = backColor;
this.fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder());
this.shadowing = style.value(PName.Shadowing).asDouble();
} else if (skinParam().shadowing(null))
this.shadowing = 3;
}
@Override
protected void drawUInternal(UGraphic ug) {
final HColor borderColor = SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBorder);
final HColor backColor = this.backColor == null
? SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground)
: this.backColor;
final UEllipse circle = new UEllipse(SIZE, SIZE);
circle.setDeltaShadow(shadowing);
ug.apply(borderColor).apply(backColor.bg()).apply(getThickness()).draw(circle);
ug.apply(fc.getColor()).apply(new UTranslate(SIZE / 2, SIZE / 2))
.draw(new UCenteredCharacter(spot.charAt(0), fc.getFont()));
}
@Override
public Dimension2D calculateDimension(StringBounder stringBounder) {
return new Dimension2DDouble(SIZE, SIZE);
}
}

View File

@ -43,7 +43,9 @@ import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -56,17 +58,18 @@ public class GtileCircleStart extends AbstractGtile {
private final HColor backColor;
private double shadowing;
public GtileCircleStart(StringBounder stringBounder, ISkinParam skinParam, HColor backColor, Swimlane swimlane,
Style style) {
private StyleSignature getDefaultStyleDefinitionCircle() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.circle);
}
public GtileCircleStart(StringBounder stringBounder, ISkinParam skinParam, HColor backColor, Swimlane swimlane) {
super(stringBounder, skinParam, swimlane);
this.backColor = backColor;
if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(skinParam().getCurrentStyleBuilder());
this.shadowing = style.value(PName.Shadowing).asDouble();
} else {
if (skinParam().shadowing(null)) {
this.shadowing = 3;
}
}
} else if (skinParam().shadowing(null))
this.shadowing = 3;
}

View File

@ -40,6 +40,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble;
@ -52,8 +53,28 @@ import net.sourceforge.plantuml.utils.MathUtils;
public class GtileColumns extends AbstractGtile {
protected final List<Gtile> gtiles;
private final List<Dimension2D> dims = new ArrayList<>();
protected final List<UTranslate> positions = new ArrayList<>();
private double margin;
private double dy;
protected final UTranslate getPosition(int pos) {
double dx = 0;
for (int i = 0; i < pos; i++) {
final Dimension2D dim = gtiles.get(i).calculateDimension(getStringBounder());
dx += dim.getWidth() + margin;
}
return new UTranslate(dx, dy);
}
protected final void setMargin(double margin) {
if (margin < 0)
throw new IllegalArgumentException("margin=" + margin);
this.margin = margin;
}
protected final void pushDown(double height) {
this.dy += height;
}
@Override
public String toString() {
@ -64,29 +85,17 @@ public class GtileColumns extends AbstractGtile {
return gtiles.get(0);
}
public GtileColumns(List<Gtile> gtiles, Swimlane singleSwimlane) {
public GtileColumns(List<Gtile> gtiles, Swimlane singleSwimlane, double margin) {
super(gtiles.get(0).getStringBounder(), gtiles.get(0).skinParam(), singleSwimlane);
this.gtiles = gtiles;
double dx = 0;
for (Gtile tile : gtiles) {
final Dimension2D dim = tile.calculateDimension(getStringBounder());
final UTranslate pos = UTranslate.dx(dx);
dx += dim.getWidth() + getMargin();
dims.add(dim);
positions.add(pos);
}
}
private double getMargin() {
return 20;
this.margin = margin;
}
@Override
protected void drawUInternal(UGraphic ug) {
for (int i = 0; i < gtiles.size(); i++) {
final Gtile tile = gtiles.get(i);
final UTranslate pos = positions.get(i);
final UTranslate pos = getPosition(i);
ug.apply(pos).draw(tile);
}
}
@ -94,9 +103,9 @@ public class GtileColumns extends AbstractGtile {
@Override
public Dimension2D calculateDimension(StringBounder stringBounder) {
Dimension2D result = new Dimension2DDouble(0, 0);
for (int i = 0; i < dims.size(); i++) {
final Dimension2D dim = dims.get(i);
final UTranslate pos = positions.get(i);
for (int i = 0; i < gtiles.size(); i++) {
final Dimension2D dim = gtiles.get(i).calculateDimension(stringBounder);
final UTranslate pos = getPosition(i);
final Dimension2D corner = pos.getTranslated(dim);
result = MathUtils.max(result, corner);
}

View File

@ -41,6 +41,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UEmpty;
import net.sourceforge.plantuml.ugraphic.UGraphic;
public class GtileEmpty extends AbstractGtile {
@ -60,7 +61,8 @@ public class GtileEmpty extends AbstractGtile {
this(stringBounder, skinParam, 0, 0, swimlane);
}
public GtileEmpty(StringBounder stringBounder, ISkinParam skinParam, double width, double height, Swimlane swimlane) {
public GtileEmpty(StringBounder stringBounder, ISkinParam skinParam, double width, double height,
Swimlane swimlane) {
super(stringBounder, skinParam, swimlane);
this.width = width;
this.height = height;
@ -68,11 +70,14 @@ public class GtileEmpty extends AbstractGtile {
@Override
public String toString() {
return "FtileEmpty";
return "GtileEmpty";
}
@Override
protected void drawUInternal(UGraphic ug) {
if (width > 0 && height > 0)
ug.draw(new UEmpty(width, height));
}
@Override

View File

@ -0,0 +1,55 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.StringBounder;
public class GtileGoto extends GtileEmpty {
private final String name;
public GtileGoto(StringBounder stringBounder, ISkinParam skinParam, Swimlane swimlane, String name) {
super(stringBounder, skinParam, swimlane);
this.name = name;
}
public final String getName() {
return name;
}
}

View File

@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.ListIterator;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.Branch;
@ -67,13 +66,17 @@ public class GtileIfHexagon extends GtileColumns {
return "GtileIfHexagon " + gtiles;
}
public static Gtile build(Swimlane swimlane, List<Gtile> gtiles, List<Branch> branches) {
final GtileIfHexagon result = new GtileIfHexagon(swimlane, gtiles, branches);
return result;
// return Gtiles.withEastMargin(result, 0);
}
// ConditionalBuilder
// FtileFactoryDelegatorIf
public GtileIfHexagon(Swimlane swimlane, List<Gtile> gtiles, List<Branch> branches) {
super(gtiles, swimlane);
if (branches.size() <= 1)
throw new IllegalArgumentException();
private GtileIfHexagon(Swimlane swimlane, List<Gtile> gtiles, List<Branch> branches) {
super(gtiles, swimlane, 20);
this.branches = branches;
@ -81,17 +84,54 @@ public class GtileIfHexagon extends GtileColumns {
this.shape2 = Gtiles.diamondEmpty(swimlane, getStringBounder(), skinParam(), getDefaultStyleDefinitionDiamond(),
branches.get(0).getColor());
final double height1 = shape1.calculateDimension(stringBounder).getHeight();
final Dimension2D dimShape1 = shape1.calculateDimension(stringBounder);
this.pushDown(dimShape1.getHeight());
for (ListIterator<UTranslate> it = positions.listIterator(); it.hasNext();) {
final UTranslate tmp = it.next();
it.set(tmp.compose(UTranslate.dy(height1)));
final double posShape;
final Dimension2D totalDim;
if (branches.size() == 2) {
final Gtile tile0 = branches.get(0).getGtile();
final Gtile tile1 = branches.get(1).getGtile();
final double northHook0 = tile0.getGPoint(GPoint.NORTH_HOOK).getCoord().getDx();
final double width0 = tile0.calculateDimension(getStringBounder()).getWidth();
final double northHook1 = tile1.getGPoint(GPoint.NORTH_HOOK).getCoord().getDx();
final double width1 = tile1.calculateDimension(getStringBounder()).getWidth();
final double shlen1 = shape1.calculateDimension(getStringBounder()).getWidth();
final double shlen = shape1.getGPoint(GPoint.EAST_HOOK).getCoord().getDx()
- shape1.getGPoint(GPoint.WEST_HOOK).getCoord().getDx();
System.err.println("shlen=" + shlen);
System.err.println("northHook0=" + northHook0);
System.err.println("width0=" + width0);
System.err.println("northHook1=" + northHook1);
System.err.println("width1=" + width1);
final double alpha = northHook0;
final double beta = width1 - northHook1;
System.err.println("alpha=" + alpha);
System.err.println("beta=" + beta);
final double wantedWidth = alpha + shlen + beta;
System.err.println("wantedWidth=" + wantedWidth);
double diff = wantedWidth - width0 - width1;
if (diff < 0)
diff = 0;
System.err.println("diff=" + diff);
this.setMargin(diff + 10);
totalDim = calculateDimensionRaw(stringBounder);
final double p2 = totalDim.getWidth() - beta;
posShape = (alpha + p2) / 2;
} else {
totalDim = calculateDimensionRaw(stringBounder);
posShape = totalDim.getWidth() / 2;
}
final Dimension2D totalDim = calculateDimensionRaw(stringBounder);
this.positionShape1 = UTranslate.dx(totalDim.getWidth() / 2)
.compose(shape1.getCoord(GPoint.NORTH_BORDER).reverse());
this.positionShape2 = new UTranslate(totalDim.getWidth() / 2, totalDim.getHeight())
this.positionShape1 = UTranslate.dx(posShape).compose(shape1.getCoord(GPoint.NORTH_BORDER).reverse());
this.positionShape2 = new UTranslate(posShape, totalDim.getHeight())
.compose(shape2.getCoord(GPoint.SOUTH_BORDER).reverse());
}
@ -108,22 +148,34 @@ public class GtileIfHexagon extends GtileColumns {
private Gtile getShape1(Swimlane swimlane) {
GtileHexagonInside tmp = Gtiles.hexagonInside(swimlane, getStringBounder(), skinParam(),
getDefaultStyleDefinitionDiamond(), branches.get(0).getColor(), branches.get(0).getLabelTest());
final TextBlock tmp0 = branches.get(0).getTextBlockPositive();
if (branches.size() == 1) {
return Gtiles.withSouthMargin(tmp.withSouthLabel(tmp0), 10);
}
final TextBlock tmp1 = branches.get(1).getTextBlockPositive();
return Gtiles.withSouthMargin(tmp.withWestLabel(tmp0).withEastLabel(tmp1), 10);
}
@Override
public Dimension2D calculateDimension(StringBounder stringBounder) {
final Dimension2D toto1 = calculateDimensionRaw(stringBounder);
final Dimension2D toto2 = shape1.calculateDimension(stringBounder);
return MathUtils.max(toto1, toto2);
final Dimension2D rawDim = calculateDimensionRaw(stringBounder);
if (branches.size() == 2) {
final Dimension2D shape1Dim = shape1.calculateDimension(stringBounder);
final double shape1max = this.positionShape1.getDx() + shape1Dim.getWidth();
return Dimension2DDouble.atLeast(rawDim, shape1max, 0);
}
// return MathUtils.max(rawDim, shape1Dim);
return rawDim;
}
private Dimension2D calculateDimensionRaw(StringBounder stringBounder) {
final double height2 = shape2.calculateDimension(stringBounder).getHeight();
final Dimension2D nude = super.calculateDimension(stringBounder);
return Dimension2DDouble.delta(nude, 0, height2);
// +30 to be done only when branches.size()==1 ?
return Dimension2DDouble.delta(nude, 0, height2 + 30);
}
final public StyleSignature getDefaultStyleDefinitionActivity() {
@ -163,18 +215,25 @@ public class GtileIfHexagon extends GtileColumns {
@Override
public Collection<GConnection> getInnerConnections() {
if (branches.size() == 2) {
if (branches.size() == 1) {
final GConnection arrow1 = new GConnectionVerticalDown(positionShape1, shape1.getGPoint(GPoint.SOUTH_HOOK),
getPosition(0), gtiles.get(0).getGPoint(GPoint.NORTH_HOOK), TextBlockUtils.EMPTY_TEXT_BLOCK);
final GConnection arrow2 = new GConnectionVerticalDown(getPosition(0),
gtiles.get(0).getGPoint(GPoint.SOUTH_HOOK), positionShape2, shape2.getGPoint(GPoint.NORTH_HOOK),
TextBlockUtils.EMPTY_TEXT_BLOCK);
return Arrays.asList(arrow1, arrow2);
} else if (branches.size() == 2) {
final GConnection arrow1 = new GConnectionHorizontalThenVerticalDown(positionShape1,
shape1.getGPoint(GPoint.WEST_HOOK), positions.get(0), gtiles.get(0).getGPoint(GPoint.NORTH_HOOK),
shape1.getGPoint(GPoint.WEST_HOOK), getPosition(0), gtiles.get(0).getGPoint(GPoint.NORTH_HOOK),
TextBlockUtils.EMPTY_TEXT_BLOCK);
final GConnection arrow2 = new GConnectionHorizontalThenVerticalDown(positionShape1,
shape1.getGPoint(GPoint.EAST_HOOK), positions.get(1), gtiles.get(1).getGPoint(GPoint.NORTH_HOOK),
shape1.getGPoint(GPoint.EAST_HOOK), getPosition(1), gtiles.get(1).getGPoint(GPoint.NORTH_HOOK),
TextBlockUtils.EMPTY_TEXT_BLOCK);
final GConnection arrow3 = new GConnectionVerticalDownThenHorizontal(positions.get(0),
final GConnection arrow3 = new GConnectionVerticalDownThenHorizontal(getPosition(0),
gtiles.get(0).getGPoint(GPoint.SOUTH_HOOK), positionShape2, shape2.getGPoint(GPoint.WEST_HOOK),
TextBlockUtils.EMPTY_TEXT_BLOCK);
final GConnection arrow4 = new GConnectionVerticalDownThenHorizontal(positions.get(1),
final GConnection arrow4 = new GConnectionVerticalDownThenHorizontal(getPosition(1),
gtiles.get(1).getGPoint(GPoint.SOUTH_HOOK), positionShape2, shape2.getGPoint(GPoint.EAST_HOOK),
TextBlockUtils.EMPTY_TEXT_BLOCK);

View File

@ -0,0 +1,55 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.StringBounder;
public class GtileLabel extends GtileEmpty {
private final String name;
public GtileLabel(StringBounder stringBounder, ISkinParam skinParam, Swimlane swimlane, String name) {
super(stringBounder, skinParam, swimlane);
this.name = name;
}
public final String getName() {
return name;
}
}

View File

@ -39,7 +39,6 @@ import java.awt.geom.Dimension2D;
import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.SName;
@ -55,7 +54,7 @@ public class GtileSplit extends GtileColumns {
private final HColor lineColor;
public GtileSplit(List<Gtile> gtiles, Swimlane singleSwimlane, HColor lineColor) {
super(gtiles, singleSwimlane);
super(gtiles, singleSwimlane, 20);
this.lineColor = lineColor;
}
@ -76,10 +75,10 @@ public class GtileSplit extends GtileColumns {
protected void drawUInternal(UGraphic ug) {
super.drawUInternal(ug);
final double x0 = gtiles.get(0).getCoord(GPoint.NORTH_HOOK).compose(positions.get(0)).getDx();
assert gtiles.size() == positions.size();
final double x0 = gtiles.get(0).getCoord(GPoint.NORTH_HOOK).compose(getPosition(0)).getDx();
final int last = gtiles.size() - 1;
final double xLast = gtiles.get(last).getCoord(GPoint.NORTH_HOOK).compose(positions.get(last)).getDx();
final double xLast = gtiles.get(last).getCoord(GPoint.NORTH_HOOK).compose(getPosition(last)).getDx();
final ULine hline = ULine.hline(xLast - x0);
ug = ug.apply(lineColor).apply(new UStroke(1.5));

View File

@ -0,0 +1,653 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.util.Arrays;
import java.util.Collection;
import net.sourceforge.plantuml.activitydiagram3.Instruction;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class GtileWhile extends GtileTopDown3 {
public GtileWhile(Gtile tile1, Gtile tile2, Gtile tile3) {
super(tile1, tile2, tile3);
}
private static StyleSignature getDefaultStyleDefinitionDiamond() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.activity, SName.diamond);
}
private static Gtile getShape1(Gtile toto, Swimlane swimlane, Display test, Display yes) {
GtileHexagonInside tmp0 = Gtiles.hexagonInside(swimlane, toto.getStringBounder(), toto.skinParam(),
getDefaultStyleDefinitionDiamond(), HColorUtils.BLUE, test);
// final TextBlock tmp0 = branches.get(0).getTextBlockPositive();
// return Gtiles.withSouthMargin(tmp.withSouthLabel(tmp0), 10);
return Gtiles.withSouthMargin(tmp0, 20);
}
public static Gtile createWhile(Swimlane swimlane, Gtile tmp, Display test, Display yes, Instruction specialOut,
Gtile back) {
final Gtile shape1 = getShape1(tmp, swimlane, test, yes);
final Gtile tile3 = new GtileEmpty(tmp.getStringBounder(), tmp.skinParam(), 10, 20, swimlane);
return new GtileWhile(shape1, tmp, tile3);
}
@Override
public Collection<GConnection> getInnerConnections() {
final GConnection arrow1 = new GConnectionVerticalDown(getPos1(), tile1.getGPoint(GPoint.SOUTH_HOOK), getPos2(),
tile2.getGPoint(GPoint.NORTH_HOOK), TextBlockUtils.EMPTY_TEXT_BLOCK);
final GConnection arrow2 = new GConnectionVerticalDownThenBack(getPos2(), tile2.getGPoint(GPoint.SOUTH_HOOK),
getPos1(), tile1.getGPoint(GPoint.EAST_HOOK), TextBlockUtils.EMPTY_TEXT_BLOCK);
return Arrays.asList(arrow1, arrow2);
}
// private final Ftile whileBlock;
// private final Ftile diamond1;
// private final Ftile specialOut;
// private final Ftile backward;
//
// @Override
// public Collection<Ftile> getMyChildren() {
// if (specialOut == null) {
// return Arrays.asList(whileBlock, diamond1);
// }
// return Arrays.asList(whileBlock, diamond1, specialOut);
// }
//
// public Set<Swimlane> getSwimlanes() {
// final Set<Swimlane> result = new HashSet<>(whileBlock.getSwimlanes());
// result.add(getSwimlaneIn());
// return result;
// }
//
// public Swimlane getSwimlaneIn() {
// return diamond1.getSwimlaneIn();
// }
//
// public Swimlane getSwimlaneOut() {
// return getSwimlaneIn();
// }
//
// private GtileWhile(Ftile whileBlock, Ftile diamond1, Ftile specialOut, Ftile backward) {
// super(whileBlock.skinParam());
// this.whileBlock = whileBlock;
// this.diamond1 = diamond1;
// this.specialOut = specialOut;
// this.backward = backward;
// }
//
// public static Ftile create(LinkRendering outColor, Swimlane swimlane, Ftile whileBlock, Display test,
// HColor borderColor, HColor backColor, Rainbow arrowColor, Display yes, FontConfiguration fontArrow,
// FtileFactory ftileFactory, ConditionStyle conditionStyle, FontConfiguration fcTest, Instruction specialOut,
// Ftile backward, LinkRendering incoming1, LinkRendering incoming2) {
//
// final TextBlock yesTb = yes.create(fontArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam());
// final TextBlock testTb = test.isWhite() ? TextBlockUtils.empty(0, 0)
// : test.create(fcTest, whileBlock.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT),
// ftileFactory.skinParam());
// final TextBlock outTb = outColor.getDisplay().create(fontArrow, HorizontalAlignment.LEFT,
// ftileFactory.skinParam());
//
// final Ftile diamond1;
// if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) {
// diamond1 = new FtileDiamondInside(testTb, whileBlock.skinParam(), backColor, borderColor, swimlane)
// .withNorth(yesTb).withWest(outTb);
// } else if (conditionStyle == ConditionStyle.INSIDE_DIAMOND) {
// diamond1 = new FtileDiamondSquare(testTb, whileBlock.skinParam(), backColor, borderColor, swimlane)
// .withNorth(yesTb).withWest(outTb);
// } else if (conditionStyle == ConditionStyle.EMPTY_DIAMOND) {
// diamond1 = new FtileDiamond(whileBlock.skinParam(), backColor, borderColor, swimlane).withNorth(testTb)
// .withSouth(yesTb).withWest(outTb);
// } else {
// throw new IllegalStateException();
// }
//
// final Ftile special = specialOut == null ? null : specialOut.createFtile(ftileFactory);
// final GtileWhile result = new GtileWhile(whileBlock, diamond1, special, backward);
//
// final Dimension2D dim = whileBlock.calculateDimension(ftileFactory.getStringBounder());
// final TextBlock back1 = incoming1.getDisplay().create(fontArrow, HorizontalAlignment.LEFT,
// ftileFactory.skinParam());
//
// final List<Connection> conns = new ArrayList<>();
// if (dim.getWidth() == 0 || dim.getHeight() == 0) {
// conns.add(result.new ConnectionBackEmpty(incoming1.getRainbow()));
// } else {
// conns.add(result.new ConnectionIn(whileBlock.getInLinkRendering().getRainbow(arrowColor)));
// if (backward == null) {
// conns.add(result.new ConnectionBackSimple(incoming1.getRainbow(), back1));
// } else {
// final TextBlock back2 = incoming2.getDisplay().create(fontArrow, HorizontalAlignment.LEFT,
// ftileFactory.skinParam());
// conns.add(result.new ConnectionBackBackward1(incoming1.getRainbow(), back1));
// conns.add(result.new ConnectionBackBackward2(incoming2.getRainbow(), back2));
// }
// }
// if (specialOut == null) {
// conns.add(result.new ConnectionOut(outColor.getRainbow()));
// } else {
// conns.add(result.new ConnectionOutSpecial(outColor.getRainbow()));
// }
// return FtileUtils.addConnection(result, conns);
// }
//
// class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {
// private final Rainbow arrowColor;
//
// public ConnectionIn(Rainbow arrowColor) {
// super(diamond1, whileBlock);
// this.arrowColor = arrowColor;
// }
//
// private Point2D getP1(final StringBounder stringBounder) {
// return getTranslateDiamond1(stringBounder)
// .getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
// }
//
// private Point2D getP2(final StringBounder stringBounder) {
// return getTranslateForWhile(stringBounder)
// .getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
//
// final Snake snake = Snake.create(arrowColor, Arrows.asToDown());
// snake.addPoint(getP1(stringBounder));
// snake.addPoint(getP2(stringBounder));
//
// ug.draw(snake);
// }
//
// @Override
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
// final StringBounder stringBounder = ug.getStringBounder();
// final Point2D p1 = getP1(stringBounder);
// final Point2D p2 = getP2(stringBounder);
// final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withMerge(MergeStrategy.LIMITED);
// final Point2D mp1a = translate1.getTranslated(p1);
// final Point2D mp2b = translate2.getTranslated(p2);
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
// snake.addPoint(mp1a);
// snake.addPoint(mp1a.getX(), middle);
// snake.addPoint(mp2b.getX(), middle);
// snake.addPoint(mp2b);
// ug.draw(snake);
// }
// }
//
// class ConnectionBackSimple extends AbstractConnection implements ConnectionTranslatable {
// private final Rainbow endInlinkColor;
// private final TextBlock back;
//
// public ConnectionBackSimple(Rainbow endInlinkColor, TextBlock back) {
// super(whileBlock, diamond1);
// this.endInlinkColor = endInlinkColor;
// this.back = back;
// }
//
// private Point2D getP1(final StringBounder stringBounder) {
// final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
// if (geo.hasPointOut() == false) {
// return null;
// }
// return getTranslateForWhile(stringBounder).getTranslated(geo.getPointOut());
// }
//
// private double getBottom(final StringBounder stringBounder) {
// final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
// return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
// }
//
// private Point2D getP2(final StringBounder stringBounder) {
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
//
// final Dimension2D dimTotal = calculateDimension(stringBounder);
// final Point2D p1 = getP1(stringBounder);
// if (p1 == null) {
// return;
// }
// final Point2D p2 = getP2(stringBounder);
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
//
// final double x1 = p1.getX();
// final double y1 = p1.getY();
// final double x2 = p2.getX() + dimDiamond1.getWidth();
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
// final double y2 = p2.getY() + dimDiamond1.getInY() + half;
//
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP)
// .withLabel(back, arrowHorizontalAlignment());
// snake.addPoint(x1, y1);
// final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize;
// snake.addPoint(x1, y1bis);
// final double xx = dimTotal.getWidth();
// snake.addPoint(xx, y1bis);
// snake.addPoint(xx, y2);
// snake.addPoint(x2, y2);
//
// ug.draw(snake);
// ug.apply(new UTranslate(x1, y1bis)).draw(new UEmpty(5, Hexagon.hexagonHalfSize));
//
// }
//
// @Override
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
// final StringBounder stringBounder = ug.getStringBounder();
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).withMerge(MergeStrategy.LIMITED);
// final Dimension2D dimTotal = calculateDimension(stringBounder);
// final Point2D ap1 = getP1(stringBounder);
// final Point2D ap2 = getP2(stringBounder);
// final Point2D p1 = translate1.getTranslated(ap1);
// final Point2D p2 = translate2.getTranslated(ap2);
//
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
//
// final double x1 = p1.getX();
// final double y1 = p1.getY();
// final double x2 = p2.getX() + dimDiamond1.getWidth();
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
// final double y2 = p2.getY() + dimDiamond1.getInY() + half;
//
// snake.addPoint(x1, y1);
// snake.addPoint(x1, y1 + Hexagon.hexagonHalfSize);
// final double xx = Math.max(translate1.getDx(), translate2.getDx()) + dimTotal.getWidth();
// snake.addPoint(xx, y1 + Hexagon.hexagonHalfSize);
// snake.addPoint(xx, y2);
// snake.addPoint(x2, y2);
//
// ug.draw(snake);
//
// ug.apply(new UTranslate(x1, y1 + Hexagon.hexagonHalfSize)).draw(new UEmpty(5, Hexagon.hexagonHalfSize));
//
// ug = ug.apply(endInlinkColor.getColor()).apply(endInlinkColor.getColor().bg());
// ug.apply(new UTranslate(xx, (y1 + y2) / 2)).draw(Arrows.asToUp());
//
// }
//
// }
//
// class ConnectionBackBackward1 extends AbstractConnection {
// private final Rainbow endInlinkColor;
// private final TextBlock back;
//
// public ConnectionBackBackward1(Rainbow endInlinkColor, TextBlock back) {
// super(whileBlock, backward);
// this.endInlinkColor = endInlinkColor;
// this.back = back;
// }
//
// private Point2D getP1(final StringBounder stringBounder) {
// final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
// if (geo.hasPointOut() == false) {
// return null;
// }
// return getTranslateForWhile(stringBounder).getTranslated(geo.getPointOut());
// }
//
// private double getBottom(final StringBounder stringBounder) {
// final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
// return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
// }
//
// private Point2D getP2(final StringBounder stringBounder) {
// final FtileGeometry dim = backward.calculateDimension(stringBounder);
// return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getOutY()));
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
//
// final Point2D p1 = getP1(stringBounder);
// if (p1 == null) {
// return;
// }
// final Point2D p2 = getP2(stringBounder);
// final double x1 = p1.getX();
// final double y1 = p1.getY();
// final double x2 = p2.getX();
// final double y2 = p2.getY();
//
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToUp()).withLabel(back,
// arrowHorizontalAlignment());
// snake.addPoint(x1, y1);
// final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize;
// snake.addPoint(x1, y1bis);
// snake.addPoint(x2, y1bis);
// snake.addPoint(x2, y2);
//
// ug.draw(snake);
// ug.apply(new UTranslate(x1, y1bis)).draw(new UEmpty(5, Hexagon.hexagonHalfSize));
// }
// }
//
// class ConnectionBackBackward2 extends AbstractConnection {
// private final Rainbow endInlinkColor;
// private final TextBlock back;
//
// public ConnectionBackBackward2(Rainbow endInlinkColor, TextBlock back) {
// super(backward, diamond1);
// this.endInlinkColor = endInlinkColor;
// this.back = back;
// }
//
// private Point2D getP1(final StringBounder stringBounder) {
// final FtileGeometry dim = backward.calculateDimension(stringBounder);
// return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getInY()));
// }
//
// private Point2D getP2(final StringBounder stringBounder) {
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
//
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).withLabel(back,
// arrowHorizontalAlignment());
//
// final Point2D p1 = getP1(stringBounder);
// final Point2D p2 = getP2(stringBounder);
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
//
// final double x1 = p1.getX();
// final double y1 = p1.getY();
// final double x2 = p2.getX() + dimDiamond1.getWidth();
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
// final double y2 = p2.getY() + dimDiamond1.getInY() + half;
//
// snake.addPoint(x1, y1);
// snake.addPoint(x1, y2);
// snake.addPoint(x2, y2);
//
// ug.draw(snake);
// }
// }
//
// class ConnectionBackEmpty extends AbstractConnection {
// private final Rainbow endInlinkColor;
//
// public ConnectionBackEmpty(Rainbow endInlinkColor) {
// super(diamond1, diamond1);
// this.endInlinkColor = endInlinkColor;
// }
//
// private Point2D getP1(final StringBounder stringBounder) {
// return getTranslateDiamond1(stringBounder)
// .getTranslated(diamond1.calculateDimension(stringBounder).getPointOut());
// }
//
// private double getBottom(final StringBounder stringBounder) {
// final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
// return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
// }
//
// private Point2D getP2(final StringBounder stringBounder) {
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
//
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP);
// final Dimension2D dimTotal = calculateDimension(stringBounder);
// final Point2D p1 = getP1(stringBounder);
// final Point2D p2 = getP2(stringBounder);
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
//
// final double x1 = p1.getX();
// final double y1 = p1.getY();
// final double x2 = p2.getX() + dimDiamond1.getWidth();
// // final double y2 = p2.getY() + dimDiamond1.getOutY() / 2;
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
// final double y2 = p2.getY() + dimDiamond1.getInY() + half;
//
// snake.addPoint(x1, y1);
// final double y1bis = Math.max(y1, getBottom(stringBounder)) + Hexagon.hexagonHalfSize;
// snake.addPoint(x1, y1bis);
// final double xx = dimTotal.getWidth();
// snake.addPoint(xx, y1bis);
// snake.addPoint(xx, y2);
// snake.addPoint(x2, y2);
//
// ug.draw(snake);
//
// ug.apply(new UTranslate(x1, y1bis)).draw(new UEmpty(5, Hexagon.hexagonHalfSize));
//
// }
//
// }
//
// class ConnectionOut extends AbstractConnection {
// private final Rainbow afterEndwhileColor;
//
// public ConnectionOut(Rainbow afterEndwhileColor) {
// super(diamond1, null);
// this.afterEndwhileColor = afterEndwhileColor;
// }
//
// private Point2D getP1(final StringBounder stringBounder) {
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
// }
//
// private Point2D getP2(final StringBounder stringBounder) {
// final FtileGeometry dimTotal = calculateDimension(stringBounder);
// return new Point2D.Double(dimTotal.getLeft(), dimTotal.getHeight());
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
//
// final Snake snake = Snake.create(afterEndwhileColor).withMerge(MergeStrategy.LIMITED)
// .emphasizeDirection(Direction.DOWN);
//
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
// final Point2D p1 = getP1(stringBounder);
// final Point2D p2 = getP2(stringBounder);
//
// final double x1 = p1.getX();
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
// final double y1 = p1.getY() + dimDiamond1.getInY() + half;
// final double x2 = p2.getX();
// final double y2 = p2.getY();
//
// snake.addPoint(x1, y1);
// snake.addPoint(Hexagon.hexagonHalfSize, y1);
// snake.addPoint(Hexagon.hexagonHalfSize, y2);
//
// ug.draw(snake);
//
// final Snake snake2 = Snake.create(afterEndwhileColor);
// snake2.addPoint(Hexagon.hexagonHalfSize, y2);
// snake2.addPoint(x2, y2);
// // snake2.goUnmergeable(MergeStrategy.LIMITED);
// ug.draw(snake2);
//
// }
// }
//
// class ConnectionOutSpecial extends AbstractConnection {
// private final Rainbow afterEndwhileColor;
//
// public ConnectionOutSpecial(Rainbow afterEndwhileColor) {
// super(diamond1, specialOut);
// this.afterEndwhileColor = afterEndwhileColor;
// }
//
// private Point2D getP1(final StringBounder stringBounder) {
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
// }
//
// private Point2D getP2(final StringBounder stringBounder) {
// return getTranslateForSpecial(stringBounder)
// .getTranslated(specialOut.calculateDimension(stringBounder).getPointIn());
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
//
// final Snake snake = Snake.create(afterEndwhileColor, Arrows.asToDown());
//
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
// final Point2D p1 = getP1(stringBounder);
// final Point2D p2 = getP2(stringBounder);
//
// final double x1 = p1.getX();
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
// final double y1 = p1.getY() + dimDiamond1.getInY() + half;
// final double x2 = p2.getX();
// final double y2 = p2.getY();
//
// snake.addPoint(x1, y1);
// snake.addPoint(x2, y1);
// snake.addPoint(x2, y2);
//
// ug.draw(snake);
//
// }
// }
//
// public void drawU(UGraphic ug) {
// final StringBounder stringBounder = ug.getStringBounder();
// ug.apply(getTranslateForWhile(stringBounder)).draw(whileBlock);
// ug.apply(getTranslateDiamond1(stringBounder)).draw(diamond1);
// if (specialOut != null) {
// ug.apply(getTranslateForSpecial(stringBounder)).draw(specialOut);
// }
// if (backward != null) {
// ug.apply(getTranslateBackward(stringBounder)).draw(backward);
// }
// }
//
// private UTranslate getTranslateBackward(StringBounder stringBounder) {
// final Dimension2D dimTotal = calculateDimensionFtile(stringBounder);
// final Dimension2D dimBackward = backward.calculateDimension(stringBounder);
// final double x = dimTotal.getWidth() - dimBackward.getWidth();
// final double y = (dimTotal.getHeight() - dimBackward.getHeight()) / 2;
//
// return new UTranslate(x, y);
// }
//
// @Override
// protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
// final FtileGeometry geoDiamond1 = diamond1.calculateDimension(stringBounder);
// FtileGeometry geoWhile = whileBlock.calculateDimension(stringBounder);
// final double diff = -geoWhile.getWidth();
// if (diff > 0) {
// geoWhile = geoWhile.addMarginX(diff / 2);
// assert false;
// }
// final FtileGeometry geo = geoDiamond1.appendBottom(geoWhile);
// final double height = geo.getHeight() + 4 * Hexagon.hexagonHalfSize;
// final double dx = 2 * Hexagon.hexagonHalfSize;
// double backwardWidth = 0;
// if (backward != null) {
// backwardWidth += backward.calculateDimension(stringBounder).getWidth();
// }
// return new FtileGeometry(
// xDeltaBecauseSpecial(stringBounder) + geo.getWidth() + dx + Hexagon.hexagonHalfSize + backwardWidth,
// height, xDeltaBecauseSpecial(stringBounder) + geo.getLeft() + dx, geoDiamond1.getInY(), height);
//
// }
//
// private double xDeltaBecauseSpecial(StringBounder stringBounder) {
// if (specialOut == null) {
// return 0;
// }
// return specialOut.calculateDimension(stringBounder).getWidth();
// }
//
// @Override
// public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
// if (child == whileBlock) {
// return getTranslateForWhile(stringBounder);
// }
// if (child == diamond1) {
// return getTranslateDiamond1(stringBounder);
// }
// throw new UnsupportedOperationException();
// }
//
// private UTranslate getTranslateForWhile(StringBounder stringBounder) {
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
//
// final FtileGeometry dimTotal = calculateDimension(stringBounder);
// final FtileGeometry dimWhile = whileBlock.calculateDimension(stringBounder);
//
// final double y = dimDiamond1.getHeight()
// + (dimTotal.getHeight() - dimDiamond1.getHeight() - dimWhile.getHeight()) / 2;
//
// final double x = dimTotal.getLeft() - dimWhile.getLeft();
// return new UTranslate(x, y);
//
// }
//
// private UTranslate getTranslateDiamond1(StringBounder stringBounder) {
// final FtileGeometry dimTotal = calculateDimension(stringBounder);
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
//
// final double y1 = 0;
// final double x1 = dimTotal.getLeft() - dimDiamond1.getLeft();
// return new UTranslate(x1, y1);
// }
//
// private UTranslate getTranslateForSpecial(StringBounder stringBounder) {
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
// final double y1 = Math.max(3 * half, 4 * Hexagon.hexagonHalfSize);
// final double xWhile = getTranslateForWhile(stringBounder).getDx() - Hexagon.hexagonHalfSize;
// final double xDiamond = getTranslateDiamond1(stringBounder).getDx();
// // final double x1 = xWhile - xDeltaBecauseSpecial(stringBounder);
// final double x1 = Math.min(xWhile, xDiamond) - xDeltaBecauseSpecial(stringBounder);
// // final double x1 = getTranslateForWhile(stringBounder).getDx() -
// // dimDiamond1.getWidth()
// // - xDeltaBecauseSpecial(stringBounder);
// return new UTranslate(x1, y1);
// }
}

View File

@ -45,6 +45,10 @@ public class GtileWithIncomingArrow extends GtileWithMargin implements Gtile {
public GtileWithIncomingArrow(AbstractGtileRoot orig, double north) {
super(orig, north, 0, 0);
if (orig instanceof GtileEmpty) {
System.err.println("Warning 1");
}
}
@Override

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.awt.geom.Dimension2D;
import java.util.Set;
import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam;
@ -88,18 +89,28 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
public StyleSignature getDefaultStyleDefinition() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note);
}
@Override
public Swimlane getSwimlane(String point) {
return tile.getSwimlane(point);
}
@Override
public Set<Swimlane> getSwimlanes() {
return tile.getSwimlanes();
}
public GtileWithNoteOpale(Gtile tile, PositionedNote note, ISkinParam skinParam, boolean withLink) {
super(tile.getStringBounder(), tile.skinParam());
this.swimlaneNote = note.getSwimlaneNote();
if (note.getColors() != null) {
if (note.getColors() != null)
skinParam = note.getColors().mute(skinParam);
}
this.tile = tile;
this.notePosition = note.getNotePosition();
if (note.getType() == NoteType.FLOATING_NOTE) {
if (note.getType() == NoteType.FLOATING_NOTE)
withLink = false;
}
final Rose rose = new Rose();
@ -162,8 +173,8 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
@Override
protected void drawUInternal(UGraphic ug) {
ug.apply(positionNote).draw(opale);
ug.apply(positionTile).draw(tile);
opale.drawU(ug.apply(positionNote));
tile.drawU(ug.apply(positionTile));
}
@Override

View File

@ -0,0 +1,236 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import java.awt.geom.Dimension2D;
import java.util.Collection;
import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet;
import net.sourceforge.plantuml.creole.SheetBlock1;
import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.svek.image.Opale;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.utils.MathUtils;
public class GtileWithNotes extends AbstractGtile {
private final Gtile tile;
private TextBlock left;
private TextBlock right;
private final double suppSpace = 20;
public StyleSignature getDefaultStyleDefinition() {
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.note);
}
@Override
protected UTranslate getCoordImpl(String name) {
if (name.equals(GPoint.NORTH_HOOK))
return tile.getCoord(name).compose(getTranslate(getStringBounder()));
if (name.equals(GPoint.SOUTH_HOOK))
return tile.getCoord(name).compose(getTranslate(getStringBounder()));
return super.getCoordImpl(name);
}
@Override
public Swimlane getSwimlane(String point) {
return tile.getSwimlane(point);
}
@Override
public Set<Swimlane> getSwimlanes() {
return tile.getSwimlanes();
}
public GtileWithNotes(Gtile tile, Collection<PositionedNote> notes, ISkinParam skinParam) {
super(tile.getStringBounder(), tile.skinParam());
this.tile = tile;
final Rose rose = new Rose();
for (PositionedNote note : notes) {
ISkinParam skinParam2 = skinParam;
if (note.getColors() != null) {
skinParam2 = note.getColors().mute(skinParam2);
}
final HColor noteBackgroundColor;
final HColor borderColor;
final FontConfiguration fc;
final double shadowing;
final LineBreakStrategy wrapWidth;
if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder())
.eventuallyOverride(note.getColors());
noteBackgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
getIHtmlColorSet());
borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), getIHtmlColorSet());
fc = style.getFontConfiguration(skinParam.getThemeStyle(), getIHtmlColorSet());
shadowing = style.value(PName.Shadowing).asDouble();
wrapWidth = style.wrapWidth();
} else {
noteBackgroundColor = rose.getHtmlColor(skinParam2, ColorParam.noteBackground);
borderColor = rose.getHtmlColor(skinParam2, ColorParam.noteBorder);
fc = new FontConfiguration(skinParam, FontParam.NOTE, null);
shadowing = skinParam.shadowing(null) ? 4 : 0;
wrapWidth = skinParam.wrapWidth();
}
final Sheet sheet = Parser
.build(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), skinParam, CreoleMode.FULL)
.createSheet(note.getDisplay());
final SheetBlock1 sheet1 = new SheetBlock1(sheet, wrapWidth, skinParam.getPadding());
final SheetBlock2 sheet2 = new SheetBlock2(sheet1, new Stencil() {
// -6 and 15 value comes from Opale: this is very ugly!
public double getStartingX(StringBounder stringBounder, double y) {
return -6;
}
public double getEndingX(StringBounder stringBounder, double y) {
return sheet1.getEndingX(stringBounder, y) + 15;
}
}, new UStroke());
final Opale opale = new Opale(shadowing, borderColor, noteBackgroundColor, sheet2, false);
final TextBlock opaleMarged = TextBlockUtils.withMargin(opale, 10, 10);
if (note.getNotePosition() == NotePosition.LEFT) {
if (left == null) {
left = opaleMarged;
} else {
left = TextBlockUtils.mergeTB(left, opaleMarged, HorizontalAlignment.CENTER);
}
} else {
if (right == null) {
right = opaleMarged;
} else {
right = TextBlockUtils.mergeTB(right, opaleMarged, HorizontalAlignment.CENTER);
}
}
}
if (left == null) {
left = TextBlockUtils.empty(0, 0);
}
if (right == null) {
right = TextBlockUtils.empty(0, 0);
}
}
private UTranslate getTranslate(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimension(stringBounder);
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
final double xDelta = left.calculateDimension(stringBounder).getWidth();
final double yDelta = (dimTotal.getHeight() - dimTile.getHeight()) / 2;
return new UTranslate(xDelta, yDelta);
}
private UTranslate getTranslateForLeft(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimension(stringBounder);
final Dimension2D dimLeft = left.calculateDimension(stringBounder);
final double xDelta = 0;
final double yDelta = (dimTotal.getHeight() - dimLeft.getHeight()) / 2;
return new UTranslate(xDelta, yDelta);
}
private UTranslate getTranslateForRight(StringBounder stringBounder) {
final Dimension2D dimTotal = calculateDimension(stringBounder);
final Dimension2D dimRight = right.calculateDimension(stringBounder);
final double xDelta = dimTotal.getWidth() - dimRight.getWidth();
final double yDelta = (dimTotal.getHeight() - dimRight.getHeight()) / 2;
return new UTranslate(xDelta, yDelta);
}
@Override
protected void drawUInternal(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
left.drawU(ug.apply(getTranslateForLeft(stringBounder)));
right.drawU(ug.apply(getTranslateForRight(stringBounder)));
tile.drawU(ug.apply(getTranslate(stringBounder)));
}
// @Override
// protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
// final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
// final FtileGeometry orig = tile.calculateDimension(stringBounder);
// final UTranslate translate = getTranslate(stringBounder);
// if (orig.hasPointOut()) {
// return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy(),
// orig.getOutY() + translate.getDy());
// }
// return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy());
// }
@Override
public Dimension2D calculateDimension(StringBounder stringBounder) {
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
final Dimension2D dimLeft = left.calculateDimension(stringBounder);
final Dimension2D dimRight = right.calculateDimension(stringBounder);
final double height = MathUtils.max(dimLeft.getHeight(), dimRight.getHeight(), dimTile.getHeight());
return new Dimension2DDouble(dimTile.getWidth() + dimLeft.getWidth() + dimRight.getWidth(), height);
}
}

View File

@ -45,6 +45,9 @@ public class GtileWithOutgoingArrow extends GtileWithMargin implements Gtile {
public GtileWithOutgoingArrow(AbstractGtileRoot orig, double south) {
super(orig, 0, south, 0);
if (orig instanceof GtileEmpty) {
System.err.println("Warning 1");
}
}
@Override

View File

@ -128,14 +128,21 @@ public class Gtiles {
static public Gtile withNorthMargin(Gtile orig, double north) {
return new GtileWithMargin((AbstractGtileRoot) orig, north, 0, 0);
}
// static public Gtile withEastMargin(Gtile orig, double east) {
// return new GtileWithMargin((AbstractGtileRoot) orig, 0, 0, east);
// }
public static Gtile withIncomingArrow(Gtile orig, double margin) {
if (orig instanceof GtileEmpty)
return orig;
return new GtileWithIncomingArrow((AbstractGtileRoot) orig, margin);
}
public static Gtile withOutgoingArrow(Gtile orig, double margin) {
if (orig instanceof GtileEmpty)
return orig;
return new GtileWithOutgoingArrow((AbstractGtileRoot) orig, margin);
}

View File

@ -0,0 +1,364 @@
package net.sourceforge.plantuml.emoji;
import java.awt.geom.AffineTransform;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.emoji.data.Dummy;
import net.sourceforge.plantuml.openiconic.SvgPath;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorNone;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorSimple;
// Emojji from https://twemoji.twitter.com/
// Shorcut from https://api.github.com/emojis
public class EmojiTmp {
private final static Map<String, EmojiTmp> ALL = new HashMap<>();
static {
final InputStream is = Dummy.class.getResourceAsStream("emoji.txt");
try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) {
String s = null;
while ((s = br.readLine()) != null) {
new EmojiTmp(s);
}
} catch (IOException e) {
e.printStackTrace();
}
}
public static Map<String, EmojiTmp> getAll() {
return Collections.unmodifiableMap(new TreeMap<>(ALL));
}
private final List<String> data = new ArrayList<>();
private final String unicode;
private final String shortcut;
private EmojiTmp(String unicode) {
final int x = unicode.indexOf(';');
if (x == -1) {
this.shortcut = null;
} else {
this.shortcut = unicode.substring(x + 1);
ALL.put(this.shortcut, this);
unicode = unicode.substring(0, x);
}
this.unicode = unicode;
ALL.put(unicode, this);
}
public static String pattern() {
final StringBuilder sb = new StringBuilder("\\<(#\\w+)?:(");
for (String s : ALL.keySet()) {
if (sb.toString().endsWith("(") == false)
sb.append("|");
sb.append(s);
}
sb.append("):\\>");
return sb.toString();
}
public static EmojiTmp retrieve(String name) {
return ALL.get(name.toLowerCase());
}
private String extractData(String name, String s) {
final Pattern p = Pattern.compile(name + "=\"([^\"]+)\"");
final Matcher m = p.matcher(s);
if (m.find())
return m.group(1);
return null;
}
private synchronized void loadIfNeed() throws IOException {
if (data.size() > 0)
return;
try (BufferedReader br = new BufferedReader(
new InputStreamReader(Dummy.class.getResourceAsStream(unicode + ".svg")))) {
final String singleLine = br.readLine();
final Pattern p = Pattern.compile("\\<[^<>]+\\>");
final Matcher m = p.matcher(singleLine);
while (m.find()) {
final String s = m.group(0);
if (s.contains("<path") || s.contains("<g ") || s.contains("<g>") || s.contains("</g>")
|| s.contains("<circle ") || s.contains("<ellipse "))
data.add(s);
else
System.err.println("???=" + s);
}
}
}
public void drawU(UGraphic ug, double scale, HColor colorForMonochrome) {
try {
loadIfNeed();
} catch (IOException e) {
e.printStackTrace();
}
UGraphicWithScale ugs = new UGraphicWithScale(ug, scale);
final List<UGraphicWithScale> stack = new ArrayList<>();
for (String s : data) {
if (s.contains("<path ")) {
drawPath(ugs, s, colorForMonochrome);
} else if (s.contains("</g>")) {
ugs = stack.remove(0);
} else if (s.contains("<g>")) {
stack.add(0, ugs);
} else if (s.contains("<g ")) {
stack.add(0, ugs);
ugs = applyFill(ugs, s, colorForMonochrome);
ugs = applyTransform(ugs, s);
} else if (s.contains("<circle ")) {
drawCircle(ugs, s, colorForMonochrome);
} else if (s.contains("<ellipse ")) {
drawEllipse(ugs, s, colorForMonochrome);
} else {
System.err.println("**?=" + s);
}
}
}
private UGraphicWithScale applyFill(UGraphicWithScale ugs, String s, HColor colorForMonochrome) {
final String fillString = extractData("fill", s);
if (fillString == null)
return ugs;
if (fillString.equals("none")) {
final String strokeString = extractData("stroke", s);
if (strokeString == null)
return ugs;
ugs = ugs.apply(new HColorNone().bg());
final HColor stroke = getTrueColor(strokeString, colorForMonochrome);
ugs = ugs.apply(stroke);
final String strokeWidth = extractData("stroke-width", s);
if (strokeWidth != null) {
ugs = ugs.apply(new UStroke(Double.parseDouble(strokeWidth)));
}
} else {
final HColor fill = getTrueColor(fillString, colorForMonochrome);
ugs = ugs.apply(fill).apply(fill.bg());
}
return ugs;
}
private HColor getTrueColor(String code, HColor colorForMonochrome) {
final HColorSimple result = (HColorSimple) HColorSet.instance().getColorOrWhite(code);
if (colorForMonochrome == null)
return result;
return result.asMonochrome((HColorSimple) colorForMonochrome);
}
private void drawCircle(UGraphicWithScale ugs, String s, HColor colorForMonochrome) {
if (s.contains("matrix(") || s.contains("rotate(")) {
System.err.println("Warning " + s);
return;
}
ugs = applyFill(ugs, s, colorForMonochrome);
ugs = applyTransform(ugs, s);
final double scalex = ugs.getAffineTransform().getScaleX();
final double scaley = ugs.getAffineTransform().getScaleY();
final double deltax = ugs.getAffineTransform().getTranslateX();
final double deltay = ugs.getAffineTransform().getTranslateY();
final double cx = Double.parseDouble(extractData("cx", s)) * scalex;
final double cy = Double.parseDouble(extractData("cy", s)) * scaley;
final double rx = Double.parseDouble(extractData("r", s)) * scalex;
final double ry = Double.parseDouble(extractData("r", s)) * scaley;
final UTranslate translate = new UTranslate(deltax + cx - rx, deltay + cy - ry);
ugs.apply(translate).draw(new UEllipse(rx * 2, ry * 2));
}
private void drawEllipse(UGraphicWithScale ugs, String s, HColor colorForMonochrome) {
ugs = applyFill(ugs, s, colorForMonochrome);
final double scalex = ugs.getAffineTransform().getScaleX();
final double scaley = ugs.getAffineTransform().getScaleY();
final double deltax = ugs.getAffineTransform().getTranslateX();
final double deltay = ugs.getAffineTransform().getTranslateY();
final double cx = Double.parseDouble(extractData("cx", s)) * scalex;
final double cy = Double.parseDouble(extractData("cy", s)) * scaley;
final double rx = Double.parseDouble(extractData("rx", s)) * scalex;
final double ry = Double.parseDouble(extractData("ry", s)) * scaley;
if (s.contains("matrix(") || s.contains("rotate(")) {
final UTranslate translate = new UTranslate(deltax + cx + rx, deltay + cy);
final String tmp = ellipseAsPath((int) rx, (int) ry);
final SvgPath svgPath = new SvgPath(tmp);
ugs = ugs.applyTranslate(translate.getDx(), translate.getDy());
// ugs = applyTransform(ugs, s);
AffineTransform rot = getRotate(s);
System.err.println("rot=" + rot);
AffineTransform current = new AffineTransform(ugs.getAffineTransform());
current.concatenate(rot);
svgPath.drawMe(ugs.getUg(), current);
} else {
ugs = applyTransform(ugs, s);
final UTranslate translate = new UTranslate(deltax + cx - rx, deltay + cy - ry);
ugs.apply(translate).draw(new UEllipse(rx * 2, ry * 2));
}
}
private String ellipseAsPath(int rx, int ry) {
return "M " + (-2 * rx) + ",0 a " + rx + "," + ry + " 0 1,0 " + (2 * rx) + ",0 a " + rx + "," + ry + " 0 1,0 "
+ (-2 * rx) + ",0";
}
private void drawPath(UGraphicWithScale ugs, String s, HColor colorForMonochrome) {
s = s.replace("id=\"", "ID=\"");
ugs = applyFill(ugs, s, colorForMonochrome);
ugs = applyTransform(ugs, s);
final int x1 = s.indexOf("d=\"");
final int x2 = s.indexOf('"', x1 + 3);
final String tmp = s.substring(x1 + 3, x2);
final SvgPath svgPath = new SvgPath(tmp);
svgPath.drawMe(ugs.getUg(), ugs.getAffineTransform());
}
private UGraphicWithScale applyTransform(UGraphicWithScale ugs, String s) {
final String transform = extractData("transform", s);
if (transform == null)
return ugs;
if (transform.contains("rotate("))
return applyRotate(ugs, transform);
if (transform.contains("matrix("))
return applyMatrix(ugs, transform);
final double[] scale = getScale(transform);
final UTranslate translate = getTranslate(transform);
ugs = ugs.applyTranslate(translate.getDx(), translate.getDy());
return ugs.applyScale(scale[0], scale[1]);
}
private UGraphicWithScale applyMatrix(UGraphicWithScale ugs, final String transform) {
final Pattern p3 = Pattern.compile(
"matrix\\(([-.0-9]+)[ ,]+([-.0-9]+)[ ,]+([-.0-9]+)[ ,]+([-.0-9]+)[ ,]+([-.0-9]+)[ ,]+([-.0-9]+)\\)");
final Matcher m3 = p3.matcher(transform);
if (m3.find()) {
final double v1 = Double.parseDouble(m3.group(1));
final double v2 = Double.parseDouble(m3.group(2));
final double v3 = Double.parseDouble(m3.group(3));
final double v4 = Double.parseDouble(m3.group(4));
final double v5 = Double.parseDouble(m3.group(5));
final double v6 = Double.parseDouble(m3.group(6));
ugs = ugs.applyMatrix(v1, v2, v3, v4, v5, v6);
} else
System.err.println("WARNING: " + transform);
return ugs;
}
private AffineTransform getRotate(String transform) {
final Pattern p3 = Pattern.compile("rotate\\(([-.0-9]+)[ ,]+([-.0-9]+)[ ,]+([-.0-9]+)\\)");
final Matcher m3 = p3.matcher(transform);
if (m3.find()) {
final double angle = Double.parseDouble(m3.group(1));
final double x = Double.parseDouble(m3.group(2));
final double y = Double.parseDouble(m3.group(3));
System.err.println("angle=" + angle);
System.err.println("x=" + x);
System.err.println("y=" + y);
final AffineTransform copy = new AffineTransform();
copy.rotate(angle * Math.PI / 180, 11, 30);
return copy;
} else
System.err.println("WARNING: " + transform);
return null;
}
private UGraphicWithScale applyRotate(UGraphicWithScale ugs, final String transform) {
final Pattern p3 = Pattern.compile("rotate\\(([-.0-9]+)[ ,]+([-.0-9]+)[ ,]+([-.0-9]+)\\)");
final Matcher m3 = p3.matcher(transform);
if (m3.find()) {
final double angle = Double.parseDouble(m3.group(1));
final double x = Double.parseDouble(m3.group(2));
final double y = Double.parseDouble(m3.group(3));
ugs = ugs.applyRotate(angle, x, y);
} else
System.err.println("WARNING: " + transform);
return ugs;
}
private UTranslate getTranslate(String transform) {
double x = 0;
double y = 0;
final Pattern p3 = Pattern.compile("translate\\(([-.0-9]+)[ ,]+([-.0-9]+)\\)");
final Matcher m3 = p3.matcher(transform);
if (m3.find()) {
x = Double.parseDouble(m3.group(1));
y = Double.parseDouble(m3.group(2));
} else {
final Pattern p4 = Pattern.compile("translate\\(([-.0-9]+)\\)");
final Matcher m4 = p4.matcher(transform);
if (m4.find()) {
x = Double.parseDouble(m4.group(1));
y = Double.parseDouble(m4.group(1));
}
}
return new UTranslate(x, y);
}
private double[] getScale(String transform) {
final double scale[] = new double[] { 1, 1 };
final Pattern p1 = Pattern.compile("scale\\(([-.0-9]+)\\)");
final Matcher m1 = p1.matcher(transform);
if (m1.find()) {
scale[0] = Double.parseDouble(m1.group(1));
scale[1] = scale[0];
} else {
final Pattern p2 = Pattern.compile("scale\\(([-.0-9]+)[ ,]+([-.0-9]+)\\)");
final Matcher m2 = p2.matcher(transform);
if (m2.find()) {
scale[0] = Double.parseDouble(m2.group(1));
scale[1] = Double.parseDouble(m2.group(2));
}
}
return scale;
}
public String getShortcut() {
return shortcut;
}
}

View File

@ -61,7 +61,7 @@ public class PSystemListEmoji extends PlainDiagram {
public void drawU(UGraphic ug) {
final TextBlockBackcolored header = GraphicStrings
.createBlackOnWhite(Arrays.asList("<b><size:16>Emoji available on Unicode Block " + text,
"(Blocks available: 26, 1F3, 1F4, 1F5, 1F6, 1F9)"));
"(Blocks available: 26, 27, 1F3, 1F4, 1F5, 1F6, 1F9)"));
header.drawU(ug);
final StringBounder stringBounder = ug.getStringBounder();
ug = ug.apply(UTranslate.dy(header.calculateDimension(stringBounder).getHeight()));

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#DD2E44" d="M16.806 10.675c-.92-2.047-2.003-4.066-3.026-6.26-.028-.068-.051-.138-.082-.206-.064-.142-.137-.277-.208-.413l-.052-.111-.002.003C11.798.698 8.343-.674 5.46.621 2.414 1.988 1.164 5.813 2.67 9.163c1.505 3.351 5.194 4.957 8.24 3.589.106-.047.205-.105.306-.159 1.935.438 1.994 1.877 1.994 1.877s4.618-1.521 3.596-3.795zM4.876 8.173c-.958-2.133-.252-4.527 1.575-5.347 1.826-.822 4.084.242 5.042 2.374.958 2.132.253 4.526-1.573 5.346-1.828.821-4.087-.241-5.044-2.373z"/><path fill="#99AAB5" d="M26.978 34.868c1.163-.657 2.187-2.474 1.529-3.638L16.754 10.559c-1.103.496-2.938 2.313-3.544 3.912l13.768 20.397z"/><path fill="#DD2E44" d="M30.54.62c-2.882-1.295-6.338.077-7.976 3.067l-.003-.003-.053.112c-.071.135-.145.27-.208.412-.03.068-.053.137-.081.206-1.023 2.194-2.107 4.213-3.026 6.26-1.021 2.274 3.597 3.796 3.597 3.796s.059-1.439 1.993-1.877c.102.054.2.111.307.159 3.045 1.368 6.733-.238 8.24-3.589 1.505-3.35.255-7.175-2.79-8.543zm.584 7.553c-.959 2.132-3.216 3.194-5.044 2.373-1.826-.82-2.531-3.214-1.572-5.346.956-2.132 3.214-3.195 5.041-2.374 1.827.82 2.532 3.214 1.575 5.347z"/><path fill="#CCD6DD" d="M9.022 34.868c-1.163-.657-2.187-2.474-1.529-3.638l11.753-20.671c1.103.496 2.938 2.313 3.544 3.912L9.022 34.868z"/><path fill="#99AAB5" d="M19.562 17.396c0 .863-.701 1.562-1.562 1.562-.863 0-1.562-.699-1.562-1.562 0-.863.699-1.562 1.562-1.562.862 0 1.562.699 1.562 1.562z"/></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#77B255" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V4c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v28z"/><path fill="#FFF" d="M29.28 6.362c-1.156-.751-2.704-.422-3.458.736L14.936 23.877l-5.029-4.65c-1.014-.938-2.596-.875-3.533.138-.937 1.014-.875 2.596.139 3.533l7.209 6.666c.48.445 1.09.665 1.696.665.673 0 1.534-.282 2.099-1.139.332-.506 12.5-19.27 12.5-19.27.751-1.159.421-2.707-.737-3.458z"/></svg>

After

Width:  |  Height:  |  Size: 482 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#66757F" d="M30 23.828c-.391.392-1.023.392-1.414 0l-1.414-1.414c-.392-.391-.392-1.024 0-1.414L30 18.172c.391-.391 1.023-.391 1.414 0l1.414 1.414c.392.391.392 1.024 0 1.414L30 23.828zm-15-15c-.391.392-1.023.392-1.414 0l-1.414-1.414c-.392-.391-.392-1.023 0-1.414L15 3.172c.391-.391 1.023-.391 1.414 0l1.414 1.414c.392.391.392 1.023 0 1.414L15 8.828z"/><path fill="#55ACEE" d="M2 22c2 0 11 1 11 1s1 9 1 11-2 2-3 1-4-6-4-6-5-3-6-4-1-3 1-3zM4 6.039C7 6 29 7 29 7s.924 22 .962 25c.038 3-2.763 4.002-3.862.001S21 15 21 15 7.045 10.583 3.995 9.898C0 9 .999 6.077 4 6.039z"/><path fill="#CCD6DD" d="M27 3c2-2 7-3 8-2s0 6-2 8-19 18-19 18-6.5 4.5-8 3 3-8 3-8S25 5 27 3z"/><path fill="#66757F" d="M14 22s.5.5-4 5-5 4-5 4-.5-.5 4-5 5-4 5-4zM29 4c1.657 0 3 1.343 3 3h.805c.114-.315.195-.645.195-1 0-1.657-1.343-3-3-3-.355 0-.685.081-1 .195V4z"/></svg>

After

Width:  |  Height:  |  Size: 909 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#CCD6DD" d="M36 27c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V9c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v18z"/><path fill="#99AAB5" d="M11.95 17.636L.637 28.949c-.027.028-.037.063-.06.091.34.57.814 1.043 1.384 1.384.029-.023.063-.033.09-.06L13.365 19.05c.39-.391.39-1.023 0-1.414-.392-.391-1.024-.391-1.415 0M35.423 29.04c-.021-.028-.033-.063-.06-.09L24.051 17.636c-.392-.391-1.024-.391-1.415 0-.391.392-.391 1.024 0 1.414l11.313 11.314c.026.026.062.037.09.06.571-.34 1.044-.814 1.384-1.384"/><path fill="#99AAB5" d="M32 5H4C1.791 5 0 6.791 0 9v1.03l14.528 14.496c1.894 1.893 4.988 1.893 6.884 0L36 10.009V9c0-2.209-1.791-4-4-4z"/><path fill="#E1E8ED" d="M32 5H4C2.412 5 1.051 5.934.405 7.275l14.766 14.767c1.562 1.562 4.096 1.562 5.657 0L35.595 7.275C34.949 5.934 33.589 5 32 5z"/></svg>

After

Width:  |  Height:  |  Size: 862 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#EF9645" d="M32.218 10.913c-.81-1.187-2.172-1.967-3.718-1.967H28s-5.353-5.672-5.15-6.091C21.754 3.446 21 4.591 21 5.924c0 0-5.509-3.431-5.247-3.947C14.71 2.669 14 3.946 14 5.424v.522S8.553 4.321 8.857 3.851C7.757 4.441 7 5.588 7 6.924V8.81l-6 6.272v2.645l17.16 14.439c0 .001 13.128-22.164 14.058-21.253z"/><g fill="#FFDC5D"><path d="M4.124 18.946c1.474 0 2.738-.831 3.392-2.043.678 1.212 1.958 2.043 3.446 2.043h.076c1.153 0 2.169-.51 2.889-1.298.023-.024.073-.082.073-.082.185-.212.343-.448.481-.695.04-.072.281-.621.342-.833.052-.173.106-.344.134-.526.141.167.296.319.46.46.069.059.45.339.576.413.589.351 1.271.56 2.008.56h3.166c-.535.27-.999.614-1.424 1-1.729 1.568-2.579 4.085-2.579 7.663 0 .276.224.5.5.5s.5-.224.5-.5c0-3.962 1.01-6.427 3.24-7.663 1.175-.651 2.682-.967 4.571-.967.059 0 .526-.033.526-.033.276 0 .5-.224.5-.5s-.224-.5-.5-.5H18c-1.657 0-3-1.343-3-3s1.343-3 3-3h11c.973 0 2.288.056 3.218.967.325.318.604.736.803 1.297l1.659 5.472c.156.512.73 2.857.626 3.346 0 7.34-8.7 14.972-19.004 14.972C6.326 36 1 27.883 1 17.957v-.229c.01.01.021.016.031.026.881.882 1.799 1.192 2.845 1.192h.248z"/><path d="M3.864 5.946h.271C5.718 5.946 7 7.229 7 8.81v6.272c0 1.582-1.282 2.864-2.864 2.864h-.272C2.282 17.946 1 16.664 1 15.082V8.81c0-1.581 1.282-2.864 2.864-2.864zm10.136 9c0 .891-.396 1.683-1.014 2.233-.53.472-1.221.767-1.986.767-1.657 0-3-1.343-3-3v-9c0-.816.328-1.554.857-2.095.544-.557 1.302-.905 2.143-.905 1.657 0 3 1.343 3 3v9zm4-6c-1.201 0-2.267.541-3 1.38v-6.38c0-.758.29-1.442.753-1.97.55-.627 1.347-1.03 2.247-1.03 1.657 0 3 1.343 3 3v5h-3zm4-4.007c0-.812.326-1.545.85-2.085.544-.559 1.301-.909 2.143-.909h.014C26.66 1.946 28 3.286 28 4.939v4.007h-6V4.939z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#EF9645" d="M20.5 2.965c-1.381 0-2.5 1.119-2.5 2.5v.005L15.5.465c-1.381 0-2.5 1.119-2.5 2.5V4.25l-2.5-1.535c-1.381 0-2.5 1.119-2.5 2.5V8.75L7 18h13.542L20.5 2.965z"/><path fill="#FFDC5D" d="M31.375 16.219c-1.381-.611-3.354.208-4.75 2.188-.917 1.3-1.187 3.151-2.391 3.344-.46.073-1.234-.313-1.234-1.397V4.5s0-2-2-2-2 2-2 2v11.633c0-.029-1-.064-1-.082V2s0-2-2-2-2 2-2 2v14.053c0 .017-1 .041-1 .069V4.25s0-2-2-2-2 2-2 2v12.638c0 .118-1 .251-1 .398V8.75s0-2-2-2-2 2-2 2V24c0 6.627 5.373 12 12 12 4.775 0 8.06-2.598 9.896-5.292 1.557-2.285 2.009-4.658 2.104-5.375 0 0 .123-1.479 1.156-2.865 1.469-1.969 2.5-3.156 3.125-3.866.317-.358.625-1.706-.906-2.383z"/><path fill="#EF9645" d="M23.439 21.471c-.297-.266-.372-.552-.417-.808-1.892.259-4.457.789-6.427 2.715-2.556 2.499-2.992 5.2-2.971 7.007.017 1.457.812 2.147 1.045-.012.292-2.706 2.254-8.063 8.784-8.58.028-.002.387-.024.591-.035 0 0-.352-.06-.605-.287z"/></svg>

After

Width:  |  Height:  |  Size: 984 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#EF9645" d="M26.992 19.016c-.255-.255-.553-.47-.875-.636l-.4-1.356-8.012-.056-.307 1.091c-.467.095-1.041.389-1.393.718l-3.611-3.954c-.817.364-1.389 1.18-1.389 2.133v.96l-4 4.166.016 2.188 9.984 10.729s10.518-15.288 10.543-15.258c-.127-.224-.511-.703-.556-.725z"/><g fill="#FFDC5D"><path d="M24.581 18H18c-.208 0-.411.021-.607.061l-.073-.278-3.273-12.464s-.416-1.957 1.54-2.372c1.956-.416 2.372 1.54 2.372 1.54l3.097 11.569c.446.024.878.063 1.305.107l2.061-10.512s.188-1.991 2.18-1.804c1.991.188 1.803 2.179 1.803 2.179L26.34 17.187l-.221 1.194c-.464-.235-.982-.381-1.538-.381zM8.916 16h.168c1.059 0 1.916.858 1.916 1.917v4.166C11 23.142 10.143 24 9.084 24h-.168C7.857 24 7 23.142 7 22.083v-4.166C7 16.858 7.857 16 8.916 16zm6.918 2.96l-.056.062C15.304 19.551 15 20.233 15 21c0 .063.013.123.018.185.044.678.308 1.292.728 1.774-.071.129-.163.243-.259.353-.366.417-.89.688-1.487.688-1.104 0-2-.896-2-2v-6c0-.441.147-.845.389-1.176.364-.497.947-.824 1.611-.824 1.104 0 2 .896 2 2v2.778c-.061.055-.109.123-.166.182z"/><path d="M9.062 25c1.024 0 1.925-.526 2.45-1.322.123.183.271.346.431.497 1.185 1.115 3.034 1.044 4.167-.086.152-.152.303-.305.419-.488l-.003-.003C16.727 23.713 17 24 18 24h2.537c-.37.279-.708.623-1.024 1-1.228 1.467-2.013 3.606-2.013 6 0 .276.224.5.5.5s.5-.224.5-.5c0-2.548.956-4.775 2.377-6 .732-.631 1.584-1 2.498-1 .713.079.847-1 .125-1H18c-1.104 0-2-.896-2-2s.896-2 2-2h8c.858 0 1.66.596 1.913 1.415L29 24c.103.335.479 1.871.411 2.191C29.411 31 24.715 36 19 36c-6.537 0-11.844-5.231-11.986-11.734l.014.01c.515.445 1.176.724 1.91.724h.124z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#EF9645" d="M6.203 21.641c-.078.922.321 1.198.946 1.636.618.433 4.383-2.867 5.614-3.369 1.231-.502 12.787-2.949 12.286-5.183-.501-2.234-3.993-2.564-6.683-2.108-2.69.456-7.838 2.822-9.342 4.099-1.504 1.276-2.821 4.925-2.821 4.925zm8.622 1.497s-3.557 1.155-3.557 4.155.866 4.692 1.276 5.513c.411.82 1.688 1.616 3.455.851 2.052-.889-.491-6.004 6-3.656 2.974 1.075 6.059 2.528 9.059 1.528C33.904 30.58 35 27 35 25c0-4.094-3-3-4-2s-9 3-10 3-6.175-2.862-6.175-2.862z"/><path fill="#F9CA55" d="M19.312 28.188s-.12-1.316-1.375-1.469c-1.031-.125-2.656.219-3.5 1.906-.844 1.688-2.344 1.406-2.281 2.812.062 1.406.5 2.5 1.406 2.781.907.282 2.188-.218 2.344-1.718.156-1.5.344-2.875 1.312-3.469.97-.593 2.094-.843 2.094-.843z"/><path fill="#EF9645" d="M18 26s-1-1-3-1-6.664 2.133-5.25 6.375c1 3 3.844 1.594 4.25-1.375.407-2.973 4-4 4-4z"/><path fill="#F9CA55" d="M17 26s-1-1-3-1-4.885 1.53-5 6c-.094 3.656 4.031 2 4-1-.031-3 4-4 4-4z"/><path fill="#EF9645" d="M5 27c0 3.297.457 5.286 2.428 4.947 3.269-.562 2.028-4.614 4.889-5.754 2.077-.827 5.101-.63 8.02 1.103C22.26 28.438 21 24 19 23s-8 0-9 0-5 4-5 4z"/><path fill="#F9CA55" d="M4.842 27.174C3.251 29.839 4.219 32.594 7 32c2.691-.574 1.343-4.07 4-6 1.489-1.082 4.698-1.445 6.698-.445S20 24 18 23s-8.54-.025-9.538.037c-1.909.119-3.62 4.137-3.62 4.137z"/><path fill="#3B88C3" d="M9.418 29.114c-.679.778-1.86.859-2.639.18l-.196-.171c-.779-.679-.859-1.859-.18-2.638L28.926.668c.679-.778 1.86-.859 2.639-.18l.195.171c.779.679.859 1.86.181 2.638L9.418 29.114z"/><path fill="#3B88C3" d="M10.49 27.886c-2.36 2.705-8.313 8.009-9.067 7.352-.753-.657 3.693-7.275 6.053-9.981 2.36-2.706 1.661-.542 2.493.185.832.726 2.881-.26.521 2.444z"/><path fill="#EF9645" d="M6.672 25.026c0 1 2.421 1.915 3.421.915s3.341-2.228 6.419-.941C23.716 28.01 21 24 18 23s-8 0-9 0-2.328 2.026-2.328 2.026z"/><path fill="#FFDC5D" d="M6.195 22.043c-.358-1.113 2.188-7.279 3.341-8.234 1.452-1.202 7.069-3.063 9.069-3.063S35 18 35 23s-2 5.625-4.875 6.406c-2.299.625-7.115.242-9.219-1.719C19.062 25.969 17.781 24.781 16 24c-3.302-1.448-5.503.424-6.503 1.424-2 2-5.768-.159-2.625-3.58C9.121 19.395 11.102 18.632 13 18c6-2 10-2 8-4-.707-.707-1.092.346-2.076.525-1.98.36-3.556.602-6.165 1.472-.902.3-5.172 3.023-6.564 6.046z"/><path fill="#EF9645" d="M13.196 16.275c1.064-.388 5.702-1.232 8.115-2.068 1.949-.676 3.659.636-.04 2.028-3.57 1.343-7.279 1.233-9.984 2.307-1.023.406-1.91-.875 1.909-2.267z"/><path fill="#3B88C3" d="M22.487 8.023s-5.928 6.795-8.446 9.661c2.254-.926 4.271-.75 6.198-1.884 1.927-1.133 2.806-2.342 5.73-5.695 1.086-1.244-3.482-2.082-3.482-2.082z"/></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#D99E82" d="M35.222 33.598c-.647-2.101-1.705-6.059-2.325-7.566-.501-1.216-.969-2.438-1.544-3.014-.575-.575-1.553-.53-2.143.058 0 0-2.469 1.675-3.354 2.783-1.108.882-2.785 3.357-2.785 3.357-.59.59-.635 1.567-.06 2.143.576.575 1.798 1.043 3.015 1.544 1.506.62 5.465 1.676 7.566 2.325.359.11 1.74-1.271 1.63-1.63z"/><path fill="#EA596E" d="M13.643 5.308c1.151 1.151 1.151 3.016 0 4.167l-4.167 4.168c-1.151 1.15-3.018 1.15-4.167 0L1.141 9.475c-1.15-1.151-1.15-3.016 0-4.167l4.167-4.167c1.15-1.151 3.016-1.151 4.167 0l4.168 4.167z"/><path fill="#FFCC4D" d="M31.353 23.018l-4.17 4.17-4.163 4.165L7.392 15.726l8.335-8.334 15.626 15.626z"/><path fill="#292F33" d="M32.078 34.763s2.709 1.489 3.441.757c.732-.732-.765-3.435-.765-3.435s-2.566.048-2.676 2.678z"/><path fill="#CCD6DD" d="M2.183 10.517l8.335-8.335 5.208 5.209-8.334 8.335z"/><path fill="#99AAB5" d="M3.225 11.558l8.334-8.334 1.042 1.042L4.267 12.6zm2.083 2.086l8.335-8.335 1.042 1.042-8.335 8.334z"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#99AAB5" d="M31.986 32.729c-.292.167-.626.271-.987.271-1.104 0-2-.896-2-2s.896-2 2-2 2 .896 2 2c0 .361-.104.695-.271.987l3.146 3.146L34.999 28l-9-7-5 5 7 9 7.134.876-3.147-3.147z"/><path fill="#66757F" d="M13.643 5.308c1.151 1.151 1.151 3.016 0 4.167l-4.167 4.168c-1.151 1.15-3.018 1.15-4.167 0L1.141 9.475c-1.15-1.151-1.15-3.016 0-4.167l4.167-4.167c1.15-1.151 3.016-1.151 4.167 0l4.168 4.167z"/><path fill="#31373D" d="M26.643 18.309L9.44 1.105 1.107 9.44l17.202 17.202c1.15 1.15 3.016 1.15 4.168 0l4.166-4.168c1.15-1.15 1.15-3.015 0-4.165z"/><path fill="#66757F" d="M8.225 16.56l8.334-8.335 2.124 2.125-8.333 8.334z"/></svg>

After

Width:  |  Height:  |  Size: 698 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M34.459 1.375c-1.391-.902-3.248-.506-4.149.884L13.5 28.17l-8.198-7.58c-1.217-1.125-3.114-1.051-4.239.166-1.125 1.216-1.051 3.115.166 4.239l10.764 9.952s.309.266.452.359c.504.328 1.07.484 1.63.484.982 0 1.945-.482 2.52-1.368L35.343 5.524c.902-1.39.506-3.248-.884-4.149z"/></svg>

After

Width:  |  Height:  |  Size: 361 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M22.238 18.004l9.883-9.883c1.172-1.171 1.172-3.071 0-4.243-1.172-1.171-3.07-1.171-4.242 0l-9.883 9.883-9.883-9.882c-1.171-1.172-3.071-1.172-4.243 0-1.171 1.171-1.171 3.071 0 4.243l9.883 9.882-9.907 9.907c-1.171 1.171-1.171 3.071 0 4.242.585.586 1.354.879 2.121.879s1.536-.293 2.122-.879l9.906-9.906 9.882 9.882c.586.586 1.354.879 2.121.879s1.535-.293 2.121-.879c1.172-1.171 1.172-3.071 0-4.242l-9.881-9.883z"/></svg>

After

Width:  |  Height:  |  Size: 500 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#9266CC" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V4c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v28z"/><path fill="#FFF" d="M26 10h-6V4c0-.552-.447-1-1-1h-2c-.552 0-1 .448-1 1v6h-6c-.552 0-1 .448-1 1v2c0 .552.448 1 1 1h6v18c0 .553.448 1 1 1h2c.553 0 1-.447 1-1V14h6c.553 0 1-.448 1-1v-2c0-.552-.447-1-1-1z"/></svg>

After

Width:  |  Height:  |  Size: 396 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#9266CC" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V4c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v28z"/><path fill="#FFF" d="M27.152 18l3.716-6.504c.177-.31.176-.69-.003-.998C30.686 10.19 30.356 10 30 10h-7.42l-3.712-6.496c-.355-.623-1.381-.623-1.736 0L13.42 10H6c-.356 0-.686.19-.865.498-.179.308-.18.688-.003.998L8.848 18l-3.716 6.504c-.177.31-.176.689.003.998.179.309.509.498.865.498h7.42l3.712 6.496c.178.312.509.504.868.504s.69-.192.868-.504L22.58 26H30c.356 0 .686-.189.865-.498.179-.309.18-.688.003-.998L27.152 18zm1.124-6L26 15.984 23.723 12h4.553zm-3.428 6l-3.428 6h-6.84l-3.429-6 3.429-6h6.839l3.429 6zM18 6.016L20.277 10h-4.553L18 6.016zM7.723 12h4.554L10 15.985 7.723 12zm0 12L10 20.015 12.277 24H7.723zM18 29.984L15.723 26h4.553L18 29.984zM23.723 24L26 20.016 28.276 24h-4.553z"/></svg>

After

Width:  |  Height:  |  Size: 880 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFAC33" d="M34.347 16.893l-8.899-3.294-3.323-10.891c-.128-.42-.517-.708-.956-.708-.439 0-.828.288-.956.708l-3.322 10.891-8.9 3.294c-.393.146-.653.519-.653.938 0 .418.26.793.653.938l8.895 3.293 3.324 11.223c.126.424.516.715.959.715.442 0 .833-.291.959-.716l3.324-11.223 8.896-3.293c.391-.144.652-.518.652-.937 0-.418-.261-.792-.653-.938z"/><path fill="#FFCC4D" d="M14.347 27.894l-2.314-.856-.9-3.3c-.118-.436-.513-.738-.964-.738-.451 0-.846.302-.965.737l-.9 3.3-2.313.856c-.393.145-.653.52-.653.938 0 .418.26.793.653.938l2.301.853.907 3.622c.112.444.511.756.97.756.459 0 .858-.312.97-.757l.907-3.622 2.301-.853c.393-.144.653-.519.653-.937 0-.418-.26-.793-.653-.937zM10.009 6.231l-2.364-.875-.876-2.365c-.145-.393-.519-.653-.938-.653-.418 0-.792.26-.938.653l-.875 2.365-2.365.875c-.393.146-.653.52-.653.938 0 .418.26.793.653.938l2.365.875.875 2.365c.146.393.52.653.938.653.418 0 .792-.26.938-.653l.875-2.365 2.365-.875c.393-.146.653-.52.653-.938 0-.418-.26-.792-.653-.938z"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#77B255" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V4c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v28z"/><path fill="#FFF" d="M31.999 16h-9.171l6.899-6.899c.781-.781.782-2.047.001-2.828-.782-.782-2.048-.781-2.829 0L20 13.172V4c0-1.104-.896-2-2-2s-2 .896-2 2v9.171L9.101 6.272c-.781-.781-2.048-.781-2.828 0-.781.781-.781 2.047 0 2.828l6.9 6.9H4c-1.104 0-2.001.896-2 2 0 1.104.896 2 1.999 2h9.174l-6.9 6.9c-.781.78-.781 2.047 0 2.828.78.78 2.047.78 2.827 0l6.9-6.9V32c0 1.104.896 2 2 2s2-.896 2-2v-9.172l6.899 6.899c.781.781 2.047.782 2.828.001.781-.781.781-2.048 0-2.829L22.828 20h9.171C33.104 20 34 19.105 34 18.001 34 16.896 33.104 16 31.999 16z"/></svg>

After

Width:  |  Height:  |  Size: 735 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M13.574 11.235c1.335.971 2.631.43 2.882-1.201l1.088-7.069c.251-1.631.661-1.631.912 0l1.088 7.069c.251 1.631 1.548 2.171 2.882 1.201l6.148-4.471c1.334-.971 1.632-.673.661.662l-4.471 6.147c-.971 1.335-.431 2.631 1.2 2.882l7.07 1.088c1.631.251 1.631.661 0 .912l-7.07 1.088c-1.631.251-2.171 1.548-1.2 2.882l4.471 6.148c.971 1.334.673 1.632-.661.661l-6.148-4.471c-1.334-.971-2.631-.431-2.882 1.2l-1.088 7.07c-.251 1.631-.661 1.631-.912 0l-1.088-7.07c-.251-1.631-1.548-2.171-2.882-1.2l-6.147 4.471c-1.334.971-1.581.713-.546-.573l5.085-6.324c1.034-1.286.542-2.523-1.092-2.748l-8.057-1.113c-1.634-.226-1.638-.62-.008-.876l7.228-1.135c1.63-.256 2.17-1.558 1.199-2.892L6.765 7.426c-.971-1.334-.673-1.632.661-.661l6.148 4.47z"/></svg>

After

Width:  |  Height:  |  Size: 807 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#88C9F9" d="M19 27.586V8.415l4.828-4.829s.707-.707 0-1.415c-.707-.707-1.414 0-1.414 0L19 5.586V1s0-1-1-1-1 1-1 1v4.586l-3.414-3.415s-.707-.707-1.414 0c-.707.708 0 1.415 0 1.415L17 8.415v19.171l-4.828 4.828s-.707.707 0 1.414 1.414 0 1.414 0L17 30.414V35s0 1 1 1 1-1 1-1v-4.586l3.414 3.414s.707.707 1.414 0 0-1.414 0-1.414L19 27.586z"/><path fill="#88C9F9" d="M34.622 20.866c-.259-.966-1.225-.707-1.225-.707l-6.595 1.767-16.603-9.586-1.767-6.595s-.259-.966-1.225-.707C6.24 5.297 6.5 6.263 6.5 6.263l1.25 4.664-3.972-2.294s-.866-.5-1.366.366c-.5.866.366 1.366.366 1.366l3.971 2.293-4.664 1.249s-.967.259-.707 1.225c.259.967 1.225.708 1.225.708l6.596-1.767 16.603 9.586 1.767 6.596s.259.966 1.225.707c.966-.26.707-1.225.707-1.225l-1.25-4.664 3.972 2.293s.867.5 1.367-.365c.5-.867-.367-1.367-.367-1.367l-3.971-2.293 4.663-1.249c0-.001.966-.26.707-1.226z"/><path fill="#88C9F9" d="M33.915 13.907l-4.664-1.25 3.972-2.293s.867-.501.367-1.367c-.501-.867-1.367-.366-1.367-.366l-3.971 2.292 1.249-4.663s.259-.966-.707-1.225c-.966-.259-1.225.707-1.225.707l-1.767 6.595-16.604 9.589-6.594-1.768s-.966-.259-1.225.707c-.26.967.707 1.225.707 1.225l4.663 1.249-3.971 2.293s-.865.501-.365 1.367c.5.865 1.365.365 1.365.365l3.972-2.293-1.25 4.663s-.259.967.707 1.225c.967.26 1.226-.706 1.226-.706l1.768-6.597 16.604-9.585 6.595 1.768s.966.259 1.225-.707c.255-.967-.71-1.225-.71-1.225z"/></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#77B255" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V4c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v28z"/><circle fill="#FFF" cx="18" cy="18" r="3"/><path fill="#FFF" d="M20 4c0-1.104-.896-2-2-2s-2 .896-2 2v8c0 1.104.896 2 2 2s2-.896 2-2V4zm0 20c0-1.104-.896-2-2-2s-2 .896-2 2v8c0 1.104.896 2 2 2s2-.896 2-2v-8zM4 16c-1.104 0-2 .896-2 2s.896 2 2 2h8c1.104 0 2-.896 2-2s-.896-2-2-2H4zm20 0c-1.104 0-2 .896-2 2s.896 2 2 2h8c1.104 0 2-.896 2-2s-.896-2-2-2h-8zm-8.829-2.243c.391.391.391 1.024 0 1.414-.39.391-1.024.391-1.414 0L6.272 7.687c-.391-.391-.391-1.024 0-1.415s1.024-.391 1.415 0l7.484 7.485zm14.557 14.556c.392.391.391 1.024 0 1.414-.39.391-1.023.392-1.414 0l-7.485-7.485c-.391-.391-.391-1.023 0-1.414s1.024-.391 1.414 0l7.485 7.485zm-15.971-7.485c.391-.391 1.024-.391 1.414 0 .391.391.391 1.024 0 1.414l-7.485 7.486c-.391.391-1.024.391-1.415 0s-.391-1.024 0-1.415l7.486-7.485zM28.313 6.272c.391-.392 1.024-.391 1.414 0 .391.39.392 1.023 0 1.414l-7.485 7.485c-.391.391-1.023.391-1.414 0s-.391-1.023 0-1.414l7.485-7.485z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#DD2E44" d="M21.533 18.002L33.768 5.768c.976-.976.976-2.559 0-3.535-.977-.977-2.559-.977-3.535 0L17.998 14.467 5.764 2.233c-.976-.977-2.56-.977-3.535 0-.977.976-.977 2.559 0 3.535l12.234 12.234L2.201 30.265c-.977.977-.977 2.559 0 3.535.488.488 1.128.732 1.768.732s1.28-.244 1.768-.732l12.262-12.263 12.234 12.234c.488.488 1.128.732 1.768.732.64 0 1.279-.244 1.768-.732.976-.977.976-2.559 0-3.535L21.533 18.002z"/></svg>

After

Width:  |  Height:  |  Size: 491 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#77B255" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V4c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v28z"/><path fill="#FFF" d="M21.529 18.006l8.238-8.238c.977-.976.977-2.559 0-3.535-.977-.977-2.559-.977-3.535 0l-8.238 8.238-8.238-8.238c-.976-.977-2.56-.977-3.535 0-.977.976-.977 2.559 0 3.535l8.238 8.238-8.258 8.258c-.977.977-.977 2.559 0 3.535.488.488 1.128.732 1.768.732s1.28-.244 1.768-.732l8.258-8.259 8.238 8.238c.488.488 1.128.732 1.768.732s1.279-.244 1.768-.732c.977-.977.977-2.559 0-3.535l-8.24-8.237z"/></svg>

After

Width:  |  Height:  |  Size: 598 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#BE1931" d="M17 27c-1.657 0-3-1.343-3-3v-4c0-1.657 1.343-3 3-3 .603-.006 6-1 6-5 0-2-2-4-5-4-2.441 0-4 2-4 3 0 1.657-1.343 3-3 3s-3-1.343-3-3c0-4.878 4.58-9 10-9 8 0 11 5.982 11 11 0 4.145-2.277 7.313-6.413 8.92-.9.351-1.79.587-2.587.747V24c0 1.657-1.343 3-3 3z"/><circle fill="#BE1931" cx="17" cy="32" r="3"/></svg>

After

Width:  |  Height:  |  Size: 388 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#CCD6DD" d="M17 27c-1.657 0-3-1.343-3-3v-4c0-1.657 1.343-3 3-3 .603-.006 6-1 6-5 0-2-2-4-5-4-2.441 0-4 2-4 3 0 1.657-1.343 3-3 3s-3-1.343-3-3c0-4.878 4.58-9 10-9 8 0 11 5.982 11 11 0 4.145-2.277 7.313-6.413 8.92-.9.351-1.79.587-2.587.747V24c0 1.657-1.343 3-3 3z"/><circle fill="#CCD6DD" cx="17" cy="32" r="3"/></svg>

After

Width:  |  Height:  |  Size: 388 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><circle fill="#CCD6DD" cx="18" cy="32" r="3"/><path fill="#CCD6DD" d="M21 24c0 1.657-1.343 3-3 3s-3-1.343-3-3V5c0-1.657 1.343-3 3-3s3 1.343 3 3v19z"/></svg>

After

Width:  |  Height:  |  Size: 216 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><circle fill="#BE1931" cx="18" cy="32" r="3"/><path fill="#BE1931" d="M21 24c0 1.657-1.344 3-3 3-1.657 0-3-1.343-3-3V5c0-1.657 1.343-3 3-3 1.656 0 3 1.343 3 3v19z"/></svg>

After

Width:  |  Height:  |  Size: 231 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#DD2E44" d="M18 4C14.875-2.375 6-.731 6 7c0 7.062 12 17 12 17s12-9.938 12-17c0-7.731-8.875-9.375-12-3z"/><circle fill="#DD2E44" cx="18" cy="31" r="5"/></svg>

After

Width:  |  Height:  |  Size: 229 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#DD2E44" d="M35.885 11.833c0-5.45-4.418-9.868-9.867-9.868-3.308 0-6.227 1.633-8.018 4.129-1.791-2.496-4.71-4.129-8.017-4.129-5.45 0-9.868 4.417-9.868 9.868 0 .772.098 1.52.266 2.241C1.751 22.587 11.216 31.568 18 34.034c6.783-2.466 16.249-11.447 17.617-19.959.17-.721.268-1.469.268-2.242z"/></svg>

After

Width:  |  Height:  |  Size: 368 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M31 15H21V5c0-1.657-1.343-3-3-3s-3 1.343-3 3v10H5c-1.657 0-3 1.343-3 3s1.343 3 3 3h10v10c0 1.657 1.343 3 3 3s3-1.343 3-3V21h10c1.657 0 3-1.343 3-3s-1.343-3-3-3z"/></svg>

After

Width:  |  Height:  |  Size: 253 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M34 18c0 1.657-1.343 3-3 3H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h26c1.657 0 3 1.343 3 3z"/></svg>

After

Width:  |  Height:  |  Size: 178 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M34 18c0 1.657-1.343 3-3 3H5c-1.657 0-3-1.343-3-3s1.343-3 3-3h26c1.657 0 3 1.343 3 3z"/><circle fill="#31373D" cx="18" cy="7" r="4"/><circle fill="#31373D" cx="18" cy="29" r="4"/></svg>

After

Width:  |  Height:  |  Size: 269 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#3B88C3" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V4c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v28z"/><path fill="#FFF" d="M7 14h9V7l13 11-13 11v-7H7z"/></svg>

After

Width:  |  Height:  |  Size: 242 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#31373D" d="M18 32.625c-5.09 0-10.5-3.965-10.5-11.312 0-4.877 3.365-9.178 7.591-12.272C12.393 7.739 9.756 7 8 7c-2.708 0-5.499.914-5.527.923-.79.258-1.635-.165-1.896-.951-.261-.785.163-1.633.949-1.895C1.658 5.033 4.793 4 8 4c2.695 0 6.449 1.158 10.01 3.162C21.565 5.158 25.31 4 28 4c3.207 0 6.222 1.559 6.344 1.625.781.422 1.312.699 1.125 1.266-.182.551-.891.328-1.75.234-.029-.003-2.156-.391-5.688-.391-1.752 0-4.41 1.003-7.1 2.304 4.215 3.083 7.568 7.36 7.568 12.212C28.5 28.639 23.09 32.625 18 32.625zm.013-21.954c-4.03 2.585-7.513 6.345-7.513 10.642 0 6.056 4.6 8.312 7.5 8.312 2.899 0 7.5-2.273 7.5-8.375 0-4.27-3.468-8.005-7.487-10.579z"/></svg>

After

Width:  |  Height:  |  Size: 723 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#269" d="M36 28c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V8c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v20z"/><path fill="#FFF" d="M34.481 11.183c-.129-.07-1.335-.683-3.851-.683-1.627 0-3.926.74-6.062 2.011C22.509 11.533 20.256 11 18.331 11h-.656c-1.925 0-4.178.533-6.238 1.511C9.301 11.24 7.002 10.5 5.375 10.5c-2.516 0-3.722.613-3.851.683-.48.26-.656.853-.404 1.337.251.484.853.671 1.341.429.009-.005.922-.45 2.914-.45 1.067 0 2.54.438 4.02 1.181-2.421 1.659-4.208 4.019-4.208 6.891 0 4.48 3.652 6.495 6.245 6.495 2.855 0 5.745-2.248 5.745-6.545 0-2.595-1.636-4.908-3.791-6.656 1.461-.556 2.974-.865 4.289-.865h.656c1.316 0 2.829.309 4.288.866-2.154 1.748-3.79 4.061-3.79 6.656 0 4.297 2.89 6.545 5.745 6.545 2.593 0 6.244-2.015 6.244-6.495 0-2.871-1.785-5.232-4.207-6.891 1.479-.743 2.952-1.181 4.02-1.181 1.991 0 2.904.445 2.914.45.488.242 1.09.055 1.341-.429.252-.485.076-1.078-.405-1.338zm-19.304 9.338c0 3.123-1.941 4.545-3.745 4.545-1.641 0-4.245-1.221-4.245-4.495 0-2.363 1.814-4.376 4.148-5.731 2.112 1.486 3.842 3.527 3.842 5.681zm13.641.05c0 3.274-2.604 4.495-4.244 4.495-1.804 0-3.745-1.422-3.745-4.545 0-2.154 1.729-4.196 3.841-5.681 2.335 1.355 4.148 3.368 4.148 5.731z"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1138,4 +1138,37 @@
26f8;ice_skate
26f9;bouncing_ball_person
26fa;tent
26fd;fuelpump
26fd;fuelpump
2702;scissors
2705;white_check_mark
2708;airplane
2709;envelope
270a;fist
270b;hand
270c;v
270d;writing_hand
270f;pencil2
2712;black_nib
2714;heavy_check_mark
2716;heavy_multiplication_x
271d;latin_cross
2721;star_of_david
2728;sparkles
2733;eight_spoked_asterisk
2734;eight_pointed_black_star
2744;snowflake
2747;sparkle
274c;x
274e;negative_squared_cross_mark
2753;question
2754;grey_question
2755;grey_exclamation
2757;exclamation
2763;heavy_heart_exclamation
2764;heart
2795;heavy_plus_sign
2796;heavy_minus_sign
2797;heavy_division_sign
27a1;arrow_right
27b0;curly_loop
27bf;loop

View File

@ -38,6 +38,8 @@ package net.sourceforge.plantuml.flashcode;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.util.Hashtable;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import ext.plantuml.com.google.zxing.BarcodeFormat;
import ext.plantuml.com.google.zxing.EncodeHintType;
@ -50,13 +52,10 @@ import net.sourceforge.plantuml.Log;
public class FlashCodeUtilsZxing implements FlashCodeUtils {
private static final boolean USE_FLASH = true;
private static final Lock lock = new ReentrantLock();
public BufferedImage exportFlashcode(String s, Color fore, Color back) {
if (USE_FLASH == false) {
return null;
}
synchronized (FlashCodeUtilsZxing.class) {
if (lock.tryLock())
try {
final QRCodeWriter writer = new QRCodeWriter();
final Hashtable hints = new Hashtable();
@ -67,10 +66,11 @@ public class FlashCodeUtilsZxing implements FlashCodeUtils {
return MatrixToImageWriter.toBufferedImage(bit, fore.getRGB() | 0xFF000000, back.getRGB() | 0xFF000000);
} catch (WriterException e) {
Log.debug("Cannot create qrcode " + e);
// e.printStackTrace();
return null;
} finally {
lock.unlock();
}
}
return null;
}
}

View File

@ -1,863 +0,0 @@
/*
ASCIIMathTeXImg.js
Based on ASCIIMathML, Version 1.4.7 Aug 30, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen
Modified with TeX conversion for IMG rendering Sept 6, 2006 (c) David Lippman http://www.pierce.ctc.edu/dlippman
Updated to match ver 2.2 Mar 3, 2014
Latest at https://github.com/mathjax/asciimathml
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
//var AMTcgiloc = ''; //set to the URL of your LaTex renderer
var noMathRender = false;
var config = {
translateOnLoad: true, //true to autotranslate
mathcolor: "", // defaults to back, or specify any other color
displaystyle: true, // puts limits above and below large operators
showasciiformulaonhover: true, // helps students learn ASCIIMath
decimalsign: ".", // change to "," if you like, beware of `(1,2)`!
AMdelimiter1: "`", AMescape1: "\\\\`", // can use other characters
AMusedelimiter2: false, //whether to use second delimiter below
AMdelimiter2: "$", AMescape2: "\\\\\\$", AMdelimiter2regexp: "\\$",
AMdocumentId: "wikitext", // PmWiki element containing math (default=body)
doubleblankmathdelimiter: false // if true, x+1 is equal to `x+1`
}; // for IE this works only in <!-- -->
var CONST = 0, UNARY = 1, BINARY = 2, INFIX = 3, LEFTBRACKET = 4,
RIGHTBRACKET = 5, SPACE = 6, UNDEROVER = 7, DEFINITION = 8,
LEFTRIGHT = 9, TEXT = 10; // token types
var AMsqrt = {input:"sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY},
AMroot = {input:"root", tag:"mroot", output:"root", tex:null, ttype:BINARY},
AMfrac = {input:"frac", tag:"mfrac", output:"/", tex:null, ttype:BINARY},
AMdiv = {input:"/", tag:"mfrac", output:"/", tex:null, ttype:INFIX},
AMover = {input:"stackrel", tag:"mover", output:"stackrel", tex:null, ttype:BINARY},
AMsub = {input:"_", tag:"msub", output:"_", tex:null, ttype:INFIX},
AMsup = {input:"^", tag:"msup", output:"^", tex:null, ttype:INFIX},
AMtext = {input:"text", tag:"mtext", output:"text", tex:null, ttype:TEXT},
AMmbox = {input:"mbox", tag:"mtext", output:"mbox", tex:null, ttype:TEXT},
AMquote = {input:"\"", tag:"mtext", output:"mbox", tex:null, ttype:TEXT};
var AMsymbols = [
//some greek symbols
{input:"alpha", tag:"mi", output:"\u03B1", tex:null, ttype:CONST},
{input:"beta", tag:"mi", output:"\u03B2", tex:null, ttype:CONST},
{input:"chi", tag:"mi", output:"\u03C7", tex:null, ttype:CONST},
{input:"delta", tag:"mi", output:"\u03B4", tex:null, ttype:CONST},
{input:"Delta", tag:"mo", output:"\u0394", tex:null, ttype:CONST},
{input:"epsi", tag:"mi", output:"\u03B5", tex:"epsilon", ttype:CONST},
{input:"varepsilon", tag:"mi", output:"\u025B", tex:null, ttype:CONST},
{input:"eta", tag:"mi", output:"\u03B7", tex:null, ttype:CONST},
{input:"gamma", tag:"mi", output:"\u03B3", tex:null, ttype:CONST},
{input:"Gamma", tag:"mo", output:"\u0393", tex:null, ttype:CONST},
{input:"iota", tag:"mi", output:"\u03B9", tex:null, ttype:CONST},
{input:"kappa", tag:"mi", output:"\u03BA", tex:null, ttype:CONST},
{input:"lambda", tag:"mi", output:"\u03BB", tex:null, ttype:CONST},
{input:"Lambda", tag:"mo", output:"\u039B", tex:null, ttype:CONST},
{input:"lamda", tag:"mi", output:"lambda", tex:null, ttype:DEFINITION},
{input:"Lamda", tag:"mi", output:"Lambda", tex:null, ttype:DEFINITION},
{input:"mu", tag:"mi", output:"\u03BC", tex:null, ttype:CONST},
{input:"nu", tag:"mi", output:"\u03BD", tex:null, ttype:CONST},
{input:"omega", tag:"mi", output:"\u03C9", tex:null, ttype:CONST},
{input:"Omega", tag:"mo", output:"\u03A9", tex:null, ttype:CONST},
{input:"phi", tag:"mi", output:"\u03C6", tex:null, ttype:CONST},
{input:"varphi", tag:"mi", output:"\u03D5", tex:null, ttype:CONST},
{input:"Phi", tag:"mo", output:"\u03A6", tex:null, ttype:CONST},
{input:"pi", tag:"mi", output:"\u03C0", tex:null, ttype:CONST},
{input:"Pi", tag:"mo", output:"\u03A0", tex:null, ttype:CONST},
{input:"psi", tag:"mi", output:"\u03C8", tex:null, ttype:CONST},
{input:"Psi", tag:"mi", output:"\u03A8", tex:null, ttype:CONST},
{input:"rho", tag:"mi", output:"\u03C1", tex:null, ttype:CONST},
{input:"sigma", tag:"mi", output:"\u03C3", tex:null, ttype:CONST},
{input:"Sigma", tag:"mo", output:"\u03A3", tex:null, ttype:CONST},
{input:"tau", tag:"mi", output:"\u03C4", tex:null, ttype:CONST},
{input:"theta", tag:"mi", output:"\u03B8", tex:null, ttype:CONST},
{input:"vartheta", tag:"mi", output:"\u03D1", tex:null, ttype:CONST},
{input:"Theta", tag:"mo", output:"\u0398", tex:null, ttype:CONST},
{input:"upsilon", tag:"mi", output:"\u03C5", tex:null, ttype:CONST},
{input:"xi", tag:"mi", output:"\u03BE", tex:null, ttype:CONST},
{input:"Xi", tag:"mo", output:"\u039E", tex:null, ttype:CONST},
{input:"zeta", tag:"mi", output:"\u03B6", tex:null, ttype:CONST},
//binary operation symbols
{input:"*", tag:"mo", output:"\u22C5", tex:"cdot", ttype:CONST},
{input:"**", tag:"mo", output:"\u2217", tex:"ast", ttype:CONST},
{input:"***", tag:"mo", output:"\u22C6", tex:"star", ttype:CONST},
{input:"//", tag:"mo", output:"/", tex:"/", ttype:CONST, val:true, notexcopy:true},
{input:"\\\\", tag:"mo", output:"\\", tex:"backslash", ttype:CONST},
{input:"setminus", tag:"mo", output:"\\", tex:null, ttype:CONST},
{input:"xx", tag:"mo", output:"\u00D7", tex:"times", ttype:CONST},
{input:"|><", tag:"mo", output:"\u22C9", tex:"ltimes", ttype:CONST},
{input:"><|", tag:"mo", output:"\u22CA", tex:"rtimes", ttype:CONST},
{input:"|><|", tag:"mo", output:"\u22C8", tex:"bowtie", ttype:CONST},
{input:"-:", tag:"mo", output:"\u00F7", tex:"div", ttype:CONST},
{input:"divide", tag:"mo", output:"-:", tex:null, ttype:DEFINITION},
{input:"@", tag:"mo", output:"\u2218", tex:"circ", ttype:CONST},
{input:"o+", tag:"mo", output:"\u2295", tex:"oplus", ttype:CONST},
{input:"ox", tag:"mo", output:"\u2297", tex:"otimes", ttype:CONST},
{input:"o.", tag:"mo", output:"\u2299", tex:"odot", ttype:CONST},
{input:"sum", tag:"mo", output:"\u2211", tex:null, ttype:UNDEROVER},
{input:"prod", tag:"mo", output:"\u220F", tex:null, ttype:UNDEROVER},
{input:"^^", tag:"mo", output:"\u2227", tex:"wedge", ttype:CONST},
{input:"^^^", tag:"mo", output:"\u22C0", tex:"bigwedge", ttype:UNDEROVER},
{input:"vv", tag:"mo", output:"\u2228", tex:"vee", ttype:CONST},
{input:"vvv", tag:"mo", output:"\u22C1", tex:"bigvee", ttype:UNDEROVER},
{input:"nn", tag:"mo", output:"\u2229", tex:"cap", ttype:CONST},
{input:"nnn", tag:"mo", output:"\u22C2", tex:"bigcap", ttype:UNDEROVER},
{input:"uu", tag:"mo", output:"\u222A", tex:"cup", ttype:CONST},
{input:"uuu", tag:"mo", output:"\u22C3", tex:"bigcup", ttype:UNDEROVER},
{input:"overset", tag:"mover", output:"stackrel", tex:null, ttype:BINARY},
{input:"underset", tag:"munder", output:"stackrel", tex:null, ttype:BINARY},
//binary relation symbols
{input:"!=", tag:"mo", output:"\u2260", tex:"ne", ttype:CONST},
{input:":=", tag:"mo", output:":=", tex:null, ttype:CONST},
{input:"lt", tag:"mo", output:"<", tex:null, ttype:CONST},
{input:"gt", tag:"mo", output:">", tex:null, ttype:CONST},
{input:"<=", tag:"mo", output:"\u2264", tex:"le", ttype:CONST},
{input:"lt=", tag:"mo", output:"\u2264", tex:"leq", ttype:CONST},
{input:"gt=", tag:"mo", output:"\u2265", tex:"geq", ttype:CONST},
{input:">=", tag:"mo", output:"\u2265", tex:"ge", ttype:CONST},
{input:"-<", tag:"mo", output:"\u227A", tex:"prec", ttype:CONST},
{input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST},
{input:">-", tag:"mo", output:"\u227B", tex:"succ", ttype:CONST},
{input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST},
{input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST},
{input:"in", tag:"mo", output:"\u2208", tex:null, ttype:CONST},
{input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST},
{input:"sub", tag:"mo", output:"\u2282", tex:"subset", ttype:CONST},
{input:"sup", tag:"mo", output:"\u2283", tex:"supset", ttype:CONST},
{input:"sube", tag:"mo", output:"\u2286", tex:"subseteq", ttype:CONST},
{input:"supe", tag:"mo", output:"\u2287", tex:"supseteq", ttype:CONST},
{input:"-=", tag:"mo", output:"\u2261", tex:"equiv", ttype:CONST},
{input:"~=", tag:"mo", output:"\u2245", tex:"stackrel{\\sim}{=}", ttype:CONST}, //back hack b/c mimetex doesn't support /cong
{input:"cong", tag:"mo", output:"~=", tex:null, ttype:DEFINITION},
{input:"~~", tag:"mo", output:"\u2248", tex:"approx", ttype:CONST},
{input:"prop", tag:"mo", output:"\u221D", tex:"propto", ttype:CONST},
//logical symbols
{input:"and", tag:"mtext", output:"and", tex:null, ttype:SPACE},
{input:"or", tag:"mtext", output:"or", tex:null, ttype:SPACE},
{input:"not", tag:"mo", output:"\u00AC", tex:"neg", ttype:CONST},
{input:"=>", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST},
{input:"implies", tag:"mo", output:"=>", tex:null, ttype:DEFINITION},
{input:"if", tag:"mo", output:"if", tex:null, ttype:SPACE},
{input:"<=>", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST},
{input:"iff", tag:"mo", output:"<=>", tex:null, ttype:DEFINITION},
{input:"AA", tag:"mo", output:"\u2200", tex:"forall", ttype:CONST},
{input:"EE", tag:"mo", output:"\u2203", tex:"exists", ttype:CONST},
{input:"_|_", tag:"mo", output:"\u22A5", tex:"bot", ttype:CONST},
{input:"TT", tag:"mo", output:"\u22A4", tex:"top", ttype:CONST},
{input:"|--", tag:"mo", output:"\u22A2", tex:"vdash", ttype:CONST},
{input:"|==", tag:"mo", output:"\u22A8", tex:"models", ttype:CONST}, //mimetex doesn't support
//grouping brackets
{input:"(", tag:"mo", output:"(", tex:null, ttype:LEFTBRACKET, val:true},
{input:")", tag:"mo", output:")", tex:null, ttype:RIGHTBRACKET, val:true},
{input:"[", tag:"mo", output:"[", tex:null, ttype:LEFTBRACKET, val:true},
{input:"]", tag:"mo", output:"]", tex:null, ttype:RIGHTBRACKET, val:true},
{input:"{", tag:"mo", output:"{", tex:"lbrace", ttype:LEFTBRACKET},
{input:"}", tag:"mo", output:"}", tex:"rbrace", ttype:RIGHTBRACKET},
{input:"|", tag:"mo", output:"|", tex:null, ttype:LEFTRIGHT, val:true},
//{input:"||", tag:"mo", output:"||", tex:null, ttype:LEFTRIGHT},
{input:"(:", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET},
{input:":)", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET},
{input:"<<", tag:"mo", output:"\u2329", tex:"langle", ttype:LEFTBRACKET},
{input:">>", tag:"mo", output:"\u232A", tex:"rangle", ttype:RIGHTBRACKET},
{input:"{:", tag:"mo", output:"{:", tex:null, ttype:LEFTBRACKET, invisible:true},
{input:":}", tag:"mo", output:":}", tex:null, ttype:RIGHTBRACKET, invisible:true},
//miscellaneous symbols
{input:"int", tag:"mo", output:"\u222B", tex:null, ttype:CONST},
{input:"dx", tag:"mi", output:"{:d x:}", tex:null, ttype:DEFINITION},
{input:"dy", tag:"mi", output:"{:d y:}", tex:null, ttype:DEFINITION},
{input:"dz", tag:"mi", output:"{:d z:}", tex:null, ttype:DEFINITION},
{input:"dt", tag:"mi", output:"{:d t:}", tex:null, ttype:DEFINITION},
{input:"oint", tag:"mo", output:"\u222E", tex:null, ttype:CONST},
{input:"del", tag:"mo", output:"\u2202", tex:"partial", ttype:CONST},
{input:"grad", tag:"mo", output:"\u2207", tex:"nabla", ttype:CONST},
{input:"+-", tag:"mo", output:"\u00B1", tex:"pm", ttype:CONST},
{input:"O/", tag:"mo", output:"\u2205", tex:"emptyset", ttype:CONST},
{input:"oo", tag:"mo", output:"\u221E", tex:"infty", ttype:CONST},
{input:"aleph", tag:"mo", output:"\u2135", tex:null, ttype:CONST},
{input:"...", tag:"mo", output:"...", tex:"ldots", ttype:CONST},
{input:":.", tag:"mo", output:"\u2234", tex:"therefore", ttype:CONST},
{input:":'", tag:"mo", output:"\u2235", tex:"because", ttype:CONST},
{input:"/_", tag:"mo", output:"\u2220", tex:"angle", ttype:CONST},
{input:"/_\\", tag:"mo", output:"\u25B3", tex:"triangle", ttype:CONST},
{input:"\\ ", tag:"mo", output:"\u00A0", tex:null, ttype:CONST, val:true},
{input:"frown", tag:"mo", output:"\u2322", tex:null, ttype:CONST},
{input:"%", tag:"mo", output:"%", tex:"%", ttype:CONST, notexcopy:true},
{input:"quad", tag:"mo", output:"\u00A0\u00A0", tex:null, ttype:CONST},
{input:"qquad", tag:"mo", output:"\u00A0\u00A0\u00A0\u00A0", tex:null, ttype:CONST},
{input:"cdots", tag:"mo", output:"\u22EF", tex:null, ttype:CONST},
{input:"vdots", tag:"mo", output:"\u22EE", tex:null, ttype:CONST},
{input:"ddots", tag:"mo", output:"\u22F1", tex:null, ttype:CONST},
{input:"diamond", tag:"mo", output:"\u22C4", tex:null, ttype:CONST},
{input:"square", tag:"mo", output:"\u25A1", tex:"boxempty", ttype:CONST},
{input:"|__", tag:"mo", output:"\u230A", tex:"lfloor", ttype:CONST},
{input:"__|", tag:"mo", output:"\u230B", tex:"rfloor", ttype:CONST},
{input:"|~", tag:"mo", output:"\u2308", tex:"lceil", ttype:CONST},
{input:"lceiling", tag:"mo", output:"|~", tex:null, ttype:DEFINITION},
{input:"~|", tag:"mo", output:"\u2309", tex:"rceil", ttype:CONST},
{input:"rceiling", tag:"mo", output:"~|", tex:null, ttype:DEFINITION},
{input:"CC", tag:"mo", output:"\u2102", tex:"mathbb{C}", ttype:CONST, notexcopy:true},
{input:"NN", tag:"mo", output:"\u2115", tex:"mathbb{N}", ttype:CONST, notexcopy:true},
{input:"QQ", tag:"mo", output:"\u211A", tex:"mathbb{Q}", ttype:CONST, notexcopy:true},
{input:"RR", tag:"mo", output:"\u211D", tex:"mathbb{R}", ttype:CONST, notexcopy:true},
{input:"ZZ", tag:"mo", output:"\u2124", tex:"mathbb{Z}", ttype:CONST, notexcopy:true},
{input:"f", tag:"mi", output:"f", tex:null, ttype:UNARY, func:true, val:true},
{input:"g", tag:"mi", output:"g", tex:null, ttype:UNARY, func:true, val:true},
{input:"''", tag:"mo", output:"''", tex:null, val:true},
{input:"'''", tag:"mo", output:"'''", tex:null, val:true},
{input:"''''", tag:"mo", output:"''''", tex:null, val:true},
//standard functions
{input:"lim", tag:"mo", output:"lim", tex:null, ttype:UNDEROVER},
{input:"Lim", tag:"mo", output:"Lim", tex:null, ttype:UNDEROVER},
{input:"sin", tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true},
{input:"cos", tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true},
{input:"tan", tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true},
{input:"arcsin", tag:"mo", output:"arcsin", tex:null, ttype:UNARY, func:true},
{input:"arccos", tag:"mo", output:"arccos", tex:null, ttype:UNARY, func:true},
{input:"arctan", tag:"mo", output:"arctan", tex:null, ttype:UNARY, func:true},
{input:"sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true},
{input:"cosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true},
{input:"tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true},
{input:"cot", tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true},
{input:"coth", tag:"mo", output:"coth", tex:null, ttype:UNARY, func:true},
{input:"sech", tag:"mo", output:"sech", tex:null, ttype:UNARY, func:true},
{input:"csch", tag:"mo", output:"csch", tex:null, ttype:UNARY, func:true},
{input:"sec", tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true},
{input:"csc", tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true},
{input:"log", tag:"mo", output:"log", tex:null, ttype:UNARY, func:true},
{input:"ln", tag:"mo", output:"ln", tex:null, ttype:UNARY, func:true},
{input:"abs", tag:"mo", output:"abs", tex:null, ttype:UNARY, notexcopy:true, rewriteleftright:["|","|"]},
{input:"norm", tag:"mo", output:"norm", tex:null, ttype:UNARY, notexcopy:true, rewriteleftright:["\\|","\\|"]},
{input:"floor", tag:"mo", output:"floor", tex:null, ttype:UNARY, notexcopy:true, rewriteleftright:["\\lfloor","\\rfloor"]},
{input:"ceil", tag:"mo", output:"ceil", tex:null, ttype:UNARY, notexcopy:true, rewriteleftright:["\\lceil","\\rceil"]},
{input:"Sin", tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true},
{input:"Cos", tag:"mo", output:"cos", tex:null, ttype:UNARY, func:true},
{input:"Tan", tag:"mo", output:"tan", tex:null, ttype:UNARY, func:true},
{input:"Arcsin", tag:"mo", output:"arcsin", tex:null, ttype:UNARY, func:true},
{input:"Arccos", tag:"mo", output:"arccos", tex:null, ttype:UNARY, func:true},
{input:"Arctan", tag:"mo", output:"arctan", tex:null, ttype:UNARY, func:true},
{input:"Sinh", tag:"mo", output:"sinh", tex:null, ttype:UNARY, func:true},
{input:"Sosh", tag:"mo", output:"cosh", tex:null, ttype:UNARY, func:true},
{input:"Tanh", tag:"mo", output:"tanh", tex:null, ttype:UNARY, func:true},
{input:"Cot", tag:"mo", output:"cot", tex:null, ttype:UNARY, func:true},
{input:"Sec", tag:"mo", output:"sec", tex:null, ttype:UNARY, func:true},
{input:"Csc", tag:"mo", output:"csc", tex:null, ttype:UNARY, func:true},
{input:"Log", tag:"mo", output:"log", tex:null, ttype:UNARY, func:true},
{input:"Ln", tag:"mo", output:"ln", tex:null, ttype:UNARY, func:true},
{input:"Abs", tag:"mo", output:"abs", tex:null, ttype:UNARY, notexcopy:true, rewriteleftright:["|","|"]},
{input:"det", tag:"mo", output:"det", tex:null, ttype:UNARY, func:true},
{input:"exp", tag:"mo", output:"exp", tex:null, ttype:UNARY, func:true},
{input:"dim", tag:"mo", output:"dim", tex:null, ttype:CONST},
{input:"mod", tag:"mo", output:"mod", tex:"text{mod}", ttype:CONST, notexcopy:true},
{input:"gcd", tag:"mo", output:"gcd", tex:null, ttype:UNARY, func:true},
{input:"lcm", tag:"mo", output:"lcm", tex:"text{lcm}", ttype:UNARY, func:true, notexcopy:true},
{input:"lub", tag:"mo", output:"lub", tex:null, ttype:CONST},
{input:"glb", tag:"mo", output:"glb", tex:null, ttype:CONST},
{input:"min", tag:"mo", output:"min", tex:null, ttype:UNDEROVER},
{input:"max", tag:"mo", output:"max", tex:null, ttype:UNDEROVER},
//arrows
{input:"uarr", tag:"mo", output:"\u2191", tex:"uparrow", ttype:CONST},
{input:"darr", tag:"mo", output:"\u2193", tex:"downarrow", ttype:CONST},
{input:"rarr", tag:"mo", output:"\u2192", tex:"rightarrow", ttype:CONST},
{input:"->", tag:"mo", output:"\u2192", tex:"to", ttype:CONST},
{input:">->", tag:"mo", output:"\u21A3", tex:"rightarrowtail", ttype:CONST},
{input:"->>", tag:"mo", output:"\u21A0", tex:"twoheadrightarrow", ttype:CONST},
{input:">->>", tag:"mo", output:"\u2916", tex:"twoheadrightarrowtail", ttype:CONST},
{input:"|->", tag:"mo", output:"\u21A6", tex:"mapsto", ttype:CONST},
{input:"larr", tag:"mo", output:"\u2190", tex:"leftarrow", ttype:CONST},
{input:"harr", tag:"mo", output:"\u2194", tex:"leftrightarrow", ttype:CONST},
{input:"rArr", tag:"mo", output:"\u21D2", tex:"Rightarrow", ttype:CONST},
{input:"lArr", tag:"mo", output:"\u21D0", tex:"Leftarrow", ttype:CONST},
{input:"hArr", tag:"mo", output:"\u21D4", tex:"Leftrightarrow", ttype:CONST},
//commands with argument
AMsqrt, AMroot, AMfrac, AMdiv, AMover, AMsub, AMsup,
{input:"cancel", tag:"menclose", output:"cancel", tex:null, ttype:UNARY},
{input:"Sqrt", tag:"msqrt", output:"sqrt", tex:null, ttype:UNARY},
{input:"hat", tag:"mover", output:"\u005E", tex:null, ttype:UNARY, acc:true},
{input:"bar", tag:"mover", output:"\u00AF", tex:"overline", ttype:UNARY, acc:true},
{input:"vec", tag:"mover", output:"\u2192", tex:null, ttype:UNARY, acc:true},
{input:"tilde", tag:"mover", output:"~", tex:null, ttype:UNARY, acc:true},
{input:"dot", tag:"mover", output:".", tex:null, ttype:UNARY, acc:true},
{input:"ddot", tag:"mover", output:"..", tex:null, ttype:UNARY, acc:true},
{input:"ul", tag:"munder", output:"\u0332", tex:"underline", ttype:UNARY, acc:true},
{input:"ubrace", tag:"munder", output:"\u23DF", tex:"underbrace", ttype:UNARY, acc:true},
{input:"obrace", tag:"mover", output:"\u23DE", tex:"overbrace", ttype:UNARY, acc:true},
AMtext, AMmbox, AMquote,
//{input:"var", tag:"mstyle", atname:"fontstyle", atval:"italic", output:"var", tex:null, ttype:UNARY},
{input:"color", tag:"mstyle", ttype:BINARY},
{input:"bb", tag:"mstyle", atname:"mathvariant", atval:"bold", output:"bb", tex:"mathbf", ttype:UNARY, notexcopy:true},
{input:"mathbf", tag:"mstyle", atname:"mathvariant", atval:"bold", output:"mathbf", tex:null, ttype:UNARY},
{input:"sf", tag:"mstyle", atname:"mathvariant", atval:"sans-serif", output:"sf", tex:"mathsf", ttype:UNARY, notexcopy:true},
{input:"mathsf", tag:"mstyle", atname:"mathvariant", atval:"sans-serif", output:"mathsf", tex:null, ttype:UNARY},
{input:"bbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"bbb", tex:"mathbb", ttype:UNARY, notexcopy:true},
{input:"mathbb", tag:"mstyle", atname:"mathvariant", atval:"double-struck", output:"mathbb", tex:null, ttype:UNARY},
{input:"cc", tag:"mstyle", atname:"mathvariant", atval:"script", output:"cc", tex:"mathcal", ttype:UNARY, notexcopy:true},
{input:"mathcal", tag:"mstyle", atname:"mathvariant", atval:"script", output:"mathcal", tex:null, ttype:UNARY},
{input:"tt", tag:"mstyle", atname:"mathvariant", atval:"monospace", output:"tt", tex:"mathtt", ttype:UNARY, notexcopy:true},
{input:"mathtt", tag:"mstyle", atname:"mathvariant", atval:"monospace", output:"mathtt", tex:null, ttype:UNARY},
{input:"fr", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"fr", tex:"mathfrak", ttype:UNARY, notexcopy:true},
{input:"mathfrak", tag:"mstyle", atname:"mathvariant", atval:"fraktur", output:"mathfrak", tex:null, ttype:UNARY}
];
function compareNames(s1,s2) {
if (s1.input > s2.input) return 1
else return -1;
}
var AMnames = []; //list of input symbols
function AMinitSymbols() {
var i;
var symlen = AMsymbols.length;
for (i=0; i<symlen; i++) {
if (AMsymbols[i].tex && !(typeof AMsymbols[i].notexcopy == "boolean" && AMsymbols[i].notexcopy)) {
AMsymbols.push({input:AMsymbols[i].tex,
tag:AMsymbols[i].tag, output:AMsymbols[i].output, ttype:AMsymbols[i].ttype,
acc:(AMsymbols[i].acc||false)});
}
}
refreshSymbols();
}
function refreshSymbols(){
var i;
AMsymbols.sort(compareNames);
for (i=0; i<AMsymbols.length; i++) AMnames[i] = AMsymbols[i].input;
}
function newcommand(oldstr,newstr) {
AMsymbols.push({input:oldstr, tag:"mo", output:newstr, tex:null, ttype:DEFINITION});
refreshSymbols();
}
function newsymbol(symbolobj) {
AMsymbols.push(symbolobj);
refreshSymbols();
}
function AMremoveCharsAndBlanks(str,n) {
//remove n characters and any following blanks
var st;
if (str.charAt(n)=="\\" && str.charAt(n+1)!="\\" && str.charAt(n+1)!=" ")
st = str.slice(n+1);
else st = str.slice(n);
for (var i=0; i<st.length && st.charCodeAt(i)<=32; i=i+1);
return st.slice(i);
}
function AMposition(arr, str, n) {
// return position >=n where str appears or would be inserted
// assumes arr is sorted
if (n==0) {
var h,m;
n = -1;
h = arr.length;
while (n+1<h) {
m = (n+h) >> 1;
if (arr[m]<str) n = m; else h = m;
}
return h;
} else
for (var i=n; i<arr.length && arr[i]<str; i++);
return i; // i=arr.length || arr[i]>=str
}
function AMgetSymbol(str) {
//return maximal initial substring of str that appears in names
//return null if there is none
var k = 0; //new pos
var j = 0; //old pos
var mk; //match pos
var st;
var tagst;
var match = "";
var more = true;
for (var i=1; i<=str.length && more; i++) {
st = str.slice(0,i); //initial substring of length i
j = k;
k = AMposition(AMnames, st, j);
if (k<AMnames.length && str.slice(0,AMnames[k].length)==AMnames[k]){
match = AMnames[k];
mk = k;
i = match.length;
}
more = k<AMnames.length && str.slice(0,AMnames[k].length)>=AMnames[k];
}
AMpreviousSymbol=AMcurrentSymbol;
if (match!=""){
AMcurrentSymbol=AMsymbols[mk].ttype;
return AMsymbols[mk];
}
// if str[0] is a digit or - return maxsubstring of digits.digits
AMcurrentSymbol=CONST;
k = 1;
st = str.slice(0,1);
var integ = true;
while ("0"<=st && st<="9" && k<=str.length) {
st = str.slice(k,k+1);
k++;
}
if (st == config.decimalsign) {
st = str.slice(k,k+1);
if ("0"<=st && st<="9") {
integ = false;
k++;
while ("0"<=st && st<="9" && k<=str.length) {
st = str.slice(k,k+1);
k++;
}
}
}
if ((integ && k>1) || k>2) {
st = str.slice(0,k-1);
tagst = "mn";
} else {
k = 2;
st = str.slice(0,1); //take 1 character
tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi");
}
if (st=="-" && AMpreviousSymbol==INFIX) {
AMcurrentSymbol = INFIX;
return {input:st, tag:tagst, output:st, ttype:UNARY, func:true, val:true};
}
return {input:st, tag:tagst, output:st, ttype:CONST, val:true}; //added val bit
}
function AMTremoveBrackets(node) {
var st;
if (node.charAt(0)=='{' && node.charAt(node.length-1)=='}') {
var leftchop = 0;
st = node.substr(1,5);
if (st=='\\left') {
st = node.charAt(6);
if (st=="(" || st=="[" || st=="{") {
leftchop = 7;
} else {
st = node.substr(6,7);
if (st=='\\lbrace') {
leftchop = 13;
}
}
} else {
st = node.charAt(1);
if (st=="(" || st=="[") {
leftchop = 2;
}
}
if (leftchop>0) {
//st = node.charAt(node.length-7);
st = node.substr(node.length-8);
if (st=="\\right)}" || st=="\\right]}" || st=='\\right.}') {
node = '{'+node.substr(leftchop);
node = node.substr(0,node.length-8)+'}';
} else if (st=='\\rbrace}') {
node = '{'+node.substr(leftchop);
node = node.substr(0,node.length-14)+'}';
}
}
}
return node;
}
/*Parsing ASCII math expressions with the following grammar
v ::= [A-Za-z] | greek letters | numbers | other constant symbols
u ::= sqrt | text | bb | other unary symbols for font commands
b ::= frac | root | stackrel binary symbols
l ::= ( | [ | { | (: | {: left brackets
r ::= ) | ] | } | :) | :} right brackets
S ::= v | lEr | uS | bSS Simple expression
I ::= S_S | S^S | S_S^S | S Intermediate expression
E ::= IE | I/I Expression
Each terminal symbol is translated into a corresponding mathml node.*/
var AMnestingDepth,AMpreviousSymbol,AMcurrentSymbol;
function AMTgetTeXsymbol(symb) {
if (typeof symb.val == "boolean" && symb.val) {
pre = '';
} else {
pre = '\\';
}
if (symb.tex==null) {
//can't remember why this was here. Breaks /delta /Delta to removed
//return (pre+(pre==''?symb.input:symb.input.toLowerCase()));
return (pre+symb.input);
} else {
return (pre+symb.tex);
}
}
function AMTparseSexpr(str) { //parses str and returns [node,tailstr]
var symbol, node, result, i, st,// rightvert = false,
newFrag = '';
str = AMremoveCharsAndBlanks(str,0);
symbol = AMgetSymbol(str); //either a token or a bracket or empty
if (symbol == null || symbol.ttype == RIGHTBRACKET && AMnestingDepth > 0) {
return [null,str];
}
if (symbol.ttype == DEFINITION) {
str = symbol.output+AMremoveCharsAndBlanks(str,symbol.input.length);
symbol = AMgetSymbol(str);
}
switch (symbol.ttype) {
case UNDEROVER:
case CONST:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
var texsymbol = AMTgetTeXsymbol(symbol);
if (texsymbol.charAt(0)=="\\" || symbol.tag=="mo") return [texsymbol,str];
else return ['{'+texsymbol+'}',str];
case LEFTBRACKET: //read (expr+)
AMnestingDepth++;
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMTparseExpr(str,true);
AMnestingDepth--;
var leftchop = 0;
if (result[0].substr(0,6)=="\\right") {
st = result[0].charAt(6);
if (st==")" || st=="]" || st=="}") {
leftchop = 6;
} else if (st==".") {
leftchop = 7;
} else {
st = result[0].substr(6,7);
if (st=='\\rbrace') {
leftchop = 13;
}
}
}
if (leftchop>0) {
result[0] = result[0].substr(leftchop);
if (typeof symbol.invisible == "boolean" && symbol.invisible)
node = '{'+result[0]+'}';
else {
node = '{'+AMTgetTeXsymbol(symbol) + result[0]+'}';
}
} else {
if (typeof symbol.invisible == "boolean" && symbol.invisible)
node = '{\\left.'+result[0]+'}';
else {
node = '{\\left'+AMTgetTeXsymbol(symbol) + result[0]+'}';
}
}
return [node,result[1]];
case TEXT:
if (symbol!=AMquote) str = AMremoveCharsAndBlanks(str,symbol.input.length);
if (str.charAt(0)=="{") i=str.indexOf("}");
else if (str.charAt(0)=="(") i=str.indexOf(")");
else if (str.charAt(0)=="[") i=str.indexOf("]");
else if (symbol==AMquote) i=str.slice(1).indexOf("\"")+1;
else i = 0;
if (i==-1) i = str.length;
st = str.slice(1,i);
if (st.charAt(0) == " ") {
newFrag = '\\ ';
}
newFrag += '\\text{'+st+'}';
if (st.charAt(st.length-1) == " ") {
newFrag += '\\ ';
}
str = AMremoveCharsAndBlanks(str,i+1);
return [newFrag,str];
case UNARY:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMTparseSexpr(str);
if (result[0]==null) return ['{'+AMTgetTeXsymbol(symbol)+'}',str];
if (typeof symbol.func == "boolean" && symbol.func) { // functions hack
st = str.charAt(0);
if (st=="^" || st=="_" || st=="/" || st=="|" || st=="," || (symbol.input.length==1 && symbol.input.match(/\w/) && st!="(")) {
return ['{'+AMTgetTeXsymbol(symbol)+'}',str];
} else {
node = '{'+AMTgetTeXsymbol(symbol)+'{'+result[0]+'}}';
return [node,result[1]];
}
}
result[0] = AMTremoveBrackets(result[0]);
if (symbol.input == "sqrt") { // sqrt
return ['\\sqrt{'+result[0]+'}',result[1]];
} else if (symbol.input == "cancel") { // cancel
return ['\\cancel{'+result[0]+'}',result[1]];
} else if (typeof symbol.rewriteleftright != "undefined") { // abs, floor, ceil
return ['{\\left'+symbol.rewriteleftright[0]+result[0]+'\\right'+symbol.rewriteleftright[1]+'}',result[1]];
} else if (typeof symbol.acc == "boolean" && symbol.acc) { // accent
//return ['{'+AMTgetTeXsymbol(symbol)+'{'+result[0]+'}}',result[1]];
return [AMTgetTeXsymbol(symbol)+'{'+result[0]+'}',result[1]];
} else { // font change command
return ['{'+AMTgetTeXsymbol(symbol)+'{'+result[0]+'}}',result[1]];
}
case BINARY:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMTparseSexpr(str);
if (result[0]==null) return ['{'+AMTgetTeXsymbol(symbol)+'}',str];
result[0] = AMTremoveBrackets(result[0]);
var result2 = AMTparseSexpr(result[1]);
if (result2[0]==null) return ['{'+AMTgetTeXsymbol(symbol)+'}',str];
result2[0] = AMTremoveBrackets(result2[0]);
if (symbol.input=="color") {
newFrag = '{\\color{'+result[0].replace(/[\{\}]/g,'')+'}'+result2[0]+'}';
} else if (symbol.input=="root") {
newFrag = '{\\sqrt['+result[0]+']{'+result2[0]+'}}';
} else {
newFrag = '{'+AMTgetTeXsymbol(symbol)+'{'+result[0]+'}{'+result2[0]+'}}';
}
return [newFrag,result2[1]];
case INFIX:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return [symbol.output,str];
case SPACE:
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return ['{\\quad\\text{'+symbol.input+'}\\quad}',str];
case LEFTRIGHT:
// if (rightvert) return [null,str]; else rightvert = true;
AMnestingDepth++;
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMTparseExpr(str,false);
AMnestingDepth--;
var st = "";
st = result[0].charAt(result[0].length -1);
//alert(result[0].lastChild+"***"+st);
if (st == "|") { // its an absolute value subterm
node = '{\\left|'+result[0]+'}';
return [node,result[1]];
} else { // the "|" is a \mid
node = '{\\mid}';
return [node,str];
}
default:
//alert("default");
str = AMremoveCharsAndBlanks(str,symbol.input.length);
return ['{'+AMTgetTeXsymbol(symbol)+'}',str];
}
}
function AMTparseIexpr(str) {
var symbol, sym1, sym2, node, result;
str = AMremoveCharsAndBlanks(str,0);
sym1 = AMgetSymbol(str);
result = AMTparseSexpr(str);
node = result[0];
str = result[1];
symbol = AMgetSymbol(str);
if (symbol.ttype == INFIX && symbol.input != "/") {
str = AMremoveCharsAndBlanks(str,symbol.input.length);
// if (symbol.input == "/") result = AMTparseIexpr(str); else
result = AMTparseSexpr(str);
if (result[0] == null) // show box in place of missing argument
result[0] = '{}';
else result[0] = AMTremoveBrackets(result[0]);
str = result[1];
// if (symbol.input == "/") AMTremoveBrackets(node);
if (symbol.input == "_") {
sym2 = AMgetSymbol(str);
if (sym2.input == "^") {
str = AMremoveCharsAndBlanks(str,sym2.input.length);
var res2 = AMTparseSexpr(str);
res2[0] = AMTremoveBrackets(res2[0]);
str = res2[1];
node = '{' + node;
node += '_{'+result[0]+'}';
node += '^{'+res2[0]+'}';
node += '}';
} else {
node += '_{'+result[0]+'}';
}
} else { //must be ^
//node = '{'+node+'}^{'+result[0]+'}';
node = node+'^{'+result[0]+'}';
}
if (typeof sym1.func != 'undefined' && sym1.func) {
sym2 = AMgetSymbol(str);
if (sym2.ttype != INFIX && sym2.ttype != RIGHTBRACKET) {
result = AMTparseIexpr(str);
node = '{'+node+result[0]+'}';
str = result[1];
}
}
}
return [node,str];
}
function AMTparseExpr(str,rightbracket) {
var symbol, node, result, i, nodeList = [],
newFrag = '';
var addedright = false;
do {
str = AMremoveCharsAndBlanks(str,0);
result = AMTparseIexpr(str);
node = result[0];
str = result[1];
symbol = AMgetSymbol(str);
if (symbol.ttype == INFIX && symbol.input == "/") {
str = AMremoveCharsAndBlanks(str,symbol.input.length);
result = AMTparseIexpr(str);
if (result[0] == null) // show box in place of missing argument
result[0] = '{}';
else result[0] = AMTremoveBrackets(result[0]);
str = result[1];
node = AMTremoveBrackets(node);
node = '\\frac' + '{'+ node + '}';
node += '{'+result[0]+'}';
newFrag += node;
symbol = AMgetSymbol(str);
} else if (node!=undefined) newFrag += node;
} while ((symbol.ttype != RIGHTBRACKET &&
(symbol.ttype != LEFTRIGHT || rightbracket)
|| AMnestingDepth == 0) && symbol!=null && symbol.output!="");
if (symbol.ttype == RIGHTBRACKET || symbol.ttype == LEFTRIGHT) {
// if (AMnestingDepth > 0) AMnestingDepth--;
var len = newFrag.length;
if (len>2 && newFrag.charAt(0)=='{' && newFrag.indexOf(',')>0) { //could be matrix (total rewrite from .js)
var right = newFrag.charAt(len - 2);
if (right==')' || right==']') {
var left = newFrag.charAt(6);
if ((left=='(' && right==')' && symbol.output != '}') || (left=='[' && right==']')) {
// Modified by Arnaud Roques
//var mxout = '\\matrix{';
var mxout = '\\begin{matrix}';
var pos = new Array(); //position of commas
pos.push(0);
var matrix = true;
var mxnestingd = 0;
var subpos = [];
subpos[0] = [0];
var lastsubposstart = 0;
var mxanynestingd = 0;
for (i=1; i<len-1; i++) {
if (newFrag.charAt(i)==left) mxnestingd++;
if (newFrag.charAt(i)==right) {
mxnestingd--;
if (mxnestingd==0 && newFrag.charAt(i+2)==',' && newFrag.charAt(i+3)=='{') {
pos.push(i+2);
lastsubposstart = i+2;
subpos[lastsubposstart] = [i+2];
}
}
if (newFrag.charAt(i)=='[' || newFrag.charAt(i)=='(' || newFrag.charAt(i)=='{') { mxanynestingd++;}
if (newFrag.charAt(i)==']' || newFrag.charAt(i)==')' || newFrag.charAt(i)=='}') { mxanynestingd--;}
if (newFrag.charAt(i)==',' && mxanynestingd==1) {
subpos[lastsubposstart].push(i);
}
if (mxanynestingd<0) { //happens at the end of the row
if (lastsubposstart == i+1) { //if at end of row, skip to next row
i++;
} else { //misformed something - abandon treating as a matrix
matrix = false;
}
}
}
pos.push(len);
var lastmxsubcnt = -1;
if (mxnestingd==0 && pos.length>0 && matrix) {
for (i=0;i<pos.length-1;i++) {
if (i>0) mxout += '\\\\';
if (i==0) {
//var subarr = newFrag.substr(pos[i]+7,pos[i+1]-pos[i]-15).split(',');
if (subpos[pos[i]].length==1) {
var subarr = [newFrag.substr(pos[i]+7,pos[i+1]-pos[i]-15)];
} else {
var subarr = [newFrag.substring(pos[i]+7,subpos[pos[i]][1])];
for (var j=2;j<subpos[pos[i]].length;j++) {
subarr.push(newFrag.substring(subpos[pos[i]][j-1]+1,subpos[pos[i]][j]));
}
subarr.push(newFrag.substring(subpos[pos[i]][subpos[pos[i]].length-1]+1,pos[i+1]-8));
}
} else {
//var subarr = newFrag.substr(pos[i]+8,pos[i+1]-pos[i]-16).split(',');
if (subpos[pos[i]].length==1) {
var subarr = [newFrag.substr(pos[i]+8,pos[i+1]-pos[i]-16)];
} else {
var subarr = [newFrag.substring(pos[i]+8,subpos[pos[i]][1])];
for (var j=2;j<subpos[pos[i]].length;j++) {
subarr.push(newFrag.substring(subpos[pos[i]][j-1]+1,subpos[pos[i]][j]));
}
subarr.push(newFrag.substring(subpos[pos[i]][subpos[pos[i]].length-1]+1,pos[i+1]-8));
}
}
if (lastmxsubcnt>0 && subarr.length!=lastmxsubcnt) {
matrix = false;
} else if (lastmxsubcnt==-1) {
lastmxsubcnt=subarr.length;
}
mxout += subarr.join('&');
}
}
// Modified by Arnaud Roques
// mxout += '}';
mxout += '\\end{matrix}';
if (matrix) { newFrag = mxout;}
}
}
}
str = AMremoveCharsAndBlanks(str,symbol.input.length);
if (typeof symbol.invisible != "boolean" || !symbol.invisible) {
node = '\\right'+AMTgetTeXsymbol(symbol); //AMcreateMmlNode("mo",document.createTextNode(symbol.output));
newFrag += node;
addedright = true;
} else {
newFrag += '\\right.';
addedright = true;
}
}
if(AMnestingDepth>0 && !addedright) {
newFrag += '\\right.'; //adjust for non-matching left brackets
//todo: adjust for non-matching right brackets
}
return [newFrag,str];
}
function AMTparseAMtoTeX(str) {
AMnestingDepth = 0;
str = str.replace(/(&nbsp;|\u00a0|&#160;)/g,"");
str = str.replace(/&gt;/g,">");
str = str.replace(/&lt;/g,"<");
if (str.match(/\S/)==null) {
return "";
}
return AMTparseExpr(str.replace(/^\s+/g,""),false)[0];
}
AMinitSymbols();
function plantuml(asciiMathInput) {
return AMTparseAMtoTeX(asciiMathInput);
}

View File

@ -1,115 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.math;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.awt.Color;
import java.awt.geom.Dimension2D;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import net.sourceforge.plantuml.BackSlash;
import net.sourceforge.plantuml.ugraphic.MutableImage;
import net.sourceforge.plantuml.ugraphic.UImageSvg;
public class AsciiMathJs implements ScientificEquation {
private static final String ASCIIMATH_PARSER_JS_LOCATION = "/net/sourceforge/plantuml/math/";
private static String JAVASCRIPT_CODE;
private final LatexBuilder builder;
private final String tex;
static {
try {
final BufferedReader br = new BufferedReader(new InputStreamReader(
AsciiMathJs.class.getResourceAsStream(ASCIIMATH_PARSER_JS_LOCATION + "ASCIIMathTeXImg.js"), UTF_8));
final StringBuilder sb = new StringBuilder();
String s = null;
while ((s = br.readLine()) != null) {
sb.append(s);
sb.append(BackSlash.NEWLINE);
}
br.close();
JAVASCRIPT_CODE = sb.toString();
} catch (Exception e) {
e.printStackTrace();
}
}
public AsciiMathJs(String form) throws ScriptException, NoSuchMethodException {
final ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
engine.eval(JAVASCRIPT_CODE);
final Invocable inv = (Invocable) engine;
this.tex = patchColor((String) inv.invokeFunction("plantuml", form));
this.builder = new LatexBuilder(tex);
}
private String patchColor(String latex) {
return latex.replace("\\color{", "\\textcolor{");
}
public Dimension2D getDimension() {
return builder.getDimension();
}
public UImageSvg getSvg(double scale, Color foregroundColor, Color backgroundColor)
throws ClassNotFoundException, IllegalAccessException, IllegalArgumentException, InvocationTargetException,
NoSuchMethodException, SecurityException, InstantiationException, IOException {
return builder.getSvg(scale, foregroundColor, backgroundColor);
}
public MutableImage getImage(Color foregroundColor, Color backgroundColor)
throws ClassNotFoundException, NoSuchMethodException, SecurityException, InstantiationException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
return builder.getImage(foregroundColor, backgroundColor);
}
public String getSource() {
return tex;
}
}

View File

@ -80,7 +80,7 @@ public class Version {
}
public static int beta() {
final int beta = 0;
final int beta = 1;
return beta;
}

View File

@ -54,13 +54,13 @@ class Fork extends WBSTextBlock {
public Fork(ISkinParam skinParam, WElement idea) {
super(idea.withBackColor(skinParam), idea.getStyleBuilder(), idea.getLevel());
if (idea.getLevel() != 0) {
if (idea.getLevel() != 0)
throw new IllegalArgumentException();
}
this.main = buildMain(idea);
for (WElement child : idea.getChildren(Direction.RIGHT)) {
for (WElement child : idea.getChildren(Direction.RIGHT))
this.right.add(ITFComposed.build2(skinParam, child));
}
}
final private double delta1x = 20;
@ -68,27 +68,42 @@ class Fork extends WBSTextBlock {
public void drawU(final UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D fullDim = calculateDimension(stringBounder);
final Dimension2D mainDim = main.calculateDimension(stringBounder);
final double dx = (fullDim.getWidth() - mainDim.getWidth()) / 2;
main.drawU(ug.apply(UTranslate.dx(dx)));
drawLine(ug, dx + mainDim.getWidth() / 2, mainDim.getHeight(), dx + mainDim.getWidth() / 2,
mainDim.getHeight() + deltay / 2);
double x = 0;
final double y = mainDim.getHeight() + deltay;
final double y0 = mainDim.getHeight();
final double y1 = y0 + deltay / 2;
final double y2 = y0 + deltay;
final double mainWidth = mainDim.getWidth();
if (right.size() == 0) {
main.drawU(ug);
drawLine(ug, mainWidth / 2, y0, mainWidth / 2, y1);
return;
}
double x = 0;
final double firstX = right.get(0).getT1(stringBounder).getX();
double lastX = firstX;
for (ITF child : right) {
lastX = x + child.getT1(stringBounder).getX();
drawLine(ug, lastX, mainDim.getHeight() + deltay / 2, lastX, y);
child.drawU(ug.apply(new UTranslate(x, y)));
drawLine(ug, lastX, y1, lastX, y2);
child.drawU(ug.apply(new UTranslate(x, y2)));
x += child.calculateDimension(stringBounder).getWidth() + delta1x;
}
lastX = Math.max(lastX, dx + mainDim.getWidth() / 2);
drawLine(ug, firstX, mainDim.getHeight() + deltay / 2, lastX, mainDim.getHeight() + deltay / 2);
final double posMain;
if (lastX > firstX) {
drawLine(ug, firstX, y1, lastX, y1);
posMain = firstX + (lastX - firstX - mainWidth) / 2;
} else {
assert lastX == firstX;
final Dimension2D fullDim = calculateDimension(stringBounder);
posMain = (fullDim.getWidth() - mainWidth) / 2;
drawLine(ug, firstX, y1, posMain + mainWidth / 2, y1);
}
main.drawU(ug.apply(UTranslate.dx(posMain)));
drawLine(ug, posMain + mainWidth / 2, y0, posMain + mainWidth / 2, y1);
}

View File

@ -84,7 +84,7 @@ abstract class WBSTextBlock extends AbstractTextBlock {
}
final protected void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
drawLine(ug, new Point2D.Double(x1, y1), new Point2D.Double(x2, y2));
drawLine(ug, new Point2D.Double(Math.min(x1, x2), y1), new Point2D.Double(Math.max(x1, x2), y2));
}
final public StyleSignature getDefaultStyleDefinitionArrow() {
@ -94,9 +94,9 @@ abstract class WBSTextBlock extends AbstractTextBlock {
final protected TextBlock buildMain(WElement idea) {
final Display label = idea.getLabel();
final Style style = idea.getStyle();
if (idea.getShape() == IdeaShape.BOX) {
if (idea.getShape() == IdeaShape.BOX)
return FtileBoxOld.createWbs(style, idea.withBackColor(skinParam), label);
}
final TextBlock text = label.create0(
style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()),
style.getHorizontalAlignment(), skinParam, style.wrapWidth(), CreoleMode.FULL, null, null);

View File

@ -67,30 +67,30 @@ final class WElement {
private StyleSignature getDefaultStyleDefinitionNode(int level) {
final String depth = SName.depth(level);
if (level == 0) {
if (level == 0)
return StyleSignature.of(SName.root, SName.element, SName.wbsDiagram, SName.node, SName.rootNode)
.add(stereotype).add(depth);
}
if (shape == IdeaShape.NONE && isLeaf()) {
if (shape == IdeaShape.NONE && isLeaf())
return StyleSignature
.of(SName.root, SName.element, SName.wbsDiagram, SName.node, SName.leafNode, SName.boxless)
.add(stereotype).add(depth);
}
if (isLeaf()) {
if (isLeaf())
return StyleSignature.of(SName.root, SName.element, SName.wbsDiagram, SName.node, SName.leafNode)
.add(stereotype).add(depth);
}
if (shape == IdeaShape.NONE) {
if (shape == IdeaShape.NONE)
return StyleSignature.of(SName.root, SName.element, SName.wbsDiagram, SName.node, SName.boxless)
.add(stereotype).add(depth);
}
return StyleSignature.of(SName.root, SName.element, SName.wbsDiagram, SName.node).add(stereotype).add(depth);
}
public ISkinParam withBackColor(ISkinParam skinParam) {
if (backColor == null) {
if (backColor == null)
return skinParam;
}
return new SkinParamColors(skinParam, Colors.empty().add(ColorType.BACK, backColor));
}
@ -130,11 +130,13 @@ final class WElement {
public WElement createElement(HColor backColor, int newLevel, Display newLabel, String stereotype,
Direction direction, IdeaShape shape, StyleBuilder styleBuilder) {
final WElement result = new WElement(backColor, newLevel, newLabel, stereotype, this, shape, styleBuilder);
if (direction == Direction.LEFT) {
if (direction == Direction.LEFT && newLevel == 1)
this.childrenRight.add(0, result);
if (direction == Direction.LEFT)
this.childrenLeft.add(result);
} else {
else
this.childrenRight.add(result);
}
return result;
}
@ -152,9 +154,8 @@ final class WElement {
}
public Collection<WElement> getChildren(Direction direction) {
if (direction == Direction.LEFT) {
if (direction == Direction.LEFT)
return Collections.unmodifiableList(childrenLeft);
}
return Collections.unmodifiableList(childrenRight);
}