1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 21:15:09 +00:00
This commit is contained in:
Arnaud Roques 2022-05-21 11:41:00 +02:00
parent 36a7cbfca1
commit 7ac50bf403
251 changed files with 1916 additions and 4319 deletions

View File

@ -40,144 +40,48 @@ import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
@HaxeIgnored @HaxeIgnored
public enum ColorParam { public enum ColorParam {
background(HColorUtils.WHITE, true, ColorType.BACK), background(HColorUtils.WHITE, true, ColorType.BACK),
hyperlink(HColorUtils.BLUE), hyperlink(HColorUtils.BLUE),
activityDiamondBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), activityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
activityDiamondBorder(HColorUtils.MY_RED, ColorType.LINE),
activityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
activityBorder(HColorUtils.MY_RED, ColorType.LINE), activityBorder(HColorUtils.MY_RED, ColorType.LINE),
activityStart(HColorUtils.BLACK),
activityEnd(HColorUtils.BLACK),
activityBar(HColorUtils.BLACK),
swimlaneBorder(HColorUtils.BLACK),
swimlaneTitleBackground(null),
usecaseBorder(HColorUtils.MY_RED, ColorType.LINE),
usecaseBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
objectBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
objectBorder(HColorUtils.MY_RED, ColorType.LINE),
classHeaderBackground(null, true, ColorType.BACK),
classBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), classBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
enumBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
classBorder(HColorUtils.MY_RED, ColorType.LINE), classBorder(HColorUtils.MY_RED, ColorType.LINE),
stereotypeCBackground(HColorUtils.COL_ADD1B2),
stereotypeNBackground(HColorUtils.COL_E3664A),
stereotypeABackground(HColorUtils.COL_A9DCDF),
stereotypeIBackground(HColorUtils.COL_B4A7E5),
stereotypeEBackground(HColorUtils.COL_EB937F),
stereotypeCBorder(null),
stereotypeNBorder(null),
stereotypeABorder(null),
stereotypeIBorder(null),
stereotypeEBorder(null),
packageBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
packageBorder(HColorUtils.BLACK, ColorType.LINE),
partitionBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
partitionBorder(HColorUtils.BLACK, ColorType.LINE),
componentBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
componentBorder(HColorUtils.MY_RED, ColorType.LINE),
interfaceBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
interfaceBorder(HColorUtils.MY_RED, ColorType.LINE),
arrow(HColorUtils.MY_RED, ColorType.ARROW),
arrowHead(HColorUtils.MY_RED, null), arrowHead(HColorUtils.MY_RED, null),
stateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
stateBorder(HColorUtils.MY_RED, ColorType.LINE), stateBorder(HColorUtils.MY_RED, ColorType.LINE),
stateStart(HColorUtils.BLACK),
stateEnd(HColorUtils.BLACK),
noteBackground(HColorUtils.COL_FBFB77, true, ColorType.BACK), noteBackground(HColorUtils.COL_FBFB77, true, ColorType.BACK),
noteBorder(HColorUtils.MY_RED, ColorType.LINE), noteBorder(HColorUtils.MY_RED, ColorType.LINE),
legendBackground(HColorUtils.COL_DDDDDD, true, ColorType.BACK),
legendBorder(HColorUtils.BLACK, ColorType.LINE),
titleBackground(null, true, ColorType.BACK),
titleBorder(null, ColorType.LINE),
diagramBorder(null, ColorType.LINE), diagramBorder(null, ColorType.LINE),
actorBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK), actorBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
actorBorder(HColorUtils.MY_RED, ColorType.LINE), actorBorder(HColorUtils.MY_RED, ColorType.LINE),
participantBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
participantBorder(HColorUtils.MY_RED, ColorType.LINE),
sequenceGroupBorder(HColorUtils.BLACK, ColorType.LINE),
sequenceGroupBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK),
sequenceGroupBodyBackground(HColorUtils.RED, true, ColorType.BACK), sequenceGroupBodyBackground(HColorUtils.RED, true, ColorType.BACK),
sequenceReferenceBorder(HColorUtils.BLACK, ColorType.LINE),
sequenceReferenceHeaderBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK), sequenceReferenceHeaderBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK),
sequenceReferenceBackground(HColorUtils.WHITE, true, ColorType.BACK), sequenceReferenceBackground(HColorUtils.WHITE, true, ColorType.BACK),
sequenceDividerBackground(HColorUtils.COL_EEEEEE, true, ColorType.BACK),
sequenceDividerBorder(HColorUtils.BLACK, ColorType.LINE),
sequenceLifeLineBackground(HColorUtils.WHITE, true, ColorType.BACK),
sequenceLifeLineBorder(HColorUtils.MY_RED, ColorType.LINE), sequenceLifeLineBorder(HColorUtils.MY_RED, ColorType.LINE),
sequenceNewpageSeparator(HColorUtils.BLACK, ColorType.LINE), sequenceNewpageSeparator(HColorUtils.BLACK, ColorType.LINE),
sequenceBoxBorder(HColorUtils.MY_RED, ColorType.LINE), sequenceBoxBorder(HColorUtils.MY_RED, ColorType.LINE),
sequenceBoxBackground(HColorUtils.COL_DDDDDD, true, ColorType.BACK),
artifactBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
artifactBorder(HColorUtils.BLACK, ColorType.LINE),
cloudBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
cloudBorder(HColorUtils.BLACK, ColorType.LINE),
queueBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
queueBorder(HColorUtils.MY_RED, ColorType.LINE),
stackBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
stackBorder(HColorUtils.MY_RED, ColorType.LINE),
databaseBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
databaseBorder(HColorUtils.BLACK, ColorType.LINE),
folderBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
folderBorder(HColorUtils.BLACK, ColorType.LINE),
fileBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
fileBorder(HColorUtils.BLACK, ColorType.LINE),
frameBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
frameBorder(HColorUtils.BLACK, ColorType.LINE),
nodeBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
nodeBorder(HColorUtils.BLACK, ColorType.LINE),
rectangleBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
rectangleBorder(HColorUtils.BLACK, ColorType.LINE),
hexagonBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
hexagonBorder(HColorUtils.BLACK, ColorType.LINE),
personBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
personBorder(HColorUtils.BLACK, ColorType.LINE),
archimateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
archimateBorder(HColorUtils.BLACK, ColorType.LINE),
cardBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
cardBorder(HColorUtils.BLACK, ColorType.LINE),
agentBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
agentBorder(HColorUtils.MY_RED, ColorType.LINE),
storageBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
storageBorder(HColorUtils.BLACK, ColorType.LINE),
boundaryBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
boundaryBorder(HColorUtils.MY_RED, ColorType.LINE),
collectionsBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
collectionsBorder(HColorUtils.MY_RED, ColorType.LINE),
controlBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
controlBorder(HColorUtils.MY_RED, ColorType.LINE),
entityBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
entityBorder(HColorUtils.MY_RED, ColorType.LINE),
iconPrivate(HColorUtils.COL_C82930),
iconPrivate(HColorUtils.COL_C82930),
iconPrivateBackground(HColorUtils.COL_F24D5C), iconPrivateBackground(HColorUtils.COL_F24D5C),
iconPackage(HColorUtils.COL_1963A0), iconPackage(HColorUtils.COL_1963A0),
iconPackageBackground(HColorUtils.COL_4177AF), iconPackageBackground(HColorUtils.COL_4177AF),
iconProtected(HColorUtils.COL_B38D22), iconProtected(HColorUtils.COL_B38D22),
iconProtectedBackground(HColorUtils.COL_FFFF44), iconProtectedBackground(HColorUtils.COL_FFFF44),
iconPublic(HColorUtils.COL_038048), iconPublic(HColorUtils.COL_038048),
iconPublicBackground(HColorUtils.COL_84BE84), iconPublicBackground(HColorUtils.COL_84BE84),
iconIEMandatory(HColorUtils.BLACK), iconIEMandatory(HColorUtils.BLACK),
arrowLollipop(HColorUtils.WHITE), arrowLollipop(HColorUtils.WHITE),
machineBackground(HColorUtils.WHITE), machineBackground(HColorUtils.WHITE),
machineBorder(HColorUtils.BLACK, ColorType.LINE), machineBorder(HColorUtils.BLACK, ColorType.LINE),
requirementBackground(HColorUtils.WHITE), requirementBackground(HColorUtils.WHITE),
@ -194,23 +98,23 @@ public enum ColorParam {
private final boolean isBackground; private final boolean isBackground;
private final HColor defaultValue; private final HColor defaultValue;
private final ColorType colorType; private final ColorType colorType;
private ColorParam(HColor defaultValue, ColorType colorType) { private ColorParam(HColor defaultValue, ColorType colorType) {
this(defaultValue, false, colorType); this(defaultValue, false, colorType);
} }
private ColorParam(HColor defaultValue) { private ColorParam(HColor defaultValue) {
this(defaultValue, false, null); this(defaultValue, false, null);
} }
private ColorParam() { private ColorParam() {
this(null, false, null); this(null, false, null);
} }
private ColorParam(boolean isBackground) { private ColorParam(boolean isBackground) {
this(null, isBackground, null); this(null, isBackground, null);
} }
private ColorParam(HColor defaultValue, boolean isBackground, ColorType colorType) { private ColorParam(HColor defaultValue, boolean isBackground, ColorType colorType) {
this.isBackground = isBackground; this.isBackground = isBackground;
this.defaultValue = defaultValue; this.defaultValue = defaultValue;

View File

@ -213,6 +213,7 @@ public enum FileFormat {
} }
protected Dimension2D calculateDimensionInternal(UFont font, String text) { protected Dimension2D calculateDimensionInternal(UFont font, String text) {
text = text.replace("\t", " ");
final Dimension2DDouble w1 = getJavaDimension(font.goTikz(-1), text); final Dimension2DDouble w1 = getJavaDimension(font.goTikz(-1), text);
final Dimension2DDouble w2 = getJavaDimension(font.goTikz(0), text); final Dimension2DDouble w2 = getJavaDimension(font.goTikz(0), text);
final Dimension2DDouble w3 = getJavaDimension(font.goTikz(1), text); final Dimension2DDouble w3 = getJavaDimension(font.goTikz(1), text);

View File

@ -41,7 +41,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines; import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.skin.ArrowDirection; import net.sourceforge.plantuml.skin.ArrowDirection;
@ -96,8 +95,6 @@ public interface ISkinParam extends ISkinSimple {
public boolean shadowingForNote(Stereotype stereotype); public boolean shadowingForNote(Stereotype stereotype);
public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter);
public PackageStyle packageStyle(); public PackageStyle packageStyle();
public ComponentStyle componentStyle(); public ComponentStyle componentStyle();

View File

@ -62,7 +62,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines; import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.skin.ArrowDirection; import net.sourceforge.plantuml.skin.ArrowDirection;
@ -738,32 +737,6 @@ public class SkinParam implements ISkinParam {
return shadowing(stereotype); return shadowing(stereotype);
} }
public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) {
final String name = Objects.requireNonNull(skinParameter).getUpperCaseName();
if (stereotype != null) {
checkStereotype(stereotype);
final String value2 = getValue(name + "shadowing" + stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR));
if (value2 != null)
return value2.equalsIgnoreCase("true");
}
final String value = getValue(name + "shadowing");
if (value == null)
return shadowing(stereotype);
if ("false".equalsIgnoreCase(value))
return false;
if ("true".equalsIgnoreCase(value))
return true;
if (strictUmlStyle())
return false;
return true;
}
private final Map<String, Sprite> sprites = new HashMap<String, Sprite>(); private final Map<String, Sprite> sprites = new HashMap<String, Sprite>();
public Collection<String> getAllSpriteNames() { public Collection<String> getAllSpriteNames() {

View File

@ -43,7 +43,6 @@ import net.sourceforge.plantuml.cucadiagram.Rankdir;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.cucadiagram.dot.DotSplines; import net.sourceforge.plantuml.cucadiagram.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle; import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.skin.ArrowDirection; import net.sourceforge.plantuml.skin.ArrowDirection;
@ -136,11 +135,6 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.shadowing(stereotype); return skinParam.shadowing(stereotype);
} }
@Override
public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) {
return skinParam.shadowing2(stereotype, skinParameter);
}
@Override @Override
public PackageStyle packageStyle() { public PackageStyle packageStyle() {
return skinParam.packageStyle(); return skinParam.packageStyle();

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class InstructionEnd extends MonoSwimable implements Instruction { public class InstructionEnd extends MonoSwimable implements Instruction {
@ -64,7 +65,7 @@ public class InstructionEnd extends MonoSwimable implements Instruction {
@Override @Override
public Ftile createFtile(FtileFactory factory) { public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.end(getSwimlaneIn()); Ftile result = factory.end(getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
return result; return result;
} }

View File

@ -53,6 +53,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -124,7 +125,7 @@ public class InstructionFork extends WithNote implements Instruction {
} }
Ftile result = factory.createParallel(all, style, label, swimlaneIn, swimlaneOut); Ftile result = factory.createParallel(all, style, label, swimlaneIn, swimlaneOut);
if (getPositionedNotes().size() > 0) { if (getPositionedNotes().size() > 0) {
result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false); result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER);
} }
return result; return result;
} }

View File

@ -49,6 +49,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -102,9 +103,9 @@ public class InstructionGroup extends AbstractInstruction implements Instruction
@Override @Override
public Ftile createFtile(FtileFactory factory) { public Ftile createFtile(FtileFactory factory) {
Ftile tmp = list.createFtile(factory); Ftile tmp = list.createFtile(factory);
if (note != null) { if (note != null)
tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam()); tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam(), VerticalAlignment.CENTER);
}
return factory.createGroup(tmp, title, backColor, titleColor, null, borderColor, type, roundCorner); return factory.createGroup(tmp, title, backColor, titleColor, null, borderColor, type, roundCorner);
} }

View File

@ -56,6 +56,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileIfHexagon;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -141,7 +142,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
elseBranch.updateFtile(factory); elseBranch.updateFtile(factory);
Ftile result = factory.createIf(swimlane, thens, elseBranch, outColor, topInlinkRendering, url); Ftile result = factory.createIf(swimlane, thens, elseBranch, outColor, topInlinkRendering, url);
if (getPositionedNotes().size() > 0) { if (getPositionedNotes().size() > 0) {
result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false); result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER);
} }
final List<WeldingPoint> weldingPoints = new ArrayList<>(); final List<WeldingPoint> weldingPoints = new ArrayList<>();
for (Branch branch : thens) { for (Branch branch : thens) {

View File

@ -54,6 +54,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileEmpty;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -125,7 +126,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return new FtileEmpty(factory.skinParam(), defaultSwimlane); return new FtileEmpty(factory.skinParam(), defaultSwimlane);
} }
final List<WeldingPoint> breaks = new ArrayList<>(); final List<WeldingPoint> breaks = new ArrayList<>();
Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn()); Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn(), VerticalAlignment.CENTER);
for (Instruction ins : all) { for (Instruction ins : all) {
Ftile cur = ins.createFtile(factory); Ftile cur = ins.createFtile(factory);
breaks.addAll(cur.getWeldingPoints()); breaks.addAll(cur.getWeldingPoints());

View File

@ -53,6 +53,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileRepeat;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -165,7 +166,7 @@ public class InstructionRepeat extends AbstractInstruction implements Instructio
Ftile result = factory.activity(backward, swimlaneBackward, boxStyle, Colors.empty(), null); Ftile result = factory.activity(backward, swimlaneBackward, boxStyle, Colors.empty(), null);
if (backwardNotes.size() > 0) if (backwardNotes.size() > 0)
result = factory.addNote(result, swimlaneBackward, backwardNotes); result = factory.addNote(result, swimlaneBackward, backwardNotes, VerticalAlignment.CENTER);
return result; return result;
} }

View File

@ -53,6 +53,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
public class InstructionSimple extends MonoSwimable implements Instruction { public class InstructionSimple extends MonoSwimable implements Instruction {
@ -104,7 +105,7 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
if (url != null) { if (url != null) {
result = factory.addUrl(result, url); result = factory.addUrl(result, url);
} }
result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
if (killed) { if (killed) {
return new FtileKilled(result); return new FtileKilled(result);
} }

View File

@ -47,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleSpot; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleSpot;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -72,7 +73,7 @@ public class InstructionSpot extends MonoSwimable implements Instruction {
@Override @Override
public Ftile createFtile(FtileFactory factory) { public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.spot(getSwimlaneIn(), spot, color); Ftile result = factory.spot(getSwimlaneIn(), spot, color);
result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
if (killed) if (killed)
return new FtileKilled(result); return new FtileKilled(result);

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class InstructionStart extends MonoSwimable implements Instruction { public class InstructionStart extends MonoSwimable implements Instruction {
@ -69,7 +70,7 @@ public class InstructionStart extends MonoSwimable implements Instruction {
@Override @Override
public Ftile createFtile(FtileFactory factory) { public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.start(getSwimlaneIn()); Ftile result = factory.start(getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
return result; return result;
} }

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart; import net.sourceforge.plantuml.activitydiagram3.gtile.GtileCircleStart;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class InstructionStop extends MonoSwimable implements Instruction { public class InstructionStop extends MonoSwimable implements Instruction {
@ -69,7 +70,7 @@ public class InstructionStop extends MonoSwimable implements Instruction {
@Override @Override
public Ftile createFtile(FtileFactory factory) { public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.stop(getSwimlaneIn()); Ftile result = factory.stop(getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn()); result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
return result; return result;
} }

View File

@ -51,6 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.gtile.GtileIfHexagon;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -72,11 +73,10 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override @Override
public boolean containsBreak() { public boolean containsBreak() {
for (Branch branch : switches) { for (Branch branch : switches)
if (branch.containsBreak()) { if (branch.containsBreak())
return true; return true;
}
}
return false; return false;
} }
@ -91,9 +91,9 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override @Override
public CommandExecutionResult add(Instruction ins) { public CommandExecutionResult add(Instruction ins) {
if (current == null) { if (current == null)
return CommandExecutionResult.error("No 'case' in this switch"); return CommandExecutionResult.error("No 'case' in this switch");
}
return current.add(ins); return current.add(ins);
} }
@ -116,7 +116,9 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
for (Branch branch : switches) for (Branch branch : switches)
branch.updateFtile(factory); branch.updateFtile(factory);
return factory.createSwitch(swimlane, switches, afterEndwhile, topInlinkRendering, labelTest); Ftile result = factory.createSwitch(swimlane, switches, afterEndwhile, topInlinkRendering, labelTest);
result = eventuallyAddNote(factory, result, getSwimlaneIn(), VerticalAlignment.TOP);
return result;
} }
@Override @Override
@ -132,12 +134,12 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override @Override
public Set<Swimlane> getSwimlanes() { public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<>(); final Set<Swimlane> result = new HashSet<>();
if (swimlane != null) { if (swimlane != null)
result.add(swimlane); result.add(swimlane);
}
for (Branch branch : switches) { for (Branch branch : switches)
result.addAll(branch.getSwimlanes()); result.addAll(branch.getSwimlanes());
}
return Collections.unmodifiableSet(result); return Collections.unmodifiableSet(result);
} }
@ -177,11 +179,11 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override @Override
public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) { public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) {
if (current.isEmpty()) { if (current == null || current.isEmpty())
return super.addNote(note, position, type, colors, swimlaneNote); return super.addNote(note, position, type, colors, swimlaneNote);
} else { else
return current.addNote(note, position, type, colors, swimlaneNote); return current.addNote(note, position, type, colors, swimlaneNote);
}
} }
} }

View File

@ -51,6 +51,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -116,12 +117,12 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi
: factory.activity(backward, swimlane, boxStyle, Colors.empty(), null); : factory.activity(backward, swimlane, boxStyle, Colors.empty(), null);
Ftile tmp = repeatList.createFtile(factory); Ftile tmp = repeatList.createFtile(factory);
tmp = factory.createWhile(outColor, swimlane, tmp, test, yes, color, specialOut, back, incoming1, incoming2); tmp = factory.createWhile(outColor, swimlane, tmp, test, yes, color, specialOut, back, incoming1, incoming2);
if (getPositionedNotes().size() > 0) { if (getPositionedNotes().size() > 0)
tmp = FtileWithNoteOpale.create(tmp, getPositionedNotes(), skinParam, false); tmp = FtileWithNoteOpale.create(tmp, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER);
}
if (killed || specialOut != null) { if (killed || specialOut != null)
return new FtileKilled(tmp); return new FtileKilled(tmp);
}
return tmp; return tmp;
} }
@ -153,11 +154,10 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi
@Override @Override
public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) { public boolean addNote(Display note, NotePosition position, NoteType type, Colors colors, Swimlane swimlaneNote) {
if (repeatList.isEmpty()) { if (repeatList.isEmpty())
return super.addNote(note, position, type, colors, swimlaneNote); return super.addNote(note, position, type, colors, swimlaneNote);
} else { else
return repeatList.addNote(note, position, type, colors, swimlaneNote); return repeatList.addNote(note, position, type, colors, swimlaneNote);
}
} }
@Override @Override

View File

@ -43,6 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -56,11 +57,12 @@ abstract class WithNote extends AbstractInstruction {
return true; return true;
} }
final protected Ftile eventuallyAddNote(FtileFactory factory, Ftile ftile, Swimlane swimlane) { final protected Ftile eventuallyAddNote(FtileFactory factory, Ftile ftile, Swimlane swimlane,
if (notes.size() == 0) { VerticalAlignment verticalAlignment) {
if (notes.size() == 0)
return ftile; return ftile;
}
return factory.addNote(ftile, swimlane, notes); return factory.addNote(ftile, swimlane, notes, verticalAlignment);
} }
public Collection<PositionedNote> getPositionedNotes() { public Collection<PositionedNote> getPositionedNotes() {

View File

@ -35,10 +35,8 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.command; package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3; import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -89,32 +87,18 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
} }
private USymbol getUSymbol(String type) { private USymbol getUSymbol(String type) {
if ("card".equalsIgnoreCase(type)) { if ("card".equalsIgnoreCase(type))
return USymbols.CARD; return USymbols.CARD;
}
if ("package".equalsIgnoreCase(type)) { if ("package".equalsIgnoreCase(type))
return USymbols.PACKAGE; return USymbols.PACKAGE;
}
if ("rectangle".equalsIgnoreCase(type)) { if ("rectangle".equalsIgnoreCase(type))
return USymbols.RECTANGLE; return USymbols.RECTANGLE;
}
return USymbols.FRAME; return USymbols.FRAME;
} }
private ColorParam getColorParamBorder(final USymbol symbol) {
if (symbol == USymbols.FRAME) {
return ColorParam.partitionBorder;
}
return symbol.getColorParamBorder();
}
private ColorParam getColorParamBack(final USymbol symbol) {
if (symbol == USymbols.FRAME) {
return ColorParam.partitionBackground;
}
return symbol.getColorParamBack();
}
private static ColorParser color(String id) { private static ColorParser color(String id) {
return ColorParser.simpleColor(ColorType.BACK, id); return ColorParser.simpleColor(ColorType.BACK, id);
} }

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.activitydiagram3.command; package net.sourceforge.plantuml.activitydiagram3.command;
import java.util.List; import java.util.List;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.StringLocated; import net.sourceforge.plantuml.StringLocated;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;

View File

@ -49,6 +49,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -68,7 +69,8 @@ public interface FtileFactory {
public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors, Stereotype stereotype); public Ftile activity(Display label, Swimlane swimlane, BoxStyle style, Colors colors, Stereotype stereotype);
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes); public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes,
VerticalAlignment verticalAlignment);
public Ftile addUrl(Ftile ftile, Url url); public Ftile addUrl(Ftile ftile, Url url);

View File

@ -55,6 +55,7 @@ import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
@ -140,8 +141,9 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.activity(label, swimlane, style, colors, stereotype); return factory.activity(label, swimlane, style, colors, stereotype);
} }
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes) { public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes,
return factory.addNote(ftile, swimlane, notes); VerticalAlignment verticalAlignment) {
return factory.addNote(ftile, swimlane, notes, verticalAlignment);
} }
public Ftile addUrl(Ftile ftile, Url url) { public Ftile addUrl(Ftile ftile, Url url) {

View File

@ -38,9 +38,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixedCentered; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixedCentered;

View File

@ -43,6 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator { public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
@ -52,22 +53,23 @@ public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
} }
@Override @Override
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes) { public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes,
if (notes.size() == 0) { VerticalAlignment verticalAlignment) {
if (notes.size() == 0)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
// if (notes.size() > 1) { // if (notes.size() > 1)
// throw new IllegalArgumentException(); // throw new IllegalArgumentException();
// }
ISkinParam skinParam = skinParam(); ISkinParam skinParam = skinParam();
if (ftile == null) { if (ftile == null) {
final PositionedNote note = notes.iterator().next(); final PositionedNote note = notes.iterator().next();
if (note.getColors() != null) { if (note.getColors() != null)
skinParam = note.getColors().mute(skinParam); skinParam = note.getColors().mute(skinParam);
}
return new FtileNoteAlone(skinParam.shadowing(null), note.getDisplay(), skinParam, return new FtileNoteAlone(skinParam.shadowing(null), note.getDisplay(), skinParam,
note.getType() == NoteType.NOTE, swimlane); note.getType() == NoteType.NOTE, swimlane);
} }
return FtileWithNoteOpale.create(ftile, notes, skinParam, true); return FtileWithNoteOpale.create(ftile, notes, skinParam, true, verticalAlignment);
} }
} }

View File

@ -37,13 +37,13 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import java.util.Collections; import java.util.Collections;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -58,12 +58,10 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
@Override @Override
public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note, public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note,
HColor borderColor, USymbol type, double roundCorner) { HColor borderColor, USymbol type, double roundCorner) {
final HColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.arrow); Ftile result = new FtileGroup(list, name, backColor, titleColor, skinParam(), borderColor, type, roundCorner);
Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor, if (note != null)
type, roundCorner); result = new FtileWithNotes(result, Collections.singleton(note), skinParam(), VerticalAlignment.CENTER);
if (note != null) {
result = new FtileWithNotes(result, Collections.singleton(note), skinParam());
}
return result; return result;
} }

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@ -48,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
@ -47,6 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -86,8 +86,8 @@ public class FtileGroup extends AbstractFtile {
return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.partition); return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.partition);
} }
public FtileGroup(Ftile inner, Display title, Display displayNote, HColor arrowColor, HColor backColor, public FtileGroup(Ftile inner, Display title, HColor backColor, HColor titleColor, ISkinParam skinParam,
HColor titleColor, ISkinParam skinParam, HColor borderColor, USymbol type, double roundCorner) { HColor borderColor, USymbol type, double roundCorner) {
super(inner.skinParam()); super(inner.skinParam());
this.roundCorner = roundCorner; this.roundCorner = roundCorner;
this.type = type; this.type = type;
@ -109,10 +109,10 @@ public class FtileGroup extends AbstractFtile {
else else
this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam); this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam);
if (Display.isNull(displayNote)) // if (Display.isNull(displayNote))
this.headerNote = TextBlockUtils.empty(0, 0); this.headerNote = TextBlockUtils.empty(0, 0);
else // else
this.headerNote = new FloatingNote(displayNote, skinParam); // this.headerNote = new FloatingNote(displayNote, skinParam);
this.stroke = thickness == null ? new UStroke(2) : thickness; this.stroke = thickness == null ? new UStroke(2) : thickness;
} }

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -61,6 +60,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.Rainbow; import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.svek.ConditionEndStyle; import net.sourceforge.plantuml.svek.ConditionEndStyle;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -63,6 +62,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -60,6 +59,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -64,6 +63,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
@ -47,6 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@ -54,6 +53,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidthCentered; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidthCentered;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact; package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -63,6 +62,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare; import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;

View File

@ -62,6 +62,7 @@ import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
@ -79,6 +80,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
private final Ftile tile; private final Ftile tile;
private final Opale opale; private final Opale opale;
private final VerticalAlignment verticalAlignment;
private final NotePosition notePosition; private final NotePosition notePosition;
private final double suppSpace = 20; private final double suppSpace = 20;
@ -110,18 +112,21 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
return Collections.singleton(tile); return Collections.singleton(tile);
} }
public static Ftile create(Ftile tile, Collection<PositionedNote> notes, ISkinParam skinParam, boolean withLink) { public static Ftile create(Ftile tile, Collection<PositionedNote> notes, ISkinParam skinParam, boolean withLink,
if (notes.size() > 1) { VerticalAlignment verticalAlignment) {
return new FtileWithNotes(tile, notes, skinParam); if (notes.size() > 1)
} return new FtileWithNotes(tile, notes, skinParam, verticalAlignment);
if (notes.size() == 0) {
if (notes.size() == 0)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
return new FtileWithNoteOpale(tile, notes.iterator().next(), skinParam, withLink); return new FtileWithNoteOpale(tile, notes.iterator().next(), skinParam, withLink, verticalAlignment);
} }
private FtileWithNoteOpale(Ftile tile, PositionedNote note, ISkinParam skinParam, boolean withLink) { private FtileWithNoteOpale(Ftile tile, PositionedNote note, ISkinParam skinParam, boolean withLink,
VerticalAlignment verticalAlignment) {
super(tile.skinParam()); super(tile.skinParam());
this.verticalAlignment = verticalAlignment;
this.swimlaneNote = note.getSwimlaneNote(); this.swimlaneNote = note.getSwimlaneNote();
if (note.getColors() != null) if (note.getColors() != null)
skinParam = note.getColors().mute(skinParam); skinParam = note.getColors().mute(skinParam);
@ -155,11 +160,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Dimension2D dimTile = tile.calculateDimension(stringBounder); final Dimension2D dimTile = tile.calculateDimension(stringBounder);
final double yForFtile = (dimTotal.getHeight() - dimTile.getHeight()) / 2; final double yForFtile = (dimTotal.getHeight() - dimTile.getHeight()) / 2;
final double marge; final double marge;
if (notePosition == NotePosition.LEFT) { if (notePosition == NotePosition.LEFT)
marge = dimNote.getWidth() + suppSpace; marge = dimNote.getWidth() + suppSpace;
} else { else
marge = 0; marge = 0;
}
return new UTranslate(marge, yForFtile); return new UTranslate(marge, yForFtile);
} }
@ -177,22 +181,25 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Dimension2D dimTotal = calculateDimension(stringBounder); final Dimension2D dimTotal = calculateDimension(stringBounder);
final Dimension2D dimNote = opale.calculateDimension(stringBounder); final Dimension2D dimNote = opale.calculateDimension(stringBounder);
final double yForNote = (dimTotal.getHeight() - dimNote.getHeight()) / 2; final double yForNote;
if (verticalAlignment == VerticalAlignment.CENTER)
yForNote = (dimTotal.getHeight() - dimNote.getHeight()) / 2;
else
yForNote = 0;
if (notePosition == NotePosition.LEFT) { if (notePosition == NotePosition.LEFT)
return UTranslate.dy(yForNote); return UTranslate.dy(yForNote);
}
final double dx = dimTotal.getWidth() - dimNote.getWidth(); final double dx = dimTotal.getWidth() - dimNote.getWidth();
return new UTranslate(dx, yForNote); return new UTranslate(dx, yForNote);
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final Swimlane intoSw; final Swimlane intoSw;
if (ug instanceof UGraphicInterceptorOneSwimlane) { if (ug instanceof UGraphicInterceptorOneSwimlane)
intoSw = ((UGraphicInterceptorOneSwimlane) ug).getSwimlane(); intoSw = ((UGraphicInterceptorOneSwimlane) ug).getSwimlane();
} else { else
intoSw = null; intoSw = null;
}
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D dimNote = opale.calculateDimension(stringBounder); final Dimension2D dimNote = opale.calculateDimension(stringBounder);
@ -208,9 +215,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Point2D pp2 = new Point2D.Double(-suppSpace, dimNote.getHeight() / 2); final Point2D pp2 = new Point2D.Double(-suppSpace, dimNote.getHeight() / 2);
opale.setOpale(strategy, pp1, pp2); opale.setOpale(strategy, pp1, pp2);
} }
if (ug instanceof UGraphicInterceptorOneSwimlane == false || swimlaneNote == null || intoSw == swimlaneNote) {
if (ug instanceof UGraphicInterceptorOneSwimlane == false || swimlaneNote == null || intoSw == swimlaneNote)
opale.drawU(ug.apply(getTranslateForOpale(ug))); opale.drawU(ug.apply(getTranslateForOpale(ug)));
}
ug.apply(getTranslate(stringBounder)).draw(tile); ug.apply(getTranslate(stringBounder)).draw(tile);
} }
@ -219,10 +227,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final FtileGeometry orig = tile.calculateDimension(stringBounder); final FtileGeometry orig = tile.calculateDimension(stringBounder);
final UTranslate translate = getTranslate(stringBounder); final UTranslate translate = getTranslate(stringBounder);
if (orig.hasPointOut()) { if (orig.hasPointOut())
return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy(), return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy(),
orig.getOutY() + translate.getDy()); orig.getOutY() + translate.getDy());
}
return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy()); return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy());
} }

View File

@ -58,8 +58,8 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
@ -77,6 +77,7 @@ public class FtileWithNotes extends AbstractFtile {
private TextBlock left; private TextBlock left;
private TextBlock right; private TextBlock right;
private final VerticalAlignment verticalAlignment;
private final double suppSpace = 20; private final double suppSpace = 20;
@ -96,8 +97,10 @@ public class FtileWithNotes extends AbstractFtile {
return tile.getSwimlaneOut(); return tile.getSwimlaneOut();
} }
public FtileWithNotes(Ftile tile, Collection<PositionedNote> notes, ISkinParam skinParam) { public FtileWithNotes(Ftile tile, Collection<PositionedNote> notes, ISkinParam skinParam,
VerticalAlignment verticalAlignment) {
super(tile.skinParam()); super(tile.skinParam());
this.verticalAlignment = verticalAlignment;
this.tile = tile; this.tile = tile;
for (PositionedNote note : notes) { for (PositionedNote note : notes) {
@ -161,7 +164,11 @@ public class FtileWithNotes extends AbstractFtile {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final Dimension2D dimTile = tile.calculateDimension(stringBounder); final Dimension2D dimTile = tile.calculateDimension(stringBounder);
final double xDelta = left.calculateDimension(stringBounder).getWidth(); final double xDelta = left.calculateDimension(stringBounder).getWidth();
final double yDelta = (dimTotal.getHeight() - dimTile.getHeight()) / 2; final double yDelta;
if (verticalAlignment == VerticalAlignment.TOP)
yDelta = 0;
else
yDelta = (dimTotal.getHeight() - dimTile.getHeight()) / 2;
return new UTranslate(xDelta, yDelta); return new UTranslate(xDelta, yDelta);
} }
@ -169,7 +176,11 @@ public class FtileWithNotes extends AbstractFtile {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final Dimension2D dimLeft = left.calculateDimension(stringBounder); final Dimension2D dimLeft = left.calculateDimension(stringBounder);
final double xDelta = 0; final double xDelta = 0;
final double yDelta = (dimTotal.getHeight() - dimLeft.getHeight()) / 2; final double yDelta;
if (verticalAlignment == VerticalAlignment.TOP)
yDelta = 0;
else
yDelta = (dimTotal.getHeight() - dimLeft.getHeight()) / 2;
return new UTranslate(xDelta, yDelta); return new UTranslate(xDelta, yDelta);
} }
@ -177,7 +188,11 @@ public class FtileWithNotes extends AbstractFtile {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder); final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final Dimension2D dimRight = right.calculateDimension(stringBounder); final Dimension2D dimRight = right.calculateDimension(stringBounder);
final double xDelta = dimTotal.getWidth() - dimRight.getWidth(); final double xDelta = dimTotal.getWidth() - dimRight.getWidth();
final double yDelta = (dimTotal.getHeight() - dimRight.getHeight()) / 2; final double yDelta;
if (verticalAlignment == VerticalAlignment.TOP)
yDelta = 0;
else
yDelta = (dimTotal.getHeight() - dimRight.getHeight()) / 2;
return new UTranslate(xDelta, yDelta); return new UTranslate(xDelta, yDelta);
} }

View File

@ -131,7 +131,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
final Swimlane swimlaneBlack = in; final Swimlane swimlaneBlack = in;
final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final Ftile black = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack); final Ftile black = new FtileBlackBlock(skinParam(), swimlaneBlack);
double x = 0; double x = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());
@ -182,7 +182,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
@Override @Override
protected Ftile doStep2(Ftile middle, Ftile result) { protected Ftile doStep2(Ftile middle, Ftile result) {
final Swimlane swimlaneBlack = out; final Swimlane swimlaneBlack = out;
final Ftile out = new FtileBlackBlock(skinParam(), barColor(), swimlaneBlack); final Ftile out = new FtileBlackBlock(skinParam(), swimlaneBlack);
((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), ((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(),
barHeight); barHeight);
if (label != null) if (label != null)
@ -205,9 +205,9 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
return result; return result;
} }
private HColor barColor() { // private HColor barColor() {
return getRose().getHtmlColor(skinParam(), ColorParam.activityBar); // return getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
} // }
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable { class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {

View File

@ -73,9 +73,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
protected Ftile doStep1(Ftile inner) { protected Ftile doStep1(Ftile inner) {
Ftile result = inner; Ftile result = inner;
final List<Connection> conns = new ArrayList<>(); final List<Connection> conns = new ArrayList<>();
final HColor colorBar = getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
final Ftile black = new FtileBlackBlock(skinParam(), colorBar, list99.get(0).getSwimlaneIn()); final Ftile black = new FtileBlackBlock(skinParam(), list99.get(0).getSwimlaneIn());
double x = 0; double x = 0;
for (Ftile tmp : list99) { for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder()); final Dimension2D dim = tmp.calculateDimension(getStringBounder());

View File

@ -40,7 +40,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows; import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;

View File

@ -63,6 +63,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
@ -144,7 +145,8 @@ public class VCompactFactory implements FtileFactory {
return FtileBox.create(colors.mute(skinParam), label, swimlane, boxStyle, stereotype); return FtileBox.create(colors.mute(skinParam), label, swimlane, boxStyle, stereotype);
} }
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes) { public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes,
VerticalAlignment verticalAlignment) {
return ftile; return ftile;
} }

View File

@ -35,18 +35,17 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
@ -66,12 +65,11 @@ public class FtileBlackBlock extends AbstractFtile {
private double width; private double width;
private double height; private double height;
private TextBlock label = TextBlockUtils.empty(0, 0); private TextBlock label = TextBlockUtils.empty(0, 0);
private HColor colorBar;
private final Swimlane swimlane; private final Swimlane swimlane;
public FtileBlackBlock(ISkinParam skinParam, HColor colorBar, Swimlane swimlane) { public FtileBlackBlock(ISkinParam skinParam, Swimlane swimlane) {
super(skinParam); super(skinParam);
this.colorBar = colorBar;
this.swimlane = swimlane; this.swimlane = swimlane;
} }
@ -103,7 +101,8 @@ public class FtileBlackBlock extends AbstractFtile {
final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final double shadowing = style.value(PName.Shadowing).asDouble(); final double shadowing = style.value(PName.Shadowing).asDouble();
rect.setDeltaShadow(shadowing); rect.setDeltaShadow(shadowing);
colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(), getIHtmlColorSet()); final HColor colorBar = style.value(PName.BackGroundColor).asColor(skinParam().getThemeStyle(),
getIHtmlColorSet());
ug.apply(colorBar).apply(colorBar.bg()).draw(rect); ug.apply(colorBar).apply(colorBar.bg()).draw(rect);
final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder()); final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder());

View File

@ -43,7 +43,6 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.SkinParamColors; import net.sourceforge.plantuml.SkinParamColors;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;

View File

@ -35,25 +35,21 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.SkinParamColors; import net.sourceforge.plantuml.SkinParamColors;
import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle; import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; import net.sourceforge.plantuml.creole.Sheet;

View File

@ -41,7 +41,6 @@ import java.util.Set;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;

View File

@ -40,7 +40,6 @@ import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;

View File

@ -40,7 +40,6 @@ import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile; import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;

View File

@ -35,10 +35,9 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,10 +35,9 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;

View File

@ -35,14 +35,13 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,14 +35,13 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,13 +35,12 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,14 +35,13 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical; package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile; import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry; import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
@ -43,6 +42,7 @@ import java.util.Set;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.skin.rose.Rose; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.UStroke; import net.sourceforge.plantuml.ugraphic.UStroke;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
@ -44,6 +43,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon; import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy; import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake; import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;

View File

@ -35,14 +35,12 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering; import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -43,6 +42,7 @@ import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,11 +35,10 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UEmpty;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
@ -43,6 +42,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,7 +35,6 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -43,6 +42,7 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.Branch; import net.sourceforge.plantuml.activitydiagram3.Branch;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,9 +35,7 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -45,6 +43,7 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,11 +35,11 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;

View File

@ -35,12 +35,12 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,12 +35,12 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,13 +35,13 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,18 +35,15 @@
*/ */
package net.sourceforge.plantuml.activitydiagram3.gtile; package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.AlignmentParam; import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote; import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane; import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser; import net.sourceforge.plantuml.creole.Parser;
import net.sourceforge.plantuml.creole.Sheet; import net.sourceforge.plantuml.creole.Sheet;
@ -59,7 +56,6 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType; import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;

View File

@ -137,16 +137,14 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String ent1String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""); final String ent1String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
final String ent2String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""); final String ent2String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
if (ent1String == null && ent2String == null) { if (ent1String == null && ent2String == null)
return executeArgSpecial3(diagram, arg); return executeArgSpecial3(diagram, arg);
}
if (ent1String == null) { if (ent1String == null)
return executeArgSpecial1(diagram, arg); return executeArgSpecial1(diagram, arg);
}
if (ent2String == null) { if (ent2String == null)
return executeArgSpecial2(diagram, arg); return executeArgSpecial2(diagram, arg);
}
Ident ident1 = diagram.buildLeafIdentSpecial(ent1String); Ident ident1 = diagram.buildLeafIdentSpecial(ent1String);
Ident ident2 = diagram.buildLeafIdentSpecial(ent2String); Ident ident2 = diagram.buildLeafIdentSpecial(ent2String);
@ -205,11 +203,10 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg); final Direction dir = getDirection(arg);
final int queue; final int queue;
if (dir == Direction.LEFT || dir == Direction.RIGHT) { if (dir == Direction.LEFT || dir == Direction.RIGHT)
queue = 1; queue = 1;
} else { else
queue = getQueueLength(arg); queue = getQueueLength(arg);
}
final Labels labels = new Labels(arg); final Labels labels = new Labels(arg);
@ -223,9 +220,9 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
} }
link.setPortMembers(port1, port2); link.setPortMembers(port1, port2);
if (dir == Direction.LEFT || dir == Direction.UP) { if (dir == Direction.LEFT || dir == Direction.UP)
link = link.getInv(); link = link.getInv();
}
link.setLinkArrow(labels.getLinkArrow()); link.setLinkArrow(labels.getLinkArrow());
link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg, link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
diagram.getSkinParam().getIHtmlColorSet())); diagram.getSkinParam().getIHtmlColorSet()));
@ -239,75 +236,75 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
private IEntity getFoo1(AbstractClassOrObjectDiagram diagram, Code code, Ident ident, Ident pure) { private IEntity getFoo1(AbstractClassOrObjectDiagram diagram, Code code, Ident ident, Ident pure) {
if (isGroupButNotTheCurrentGroup(diagram, code, ident)) { if (isGroupButNotTheCurrentGroup(diagram, code, ident)) {
if (diagram.V1972()) { if (diagram.V1972())
return diagram.getGroupVerySmart(ident); return diagram.getGroupVerySmart(ident);
}
// final Code tap = ident.toCode(diagram); // final Code tap = ident.toCode(diagram);
return diagram.getGroup(code); return diagram.getGroup(code);
} }
if (diagram.V1972()) { if (diagram.V1972()) {
final IEntity result = pure.size() == 1 ? diagram.getLeafVerySmart(ident) : diagram.getLeafStrict(ident); final IEntity result = pure.size() == 1 ? diagram.getLeafVerySmart(ident) : diagram.getLeafStrict(ident);
if (result != null) { if (result != null)
return result; return result;
}
} }
return diagram.getOrCreateLeaf(ident, code, null, null); return diagram.getOrCreateLeaf(ident, code, null, null);
} }
private boolean isGroupButNotTheCurrentGroup(AbstractClassOrObjectDiagram diagram, Code code, Ident ident) { private boolean isGroupButNotTheCurrentGroup(AbstractClassOrObjectDiagram diagram, Code code, Ident ident) {
if (diagram.V1972()) { if (diagram.V1972()) {
if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName())) { if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName()))
return false; return false;
}
return diagram.isGroupVerySmart(ident); return diagram.isGroupVerySmart(ident);
} else { } else {
if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName())) { if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName()))
return false; return false;
}
return diagram.isGroup(code); return diagram.isGroup(code);
} }
} }
private Ident removeMemberPartIdentSpecial(AbstractClassOrObjectDiagram diagram, Ident ident) { private Ident removeMemberPartIdentSpecial(AbstractClassOrObjectDiagram diagram, Ident ident) {
if (diagram.leafExistSmart(ident)) { if (diagram.leafExistSmart(ident))
return null; return null;
}
final Ident before = ident.parent(); final Ident before = ident.parent();
if (before == null) { if (before == null)
return null; return null;
}
if (diagram.leafExistSmart(before) == false) { if (diagram.leafExistSmart(before) == false)
return null; return null;
}
return before; return before;
} }
private Ident removeMemberPartIdent(AbstractClassOrObjectDiagram diagram, Ident ident) { private Ident removeMemberPartIdent(AbstractClassOrObjectDiagram diagram, Ident ident) {
if (diagram.leafExistSmart(ident)) { if (diagram.leafExistSmart(ident))
return null; return null;
}
final Ident before = ident.removeMemberPart(); final Ident before = ident.removeMemberPart();
if (before == null) { if (before == null)
return null; return null;
}
if (diagram.leafExistSmart(before) == false) { if (diagram.leafExistSmart(before) == false)
return null; return null;
}
return before; return before;
} }
private Code removeMemberPartLegacy1972(AbstractClassOrObjectDiagram diagram, Ident ident) { private Code removeMemberPartLegacy1972(AbstractClassOrObjectDiagram diagram, Ident ident) {
if (diagram.leafExist(ident)) { if (diagram.leafExist(ident))
return null; return null;
}
final Ident before = ident.removeMemberPart(); final Ident before = ident.removeMemberPart();
if (before == null) { if (before == null)
return null; return null;
}
final Code code = before.toCode(diagram); final Code code = before.toCode(diagram);
if (diagram.leafExist(code) == false) { if (diagram.leafExist(code) == false)
return null; return null;
}
return code; return code;
} }
@ -345,11 +342,10 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg); final Direction dir = getDirection(arg);
final int queue; final int queue;
if (dir == Direction.LEFT || dir == Direction.RIGHT) { if (dir == Direction.LEFT || dir == Direction.RIGHT)
queue = 1; queue = 1;
} else { else
queue = getQueueLength(arg); queue = getQueueLength(arg);
}
final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final String firstLabel = arg.get("FIRST_LABEL", 0); final String firstLabel = arg.get("FIRST_LABEL", 0);
@ -374,12 +370,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String name1B = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("COUPLE1", 1)); final String name1B = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("COUPLE1", 1));
final Code clName1A = diagram.buildCode(name1A); final Code clName1A = diagram.buildCode(name1A);
final Code clName1B = diagram.buildCode(name1B); final Code clName1B = diagram.buildCode(name1B);
if (diagram.leafExist(clName1A) == false) { if (diagram.leafExist(clName1A) == false)
return CommandExecutionResult.error("No class " + clName1A); return CommandExecutionResult.error("No class " + clName1A);
}
if (diagram.leafExist(clName1B) == false) { if (diagram.leafExist(clName1B) == false)
return CommandExecutionResult.error("No class " + clName1B); return CommandExecutionResult.error("No class " + clName1B);
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""); final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
final Code ent2 = diagram.buildCode(idShort); final Code ent2 = diagram.buildCode(idShort);
@ -389,9 +384,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final boolean result = diagram.associationClass(1, name1A, name1B, cl2, linkType, label); final boolean result = diagram.associationClass(1, name1A, name1B, cl2, linkType, label);
if (result == false) { if (result == false)
return CommandExecutionResult.error("Cannot have more than 2 assocications"); return CommandExecutionResult.error("Cannot have more than 2 assocications");
}
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
@ -401,12 +395,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String name1B = arg.get("COUPLE1", 1); final String name1B = arg.get("COUPLE1", 1);
final Ident ident1A = diagram.buildLeafIdent(name1A); final Ident ident1A = diagram.buildLeafIdent(name1A);
final Ident ident1B = diagram.buildLeafIdent(name1B); final Ident ident1B = diagram.buildLeafIdent(name1B);
if (diagram.leafExistSmart(ident1A) == false) { if (diagram.leafExistSmart(ident1A) == false)
return CommandExecutionResult.error("No class " + ident1A.getName()); return CommandExecutionResult.error("No class " + ident1A.getName());
}
if (diagram.leafExistSmart(ident1B) == false) { if (diagram.leafExistSmart(ident1B) == false)
return CommandExecutionResult.error("No class " + ident1B.getName()); return CommandExecutionResult.error("No class " + ident1B.getName());
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""); final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
final Ident ident2 = diagram.buildLeafIdent(idShort); final Ident ident2 = diagram.buildLeafIdent(idShort);
@ -416,9 +409,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final boolean result = diagram.associationClass(1, name1A, name1B, cl2, linkType, label); final boolean result = diagram.associationClass(1, name1A, name1B, cl2, linkType, label);
if (result == false) { if (result == false)
return CommandExecutionResult.error("Cannot have more than 2 assocications"); return CommandExecutionResult.error("Cannot have more than 2 assocications");
}
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
@ -428,12 +420,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String name2B = arg.get("COUPLE2", 1); final String name2B = arg.get("COUPLE2", 1);
final Ident ident2A = diagram.buildLeafIdent(name2A); final Ident ident2A = diagram.buildLeafIdent(name2A);
final Ident ident2B = diagram.buildLeafIdent(name2B); final Ident ident2B = diagram.buildLeafIdent(name2B);
if (diagram.leafExistSmart(ident2A) == false) { if (diagram.leafExistSmart(ident2A) == false)
return CommandExecutionResult.error("No class " + ident2A.getName()); return CommandExecutionResult.error("No class " + ident2A.getName());
}
if (diagram.leafExistSmart(ident2B) == false) { if (diagram.leafExistSmart(ident2B) == false)
return CommandExecutionResult.error("No class " + ident2B.getName()); return CommandExecutionResult.error("No class " + ident2B.getName());
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""); final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
final Ident ident1 = diagram.buildLeafIdent(idShort); final Ident ident1 = diagram.buildLeafIdent(idShort);
@ -443,9 +434,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final boolean result = diagram.associationClass(2, name2A, name2B, cl1, linkType, label); final boolean result = diagram.associationClass(2, name2A, name2B, cl1, linkType, label);
if (result == false) { if (result == false)
return CommandExecutionResult.error("Cannot have more than 2 assocications"); return CommandExecutionResult.error("Cannot have more than 2 assocications");
}
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
@ -459,18 +449,17 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Ident ident1B = diagram.buildLeafIdent(name1B); final Ident ident1B = diagram.buildLeafIdent(name1B);
final Ident ident2A = diagram.buildLeafIdent(name2A); final Ident ident2A = diagram.buildLeafIdent(name2A);
final Ident ident2B = diagram.buildLeafIdent(name2B); final Ident ident2B = diagram.buildLeafIdent(name2B);
if (diagram.leafExistSmart(ident1A) == false) { if (diagram.leafExistSmart(ident1A) == false)
return CommandExecutionResult.error("No class " + ident1A.getName()); return CommandExecutionResult.error("No class " + ident1A.getName());
}
if (diagram.leafExistSmart(ident1B) == false) { if (diagram.leafExistSmart(ident1B) == false)
return CommandExecutionResult.error("No class " + ident1B.getName()); return CommandExecutionResult.error("No class " + ident1B.getName());
}
if (diagram.leafExistSmart(ident2A) == false) { if (diagram.leafExistSmart(ident2A) == false)
return CommandExecutionResult.error("No class " + ident2A.getName()); return CommandExecutionResult.error("No class " + ident2A.getName());
}
if (diagram.leafExistSmart(ident2B) == false) { if (diagram.leafExistSmart(ident2B) == false)
return CommandExecutionResult.error("No class " + ident2B.getName()); return CommandExecutionResult.error("No class " + ident2B.getName());
}
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
@ -489,18 +478,17 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Code clName1B = diagram.buildCode(name1B); final Code clName1B = diagram.buildCode(name1B);
final Code clName2A = diagram.buildCode(name2A); final Code clName2A = diagram.buildCode(name2A);
final Code clName2B = diagram.buildCode(name2B); final Code clName2B = diagram.buildCode(name2B);
if (diagram.leafExist(clName1A) == false) { if (diagram.leafExist(clName1A) == false)
return CommandExecutionResult.error("No class " + clName1A); return CommandExecutionResult.error("No class " + clName1A);
}
if (diagram.leafExist(clName1B) == false) { if (diagram.leafExist(clName1B) == false)
return CommandExecutionResult.error("No class " + clName1B); return CommandExecutionResult.error("No class " + clName1B);
}
if (diagram.leafExist(clName2A) == false) { if (diagram.leafExist(clName2A) == false)
return CommandExecutionResult.error("No class " + clName2A); return CommandExecutionResult.error("No class " + clName2A);
}
if (diagram.leafExist(clName2B) == false) { if (diagram.leafExist(clName2B) == false)
return CommandExecutionResult.error("No class " + clName2B); return CommandExecutionResult.error("No class " + clName2B);
}
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
@ -515,12 +503,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String name2B = arg.get("COUPLE2", 1); final String name2B = arg.get("COUPLE2", 1);
final Code clName2A = diagram.buildCode(name2A); final Code clName2A = diagram.buildCode(name2A);
final Code clName2B = diagram.buildCode(name2B); final Code clName2B = diagram.buildCode(name2B);
if (diagram.leafExist(clName2A) == false) { if (diagram.leafExist(clName2A) == false)
return CommandExecutionResult.error("No class " + clName2A); return CommandExecutionResult.error("No class " + clName2A);
}
if (diagram.leafExist(clName2B) == false) { if (diagram.leafExist(clName2B) == false)
return CommandExecutionResult.error("No class " + clName2B); return CommandExecutionResult.error("No class " + clName2B);
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\""); final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
final Code ent1 = diagram.buildCode(idShort); final Code ent1 = diagram.buildCode(idShort);
@ -530,9 +517,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final boolean result = diagram.associationClass(2, name2A, name2B, cl1, linkType, label); final boolean result = diagram.associationClass(2, name2A, name2B, cl1, linkType, label);
if (result == false) { if (result == false)
return CommandExecutionResult.error("Cannot have more than 2 assocications"); return CommandExecutionResult.error("Cannot have more than 2 assocications");
}
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
@ -542,110 +528,110 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return LinkDecor.NONE; return LinkDecor.NONE;
} }
s = StringUtils.trin(s); s = StringUtils.trin(s);
if ("<|".equals(s)) { if ("<|".equals(s))
return LinkDecor.EXTENDS; return LinkDecor.EXTENDS;
}
if ("<|:".equals(s)) { if ("<|:".equals(s))
return LinkDecor.DEFINEDBY; return LinkDecor.DEFINEDBY;
}
if ("<||".equals(s)) { if ("<||".equals(s))
return LinkDecor.REDEFINES; return LinkDecor.REDEFINES;
}
if ("}".equals(s)) { if ("}".equals(s))
return LinkDecor.CROWFOOT; return LinkDecor.CROWFOOT;
}
if ("}o".equals(s)) { if ("}o".equals(s))
return LinkDecor.CIRCLE_CROWFOOT; return LinkDecor.CIRCLE_CROWFOOT;
}
if ("}|".equals(s)) { if ("}|".equals(s))
return LinkDecor.LINE_CROWFOOT; return LinkDecor.LINE_CROWFOOT;
}
if ("|o".equals(s)) { if ("|o".equals(s))
return LinkDecor.CIRCLE_LINE; return LinkDecor.CIRCLE_LINE;
}
if ("||".equals(s)) { if ("||".equals(s))
return LinkDecor.DOUBLE_LINE; return LinkDecor.DOUBLE_LINE;
}
if ("<".equals(s)) { if ("<".equals(s))
return LinkDecor.ARROW; return LinkDecor.ARROW;
}
if ("^".equals(s)) { if ("^".equals(s))
return LinkDecor.EXTENDS; return LinkDecor.EXTENDS;
}
if ("+".equals(s)) { if ("+".equals(s))
return LinkDecor.PLUS; return LinkDecor.PLUS;
}
if ("o".equals(s)) { if ("o".equals(s))
return LinkDecor.AGREGATION; return LinkDecor.AGREGATION;
}
if ("x".equals(s)) { if ("x".equals(s))
return LinkDecor.NOT_NAVIGABLE; return LinkDecor.NOT_NAVIGABLE;
}
if ("*".equals(s)) { if ("*".equals(s))
return LinkDecor.COMPOSITION; return LinkDecor.COMPOSITION;
}
if ("#".equals(s)) { if ("#".equals(s))
return LinkDecor.SQUARE; return LinkDecor.SQUARE;
}
if (")".equals(s)) { if (")".equals(s))
return LinkDecor.PARENTHESIS; return LinkDecor.PARENTHESIS;
}
return LinkDecor.NONE; return LinkDecor.NONE;
} }
private LinkDecor getDecors2(String s) { private LinkDecor getDecors2(String s) {
if (s == null) { if (s == null)
return LinkDecor.NONE; return LinkDecor.NONE;
}
s = StringUtils.trin(s); s = StringUtils.trin(s);
if ("|>".equals(s)) { if ("|>".equals(s))
return LinkDecor.EXTENDS; return LinkDecor.EXTENDS;
}
if (":|>".equals(s)) { if (":|>".equals(s))
return LinkDecor.DEFINEDBY; return LinkDecor.DEFINEDBY;
}
if ("||>".equals(s)) { if ("||>".equals(s))
return LinkDecor.REDEFINES; return LinkDecor.REDEFINES;
}
if (">".equals(s)) { if (">".equals(s))
return LinkDecor.ARROW; return LinkDecor.ARROW;
}
if ("{".equals(s)) { if ("{".equals(s))
return LinkDecor.CROWFOOT; return LinkDecor.CROWFOOT;
}
if ("o{".equals(s)) { if ("o{".equals(s))
return LinkDecor.CIRCLE_CROWFOOT; return LinkDecor.CIRCLE_CROWFOOT;
}
if ("|{".equals(s)) { if ("|{".equals(s))
return LinkDecor.LINE_CROWFOOT; return LinkDecor.LINE_CROWFOOT;
}
if ("o|".equals(s)) { if ("o|".equals(s))
return LinkDecor.CIRCLE_LINE; return LinkDecor.CIRCLE_LINE;
}
if ("||".equals(s)) { if ("||".equals(s))
return LinkDecor.DOUBLE_LINE; return LinkDecor.DOUBLE_LINE;
}
if ("^".equals(s)) { if ("^".equals(s))
return LinkDecor.EXTENDS; return LinkDecor.EXTENDS;
}
if ("+".equals(s)) { if ("+".equals(s))
return LinkDecor.PLUS; return LinkDecor.PLUS;
}
if ("o".equals(s)) { if ("o".equals(s))
return LinkDecor.AGREGATION; return LinkDecor.AGREGATION;
}
if ("x".equals(s)) { if ("x".equals(s))
return LinkDecor.NOT_NAVIGABLE; return LinkDecor.NOT_NAVIGABLE;
}
if ("*".equals(s)) { if ("*".equals(s))
return LinkDecor.COMPOSITION; return LinkDecor.COMPOSITION;
}
if ("#".equals(s)) { if ("#".equals(s))
return LinkDecor.SQUARE; return LinkDecor.SQUARE;
}
if ("(".equals(s)) { if ("(".equals(s))
return LinkDecor.PARENTHESIS; return LinkDecor.PARENTHESIS;
}
return LinkDecor.NONE; return LinkDecor.NONE;
} }
@ -654,19 +640,19 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkDecor decors2 = getDecors2(getArrowHead2(arg)); final LinkDecor decors2 = getDecors2(getArrowHead2(arg));
LinkType result = new LinkType(decors2, decors1); LinkType result = new LinkType(decors2, decors1);
if (arg.get("ARROW_BODY1", 0).contains(".") || arg.get("ARROW_BODY2", 0).contains(".")) { if (arg.get("ARROW_BODY1", 0).contains(".") || arg.get("ARROW_BODY2", 0).contains("."))
result = result.goDashed(); result = result.goDashed();
}
final String middle = arg.get("INSIDE", 0); final String middle = arg.get("INSIDE", 0);
if ("0".equals(middle)) { if ("0".equals(middle))
result = result.withMiddleCircle(); result = result.withMiddleCircle();
} else if ("0)".equals(middle)) { else if ("0)".equals(middle))
result = result.withMiddleCircleCircled1(); result = result.withMiddleCircleCircled1();
} else if ("(0".equals(middle)) { else if ("(0".equals(middle))
result = result.withMiddleCircleCircled2(); result = result.withMiddleCircleCircled2();
} else if ("(0)".equals(middle)) { else if ("(0)".equals(middle))
result = result.withMiddleCircleCircled(); result = result.withMiddleCircleCircled();
}
return result; return result;
} }
@ -682,12 +668,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
String s = getFullArrow(arg); String s = getFullArrow(arg);
s = s.replaceAll("[^-.=\\w]", ""); s = s.replaceAll("[^-.=\\w]", "");
if (s.startsWith("o")) { if (s.startsWith("o"))
s = s.substring(1); s = s.substring(1);
}
if (s.endsWith("o")) { if (s.endsWith("o"))
s = s.substring(0, s.length() - 1); s = s.substring(0, s.length() - 1);
}
Direction result = StringUtils.getQueueDirection(s); Direction result = StringUtils.getQueueDirection(s);
// if (isInversed(decors1, decors2) && s.matches(".*\\w.*")) { // if (isInversed(decors1, decors2) && s.matches(".*\\w.*")) {
@ -715,29 +700,9 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
} }
public static String notNull(String s) { public static String notNull(String s) {
if (s == null) { if (s == null)
return ""; return "";
}
return s; return s;
} }
// private boolean isInversed(LinkDecor decors1, LinkDecor decors2) {
// if (decors1 == LinkDecor.ARROW && decors2 != LinkDecor.ARROW) {
// return true;
// }
// if (decors2 == LinkDecor.AGREGATION) {
// return true;
// }
// if (decors2 == LinkDecor.COMPOSITION) {
// return true;
// }
// if (decors2 == LinkDecor.PLUS) {
// return true;
// }
// // if (decors2 == LinkDecor.EXTENDS) {
// // return true;
// // }
// return false;
// }
} }

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.command.note; package net.sourceforge.plantuml.command.note;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
@ -243,8 +242,8 @@ public final class CommandFactoryNoteOnEntity implements SingleMultiFactoryComma
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,
ColorParam.noteBackground, ColorParam.noteBorder); ColorParam.noteBorder);
note.setStereotype(stereotype); note.setStereotype(stereotype);
} }

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.command.note.sequence; package net.sourceforge.plantuml.command.note.sequence;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder; import net.sourceforge.plantuml.UrlBuilder;
@ -160,8 +159,8 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,
ColorParam.noteBackground, ColorParam.noteBorder); ColorParam.noteBorder);
note.setStereotype(stereotype); note.setStereotype(stereotype);
} }
note.setColors(colors); note.setColors(colors);

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.command.note.sequence; package net.sourceforge.plantuml.command.note.sequence;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
@ -159,8 +158,8 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
final String stereotypeString = arg.get("STEREO", 0); final String stereotypeString = arg.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,
ColorParam.noteBackground, ColorParam.noteBorder); ColorParam.noteBorder);
note.setStereotype(stereotype); note.setStereotype(stereotype);
} }
note.setColors(colors); note.setColors(colors);

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.command.note.sequence; package net.sourceforge.plantuml.command.note.sequence;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
@ -154,8 +153,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,
ColorParam.noteBackground, ColorParam.noteBorder); ColorParam.noteBorder);
note.setStereotype(stereotype); note.setStereotype(stereotype);
} }
note.setUrl(url); note.setUrl(url);

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.command.note.sequence; package net.sourceforge.plantuml.command.note.sequence;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation; import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
@ -170,8 +169,8 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,
ColorParam.noteBackground, ColorParam.noteBorder); ColorParam.noteBorder);
note.setStereotype(stereotype); note.setStereotype(stereotype);
} }
note.setColors(colors); note.setColors(colors);

View File

@ -221,7 +221,7 @@ public class BodierLikeClassOrObject implements Bodier {
if (type.isLikeClass() && isBodyEnhanced()) { if (type.isLikeClass() && isBodyEnhanced()) {
if (showMethods || showFields) { if (showMethods || showFields) {
return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
rawBodyWithoutHidden(), fontParam, skinParam, stereotype, leaf, style); rawBodyWithoutHidden(), skinParam, stereotype, leaf, style);
} }
return null; return null;
} }
@ -233,15 +233,15 @@ public class BodierLikeClassOrObject implements Bodier {
return new TextBlockLineBefore(style.value(PName.LineThickness).asDouble(), TextBlockUtils.empty(0, 0)); return new TextBlockLineBefore(style.value(PName.LineThickness).asDouble(), TextBlockUtils.empty(0, 0));
} }
return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
rawBodyWithoutHidden(), fontParam, skinParam, stereotype, leaf, style); rawBodyWithoutHidden(), skinParam, stereotype, leaf, style);
} }
assert type.isLikeClass(); assert type.isLikeClass();
final MethodsOrFieldsArea fields = new MethodsOrFieldsArea(getFieldsToDisplay(), fontParam, skinParam, final MethodsOrFieldsArea fields = new MethodsOrFieldsArea(getFieldsToDisplay(), skinParam, leaf,
stereotype, leaf, style); style);
final MethodsOrFieldsArea methods = new MethodsOrFieldsArea(getMethodsToDisplay(), fontParam, skinParam, final MethodsOrFieldsArea methods = new MethodsOrFieldsArea(getMethodsToDisplay(), skinParam, leaf,
stereotype, leaf, style); style);
if (showFields && showMethods == false) { if (showFields && showMethods == false) {
return fields.asBlockMemberImpl(); return fields.asBlockMemberImpl();
} else if (showMethods && showFields == false) { } else if (showMethods && showFields == false) {

View File

@ -96,8 +96,8 @@ public class BodierSimple implements Bodier {
@Override @Override
public TextBlock getBody(FontParam fontParam, ISkinParam skinParam, boolean showMethods, boolean showFields, public TextBlock getBody(FontParam fontParam, ISkinParam skinParam, boolean showMethods, boolean showFields,
Stereotype stereotype, Style style, FontConfiguration fontConfiguration) { Stereotype stereotype, Style style, FontConfiguration fontConfiguration) {
return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), rawBody, fontParam, return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), rawBody, skinParam,
skinParam, stereotype, leaf, style); stereotype, leaf, style);
} }
} }

View File

@ -44,7 +44,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import net.sourceforge.plantuml.EmbeddedDiagram; import net.sourceforge.plantuml.EmbeddedDiagram;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
@ -65,22 +64,21 @@ import net.sourceforge.plantuml.svek.WithPorts;
public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, WithPorts { public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, WithPorts {
private final Display rawBody2; private final Display rawBody2;
private final FontParam fontParam;
private final ISkinParam skinParam; private final ISkinParam skinParam;
private final boolean lineFirst; private final boolean lineFirst;
private final List<Url> urls = new ArrayList<>(); private final List<Url> urls = new ArrayList<>();
private final Stereotype stereotype;
private final ILeaf entity; private final ILeaf entity;
private final boolean inEllipse; private final boolean inEllipse;
private final Style style; private final Style style;
BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, List<CharSequence> rawBody, ISkinParam skinParam, ILeaf entity,
Stereotype stereotype, ILeaf entity, Style style) { Style style) {
super(align, style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style); super(align, style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style);
this.style = style; this.style = style;
this.rawBody2 = Display.create(rawBody); this.rawBody2 = Display.create(rawBody);
this.stereotype = stereotype;
this.fontParam = fontParam;
this.skinParam = skinParam; this.skinParam = skinParam;
this.lineFirst = true; this.lineFirst = true;
@ -89,20 +87,19 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
this.inEllipse = false; this.inEllipse = false;
} }
BodyEnhanced1(HorizontalAlignment align, Display display, FontParam fontParam, ISkinParam skinParam, BodyEnhanced1(HorizontalAlignment align, Display display, ISkinParam skinParam, ILeaf entity,
Stereotype stereotype, ILeaf entity, Style style) { Style style) {
super(align, style == null ? FontConfiguration.create(skinParam, fontParam, stereotype) super(align, style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style);
: style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style);
this.style = style; this.style = style;
this.entity = entity; this.entity = entity;
this.stereotype = stereotype;
this.fontParam = fontParam;
this.skinParam = skinParam; this.skinParam = skinParam;
this.lineFirst = false; this.lineFirst = false;
this.inEllipse = fontParam == FontParam.USECASE; final LeafType leafType = entity.getLeafType();
this.inEllipse = leafType == LeafType.USECASE || leafType == LeafType.USECASE_BUSINESS;
if (inEllipse && display.size() > 0 && isBlockSeparator(display.get(0).toString())) if (inEllipse && display.size() > 0 && isBlockSeparator(display.get(0).toString()))
display = display.add(""); display = display.add("");
@ -137,8 +134,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
if (cs instanceof EmbeddedDiagram) { if (cs instanceof EmbeddedDiagram) {
if (display.size() > 0 || separator != 0) { if (display.size() > 0 || separator != 0) {
blocks.add(decorate(stringBounder, blocks.add(decorate(stringBounder,
new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator, title));
separator, title));
separator = 0; separator = 0;
title = null; title = null;
display = Display.empty(); display = Display.empty();
@ -148,23 +144,24 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
final String s = cs.toString(); final String s = cs.toString();
if (isBlockSeparator(s)) { if (isBlockSeparator(s)) {
blocks.add(decorate(stringBounder, blocks.add(decorate(stringBounder,
new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator, title));
separator, title));
separator = s.charAt(0); separator = s.charAt(0);
title = getTitle(s, skinParam); title = getTitle(s, skinParam);
display = Display.empty(); display = Display.empty();
} else if (isTreeOrTable(s)) { } else if (isTreeOrTable(s)) {
final boolean isTable = CreoleParser.isTableLine(s); final boolean isTable = CreoleParser.isTableLine(s);
if (display.size() > 0) if (display.size() > 0)
blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(display, fontParam, skinParam, align, blocks.add(decorate(stringBounder,
stereotype, entity, style), separator, title)); new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator, title));
separator = 0; separator = 0;
title = null; title = null;
display = Display.empty(); display = Display.empty();
final List<CharSequence> allTree = buildTreeOrTable(s, it); final List<CharSequence> allTree = buildTreeOrTable(s, it);
TextBlock bloc = Display.create(allTree).create7(fontParam.getFontConfiguration(skinParam), align, final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam.getThemeStyle(),
skinParam, CreoleMode.FULL); skinParam.getIHtmlColorSet());
TextBlock bloc = Display.create(allTree).create7(fontConfiguration, align, skinParam,
CreoleMode.FULL);
if (isTable) if (isTable)
bloc = TextBlockUtils.withMargin(bloc, 10, 10, 0, 5); bloc = TextBlockUtils.withMargin(bloc, 10, 10, 0, 5);
@ -180,8 +177,7 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
if (inEllipse && display.size() == 0) { if (inEllipse && display.size() == 0) {
display = display.add(""); display = display.add("");
} }
blocks.add(decorate(stringBounder, blocks.add(decorate(stringBounder, new MethodsOrFieldsArea(display, skinParam, align, entity, style), separator,
new MethodsOrFieldsArea(display, fontParam, skinParam, align, stereotype, entity, style), separator,
title)); title));
if (blocks.size() == 1) if (blocks.size() == 1)

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.cucadiagram;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.Guillemet;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
@ -57,8 +56,8 @@ public class BodyEnhanced2 extends BodyEnhancedAbstract {
private final LineBreakStrategy lineBreakStrategy; private final LineBreakStrategy lineBreakStrategy;
BodyEnhanced2(Display rawBody, FontParam fontParam, ISkinSimple skinParam, HorizontalAlignment align, BodyEnhanced2(Display rawBody, ISkinSimple skinParam, HorizontalAlignment align, FontConfiguration titleConfig,
FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, Style style) { LineBreakStrategy lineBreakStrategy, Style style) {
super(align, titleConfig, style); super(align, titleConfig, style);
this.rawBody = rawBody; this.rawBody = rawBody;
this.lineBreakStrategy = lineBreakStrategy; this.lineBreakStrategy = lineBreakStrategy;

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.cucadiagram;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.LineBreakStrategy; import net.sourceforge.plantuml.LineBreakStrategy;
@ -53,9 +52,9 @@ public class BodyFactory {
public final static boolean BODY3 = false; public final static boolean BODY3 = false;
public static Bodier createLeaf(LeafType type, Set<VisibilityModifier> hides) { public static Bodier createLeaf(LeafType type, Set<VisibilityModifier> hides) {
if (type.isLikeClass() || type == LeafType.OBJECT) { if (type.isLikeClass() || type == LeafType.OBJECT)
return new BodierLikeClassOrObject(type, hides); return new BodierLikeClassOrObject(type, hides);
}
return new BodierSimple(); return new BodierSimple();
} }
@ -63,20 +62,19 @@ public class BodyFactory {
return new BodierSimple(); return new BodierSimple();
} }
public static TextBlock create1(HorizontalAlignment align, List<CharSequence> rawBody, FontParam fontParam, public static TextBlock create1(HorizontalAlignment align, List<CharSequence> rawBody, ISkinParam skinParam,
ISkinParam skinParam, Stereotype stereotype, ILeaf entity, Style style) { Stereotype stereotype, ILeaf entity, Style style) {
return new BodyEnhanced1(align, rawBody, fontParam, skinParam, stereotype, entity, style); return new BodyEnhanced1(align, rawBody, skinParam, entity, style);
} }
public static TextBlock create2(HorizontalAlignment align, Display display, FontParam fontParam, public static TextBlock create2(HorizontalAlignment align, Display display, ISkinParam skinParam,
ISkinParam skinParam, Stereotype stereotype, ILeaf entity, Style style) { Stereotype stereotype, ILeaf entity, Style style) {
return new BodyEnhanced1(align, display, fontParam, skinParam, stereotype, entity, style); return new BodyEnhanced1(align, display, skinParam, entity, style);
} }
public static TextBlock create3(Display rawBody, FontParam fontParam, ISkinSimple skinParam, public static TextBlock create3(Display rawBody, ISkinSimple skinParam, HorizontalAlignment align,
HorizontalAlignment align, FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, Style style) {
Style style) { return new BodyEnhanced2(rawBody, skinParam, align, titleConfig, lineBreakStrategy, style);
return new BodyEnhanced2(rawBody, fontParam, skinParam, align, titleConfig, lineBreakStrategy, style);
} }
} }

View File

@ -41,7 +41,6 @@ import java.util.HashSet;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EmbeddedDiagram; import net.sourceforge.plantuml.EmbeddedDiagram;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
@ -77,35 +76,32 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock,
TextBlockUtils.withMargin(this, 6, 4)); TextBlockUtils.withMargin(this, 6, 4));
} }
private final FontParam fontParam;
private final ISkinParam skinParam; private final ISkinParam skinParam;
private final Display members; private final Display members;
private final HorizontalAlignment align; private final HorizontalAlignment align;
private final Stereotype stereotype;
private final ILeaf leaf; private final ILeaf leaf;
private final Style style; private final Style style;
public MethodsOrFieldsArea(Display members, FontParam fontParam, ISkinParam skinParam, Stereotype stereotype, public MethodsOrFieldsArea(Display members, ISkinParam skinParam, ILeaf leaf, Style style) {
ILeaf leaf, Style style) { this(members, skinParam, HorizontalAlignment.LEFT, leaf, style);
this(members, fontParam, skinParam, HorizontalAlignment.LEFT, stereotype, leaf, style);
} }
public MethodsOrFieldsArea(Display members, FontParam fontParam, ISkinParam skinParam, HorizontalAlignment align, public MethodsOrFieldsArea(Display members, ISkinParam skinParam, HorizontalAlignment align, ILeaf leaf,
Stereotype stereotype, ILeaf leaf, Style style) { Style style) {
this.style = style; this.style = style;
this.leaf = leaf; this.leaf = leaf;
this.stereotype = stereotype;
this.align = align; this.align = align;
this.skinParam = skinParam; this.skinParam = skinParam;
this.fontParam = fontParam;
this.members = members; this.members = members;
} }
private boolean hasSmallIcon() { private boolean hasSmallIcon() {
if (skinParam.classAttributeIconSize() == 0) { if (skinParam.classAttributeIconSize() == 0)
return false; return false;
}
for (CharSequence cs : members) { for (CharSequence cs : members) {
if (cs instanceof Member == false) if (cs instanceof Member == false)
continue; continue;
@ -119,9 +115,9 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock,
public Dimension2D calculateDimension(StringBounder stringBounder) { public Dimension2D calculateDimension(StringBounder stringBounder) {
double smallIcon = 0; double smallIcon = 0;
if (hasSmallIcon()) { if (hasSmallIcon())
smallIcon = skinParam.getCircledCharacterRadius() + 3; smallIcon = skinParam.getCircledCharacterRadius() + 3;
}
double x = 0; double x = 0;
double y = 0; double y = 0;
for (CharSequence cs : members) { for (CharSequence cs : members) {
@ -178,11 +174,7 @@ public class MethodsOrFieldsArea extends AbstractTextBlock implements TextBlock,
private TextBlock createTextBlock(CharSequence cs) { private TextBlock createTextBlock(CharSequence cs) {
FontConfiguration config; FontConfiguration config = FontConfiguration.create(skinParam, style);
if (style != null)
config = FontConfiguration.create(skinParam, style);
else
config = FontConfiguration.create(skinParam, fontParam, stereotype);
if (cs instanceof Member) { if (cs instanceof Member) {
final Member m = (Member) cs; final Member m = (Member) cs;

View File

@ -47,9 +47,7 @@ import java.util.Map.Entry;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Bodier; import net.sourceforge.plantuml.cucadiagram.Bodier;
import net.sourceforge.plantuml.cucadiagram.BodierJSon; import net.sourceforge.plantuml.cucadiagram.BodierJSon;
@ -69,9 +67,7 @@ import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.SuperGroup; import net.sourceforge.plantuml.cucadiagram.SuperGroup;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.skin.VisibilityModifier; import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public final class EntityFactory { public final class EntityFactory {

View File

@ -666,9 +666,6 @@ final public class EntityImpl implements ILeaf, IGroup {
} }
private FontParam getTitleFontParam() { private FontParam getTitleFontParam() {
if (symbol != null) {
return symbol.getFontParam();
}
return getGroupType() == GroupType.STATE ? FontParam.STATE : FontParam.PACKAGE; return getGroupType() == GroupType.STATE ? FontParam.STATE : FontParam.PACKAGE;
} }

View File

@ -50,6 +50,7 @@ import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.security.SImageIO; import net.sourceforge.plantuml.security.SImageIO;
import net.sourceforge.plantuml.ugraphic.AffineTransformType; import net.sourceforge.plantuml.ugraphic.AffineTransformType;
import net.sourceforge.plantuml.ugraphic.PixelImage; import net.sourceforge.plantuml.ugraphic.PixelImage;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UImage;
public class PSystemDedication extends PlainDiagram { public class PSystemDedication extends PlainDiagram {
@ -63,7 +64,12 @@ public class PSystemDedication extends PlainDiagram {
@Override @Override
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) { protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) {
return ug -> ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR))); // return ug -> ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR)));
return new UDrawable() {
public void drawU(UGraphic ug) {
ug.draw(new UImage(new PixelImage(img, AffineTransformType.TYPE_BILINEAR)));
}
};
} }
public static BufferedImage getBufferedImage(InputStream is) { public static BufferedImage getBufferedImage(InputStream is) {

View File

@ -35,8 +35,6 @@
*/ */
package net.sourceforge.plantuml.descdiagram; package net.sourceforge.plantuml.descdiagram;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam; import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.Guillemet; import net.sourceforge.plantuml.Guillemet;
@ -44,6 +42,7 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.SkinParamUtils; import net.sourceforge.plantuml.SkinParamUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.Stencil; import net.sourceforge.plantuml.creole.Stencil;
import net.sourceforge.plantuml.cucadiagram.BodyFactory; import net.sourceforge.plantuml.cucadiagram.BodyFactory;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
@ -51,11 +50,13 @@ import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.Stereotype; import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils; import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.svek.AbstractEntityImage; import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType; import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine; import net.sourceforge.plantuml.ugraphic.AbstractUGraphicHorizontalLine;
@ -78,7 +79,7 @@ public class EntityImageRequirement extends AbstractEntityImage {
final Stereotype stereotype = entity.getStereotype(); final Stereotype stereotype = entity.getStereotype();
final TextBlock tmp = BodyFactory.create2(skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), final TextBlock tmp = BodyFactory.create2(skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER),
entity.getDisplay(), FontParam.REQUIREMENT, skinParam, stereotype, entity, null); entity.getDisplay(), skinParam, stereotype, entity, getStyle());
if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) { if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) {
this.desc = tmp; this.desc = tmp;
@ -91,13 +92,18 @@ public class EntityImageRequirement extends AbstractEntityImage {
this.url = entity.getUrl99(); this.url = entity.getUrl99();
} }
private Style getStyle() {
return StyleSignatureBasic.of(SName.root, SName.element, SName.componentDiagram, SName.requirement)
.withTOBECHANGED(getEntity().getStereotype()).getMergedStyle(getSkinParam().getCurrentStyleBuilder());
}
private UStroke getStroke() { private UStroke getStroke() {
UStroke stroke = getSkinParam().getThickness(LineParam.requirementBorder, getStereo()); UStroke stroke = getSkinParam().getThickness(LineParam.requirementBorder, getStereo());
if (stroke == null) { if (stroke == null)
stroke = new UStroke(7, 7, 1.5); stroke = new UStroke(7, 7, 1.5);
// stroke = new UStroke(1.5);
}
return stroke; return stroke;
} }
@ -108,32 +114,28 @@ public class EntityImageRequirement extends AbstractEntityImage {
final public void drawU(UGraphic ug) { final public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder); final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder);
if (getSkinParam().shadowing2(getStereo(), SkinParameter.USECASE)) {
ellipse.setDeltaShadow(3);
}
if (url != null) { if (url != null)
ug.startUrl(url); ug.startUrl(url);
}
ug = ug.apply(getStroke()); ug = ug.apply(getStroke());
HColor linecolor = getEntity().getColors().getColor(ColorType.LINE); HColor linecolor = getEntity().getColors().getColor(ColorType.LINE);
if (linecolor == null) { if (linecolor == null)
linecolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBorder); linecolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBorder);
}
ug = ug.apply(linecolor); ug = ug.apply(linecolor);
HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); HColor backcolor = getEntity().getColors().getColor(ColorType.BACK);
if (backcolor == null) { if (backcolor == null)
backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBackground); backcolor = SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.requirementBackground);
}
ug = ug.apply(backcolor.bg()); ug = ug.apply(backcolor.bg());
final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse()); final UGraphic ug2 = new MyUGraphicEllipse(ug, 0, 0, ellipse.getUEllipse());
ellipse.drawU(ug2); ellipse.drawU(ug2);
if (url != null) { if (url != null)
ug.closeUrl(); ug.closeUrl();
}
} }
public ShapeType getShapeType() { public ShapeType getShapeType() {
@ -159,13 +161,13 @@ public class EntityImageRequirement extends AbstractEntityImage {
} }
private double getNormalized(double y) { private double getNormalized(double y) {
if (y < yTheoricalPosition) { if (y < yTheoricalPosition)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
y = y - yTheoricalPosition; y = y - yTheoricalPosition;
if (y > ellipse.getHeight()) { if (y > ellipse.getHeight())
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
return y; return y;
} }

View File

@ -264,8 +264,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(), backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(),
group.getUSymbol()); group.getUSymbol());
final double roundCorner = group.getUSymbol() == null ? 0 final double roundCorner = style.value(PName.RoundCorner).asDouble();
: group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype()); // final double roundCorner = group.getUSymbol() == null ? 0
// : group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype());
final TextBlock ztitle = getTitleBlock(group); final TextBlock ztitle = getTitleBlock(group);
final TextBlock zstereo = TextBlockUtils.empty(0, 0); final TextBlock zstereo = TextBlockUtils.empty(0, 0);

View File

@ -39,10 +39,8 @@ import java.awt.geom.Point2D;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram; import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.Link; import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor; import net.sourceforge.plantuml.cucadiagram.LinkDecor;
@ -112,21 +110,6 @@ public class ElkPath implements UDrawable {
} }
private ColorParam getArrowColorParam() {
if (diagram.getUmlDiagramType() == UmlDiagramType.CLASS)
return ColorParam.arrow;
else if (diagram.getUmlDiagramType() == UmlDiagramType.OBJECT)
return ColorParam.arrow;
else if (diagram.getUmlDiagramType() == UmlDiagramType.DESCRIPTION)
return ColorParam.arrow;
else if (diagram.getUmlDiagramType() == UmlDiagramType.ACTIVITY)
return ColorParam.arrow;
else if (diagram.getUmlDiagramType() == UmlDiagramType.STATE)
return ColorParam.arrow;
throw new IllegalStateException();
}
private Style getStyle() { private Style getStyle() {
final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, styleName, SName.arrow); final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, styleName, SName.arrow);
return signature.getMergedStyle(diagram.getCurrentStyleBuilder()); return signature.getMergedStyle(diagram.getCurrentStyleBuilder());

View File

@ -35,9 +35,8 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;

View File

@ -35,12 +35,12 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainerEmpty; import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode; import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.svek.IEntityImage; import net.sourceforge.plantuml.svek.IEntityImage;

View File

@ -35,10 +35,10 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -38,7 +38,6 @@ package net.sourceforge.plantuml.graphic;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.cucadiagram.LinkStyle; import net.sourceforge.plantuml.cucadiagram.LinkStyle;
import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;

View File

@ -35,9 +35,8 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,13 +35,13 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainer; import net.sourceforge.plantuml.SpriteContainer;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.sprite.Sprite; import net.sourceforge.plantuml.sprite.Sprite;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -1,225 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2023, 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.graphic;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.CornerParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.ugraphic.UStroke;
public class SkinParameter {
public static final SkinParameter DATABASE = new SkinParameter(SName.database, "DATABASE",
ColorParam.databaseBackground, ColorParam.databaseBorder, FontParam.DATABASE,
FontParam.DATABASE_STEREOTYPE);
public static final SkinParameter ARTIFACT = new SkinParameter(SName.artifact, "ARTIFACT",
ColorParam.artifactBackground, ColorParam.artifactBorder, FontParam.ARTIFACT,
FontParam.ARTIFACT_STEREOTYPE);
public static final SkinParameter COMPONENT1 = new SkinParameter(SName.component, "COMPONENT1",
ColorParam.componentBackground, ColorParam.componentBorder, FontParam.COMPONENT,
FontParam.COMPONENT_STEREOTYPE, CornerParam.component, LineParam.componentBorder);
public static final SkinParameter NODE = new SkinParameter(SName.node, "NODE", ColorParam.nodeBackground,
ColorParam.nodeBorder, FontParam.NODE, FontParam.NODE_STEREOTYPE);
public static final SkinParameter STORAGE = new SkinParameter(SName.storage, "STORAGE",
ColorParam.storageBackground, ColorParam.storageBorder, FontParam.STORAGE, FontParam.STORAGE_STEREOTYPE);
public static final SkinParameter QUEUE = new SkinParameter(SName.queue, "QUEUE", ColorParam.queueBackground,
ColorParam.queueBorder, FontParam.QUEUE, FontParam.QUEUE_STEREOTYPE);
public static final SkinParameter STACK = new SkinParameter(SName.stack, "STACK", ColorParam.stackBackground,
ColorParam.stackBorder, FontParam.STACK, FontParam.STACK_STEREOTYPE);
public static final SkinParameter CLOUD = new SkinParameter(SName.cloud, "CLOUD", ColorParam.cloudBackground,
ColorParam.cloudBorder, FontParam.CLOUD, FontParam.CLOUD_STEREOTYPE);
public static final SkinParameter FRAME = new SkinParameter(SName.frame, "FRAME", ColorParam.frameBackground,
ColorParam.frameBorder, FontParam.FRAME, FontParam.FRAME_STEREOTYPE);
public static final SkinParameter COMPONENT2 = new SkinParameter(SName.component, "COMPONENT2",
ColorParam.componentBackground, ColorParam.componentBorder, FontParam.COMPONENT,
FontParam.COMPONENT_STEREOTYPE, CornerParam.component, LineParam.componentBorder);
public static final SkinParameter AGENT = new SkinParameter(SName.agent, "AGENT", ColorParam.agentBackground,
ColorParam.agentBorder, FontParam.AGENT, FontParam.AGENT_STEREOTYPE, CornerParam.agent,
LineParam.agentBorder);
public static final SkinParameter FOLDER = new SkinParameter(SName.folder, "FOLDER", ColorParam.folderBackground,
ColorParam.folderBorder, FontParam.FOLDER, FontParam.FOLDER_STEREOTYPE);
public static final SkinParameter FILE = new SkinParameter(SName.file, "FILE", ColorParam.fileBackground,
ColorParam.fileBorder, FontParam.FILE, FontParam.FILE_STEREOTYPE);
public static final SkinParameter PACKAGE = new SkinParameter(SName.package_, "PACKAGE",
ColorParam.packageBackground, ColorParam.packageBorder, FontParam.PACKAGE, FontParam.PACKAGE_STEREOTYPE,
CornerParam.DEFAULT, LineParam.packageBorder);
public static final SkinParameter CARD = new SkinParameter(SName.card, "CARD", ColorParam.cardBackground,
ColorParam.cardBorder, FontParam.CARD, FontParam.CARD_STEREOTYPE, CornerParam.card, LineParam.cardBorder);
public static final SkinParameter RECTANGLE = new SkinParameter(SName.rectangle, "RECTANGLE",
ColorParam.rectangleBackground, ColorParam.rectangleBorder, FontParam.RECTANGLE,
FontParam.RECTANGLE_STEREOTYPE, CornerParam.rectangle, LineParam.rectangleBorder);
public static final SkinParameter LABEL = new SkinParameter(SName.label, "LABEL", ColorParam.rectangleBackground,
ColorParam.rectangleBorder, FontParam.LABEL, FontParam.LABEL_STEREOTYPE);
public static final SkinParameter HEXAGON = new SkinParameter(SName.hexagon, "HEXAGON",
ColorParam.hexagonBackground, ColorParam.hexagonBorder, FontParam.HEXAGON, FontParam.HEXAGON_STEREOTYPE,
CornerParam.hexagon, LineParam.hexagonBorder);
public static final SkinParameter PERSON = new SkinParameter(SName.person, "PERSON", ColorParam.personBackground,
ColorParam.personBorder, FontParam.PERSON, FontParam.PERSON_STEREOTYPE, CornerParam.person,
LineParam.personBorder);
public static final SkinParameter ARCHIMATE = new SkinParameter(SName.archimate, "ARCHIMATE",
ColorParam.archimateBackground, ColorParam.archimateBorder, FontParam.ARCHIMATE,
FontParam.ARCHIMATE_STEREOTYPE, CornerParam.archimate, LineParam.archimateBorder);
public static final SkinParameter COLLECTIONS = new SkinParameter(SName.collections, "COLLECTIONS",
ColorParam.collectionsBackground, ColorParam.collectionsBorder, FontParam.RECTANGLE,
FontParam.RECTANGLE_STEREOTYPE);
public static final SkinParameter ACTOR = new SkinParameter(SName.actor, "ACTOR", ColorParam.actorBackground,
ColorParam.actorBorder, FontParam.ACTOR, FontParam.ACTOR_STEREOTYPE);
public static final SkinParameter USECASE = new SkinParameter(SName.usecase, "USECASE",
ColorParam.usecaseBackground, ColorParam.usecaseBorder, FontParam.USECASE, FontParam.USECASE_STEREOTYPE);
public static final SkinParameter BOUNDARY = new SkinParameter(SName.boundary, "BOUNDARY",
ColorParam.boundaryBackground, ColorParam.boundaryBorder, FontParam.BOUNDARY,
FontParam.BOUNDARY_STEREOTYPE);
public static final SkinParameter CONTROL = new SkinParameter(SName.control, "CONTROL",
ColorParam.controlBackground, ColorParam.controlBorder, FontParam.CONTROL, FontParam.CONTROL_STEREOTYPE);
public static final SkinParameter ENTITY = new SkinParameter(SName.entity, "ENTITY", ColorParam.entityBackground,
ColorParam.entityBorder, FontParam.ENTITY, FontParam.ENTITY_STEREOTYPE);
public static final SkinParameter INTERFACE = new SkinParameter(SName.interface_, "INTERFACE",
ColorParam.interfaceBackground, ColorParam.interfaceBorder, FontParam.INTERFACE,
FontParam.INTERFACE_STEREOTYPE);
public static final SkinParameter PARTICIPANT = new SkinParameter(SName.participant, "PARTICIPANT",
ColorParam.participantBackground, ColorParam.participantBorder, FontParam.PARTICIPANT,
FontParam.PARTICIPANT_STEREOTYPE);
private final ColorParam colorParamBorder;
private final ColorParam colorParamBack;
private final FontParam fontParam;
private final FontParam fontParamStereotype;
private final String name;
private final LineParam lineParam;
private final CornerParam roundParam;
private final SName styleName;
@Override
public String toString() {
return name;
}
public SName getStyleName() {
return styleName;
}
private SkinParameter(SName styleName, String name, ColorParam colorParamBack, ColorParam colorParamBorder,
FontParam fontParam, FontParam fontParamStereotype, CornerParam roundParam, LineParam lineParam) {
this.name = name;
this.styleName = styleName;
this.colorParamBack = colorParamBack;
this.colorParamBorder = colorParamBorder;
this.fontParam = fontParam;
this.fontParamStereotype = fontParamStereotype;
this.lineParam = lineParam;
this.roundParam = roundParam;
}
private SkinParameter(SName styleName, String name, ColorParam colorParamBack, ColorParam colorParamBorder,
FontParam fontParam, FontParam fontParamStereotype) {
this(styleName, name, colorParamBack, colorParamBorder, fontParam, fontParamStereotype, CornerParam.DEFAULT,
null);
}
public String getUpperCaseName() {
if (name.endsWith("1") || name.endsWith("2")) {
return name.substring(0, name.length() - 1);
}
return name;
}
public ColorParam getColorParamBorder() {
return colorParamBorder;
}
public ColorParam getColorParamBack() {
return colorParamBack;
}
public FontParam getFontParam() {
return fontParam;
}
public FontParam getFontParamStereotype() {
return fontParamStereotype;
}
public double getRoundCorner(ISkinParam skinParam, Stereotype stereotype) {
return skinParam.getRoundCorner(roundParam, stereotype);
}
public double getDiagonalCorner(ISkinParam skinParam, Stereotype stereotype) {
return skinParam.getDiagonalCorner(roundParam, stereotype);
}
public UStroke getStroke(ISkinParam skinParam, Stereotype stereotype) {
UStroke result = null;
if (lineParam != null) {
result = skinParam.getThickness(lineParam, stereotype);
}
if (result == null) {
result = new UStroke(1.5);
}
return result;
}
}

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UEmpty;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UShapeIgnorableForCompression; import net.sourceforge.plantuml.ugraphic.UShapeIgnorableForCompression;

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D; import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
public interface StringBounder { public interface StringBounder {

View File

@ -37,10 +37,10 @@ package net.sourceforge.plantuml.graphic;
import java.awt.font.FontRenderContext; import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics; import java.awt.font.LineMetrics;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormat; import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.text.RichText; import net.sourceforge.plantuml.text.RichText;
import net.sourceforge.plantuml.text.StyledString; import net.sourceforge.plantuml.text.StyledString;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;

View File

@ -35,9 +35,9 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.UShape;

View File

@ -35,11 +35,11 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,11 +35,11 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.Objects; import java.util.Objects;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.svek.GuideLine; import net.sourceforge.plantuml.svek.GuideLine;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.UPolygon;

View File

@ -35,9 +35,8 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.SheetBlock2; import net.sourceforge.plantuml.creole.SheetBlock2;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.Shadowable;

View File

@ -35,9 +35,8 @@
*/ */
package net.sourceforge.plantuml.graphic; package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
public class TextBlockEmpty extends AbstractTextBlock { public class TextBlockEmpty extends AbstractTextBlock {

Some files were not shown because too many files have changed in this diff Show More