mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-21 12:35:10 +00:00
version 1.2019.11
This commit is contained in:
parent
90372b993c
commit
c4397fac97
2
pom.xml
2
pom.xml
@ -35,7 +35,7 @@
|
||||
|
||||
<groupId>net.sourceforge.plantuml</groupId>
|
||||
<artifactId>plantuml</artifactId>
|
||||
<version>1.2019.11-SNAPSHOT</version>
|
||||
<version>1.2019.12-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>PlantUML</name>
|
||||
|
@ -138,33 +138,41 @@ delay {
|
||||
|
||||
participant {
|
||||
LineThickness 1.5
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
actor {
|
||||
LineThickness 2.0
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
boundary {
|
||||
LineThickness 2.0
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
control {
|
||||
LineThickness 2.0
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
entity {
|
||||
LineThickness 2.0
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
queue {
|
||||
LineThickness 2.0
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
database {
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
collections {
|
||||
LineThickness 1.5
|
||||
HorizontalAlignment center
|
||||
}
|
||||
|
||||
swimlane {
|
||||
|
6
skin/strictuml.skin
Normal file
6
skin/strictuml.skin
Normal file
@ -0,0 +1,6 @@
|
||||
root {
|
||||
Shadowing 0.0
|
||||
}
|
||||
element {
|
||||
Shadowing 0.0
|
||||
}
|
@ -37,6 +37,7 @@ package net.sourceforge.plantuml;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -47,6 +48,8 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import net.sourceforge.plantuml.command.BlocLines;
|
||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||
import net.sourceforge.plantuml.command.regex.Matcher2;
|
||||
import net.sourceforge.plantuml.command.regex.MyPattern;
|
||||
import net.sourceforge.plantuml.command.regex.Pattern2;
|
||||
@ -96,10 +99,10 @@ public class SkinParam implements ISkinParam {
|
||||
if (type == UmlDiagramType.WBS) {
|
||||
USE_STYLE2.set(true);
|
||||
}
|
||||
// if (type == UmlDiagramType.SEQUENCE) {
|
||||
// // skin = "debug.skin";
|
||||
// USE_STYLE2.set(true);
|
||||
// }
|
||||
if (type == UmlDiagramType.SEQUENCE) {
|
||||
// skin = "debug.skin";
|
||||
//USE_STYLE2.set(true);
|
||||
}
|
||||
// if (type == UmlDiagramType.ACTIVITY) {
|
||||
// // skin = "debug.skin";
|
||||
// USE_STYLE2.set(true);
|
||||
@ -182,6 +185,20 @@ public class SkinParam implements ISkinParam {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ("style".equalsIgnoreCase(key) && "strictuml".equalsIgnoreCase(value)) {
|
||||
if (USE_STYLES()) {
|
||||
final InputStream internalIs = StyleLoader.class.getResourceAsStream("/skin/strictuml.skin");
|
||||
final StyleBuilder styleBuilder = this.getCurrentStyleBuilder();
|
||||
try {
|
||||
final BlocLines lines = BlocLines.load(internalIs, null);
|
||||
for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines, styleBuilder)) {
|
||||
this.muteStyle(modifiedStyle);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static SkinParam create(UmlDiagramType type) {
|
||||
|
@ -70,6 +70,10 @@ public class SourceStringReader {
|
||||
this(defines, source, "UTF-8", config);
|
||||
}
|
||||
|
||||
public SourceStringReader(Defines defines, String source) {
|
||||
this(defines, source, "UTF-8", Collections.<String> emptyList());
|
||||
}
|
||||
|
||||
public SourceStringReader(String source, File newCurrentDir) {
|
||||
this(Defines.createEmpty(), source, "UTF-8", Collections.<String> emptyList(), newCurrentDir);
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
|
||||
RegexLeaf.end());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocLines lines) {
|
||||
lines = lines.trim(false);
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
|
@ -72,6 +72,7 @@ public class CommandActivityLong3 extends CommandMultilines2<ActivityDiagram3> {
|
||||
RegexLeaf.end());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
|
||||
lines = lines.removeEmptyColumns();
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
|
@ -71,6 +71,7 @@ public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
|
||||
RegexLeaf.end());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines lines) {
|
||||
lines = lines.removeEmptyColumns();
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
|
@ -61,10 +61,12 @@ public class CommandNoteLong3 extends CommandMultilines2<ActivityDiagram3> {
|
||||
return ColorParser.simpleColor(ColorType.BACK);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPatternEnd() {
|
||||
return "(?i)^end[%s]?note$";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(final ActivityDiagram3 diagram, BlocLines lines) {
|
||||
// final List<? extends CharSequence> in = StringUtils.removeEmptyColumns2(lines.subList(1, lines.size() - 1));
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
|
@ -140,6 +140,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
|
||||
return ColorParser.simpleColor(ColorType.BACK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(ClassDiagram diagram, BlocLines lines) {
|
||||
lines = lines.trimSmart(1);
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
|
@ -71,14 +71,15 @@ public class CommandFooter extends SingleLineCommand2<TitledDiagram> {
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String align = arg.get("POSITION", 0);
|
||||
HorizontalAlignment defaultAlign = HorizontalAlignment.CENTER;
|
||||
if (SkinParam.USE_STYLES()) {
|
||||
defaultAlign = FontParam.FOOTER.getStyleDefinition()
|
||||
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER);
|
||||
if (SkinParam.USE_STYLES() && align == null) {
|
||||
ha = FontParam.FOOTER.getStyleDefinition()
|
||||
.getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder())
|
||||
.getHorizontalAlignment();
|
||||
}
|
||||
diagram.getFooter().putDisplay(Display.getWithNewlines(arg.get("LABEL", 0)),
|
||||
HorizontalAlignment.fromString(align, defaultAlign));
|
||||
diagram.getFooter().putDisplay(Display.getWithNewlines(arg.get("LABEL", 0)), ha);
|
||||
|
||||
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
}
|
||||
|
@ -73,14 +73,13 @@ public class CommandHeader extends SingleLineCommand2<TitledDiagram> {
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String align = arg.get("POSITION", 0);
|
||||
HorizontalAlignment defaultAlign = HorizontalAlignment.RIGHT;
|
||||
if (SkinParam.USE_STYLES()) {
|
||||
defaultAlign = FontParam.HEADER.getStyleDefinition()
|
||||
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT);
|
||||
if (SkinParam.USE_STYLES() && align == null) {
|
||||
ha = FontParam.HEADER.getStyleDefinition()
|
||||
.getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder())
|
||||
.getHorizontalAlignment();
|
||||
}
|
||||
diagram.getHeader().putDisplay(Display.getWithNewlines(arg.get("LABEL", 0)),
|
||||
HorizontalAlignment.fromString(align, defaultAlign));
|
||||
diagram.getHeader().putDisplay(Display.getWithNewlines(arg.get("LABEL", 0)), ha);
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
}
|
||||
|
@ -65,13 +65,13 @@ public class CommandMultilinesFooter extends CommandMultilines<TitledDiagram> {
|
||||
lines = lines.subExtract(1, 1);
|
||||
final Display strings = lines.toDisplay();
|
||||
if (strings.size() > 0) {
|
||||
HorizontalAlignment defaultAlign = HorizontalAlignment.CENTER;
|
||||
if (SkinParam.USE_STYLES()) {
|
||||
defaultAlign = FontParam.FOOTER.getStyleDefinition()
|
||||
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.CENTER);
|
||||
if (SkinParam.USE_STYLES() && align == null) {
|
||||
ha = FontParam.FOOTER.getStyleDefinition()
|
||||
.getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder())
|
||||
.getHorizontalAlignment();
|
||||
}
|
||||
diagram.getFooter().putDisplay(strings, HorizontalAlignment.fromString(align, defaultAlign));
|
||||
diagram.getFooter().putDisplay(strings, ha);
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
return CommandExecutionResult.error("Empty footer");
|
||||
|
@ -65,13 +65,13 @@ public class CommandMultilinesHeader extends CommandMultilines<TitledDiagram> {
|
||||
lines = lines.subExtract(1, 1);
|
||||
final Display strings = lines.toDisplay();
|
||||
if (strings.size() > 0) {
|
||||
HorizontalAlignment defaultAlign = HorizontalAlignment.RIGHT;
|
||||
if (SkinParam.USE_STYLES()) {
|
||||
defaultAlign = FontParam.HEADER.getStyleDefinition()
|
||||
HorizontalAlignment ha = HorizontalAlignment.fromString(align, HorizontalAlignment.RIGHT);
|
||||
if (SkinParam.USE_STYLES() && align == null) {
|
||||
ha = FontParam.HEADER.getStyleDefinition()
|
||||
.getMergedStyle(((UmlDiagram) diagram).getSkinParam().getCurrentStyleBuilder())
|
||||
.getHorizontalAlignment();
|
||||
}
|
||||
diagram.getHeader().putDisplay(strings, HorizontalAlignment.fromString(align, defaultAlign));
|
||||
diagram.getHeader().putDisplay(strings, ha);
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
return CommandExecutionResult.error("Empty header");
|
||||
|
@ -225,7 +225,7 @@ public abstract class UmlDiagramFactory extends PSystemAbstractFactory {
|
||||
}
|
||||
|
||||
final protected void addCommonCommands2(List<Command> cmds) {
|
||||
cmds.add(new CommandListSprite());
|
||||
// cmds.add(new CommandListSprite());
|
||||
cmds.add(new CommandNope());
|
||||
cmds.add(new CommandPragma());
|
||||
|
||||
|
@ -76,7 +76,7 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
|
||||
RegexLeaf.spaceZeroOrMore(), //
|
||||
new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
|
||||
RegexLeaf.spaceOneOrMore(), //
|
||||
new RegexLeaf("POSITION", "(right|left)"), //
|
||||
new RegexLeaf("POSITION", "(right|left|bottom|top)"), //
|
||||
RegexLeaf.spaceZeroOrMore(), //
|
||||
ColorParser.exp1(), //
|
||||
RegexLeaf.spaceZeroOrMore(), //
|
||||
@ -90,7 +90,7 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
|
||||
RegexLeaf.spaceZeroOrMore(), //
|
||||
new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
|
||||
RegexLeaf.spaceOneOrMore(), //
|
||||
new RegexLeaf("POSITION", "(right|left)"), //
|
||||
new RegexLeaf("POSITION", "(right|left|bottom|top)"), //
|
||||
RegexLeaf.spaceZeroOrMore(), //
|
||||
ColorParser.exp1(), //
|
||||
RegexLeaf.spaceZeroOrMore(), //
|
||||
|
@ -35,6 +35,7 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.creole;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -42,7 +43,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
public abstract class AbstractAtom implements Atom {
|
||||
|
||||
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
|
||||
throw new UnsupportedOperationException(getClass().toString());
|
||||
return Arrays.asList((Atom) this);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
@ -69,7 +71,7 @@ public class AtomImg extends AbstractAtom implements Atom {
|
||||
private final BufferedImage image;
|
||||
private final double scale;
|
||||
private final Url url;
|
||||
|
||||
|
||||
private AtomImg(BufferedImage image, double scale, Url url) {
|
||||
this.image = image;
|
||||
this.scale = scale;
|
||||
|
@ -53,11 +53,6 @@ public class AtomSprite extends AbstractAtom implements Atom {
|
||||
private final Url url;
|
||||
private final HtmlColor color;
|
||||
|
||||
@Override
|
||||
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
|
||||
return Arrays.asList((Atom) this);
|
||||
}
|
||||
|
||||
public AtomSprite(HtmlColor newColor, double scale, FontConfiguration fontConfiguration, Sprite sprite, Url url) {
|
||||
this.scale = scale;
|
||||
this.sprite = sprite;
|
||||
|
@ -90,6 +90,12 @@ public class AtomText extends AbstractAtom implements Atom {
|
||||
public static Atom create(String text, FontConfiguration fontConfiguration) {
|
||||
return new AtomText(text, fontConfiguration, null, ZERO, ZERO);
|
||||
}
|
||||
|
||||
// public static AtomText createHeading(String text, FontConfiguration fontConfiguration, int order) {
|
||||
// fontConfiguration = FOO(fontConfiguration, order);
|
||||
// return new AtomText(text, fontConfiguration, null, ZERO, ZERO);
|
||||
// }
|
||||
|
||||
|
||||
public static Atom createUrl(Url url, FontConfiguration fontConfiguration, ISkinSimple skinSimple) {
|
||||
fontConfiguration = fontConfiguration.hyperlink();
|
||||
@ -149,19 +155,6 @@ public class AtomText extends AbstractAtom implements Atom {
|
||||
return new AtomHorizontalTexts(result);
|
||||
}
|
||||
|
||||
public static AtomText createHeading(String text, FontConfiguration fontConfiguration, int order) {
|
||||
if (order == 0) {
|
||||
fontConfiguration = fontConfiguration.bigger(4).bold();
|
||||
} else if (order == 1) {
|
||||
fontConfiguration = fontConfiguration.bigger(2).bold();
|
||||
} else if (order == 2) {
|
||||
fontConfiguration = fontConfiguration.bigger(1).bold();
|
||||
} else {
|
||||
fontConfiguration = fontConfiguration.italic();
|
||||
}
|
||||
return new AtomText(text, fontConfiguration, null, ZERO, ZERO);
|
||||
}
|
||||
|
||||
public static Atom createListNumber(final FontConfiguration fontConfiguration, final int order, int localNumber) {
|
||||
final DelayedDouble left = new DelayedDouble() {
|
||||
public double getDouble(StringBounder stringBounder) {
|
||||
|
@ -57,12 +57,6 @@ public class AtomTree extends AbstractAtom implements Atom {
|
||||
private final Map<Atom, Integer> levels = new HashMap<Atom, Integer>();
|
||||
private final double margin = 2;
|
||||
|
||||
@Override
|
||||
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
|
||||
return Arrays.asList((Atom) this);
|
||||
}
|
||||
|
||||
|
||||
public AtomTree(HtmlColor lineColor) {
|
||||
this.lineColor = lineColor;
|
||||
}
|
||||
|
@ -74,14 +74,6 @@ public class CommandCreoleUrl implements Command {
|
||||
final UrlBuilder urlBuilder = new UrlBuilder(skinParam.getValue("topurl"), ModeUrl.STRICT);
|
||||
final Url url = urlBuilder.getUrl(m.group(1));
|
||||
stripe.addUrl(url);
|
||||
|
||||
// final int size = Integer.parseInt(m.group(2));
|
||||
// final FontConfiguration fc1 = stripe.getActualFontConfiguration();
|
||||
// final FontConfiguration fc2 = fc1.changeSize(size);
|
||||
// // final FontConfiguration fc2 = new AddStyle(style, null).apply(fc1);
|
||||
// stripe.setActualFontConfiguration(fc2);
|
||||
// stripe.analyzeAndAdd("AZERTY");
|
||||
// stripe.setActualFontConfiguration(fc1);
|
||||
return line.substring(m.group(1).length());
|
||||
}
|
||||
}
|
||||
|
@ -59,11 +59,6 @@ public class CreoleHorizontalLine extends AbstractAtom implements Atom {
|
||||
private final char style;
|
||||
private final ISkinSimple skinParam;
|
||||
|
||||
@Override
|
||||
public List<Atom> splitInTwo(StringBounder stringBounder, double width) {
|
||||
return Arrays.asList((Atom) this);
|
||||
}
|
||||
|
||||
public static CreoleHorizontalLine create(FontConfiguration fontConfiguration, String line, char style,
|
||||
ISkinSimple skinParam) {
|
||||
return new CreoleHorizontalLine(fontConfiguration, line, style, skinParam);
|
||||
|
@ -164,7 +164,8 @@ public class StripeSimple implements Stripe {
|
||||
}
|
||||
line = CharHidder.hide(line);
|
||||
if (style.getType() == StripeStyleType.HEADING) {
|
||||
atoms.add(AtomText.createHeading(line, fontConfiguration, style.getOrder()));
|
||||
fontConfiguration = fontConfigurationForHeading(fontConfiguration, style.getOrder());
|
||||
modifyStripe(line);
|
||||
} else if (style.getType() == StripeStyleType.HORIZONTAL_LINE) {
|
||||
atoms.add(CreoleHorizontalLine.create(fontConfiguration, line, style.getStyle(), skinParam));
|
||||
} else {
|
||||
@ -172,6 +173,19 @@ public class StripeSimple implements Stripe {
|
||||
}
|
||||
}
|
||||
|
||||
private static FontConfiguration fontConfigurationForHeading(FontConfiguration fontConfiguration, int order) {
|
||||
if (order == 0) {
|
||||
fontConfiguration = fontConfiguration.bigger(4).bold();
|
||||
} else if (order == 1) {
|
||||
fontConfiguration = fontConfiguration.bigger(2).bold();
|
||||
} else if (order == 2) {
|
||||
fontConfiguration = fontConfiguration.bigger(1).bold();
|
||||
} else {
|
||||
fontConfiguration = fontConfiguration.italic();
|
||||
}
|
||||
return fontConfiguration;
|
||||
}
|
||||
|
||||
public void addImage(String src, double scale) {
|
||||
atoms.add(AtomImg.create(src, ImgValign.TOP, 0, scale, null));
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class StripeTree implements Stripe {
|
||||
public List<Atom> getAtoms() {
|
||||
return Collections.<Atom> singletonList(marged);
|
||||
}
|
||||
|
||||
|
||||
public Atom getHeader() {
|
||||
return null;
|
||||
}
|
||||
@ -70,13 +70,29 @@ public class StripeTree implements Stripe {
|
||||
for (String s : lines) {
|
||||
final StripeSimple cell = new StripeSimple(fontConfiguration, stripeStyle, new CreoleContext(), skinParam,
|
||||
CreoleMode.FULL);
|
||||
// EMTEC
|
||||
final String text = s.replaceFirst("^\\s*\\|_", "");
|
||||
final int level = (s.length() - text.length()) / 2;
|
||||
final int level = computeLevel(s);
|
||||
cell.analyzeAndAdd(text);
|
||||
this.tree.addCell(StripeTable.asAtom(Collections.singletonList(cell), 0), level);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private int computeLevel(String s) {
|
||||
int result = 1;
|
||||
while (s.length() > 0) {
|
||||
if (s.startsWith(" ")) {
|
||||
result++;
|
||||
s = s.substring(2);
|
||||
continue;
|
||||
} else if (s.startsWith("\t")) {
|
||||
result++;
|
||||
s = s.substring(1);
|
||||
continue;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -148,6 +148,10 @@ final public class DotData implements PortionShower {
|
||||
return entityFactory.getRootGroup();
|
||||
}
|
||||
|
||||
public boolean isDegeneratedWithFewEntities(int nb) {
|
||||
return entityFactory.getGroupsvalues().size() == 0 && getLinks().size() == 0 && getLeafs().size() == nb;
|
||||
}
|
||||
|
||||
public final boolean isHideEmptyDescriptionForState() {
|
||||
return isHideEmptyDescriptionForState;
|
||||
}
|
||||
|
@ -364,8 +364,9 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
|
||||
queue = getQueue(arg);
|
||||
}
|
||||
|
||||
Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(arg.get("LABEL_LINK", 0)), queue.length(),
|
||||
diagram.getSkinParam().getCurrentStyleBuilder());
|
||||
final Labels labels = new Labels(arg);
|
||||
Link link = new Link(cl1, cl2, linkType, Display.getWithNewlines(labels.labelLink), queue.length(), diagram
|
||||
.getSkinParam().getCurrentStyleBuilder());
|
||||
if (dir == Direction.LEFT || dir == Direction.UP) {
|
||||
link = link.getInv();
|
||||
}
|
||||
|
@ -71,23 +71,23 @@ public class PSystemDonors extends AbstractPSystem {
|
||||
private static final int COLS = 6;
|
||||
private static final int FREE_LINES = 6;
|
||||
|
||||
public static final String DONORS = "6ty902mFR3fSuLzO9ciEU-UTVLaMenKn_Poll0GDwsu450sG0Q8aQloSnDhywO_J0H90rz3HOsxVwN6_"
|
||||
+ "aVuYkjAzRveHRVcs-MeT28Jb1yTZxQt2wPrlgWmfGKmLss-PqDxVVbneGbeh65VWfd92vl-cq-9uA8HP"
|
||||
+ "cgrmFXgXChPaZuwvpzsFeYvKNLo2gc-56jEfn35S5JQ6wpFKDHonwDhLyQWe6HGZh28bKJUE8C4TDngr"
|
||||
+ "KJd19r8B_r4BQDAQJKFIAQ1OHefOyxRC-UC0zJTXu4GGKpeS8CAXf2DuWJ54VI618AeODMgZw8pDLCzv"
|
||||
+ "ueE955JOWN_af7fl8TkZ31q8OhAXGC9F40HWpzLGuhEvsO3IBRp5l0QRTMfPoMZtDrDIQguqF00wOY9e"
|
||||
+ "1Ln1o9kW2tuVRUOIPngxei0RdiHubTi7kSZs0DXU3EZRMHC3vGizEVEKPKPrQo6TKwvp_EfiaEyQChEt"
|
||||
+ "cr75E8k9cD_cKXY-k03xcw2NMaF5-9lpp48sXCUKkf2Tv_Bbt8b0M6KfMUGgbgIc_hIBAMrTpFUcBEBT"
|
||||
+ "-tLgADimWbTJv80-gfNsXiuNYgk6-kSXZxgEJ-5hqXRYNQBlJiojuk_jRWapJbVGzIPyg6w0A3Lwucgk"
|
||||
+ "M5GHk8FesP27WDo1wilaLdbPFYIkvmDIRqiu49aDOYDnpRRYa8j5c0TMTgMA0S0MBj6kt_gTf5zvTK8V"
|
||||
+ "WfLHP8IxVhj9zx1vDioDNYj0Gur1UKDdonSPgxaW3ZDCownPFT1-n564otYGl7hUCxkk0bYJUMzRR8sd"
|
||||
+ "Cx2kOSumITCH-JZIbcGSwYWzYxFDcxh4gxcTx3nqEpXFRz49Piuswo5J8FUeUMcfMunxrs38crDPnQxb"
|
||||
+ "ehq4-kfcFL32Cpu5t6wS3Ada4eAeuKn7I4n09BNEApPOulekgdevEPwQbZ1hjzL1eDhv4Ni3GLMm4suW"
|
||||
+ "plfUusT4YMBdxVDUcNLNtuUKM1TG8GO48wbGjX5ILCBcL3AizrRFyUZWjL_QT46_ZM-MB0aKtW4HQhv1"
|
||||
+ "qYdC8q_mHirPefHJgv8lUqoCWEzn-GtsnAuES_oEbbOUPv0RWfGxfO3abs15Isst9bXlqVksRNjRDlxy"
|
||||
+ "tskod5Cprx7o0Bg0k02rUH4xKHVrF2d_TT0ddUCMCWD6dHpxoXjJhmSO28fcsUvLUp-ZVhcKbzjLEtsK"
|
||||
+ "zKEb_qCgGJ2M5oox6AMeZ3ObM6rxgniLYttxZR2NG-FycwYoAJ-uobIhPqHIiSkTEC_ZjOrK8efAESo0"
|
||||
+ "jXE2mDblV9P2uoMZZIjWjSC5HJwVPfV3evcMs12Kbf7rm2_T0000";
|
||||
public static final String DONORS = "6uq902mFw6aNBnoRoJQNUtErFonYo206_-9C-IFeunriW0n1BL5IhOvS7xq622gWQ-ZeCRVlzBZVI7yH"
|
||||
+ "NUdUDys8jcnDSPvH50k27c-JQuPjxkqnSsBnGt1dZe133yW3iacsZHfPkfVj92sddof3IY7pywS6s9OA"
|
||||
+ "ihYRQXukK7S6TknnUzX_ePwbHp_sKxhZEw0nZHBhiAEQb5SFVAsgP8B2sM_7DwrYLapW42cEjd043jcO"
|
||||
+ "YNnrMiUu85NxZte3BJPcM2foJoYssYMf-UVP-hQ1xXCOJ2AmYG4RC7Eew32UO2vGRyGGM4MYYUpiZCQ6"
|
||||
+ "QsvveeC95zInXd-KHKsFLEOSZau4Dg-40Ww_XXE0hIYlmcVxDWCAHNgBkYN9EZMUX9N6XoKfhXyqt006"
|
||||
+ "R2ne7QY2a3T19_nfCVjJatjT3GLUzEpClTaPo4Ms0y3nPaRVPDsPAF_t3yuqiMsfbaXrBlrvhlTn3iZT"
|
||||
+ "Kgj6_37QM6LBtDQJ5nLQUN81_4FGIxsZOdxETMCX6UAvT7iYpdFgojSe0cR5OMJXJx4bDUxIBazZVLcU"
|
||||
+ "eIp1Z_RhL2EPq89N8bu6_QfMA0zqlb2oBArSFlHeMBqCV4t8JBmjkcV7NCh_lrAymupI5RJVnPogQo1A"
|
||||
+ "dh5pLUjigWXC8texv2QGAr3jhbknU_-G_vmFIBqbaO78RCvnlrIig3LT334RrdIwn0nWyfHe9mAxaqGY"
|
||||
+ "faReNR2oZ4mhnQw7g-VqYJ5nxVJ2uxwfCOWFTBBo9EpfHR1cXY79chaDxGUSWt06NvnNN_VXFLO1hBjv"
|
||||
+ "Zxr9pHzd85tfXP4aRKQKszRzgR1c1QLdKPPyM96_U_4p5mzT2bvdikW8Cwysno5ZeNZPf9N-PFJ3aY5l"
|
||||
+ "dygo_aeLUGFkbug5G9XdV0nuF3XPKCKb15RJMGuJ6u1mweDNx3SlSJEekgNav18snAp3LkU1IkU7UGT6"
|
||||
+ "bN7WcOCTtRt4pz0IHSx7vxso-cbbhIfsBA1uLWYMKaVPQweeqkTKCcICGSzXQ-3jDmjT42xrsXkc1Gfl"
|
||||
+ "W-Y-V0EjKyYq4kC7JPybqeLyHRxaiJ02_iwltsGlEDP1nhyPtOV7cUUA8AKgEi0vSRRKQbjQ1-ij-lpv"
|
||||
+ "ifoy1t_-xpLjvrI8vtoM0Bg0WlQlfS2SQDRLF7liJwEF3kmsiW9Y7PpqbLUcNWWm40oQPQcNrcb6uSuO"
|
||||
+ "Ncwg1dt6yQ52No4L9uZZ3SikbYcA6bFEykLanQYys9VU22SvU5x_55M6KbnbkPeOeLNi_2ZEqtWVjHjk"
|
||||
+ "TUa24j0T5mJAVlExtIntZJvVW7qO7b3avoDvwB25QK4Lfx4yDJ15OtrlnjjJPwP-4m00";
|
||||
|
||||
/*
|
||||
* Special thanks to our sponsors and donors:
|
||||
|
@ -325,7 +325,8 @@ public class QuoteUtils {
|
||||
"Fvapr gurer'f ab pbapyhfvba gb gur cnenqbk gurbel, gurer'f ab jnl gb cebir gurer'f ab cnenqbk.",
|
||||
"Gnxr zr guebhtu gur qnexarff gb gur oernx bs gur qnl",
|
||||
"Vg znxrf gur gehgu rira zber vapbzcerurafvoyr orpnhfr rirelguvat vf arj",
|
||||
"V qba'g xabj ubj ohg V fhqqrayl ybfr pbageby", "Gurer ner zbzragf jura V guvax V'z tbvat penml");
|
||||
"V qba'g xabj ubj ohg V fhqqrayl ybfr pbageby", "Gurer ner zbzragf jura V guvax V'z tbvat penml",
|
||||
"Jbhyq gung vg jrer fb fvzcyr", "Pnyy gung n xavsr? Guvf vf n xavsr.");
|
||||
|
||||
private QuoteUtils() {
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
|
||||
public class CommandMindMapLeft extends SingleLineCommand2<MindMapDiagram> {
|
||||
|
||||
@ -62,7 +63,7 @@ public class CommandMindMapLeft extends SingleLineCommand2<MindMapDiagram> {
|
||||
protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String type = arg.get("TYPE", 0);
|
||||
final String label = arg.get("LABEL", 0);
|
||||
return diagram.addIdea(null, type.length() - 1, label, IdeaShape.fromDesc(arg.get("SHAPE", 0)), Direction.LEFT);
|
||||
return diagram.addIdea(null, type.length() - 1, Display.getWithNewlines(label), IdeaShape.fromDesc(arg.get("SHAPE", 0)), Direction.LEFT);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
|
||||
public class CommandMindMapLeftNumber extends SingleLineCommand2<MindMapDiagram> {
|
||||
|
||||
@ -61,7 +62,7 @@ public class CommandMindMapLeftNumber extends SingleLineCommand2<MindMapDiagram>
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String label = arg.get("LABEL", 0);
|
||||
return diagram.addIdea(null, Integer.parseInt(arg.get("TYPE", 0)), label,
|
||||
return diagram.addIdea(null, Integer.parseInt(arg.get("TYPE", 0)), Display.getWithNewlines(label),
|
||||
IdeaShape.fromDesc(arg.get("SHAPE", 0)), Direction.LEFT);
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexOptional;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
|
||||
public class CommandMindMapOrgmode extends SingleLineCommand2<MindMapDiagram> {
|
||||
@ -69,7 +70,8 @@ public class CommandMindMapOrgmode extends SingleLineCommand2<MindMapDiagram> {
|
||||
if (stringColor != null) {
|
||||
backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(stringColor);
|
||||
}
|
||||
return diagram.addIdea(backColor, type.length() - 1, label, IdeaShape.fromDesc(arg.get("SHAPE", 0)));
|
||||
return diagram.addIdea(backColor, type.length() - 1, Display.getWithNewlines(label),
|
||||
IdeaShape.fromDesc(arg.get("SHAPE", 0)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,86 @@
|
||||
/* ========================================================================
|
||||
* 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.mindmap;
|
||||
|
||||
import net.sourceforge.plantuml.command.BlocLines;
|
||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||
import net.sourceforge.plantuml.command.CommandMultilines2;
|
||||
import net.sourceforge.plantuml.command.MultilinesStrategy;
|
||||
import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexOptional;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
|
||||
public class CommandMindMapOrgmodeMultiline extends CommandMultilines2<MindMapDiagram> {
|
||||
|
||||
public CommandMindMapOrgmodeMultiline() {
|
||||
super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
|
||||
}
|
||||
|
||||
static IRegex getRegexConcat() {
|
||||
return RegexConcat.build(CommandMindMapOrgmodeMultiline.class.getName(), RegexLeaf.start(), //
|
||||
new RegexLeaf("TYPE", "([*]+)"), //
|
||||
new RegexOptional(new RegexLeaf("BACKCOLOR", "\\[(#\\w+)\\]")), //
|
||||
new RegexLeaf("SHAPE", "(_)?"), //
|
||||
new RegexLeaf(":"), //
|
||||
new RegexLeaf("DATA", "(.*)"), //
|
||||
RegexLeaf.end());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPatternEnd() {
|
||||
return "^(.*);$";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(MindMapDiagram diagram, BlocLines lines) {
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
final String type = line0.get("TYPE", 0);
|
||||
final String stringColor = line0.get("BACKCOLOR", 0);
|
||||
HtmlColor backColor = null;
|
||||
if (stringColor != null) {
|
||||
backColor = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(stringColor);
|
||||
}
|
||||
lines = lines.removeStartingAndEnding2(line0.get("DATA", 0));
|
||||
|
||||
return diagram.addIdea(backColor, type.length() - 1, lines.toDisplay(),
|
||||
IdeaShape.fromDesc(line0.get("SHAPE", 0)));
|
||||
}
|
||||
|
||||
}
|
@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
|
||||
public class CommandMindMapPlus extends SingleLineCommand2<MindMapDiagram> {
|
||||
|
||||
@ -63,7 +64,8 @@ public class CommandMindMapPlus extends SingleLineCommand2<MindMapDiagram> {
|
||||
final String type = arg.get("TYPE", 0);
|
||||
final String label = arg.get("LABEL", 0);
|
||||
final Direction direction = type.contains("-") ? Direction.LEFT : Direction.RIGHT;
|
||||
return diagram.addIdea(null, type.length() - 1, label, IdeaShape.fromDesc(arg.get("SHAPE", 0)), direction);
|
||||
return diagram.addIdea(null, type.length() - 1, Display.getWithNewlines(label),
|
||||
IdeaShape.fromDesc(arg.get("SHAPE", 0)), direction);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
|
||||
public class CommandMindMapRight extends SingleLineCommand2<MindMapDiagram> {
|
||||
|
||||
@ -62,8 +63,8 @@ public class CommandMindMapRight extends SingleLineCommand2<MindMapDiagram> {
|
||||
protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String type = arg.get("TYPE", 0);
|
||||
final String label = arg.get("LABEL", 0);
|
||||
return diagram
|
||||
.addIdea(null, type.length() - 1, label, IdeaShape.fromDesc(arg.get("SHAPE", 0)), Direction.RIGHT);
|
||||
return diagram.addIdea(null, type.length() - 1, Display.getWithNewlines(label),
|
||||
IdeaShape.fromDesc(arg.get("SHAPE", 0)), Direction.RIGHT);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
|
||||
public class CommandMindMapRightNumber extends SingleLineCommand2<MindMapDiagram> {
|
||||
|
||||
@ -61,7 +62,7 @@ public class CommandMindMapRightNumber extends SingleLineCommand2<MindMapDiagram
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String label = arg.get("LABEL", 0);
|
||||
return diagram.addIdea(null, Integer.parseInt(arg.get("TYPE", 0)), label,
|
||||
return diagram.addIdea(null, Integer.parseInt(arg.get("TYPE", 0)), Display.getWithNewlines(label),
|
||||
IdeaShape.fromDesc(arg.get("SHAPE", 0)), Direction.RIGHT);
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
|
||||
public class CommandMindMapRoot extends SingleLineCommand2<MindMapDiagram> {
|
||||
|
||||
@ -59,7 +60,7 @@ public class CommandMindMapRoot extends SingleLineCommand2<MindMapDiagram> {
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String label = arg.get("LABEL", 0);
|
||||
return diagram.addIdea(null, 0, label, IdeaShape.BOX, null);
|
||||
return diagram.addIdea(null, 0, Display.getWithNewlines(label), IdeaShape.BOX, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ import net.sourceforge.plantuml.command.regex.IRegex;
|
||||
import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
|
||||
public class CommandMindMapTabulation extends SingleLineCommand2<MindMapDiagram> {
|
||||
|
||||
@ -61,7 +62,8 @@ public class CommandMindMapTabulation extends SingleLineCommand2<MindMapDiagram>
|
||||
protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation location, RegexResult arg) {
|
||||
final String type = arg.get("TYPE", 0);
|
||||
final String label = arg.get("LABEL", 0);
|
||||
return diagram.addIdea(null, type.length() - 1, label, IdeaShape.fromDesc(arg.get("SHAPE", 0)));
|
||||
return diagram.addIdea(null, type.length() - 1, Display.getWithNewlines(label),
|
||||
IdeaShape.fromDesc(arg.get("SHAPE", 0)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -175,16 +175,16 @@ public class MindMapDiagram extends UmlDiagram {
|
||||
}
|
||||
}
|
||||
|
||||
public CommandExecutionResult addIdea(HtmlColor backColor, int level, String label, IdeaShape shape) {
|
||||
public CommandExecutionResult addIdea(HtmlColor backColor, int level, Display label, IdeaShape shape) {
|
||||
return addIdea(backColor, level, label, shape, defaultDirection);
|
||||
}
|
||||
|
||||
public CommandExecutionResult addIdea(HtmlColor backColor, int level, String label, IdeaShape shape,
|
||||
public CommandExecutionResult addIdea(HtmlColor backColor, int level, Display label, IdeaShape shape,
|
||||
Direction direction) {
|
||||
final Matcher2 m = WBSDiagram.patternStereotype.matcher(label);
|
||||
final Matcher2 m = WBSDiagram.patternStereotype.matcher(label.get(0));
|
||||
String stereotype = null;
|
||||
if (m.matches()) {
|
||||
label = m.group(1);
|
||||
label = Display.getWithNewlines(m.group(1));
|
||||
stereotype = m.group(2);
|
||||
}
|
||||
if (level == 0) {
|
||||
@ -207,8 +207,8 @@ public class MindMapDiagram extends UmlDiagram {
|
||||
private Idea last;
|
||||
private Finger finger;
|
||||
|
||||
private void initRoot(StyleBuilder styleBuilder, String label, IdeaShape shape, String stereotype) {
|
||||
root = new Idea(styleBuilder, Display.getWithNewlines(label), shape, stereotype);
|
||||
private void initRoot(StyleBuilder styleBuilder, Display label, IdeaShape shape, String stereotype) {
|
||||
root = new Idea(styleBuilder, label, shape, stereotype);
|
||||
last = root;
|
||||
}
|
||||
|
||||
@ -220,21 +220,20 @@ public class MindMapDiagram extends UmlDiagram {
|
||||
return result;
|
||||
}
|
||||
|
||||
private CommandExecutionResult add(StyleBuilder styleBuilder, HtmlColor backColor, int level, String label,
|
||||
private CommandExecutionResult add(StyleBuilder styleBuilder, HtmlColor backColor, int level, Display label,
|
||||
IdeaShape shape, String stereotype) {
|
||||
if (last == null) {
|
||||
return CommandExecutionResult.error("Check your indentation ?");
|
||||
}
|
||||
if (level == last.getLevel() + 1) {
|
||||
final Idea newIdea = last.createIdea(styleBuilder, backColor, level, Display.getWithNewlines(label),
|
||||
shape, stereotype);
|
||||
final Idea newIdea = last.createIdea(styleBuilder, backColor, level, label, shape, stereotype);
|
||||
last = newIdea;
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
if (level <= last.getLevel()) {
|
||||
final int diff = last.getLevel() - level + 1;
|
||||
final Idea newIdea = getParentOfLast(diff).createIdea(styleBuilder, backColor, level,
|
||||
Display.getWithNewlines(label), shape, stereotype);
|
||||
final Idea newIdea = getParentOfLast(diff).createIdea(styleBuilder, backColor, level, label, shape,
|
||||
stereotype);
|
||||
last = newIdea;
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public class MindMapDiagramFactory extends UmlDiagramFactory {
|
||||
addCommonCommands1(cmds);
|
||||
cmds.add(new CommandMindMapTabulation());
|
||||
cmds.add(new CommandMindMapOrgmode());
|
||||
cmds.add(new CommandMindMapOrgmodeMultiline());
|
||||
cmds.add(new CommandMindMapRoot());
|
||||
cmds.add(new CommandMindMapPlus());
|
||||
cmds.add(new CommandMindMapDirection());
|
||||
|
@ -83,6 +83,7 @@ public class CommandCreateEntityObjectMultilines extends CommandMultilines2<Abst
|
||||
return "(?i)^[%s]*\\}[%s]*$";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(AbstractClassOrObjectDiagram diagram, BlocLines lines) {
|
||||
lines = lines.trim(true);
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
|
@ -101,12 +101,18 @@ public class Defines implements Truth {
|
||||
final Defines result = createEmpty();
|
||||
result.overrideFilename(file.getName());
|
||||
result.environment.put("filedate", new Date(file.lastModified()).toString());
|
||||
// result.environment.put("filename", file.getName());
|
||||
// result.environment.put("filenameNoExtension", nameNoExtension(file));
|
||||
result.environment.put("dirpath", file.getAbsoluteFile().getParentFile().getAbsolutePath().replace('\\', '/'));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static Defines createWithMap(Map<String, String> init) {
|
||||
final Defines result = createEmpty();
|
||||
for (Map.Entry<String, String> ent : init.entrySet()) {
|
||||
result.environment.put(ent.getKey(), ent.getValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getEnvironmentValue(String key) {
|
||||
return this.environment.get(key);
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ import java.util.Set;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
||||
import net.sourceforge.plantuml.style.PName;
|
||||
import net.sourceforge.plantuml.style.SName;
|
||||
import net.sourceforge.plantuml.style.Style;
|
||||
import net.sourceforge.plantuml.style.StyleBuilder;
|
||||
@ -53,12 +54,15 @@ import net.sourceforge.plantuml.style.WithStyle;
|
||||
public abstract class AbstractMessage implements EventWithDeactivate, WithStyle {
|
||||
|
||||
public Style[] getUsedStyles() {
|
||||
return new Style[] { getDefaultStyleDefinition().getMergedStyle(styleBuilder) };
|
||||
Style style = getDefaultStyleDefinition().getMergedStyle(styleBuilder);
|
||||
if (style != null && arrowConfiguration.getColor() != null) {
|
||||
style = style.eventuallyOverride(PName.LineColor, arrowConfiguration.getColor());
|
||||
}
|
||||
return new Style[] { style };
|
||||
}
|
||||
|
||||
public StyleSignature getDefaultStyleDefinition() {
|
||||
return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram,
|
||||
SName.arrow);
|
||||
return StyleSignature.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow);
|
||||
}
|
||||
|
||||
private final Display label;
|
||||
@ -181,7 +185,8 @@ public abstract class AbstractMessage implements EventWithDeactivate, WithStyle
|
||||
}
|
||||
|
||||
public final void setNote(Note note) {
|
||||
if (note.getPosition() != NotePosition.LEFT && note.getPosition() != NotePosition.RIGHT) {
|
||||
if (note.getPosition() != NotePosition.LEFT && note.getPosition() != NotePosition.RIGHT
|
||||
&& note.getPosition() != NotePosition.BOTTOM && note.getPosition() != NotePosition.TOP) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
note = note.withPosition(overideNotePosition(note.getPosition()));
|
||||
|
@ -49,14 +49,21 @@ import net.sourceforge.plantuml.style.StyleBuilder;
|
||||
import net.sourceforge.plantuml.style.StyleSignature;
|
||||
import net.sourceforge.plantuml.style.WithStyle;
|
||||
|
||||
public class Note extends AbstractEvent implements Event, SpecificBackcolorable, WithStyle {
|
||||
final public class Note extends AbstractEvent implements Event, SpecificBackcolorable, WithStyle {
|
||||
|
||||
private final Participant p;
|
||||
private final Participant p2;
|
||||
|
||||
private final Display strings;
|
||||
|
||||
private final NotePosition position;
|
||||
private/* final */NotePosition position;
|
||||
|
||||
public void temporaryProtectedUntilTeozIsStandard() {
|
||||
if (position == NotePosition.BOTTOM || position == NotePosition.TOP) {
|
||||
position = NotePosition.LEFT;
|
||||
}
|
||||
}
|
||||
|
||||
private final StyleBuilder styleBuilder;
|
||||
private NoteStyle noteStyle = NoteStyle.NORMAL;
|
||||
private Colors colors = Colors.empty();
|
||||
@ -186,14 +193,4 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable,
|
||||
return parallel;
|
||||
}
|
||||
|
||||
// public Style[] applyStyle2(Style[] usedStyles) {
|
||||
// if (usedStyles.length != 1) {
|
||||
// throw new IllegalArgumentException();
|
||||
// }
|
||||
// Style tmp = usedStyles[0];
|
||||
// if (tmp != null) {
|
||||
// tmp = tmp.eventuallyOverride(colors);
|
||||
// }
|
||||
// return new Style[] { tmp };
|
||||
// }
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ package net.sourceforge.plantuml.sequencediagram;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
|
||||
public enum NotePosition {
|
||||
LEFT, RIGHT, OVER, OVER_SEVERAL;
|
||||
LEFT, RIGHT, OVER, OVER_SEVERAL, BOTTOM, TOP;
|
||||
|
||||
public static NotePosition defaultLeft(String s) {
|
||||
if (s == null) {
|
||||
|
@ -177,6 +177,7 @@ class Step1Message extends Step1Abstract {
|
||||
for (int i = 0; i < getNotes().size(); i++) {
|
||||
final Component note = getNotes().get(i);
|
||||
final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
|
||||
noteOnMessage.temporaryProtectedUntilTeozIsStandard();
|
||||
noteBoxes.add(createNoteBox(getStringBounder(), messageSelfArrow, note, noteOnMessage));
|
||||
}
|
||||
return new ArrowAndNoteBox(getStringBounder(), messageSelfArrow, noteBoxes);
|
||||
@ -185,6 +186,7 @@ class Step1Message extends Step1Abstract {
|
||||
for (int i = 0; i < getNotes().size(); i++) {
|
||||
final Component note = getNotes().get(i);
|
||||
final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
|
||||
noteOnMessage.temporaryProtectedUntilTeozIsStandard();
|
||||
noteBoxes.add(createNoteBox(getStringBounder(), messageArrow, note, noteOnMessage));
|
||||
}
|
||||
return new ArrowAndNoteBox(getStringBounder(), messageArrow, noteBoxes);
|
||||
|
@ -0,0 +1,156 @@
|
||||
/* ========================================================================
|
||||
* 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.sequencediagram.teoz;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
|
||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||
import net.sourceforge.plantuml.sequencediagram.Note;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class CommunicationTileNoteBottom extends AbstractTile implements TileWithUpdateStairs, TileWithCallbackY {
|
||||
|
||||
private final TileWithUpdateStairs tile;
|
||||
private final AbstractMessage message;
|
||||
private final Rose skin;
|
||||
private final ISkinParam skinParam;
|
||||
private final Note noteOnMessage;
|
||||
|
||||
public Event getEvent() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getYPoint(StringBounder stringBounder) {
|
||||
return tile.getYPoint(stringBounder);
|
||||
}
|
||||
|
||||
public CommunicationTileNoteBottom(TileWithUpdateStairs tile, AbstractMessage message, Rose skin,
|
||||
ISkinParam skinParam, Note noteOnMessage) {
|
||||
this.tile = tile;
|
||||
this.message = message;
|
||||
this.skin = skin;
|
||||
this.skinParam = skinParam;
|
||||
this.noteOnMessage = noteOnMessage;
|
||||
}
|
||||
|
||||
public void updateStairs(StringBounder stringBounder, double y) {
|
||||
tile.updateStairs(stringBounder, y);
|
||||
}
|
||||
|
||||
private Component getComponent(StringBounder stringBounder) {
|
||||
final Component comp = skin.createComponent(noteOnMessage.getUsedStyles(), ComponentType.NOTE, null,
|
||||
noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
|
||||
return comp;
|
||||
}
|
||||
|
||||
private Real getNotePosition(StringBounder stringBounder) {
|
||||
final Real minX = tile.getMinX(stringBounder);
|
||||
return minX;
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Component comp = getComponent(stringBounder);
|
||||
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
|
||||
final Area area = new Area(dim.getWidth(), dim.getHeight());
|
||||
tile.drawU(ug);
|
||||
|
||||
final double middleMsg = (tile.getMinX(stringBounder).getCurrentValue() + tile.getMaxX(stringBounder).getCurrentValue()) / 2;
|
||||
|
||||
final double xNote = getNotePosition(stringBounder).getCurrentValue();
|
||||
final double yNote = tile.getPreferredHeight(stringBounder);
|
||||
|
||||
comp.drawU(ug.apply(new UTranslate(xNote, yNote + spacey)), area, (Context2D) ug);
|
||||
|
||||
drawLine(ug, middleMsg, tile.getYPoint(stringBounder), xNote + dim.getWidth() / 2, yNote + spacey
|
||||
+ Rose.paddingY);
|
||||
|
||||
}
|
||||
|
||||
private final double spacey = 10;
|
||||
|
||||
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
|
||||
final HtmlColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
|
||||
|
||||
final double dx = x2 - x1;
|
||||
final double dy = y2 - y1;
|
||||
|
||||
ug.apply(new UTranslate(x1, y1)).apply(new UChangeColor(color)).apply(new UStroke(2, 2, 1))
|
||||
.draw(new ULine(dx, dy));
|
||||
|
||||
}
|
||||
|
||||
public double getPreferredHeight(StringBounder stringBounder) {
|
||||
final Component comp = getComponent(stringBounder);
|
||||
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
|
||||
return tile.getPreferredHeight(stringBounder) + dim.getHeight() + spacey;
|
||||
}
|
||||
|
||||
public void addConstraints(StringBounder stringBounder) {
|
||||
tile.addConstraints(stringBounder);
|
||||
}
|
||||
|
||||
public Real getMinX(StringBounder stringBounder) {
|
||||
return tile.getMinX(stringBounder);
|
||||
}
|
||||
|
||||
public Real getMaxX(StringBounder stringBounder) {
|
||||
return tile.getMaxX(stringBounder);
|
||||
}
|
||||
|
||||
public void callbackY(double y) {
|
||||
if (tile instanceof TileWithCallbackY) {
|
||||
((TileWithCallbackY) tile).callbackY(y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
/* ========================================================================
|
||||
* 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.sequencediagram.teoz;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.real.Real;
|
||||
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
|
||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||
import net.sourceforge.plantuml.sequencediagram.Note;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.skin.ComponentType;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class CommunicationTileNoteTop extends AbstractTile implements TileWithUpdateStairs, TileWithCallbackY {
|
||||
|
||||
private final TileWithUpdateStairs tile;
|
||||
private final AbstractMessage message;
|
||||
private final Rose skin;
|
||||
private final ISkinParam skinParam;
|
||||
private final Note noteOnMessage;
|
||||
|
||||
public Event getEvent() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getYPoint(StringBounder stringBounder) {
|
||||
return tile.getYPoint(stringBounder);
|
||||
}
|
||||
|
||||
public CommunicationTileNoteTop(TileWithUpdateStairs tile, AbstractMessage message, Rose skin,
|
||||
ISkinParam skinParam, Note noteOnMessage) {
|
||||
this.tile = tile;
|
||||
this.message = message;
|
||||
this.skin = skin;
|
||||
this.skinParam = skinParam;
|
||||
this.noteOnMessage = noteOnMessage;
|
||||
}
|
||||
|
||||
public void updateStairs(StringBounder stringBounder, double y) {
|
||||
tile.updateStairs(stringBounder, y);
|
||||
}
|
||||
|
||||
private Component getComponent(StringBounder stringBounder) {
|
||||
final Component comp = skin.createComponent(noteOnMessage.getUsedStyles(), ComponentType.NOTE, null,
|
||||
noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
|
||||
return comp;
|
||||
}
|
||||
|
||||
private Real getNotePosition(StringBounder stringBounder) {
|
||||
final Real minX = tile.getMinX(stringBounder);
|
||||
return minX;
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Component comp = getComponent(stringBounder);
|
||||
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
|
||||
final Area area = new Area(dim.getWidth(), dim.getHeight());
|
||||
|
||||
tile.drawU(ug.apply(new UTranslate(0, dim.getHeight() + spacey)));
|
||||
|
||||
final double middleMsg = (tile.getMinX(stringBounder).getCurrentValue() + tile.getMaxX(stringBounder)
|
||||
.getCurrentValue()) / 2;
|
||||
|
||||
final double xNote = getNotePosition(stringBounder).getCurrentValue();
|
||||
|
||||
comp.drawU(ug.apply(new UTranslate(xNote, 0)), area, (Context2D) ug);
|
||||
|
||||
drawLine(ug, middleMsg, tile.getYPoint(stringBounder) + dim.getHeight() + spacey, xNote + dim.getWidth() / 2,
|
||||
dim.getHeight() - 2 * Rose.paddingY);
|
||||
|
||||
}
|
||||
|
||||
private final double spacey = 10;
|
||||
|
||||
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2) {
|
||||
final HtmlColor color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);
|
||||
|
||||
final double dx = x2 - x1;
|
||||
final double dy = y2 - y1;
|
||||
|
||||
ug.apply(new UTranslate(x1, y1)).apply(new UChangeColor(color)).apply(new UStroke(2, 2, 1))
|
||||
.draw(new ULine(dx, dy));
|
||||
|
||||
}
|
||||
|
||||
public double getPreferredHeight(StringBounder stringBounder) {
|
||||
final Component comp = getComponent(stringBounder);
|
||||
final Dimension2D dim = comp.getPreferredDimension(stringBounder);
|
||||
return tile.getPreferredHeight(stringBounder) + dim.getHeight() + spacey;
|
||||
}
|
||||
|
||||
public void addConstraints(StringBounder stringBounder) {
|
||||
tile.addConstraints(stringBounder);
|
||||
}
|
||||
|
||||
public Real getMinX(StringBounder stringBounder) {
|
||||
return tile.getMinX(stringBounder);
|
||||
}
|
||||
|
||||
public Real getMaxX(StringBounder stringBounder) {
|
||||
return tile.getMaxX(stringBounder);
|
||||
}
|
||||
|
||||
public void callbackY(double y) {
|
||||
if (tile instanceof TileWithCallbackY) {
|
||||
((TileWithCallbackY) tile).callbackY(y);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -58,7 +58,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
public class LiveBoxesDrawer {
|
||||
|
||||
private double y1;
|
||||
private SymbolContext color;
|
||||
private SymbolContext symbolContext;
|
||||
|
||||
private final Component cross;
|
||||
private final Context2D context;
|
||||
@ -86,9 +86,9 @@ public class LiveBoxesDrawer {
|
||||
return compForWidth.getPreferredWidth(stringBounder);
|
||||
}
|
||||
|
||||
public void addStart(double y1, SymbolContext color) {
|
||||
public void addStart(double y1, SymbolContext symbolContext) {
|
||||
this.y1 = y1;
|
||||
this.color = color;
|
||||
this.symbolContext = symbolContext;
|
||||
}
|
||||
|
||||
public void doDrawing(UGraphic ug, StairsPosition yposition) {
|
||||
@ -121,10 +121,13 @@ public class LiveBoxesDrawer {
|
||||
private void drawInternal(UGraphic ug, StairsPosition yposition, double ya, double yb, ComponentType type) {
|
||||
final double width = getWidth(ug.getStringBounder());
|
||||
final Area area = new Area(width, yb - ya);
|
||||
final ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, color == null ? null : color.getBackColor());
|
||||
final Component comp = skin.createComponent(
|
||||
new Style[] { type.getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder()) },
|
||||
type, null, skinParam2, null);
|
||||
ISkinParam skinParam2 = new SkinParamBackcolored(skinParam, symbolContext == null ? null
|
||||
: symbolContext.getBackColor());
|
||||
Style style = type.getDefaultStyleDefinition().getMergedStyle(skinParam.getCurrentStyleBuilder());
|
||||
if (style != null) {
|
||||
style = style.eventuallyOverride(symbolContext);
|
||||
}
|
||||
final Component comp = skin.createComponent(new Style[] { style }, type, null, skinParam2, null);
|
||||
comp.drawU(ug.apply(new UTranslate(-width / 2, ya)), area, context);
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,12 @@ public class TileBuilder {
|
||||
} else if (notePosition == NotePosition.RIGHT) {
|
||||
result = new CommunicationTileNoteRight((TileWithUpdateStairs) result, msg, skin, skinParam,
|
||||
reverse ? livingSpace1 : livingSpace2, noteOnMessage);
|
||||
} else if (notePosition == NotePosition.BOTTOM) {
|
||||
result = new CommunicationTileNoteBottom((TileWithUpdateStairs) result, msg, skin, skinParam,
|
||||
noteOnMessage);
|
||||
} else if (notePosition == NotePosition.TOP) {
|
||||
result = new CommunicationTileNoteTop((TileWithUpdateStairs) result, msg, skin, skinParam,
|
||||
noteOnMessage);
|
||||
}
|
||||
}
|
||||
tiles.add(result);
|
||||
|
@ -66,7 +66,7 @@ import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
public class Rose {
|
||||
|
||||
final private double paddingX = 5;
|
||||
final private double paddingY = 5;
|
||||
final public static double paddingY = 5;
|
||||
|
||||
public HtmlColor getFontColor(ISkinParam skin, FontParam fontParam) {
|
||||
return skin.getFontHtmlColor(null, fontParam);
|
||||
@ -321,7 +321,22 @@ public class Rose {
|
||||
final String value = textStyle.value(PName.HorizontalAlignment).asString();
|
||||
messageHorizontalAlignment = textStyle.getHorizontalAlignment();
|
||||
textHorizontalAlignment = textStyle.getHorizontalAlignment();
|
||||
if ("direction".equalsIgnoreCase(value)) {
|
||||
if ("first".equalsIgnoreCase(value)) {
|
||||
final boolean isReverseDefine = config.isReverseDefine();
|
||||
if (arrowDirection == ArrowDirection.RIGHT_TO_LEFT_REVERSE) {
|
||||
if (isReverseDefine) {
|
||||
messageHorizontalAlignment = HorizontalAlignment.LEFT;
|
||||
} else {
|
||||
messageHorizontalAlignment = HorizontalAlignment.RIGHT;
|
||||
}
|
||||
} else {
|
||||
if (isReverseDefine) {
|
||||
messageHorizontalAlignment = HorizontalAlignment.RIGHT;
|
||||
} else {
|
||||
messageHorizontalAlignment = HorizontalAlignment.LEFT;
|
||||
}
|
||||
}
|
||||
} else if ("direction".equalsIgnoreCase(value)) {
|
||||
if (arrowDirection == ArrowDirection.LEFT_TO_RIGHT_NORMAL) {
|
||||
messageHorizontalAlignment = HorizontalAlignment.LEFT;
|
||||
} else if (arrowDirection == ArrowDirection.RIGHT_TO_LEFT_REVERSE) {
|
||||
|
@ -56,6 +56,7 @@ public class ListSpriteDiagramFactory extends UmlDiagramFactory {
|
||||
final List<Command> cmds = new ArrayList<Command>();
|
||||
addCommonCommands1(cmds);
|
||||
addCommonCommands2(cmds);
|
||||
cmds.add(new CommandListSprite());
|
||||
return cmds;
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@ package net.sourceforge.plantuml.style;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import net.sourceforge.plantuml.FileSystem;
|
||||
import net.sourceforge.plantuml.LineLocation;
|
||||
@ -75,10 +76,18 @@ public class CommandStyleImport extends SingleLineCommand2<UmlDiagram> {
|
||||
final String path = arg.get("PATH", 0);
|
||||
try {
|
||||
final File f = FileSystem.getInstance().getFile(path);
|
||||
if (f.exists() == false) {
|
||||
BlocLines lines = null;
|
||||
if (f.exists()) {
|
||||
lines = BlocLines.load(f, location);
|
||||
} else {
|
||||
final InputStream internalIs = StyleLoader.class.getResourceAsStream("/skin/" + path);
|
||||
if (internalIs != null) {
|
||||
lines = BlocLines.load(internalIs, location);
|
||||
}
|
||||
}
|
||||
if (lines == null) {
|
||||
return CommandExecutionResult.error("File does not exist: " + path);
|
||||
}
|
||||
final BlocLines lines = BlocLines.load(f, location);
|
||||
final StyleBuilder styleBuilder = diagram.getSkinParam().getCurrentStyleBuilder();
|
||||
for (Style modifiedStyle : StyleLoader.getDeclaredStyles(lines, styleBuilder)) {
|
||||
diagram.getSkinParam().muteStyle(modifiedStyle);
|
||||
|
@ -89,25 +89,35 @@ public class FromSkinparamToStyle {
|
||||
addConvert("entityBorderThickness", PName.LineThickness, SName.entity);
|
||||
addConFont("entity", SName.entity);
|
||||
addConFont("footer", SName.footer);
|
||||
|
||||
addConvert("sequenceStereotypeFontSize", PName.FontSize, SName.stereotype);
|
||||
addConvert("sequenceStereotypeFontStyle", PName.FontStyle, SName.stereotype);
|
||||
addConvert("sequenceStereotypeFontColor", PName.FontColor, SName.stereotype);
|
||||
addConvert("sequenceStereotypeFontName", PName.FontName, SName.stereotype);
|
||||
addConvert("SequenceReferenceBorderColor", PName.LineColor, SName.reference);
|
||||
addConvert("SequenceReferenceBorderColor", PName.LineColor, SName.referenceHeader);
|
||||
addConvert("SequenceReferenceBackgroundColor", PName.BackGroundColor, SName.reference);
|
||||
addConvert("sequenceReferenceHeaderBackgroundColor", PName.BackGroundColor, SName.referenceHeader);
|
||||
addConFont("sequenceReference", SName.reference);
|
||||
addConFont("sequenceReference", SName.referenceHeader);
|
||||
addConvert("sequenceGroupBorderThickness", PName.LineThickness, SName.group);
|
||||
addConvert("SequenceGroupBorderColor", PName.LineColor, SName.group);
|
||||
addConvert("SequenceGroupBorderColor", PName.LineColor, SName.groupHeader);
|
||||
addConvert("SequenceGroupBackgroundColor", PName.BackGroundColor, SName.groupHeader);
|
||||
addConFont("SequenceGroup", SName.group);
|
||||
addConFont("SequenceGroupHeader", SName.groupHeader);
|
||||
addConvert("SequenceBoxBorderColor", PName.LineColor, SName.box);
|
||||
addConvert("SequenceBoxBackgroundColor", PName.BackGroundColor, SName.box);
|
||||
addConvert("SequenceLifeLineBorderColor", PName.LineColor, SName.lifeLine);
|
||||
addConvert("SequenceLifeLineBackgroundColor", PName.BackGroundColor, SName.lifeLine);
|
||||
addConvert("sequenceDividerBackgroundColor", PName.BackGroundColor, SName.separator);
|
||||
addConvert("sequenceDividerBorderColor", PName.LineColor, SName.separator);
|
||||
addConFont("sequenceDivider", SName.separator);
|
||||
addConvert("sequenceDividerBorderThickness", PName.LineThickness, SName.separator);
|
||||
addConvert("SequenceMessageAlignment", PName.HorizontalAlignment, SName.arrow);
|
||||
|
||||
addConFont("note", SName.note);
|
||||
addConvert("noteBorderThickness", PName.LineThickness, SName.note);
|
||||
addConvert("noteBackgroundColor", PName.BackGroundColor, SName.note);
|
||||
addConvert("packageBackgroundColor", PName.BackGroundColor, SName.group);
|
||||
addConvert("packageBorderColor", PName.LineColor, SName.group);
|
||||
@ -125,7 +135,12 @@ public class FromSkinparamToStyle {
|
||||
addConvert("activityDiamondBorderColor", PName.LineColor, SName.diamond);
|
||||
addConFont("activityDiamond", SName.diamond);
|
||||
addConvert("arrowColor", PName.LineColor, SName.arrow);
|
||||
|
||||
addConFont("arrow", SName.arrow);
|
||||
addConvert("arrowThickness", PName.LineThickness, SName.arrow);
|
||||
addConvert("arrowColor", PName.LineColor, SName.arrow);
|
||||
addConvert("arrowStyle", PName.LineStyle, SName.arrow);
|
||||
|
||||
addConvert("defaulttextalignment", PName.HorizontalAlignment, SName.root);
|
||||
addConvert("defaultFontName", PName.FontName, SName.root);
|
||||
addConFont("SwimlaneTitle", SName.swimlane);
|
||||
@ -150,7 +165,10 @@ public class FromSkinparamToStyle {
|
||||
private final List<Style> styles = new ArrayList<Style>();
|
||||
private String stereo = null;
|
||||
|
||||
public FromSkinparamToStyle(String key, final String value, final AutomaticCounter counter) {
|
||||
public FromSkinparamToStyle(String key, String value, final AutomaticCounter counter) {
|
||||
if (value.equals("right:right")) {
|
||||
value = "right";
|
||||
}
|
||||
if (key.contains("<<")) {
|
||||
final StringTokenizer st = new StringTokenizer(key, "<>");
|
||||
key = st.nextToken();
|
||||
|
@ -124,6 +124,17 @@ public class Style {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Style eventuallyOverride(SymbolContext symbolContext) {
|
||||
Style result = this;
|
||||
if (symbolContext != null) {
|
||||
final HtmlColor back = symbolContext.getBackColor();
|
||||
if (back != null) {
|
||||
result = result.eventuallyOverride(PName.BackGroundColor, back);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public StyleSignature getSignature() {
|
||||
return signature;
|
||||
}
|
||||
@ -215,4 +226,5 @@ public class Style {
|
||||
ug = ug.apply(getStroke());
|
||||
return ug;
|
||||
}
|
||||
|
||||
}
|
@ -36,6 +36,7 @@
|
||||
package net.sourceforge.plantuml.svek;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -47,6 +48,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
import net.sourceforge.plantuml.BaseFile;
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.Guillemet;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
@ -66,6 +68,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
|
||||
import net.sourceforge.plantuml.cucadiagram.EntityPortion;
|
||||
import net.sourceforge.plantuml.cucadiagram.EntityPosition;
|
||||
import net.sourceforge.plantuml.cucadiagram.GroupRoot;
|
||||
import net.sourceforge.plantuml.cucadiagram.GroupType;
|
||||
import net.sourceforge.plantuml.cucadiagram.IEntity;
|
||||
import net.sourceforge.plantuml.cucadiagram.IGroup;
|
||||
@ -90,6 +93,7 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.GraphicStrings;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.InnerStrategy;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockEmpty;
|
||||
@ -125,6 +129,8 @@ import net.sourceforge.plantuml.svek.image.EntityImageStateEmptyDescription;
|
||||
import net.sourceforge.plantuml.svek.image.EntityImageSynchroBar;
|
||||
import net.sourceforge.plantuml.svek.image.EntityImageTips;
|
||||
import net.sourceforge.plantuml.svek.image.EntityImageUseCase;
|
||||
import net.sourceforge.plantuml.ugraphic.MinMax;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
|
||||
public final class GeneralImageBuilder {
|
||||
|
||||
@ -265,6 +271,7 @@ public final class GeneralImageBuilder {
|
||||
private final EntityFactory entityFactory;
|
||||
private final UmlSource source;
|
||||
private final Pragma pragma;
|
||||
private final boolean strictUmlStyle;
|
||||
private Map<Code, Double> maxX;
|
||||
|
||||
private final StringBounder stringBounder;
|
||||
@ -276,13 +283,72 @@ public final class GeneralImageBuilder {
|
||||
this.source = source;
|
||||
this.pragma = pragma;
|
||||
this.stringBounder = stringBounder;
|
||||
this.strictUmlStyle = dotData.getSkinParam().strictUmlStyle();
|
||||
}
|
||||
|
||||
final public StyleSignature getDefaultStyleDefinitionArrow() {
|
||||
return StyleSignature.of(SName.root, SName.element, SName.activityDiagram, SName.arrow);
|
||||
}
|
||||
|
||||
private boolean isOpalisable(IEntity entity) {
|
||||
if (strictUmlStyle) {
|
||||
return false;
|
||||
}
|
||||
return entity.isGroup() == false && entity.getLeafType() == LeafType.NOTE && onlyOneLink(entity);
|
||||
}
|
||||
|
||||
static class IEntityImageEmpty implements IEntityImage {
|
||||
|
||||
public boolean isHidden() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public HtmlColor getBackcolor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new Dimension2DDouble(10, 10);
|
||||
}
|
||||
|
||||
public MinMax getMinMax(StringBounder stringBounder) {
|
||||
return MinMax.fromDim(calculateDimension(stringBounder));
|
||||
}
|
||||
|
||||
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
}
|
||||
|
||||
public ShapeType getShapeType() {
|
||||
return ShapeType.RECTANGLE;
|
||||
}
|
||||
|
||||
public Margins getShield(StringBounder stringBounder) {
|
||||
return Margins.NONE;
|
||||
}
|
||||
|
||||
public double getOverscanX(StringBounder stringBounder) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public IEntityImage buildImage(BaseFile basefile, String dotStrings[]) {
|
||||
if (dotData.isDegeneratedWithFewEntities(0)) {
|
||||
return new IEntityImageEmpty();
|
||||
}
|
||||
if (dotData.isDegeneratedWithFewEntities(1) && dotData.getUmlDiagramType() != UmlDiagramType.STATE) {
|
||||
final ILeaf single = dotData.getLeafs().iterator().next();
|
||||
final IGroup group = single.getParentContainer();
|
||||
if (group instanceof GroupRoot) {
|
||||
return new IEntityImageMoved(GeneralImageBuilder.createEntityImageBlock(single, dotData.getSkinParam(),
|
||||
dotData.isHideEmptyDescriptionForState(), dotData, null, null, dotData.getUmlDiagramType(),
|
||||
dotData.getLinks()));
|
||||
}
|
||||
}
|
||||
dotData.removeIrrelevantSametail();
|
||||
final DotStringFactory dotStringFactory = new DotStringFactory(stringBounder, dotData);
|
||||
|
||||
@ -309,16 +375,14 @@ public final class GeneralImageBuilder {
|
||||
|
||||
dotStringFactory.getBibliotekon().addLine(line);
|
||||
|
||||
if (link.getEntity1().isGroup() == false && link.getEntity1().getLeafType() == LeafType.NOTE
|
||||
&& onlyOneLink(link.getEntity1())) {
|
||||
if (isOpalisable(link.getEntity1())) {
|
||||
final Shape shape = dotStringFactory.getBibliotekon().getShape(link.getEntity1());
|
||||
final Shape other = dotStringFactory.getBibliotekon().getShape(link.getEntity2());
|
||||
if (other != null) {
|
||||
((EntityImageNote) shape.getImage()).setOpaleLine(line, shape, other);
|
||||
line.setOpale(true);
|
||||
}
|
||||
} else if (link.getEntity2().isGroup() == false && link.getEntity2().getLeafType() == LeafType.NOTE
|
||||
&& onlyOneLink(link.getEntity2())) {
|
||||
} else if (isOpalisable(link.getEntity2())) {
|
||||
final Shape shape = dotStringFactory.getBibliotekon().getShape(link.getEntity2());
|
||||
final Shape other = dotStringFactory.getBibliotekon().getShape(link.getEntity1());
|
||||
if (other != null) {
|
||||
@ -335,13 +399,10 @@ public final class GeneralImageBuilder {
|
||||
return error(dotStringFactory.getDotExe());
|
||||
}
|
||||
|
||||
// final boolean trace = OptionFlags.getInstance().isKeepTmpFiles() || OptionFlags.TRACE_DOT || isSvekTrace();
|
||||
// option.isDebugSvek
|
||||
// System.err.println("FOO11 svekDebug=" + svekDebug);
|
||||
if (basefile == null && isSvekTrace()) {
|
||||
basefile = new BaseFile();
|
||||
}
|
||||
// System.err.println("FOO11 basefile=" + basefile);
|
||||
|
||||
final String svg;
|
||||
try {
|
||||
svg = dotStringFactory.getSvg(basefile, dotStrings);
|
||||
|
97
src/net/sourceforge/plantuml/svek/IEntityImageMoved.java
Normal file
97
src/net/sourceforge/plantuml/svek/IEntityImageMoved.java
Normal file
@ -0,0 +1,97 @@
|
||||
/* ========================================================================
|
||||
* 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.svek;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.InnerStrategy;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.MinMax;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class IEntityImageMoved implements IEntityImage {
|
||||
|
||||
private final IEntityImage orig;
|
||||
private final double delta = 7;
|
||||
|
||||
public IEntityImageMoved(IEntityImage orig) {
|
||||
this.orig = orig;
|
||||
}
|
||||
|
||||
public boolean isHidden() {
|
||||
return orig.isHidden();
|
||||
}
|
||||
|
||||
public HtmlColor getBackcolor() {
|
||||
return orig.getBackcolor();
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return Dimension2DDouble.delta(orig.calculateDimension(stringBounder), delta * 2, delta * 2);
|
||||
}
|
||||
|
||||
public MinMax getMinMax(StringBounder stringBounder) {
|
||||
return orig.getMinMax(stringBounder);
|
||||
// return orig.getMinMax(stringBounder).translate(new UTranslate(delta, delta));
|
||||
// return orig.getMinMax(stringBounder).appendToMax(delta, delta);
|
||||
}
|
||||
|
||||
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
||||
return orig.getInnerPosition(member, stringBounder, strategy);
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
orig.drawU(ug.apply(new UTranslate(delta, delta)));
|
||||
|
||||
}
|
||||
|
||||
public ShapeType getShapeType() {
|
||||
return orig.getShapeType();
|
||||
}
|
||||
|
||||
public Margins getShield(StringBounder stringBounder) {
|
||||
return orig.getShield(stringBounder);
|
||||
}
|
||||
|
||||
public double getOverscanX(StringBounder stringBounder) {
|
||||
return orig.getOverscanX(stringBounder);
|
||||
}
|
||||
|
||||
}
|
@ -68,15 +68,6 @@ public class Opale extends AbstractTextBlock implements TextBlock {
|
||||
|
||||
private final TextBlock textBlock;
|
||||
|
||||
private Opale(boolean shadowing, HtmlColor borderColor, HtmlColor noteBackgroundColor, TextBlock textBlock,
|
||||
boolean withLink) {
|
||||
this.noteBackgroundColor = noteBackgroundColor;
|
||||
this.withLink = withLink;
|
||||
this.shadowing2 = shadowing ? 4 : 0;
|
||||
this.borderColor = borderColor;
|
||||
this.textBlock = textBlock;
|
||||
}
|
||||
|
||||
public Opale(double shadowing, HtmlColor borderColor, HtmlColor noteBackgroundColor, TextBlock textBlock,
|
||||
boolean withLink) {
|
||||
this.noteBackgroundColor = noteBackgroundColor;
|
||||
|
@ -90,7 +90,10 @@ public class SvgGraphics {
|
||||
// http://www.w3schools.com/svg/svg_feoffset.asp
|
||||
// http://www.adobe.com/svg/demos/samples.html
|
||||
|
||||
private static final String XLINK_HREF = "href";
|
||||
private static final String XLINK_TITLE1 = "title";
|
||||
private static final String XLINK_TITLE2 = "xlink:title";
|
||||
private static final String XLINK_HREF1 = "href";
|
||||
private static final String XLINK_HREF2 = "xlink:href";
|
||||
|
||||
final private Document document;
|
||||
final private Element root;
|
||||
@ -329,15 +332,18 @@ public class SvgGraphics {
|
||||
|
||||
pendingAction.add(0, (Element) document.createElement("a"));
|
||||
pendingAction.get(0).setAttribute("target", target);
|
||||
pendingAction.get(0).setAttribute(XLINK_HREF, url);
|
||||
pendingAction.get(0).setAttribute(XLINK_HREF1, url);
|
||||
pendingAction.get(0).setAttribute(XLINK_HREF2, url);
|
||||
pendingAction.get(0).setAttribute("xlink:type", "simple");
|
||||
pendingAction.get(0).setAttribute("xlink:actuate", "onRequest");
|
||||
pendingAction.get(0).setAttribute("xlink:show", "new");
|
||||
if (title == null) {
|
||||
pendingAction.get(0).setAttribute("xlink:title", url);
|
||||
pendingAction.get(0).setAttribute(XLINK_TITLE1, url);
|
||||
pendingAction.get(0).setAttribute(XLINK_TITLE2, url);
|
||||
} else {
|
||||
title = title.replaceAll("\\\\n", "\n");
|
||||
pendingAction.get(0).setAttribute("xlink:title", title);
|
||||
pendingAction.get(0).setAttribute(XLINK_TITLE1, title);
|
||||
pendingAction.get(0).setAttribute(XLINK_TITLE2, title);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,19 +90,20 @@ public class ShuntingYard {
|
||||
} else if (token.getTokenType() == TokenType.OPEN_PAREN_MATH) {
|
||||
operatorStack.addFirst(token);
|
||||
} else if (token.getTokenType() == TokenType.CLOSE_PAREN_FUNC) {
|
||||
ouputQueue.add(operatorStack.removeFirst());
|
||||
final Token first = operatorStack.removeFirst();
|
||||
ouputQueue.add(first);
|
||||
} else if (token.getTokenType() == TokenType.CLOSE_PAREN_MATH) {
|
||||
while (operatorStack.peekFirst().getTokenType() != TokenType.OPEN_PAREN_MATH) {
|
||||
ouputQueue.add(operatorStack.removeFirst());
|
||||
// System.err.println("Warning 2013");
|
||||
}
|
||||
if (operatorStack.peekFirst().getTokenType() == TokenType.OPEN_PAREN_MATH) {
|
||||
// System.err.println("Warning 4210");
|
||||
operatorStack.removeFirst();
|
||||
// throw new UnsupportedOperationException(token.toString());
|
||||
}
|
||||
} else if (token.getTokenType() == TokenType.COMMA) {
|
||||
// Just ignore
|
||||
while (operatorStack.peekFirst() != null
|
||||
&& operatorStack.peekFirst().getTokenType() != TokenType.OPEN_PAREN_FUNC) {
|
||||
ouputQueue.add(operatorStack.removeFirst());
|
||||
}
|
||||
} else {
|
||||
throw new UnsupportedOperationException(token.toString());
|
||||
}
|
||||
|
@ -52,10 +52,12 @@ public class CommandNoteLong extends CommandMultilines2<TimingDiagram> {
|
||||
super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPatternEnd() {
|
||||
return "(?i)^end[%s]?note$";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandExecutionResult executeNow(final TimingDiagram diagram, BlocLines lines) {
|
||||
|
||||
final RegexResult line0 = getStartingPattern().matcher(lines.getFirst499().getTrimmed().getString());
|
||||
|
@ -43,7 +43,7 @@ public class Version {
|
||||
private static final int MAJOR_SEPARATOR = 1000000;
|
||||
|
||||
public static int version() {
|
||||
return 1201910;
|
||||
return 1201911;
|
||||
}
|
||||
|
||||
public static int versionPatched() {
|
||||
@ -93,7 +93,7 @@ public class Version {
|
||||
}
|
||||
|
||||
public static long compileTime() {
|
||||
return 1568407983922L;
|
||||
return 1569146535007L;
|
||||
}
|
||||
|
||||
public static String compileTimeString() {
|
||||
|
@ -128,7 +128,7 @@ public class WBSDiagram extends UmlDiagram {
|
||||
return new Fork(getSkinParam(), root);
|
||||
}
|
||||
|
||||
public final static Pattern2 patternStereotype = MyPattern.cmpile("^\\s*(.*?)(?:\\s*\\<\\<\\s*(.*)\\s*\\>\\>)?\\s*$");
|
||||
public final static Pattern2 patternStereotype = MyPattern.cmpile("^\\s*(.*?)(?:\\s*\\<\\<\\s*(.*)\\s*\\>\\>)\\s*$");
|
||||
|
||||
public CommandExecutionResult addIdea(int level, String label, Direction direction, IdeaShape shape) {
|
||||
final Matcher2 m = patternStereotype.matcher(label);
|
||||
|
Loading…
Reference in New Issue
Block a user