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,131 +40,35 @@ import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
@HaxeIgnored
public enum ColorParam {
background(HColorUtils.WHITE, true, ColorType.BACK),
hyperlink(HColorUtils.BLUE),
activityDiamondBackground(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),
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),
enumBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
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),
stateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
stateBorder(HColorUtils.MY_RED, ColorType.LINE),
stateStart(HColorUtils.BLACK),
stateEnd(HColorUtils.BLACK),
noteBackground(HColorUtils.COL_FBFB77, true, ColorType.BACK),
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),
actorBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
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),
sequenceReferenceBorder(HColorUtils.BLACK, ColorType.LINE),
sequenceReferenceHeaderBackground(HColorUtils.COL_EEEEEE, 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),
sequenceNewpageSeparator(HColorUtils.BLACK, 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),
iconPrivateBackground(HColorUtils.COL_F24D5C),

View File

@ -213,6 +213,7 @@ public enum FileFormat {
}
protected Dimension2D calculateDimensionInternal(UFont font, String text) {
text = text.replace("\t", " ");
final Dimension2DDouble w1 = getJavaDimension(font.goTikz(-1), text);
final Dimension2DDouble w2 = getJavaDimension(font.goTikz(0), 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.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.skin.ArrowDirection;
@ -96,8 +95,6 @@ public interface ISkinParam extends ISkinSimple {
public boolean shadowingForNote(Stereotype stereotype);
public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter);
public PackageStyle packageStyle();
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.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.skin.ArrowDirection;
@ -738,32 +737,6 @@ public class SkinParam implements ISkinParam {
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>();
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.dot.DotSplines;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.SkinParameter;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.ActorStyle;
import net.sourceforge.plantuml.skin.ArrowDirection;
@ -136,11 +135,6 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.shadowing(stereotype);
}
@Override
public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) {
return skinParam.shadowing2(stereotype, skinParameter);
}
@Override
public PackageStyle 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.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class InstructionEnd extends MonoSwimable implements Instruction {
@ -64,7 +65,7 @@ public class InstructionEnd extends MonoSwimable implements Instruction {
@Override
public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.end(getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
return result;
}

View File

@ -53,6 +53,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
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);
if (getPositionedNotes().size() > 0) {
result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false);
result = FtileWithNoteOpale.create(result, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER);
}
return result;
}

View File

@ -49,6 +49,7 @@ import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -102,9 +103,9 @@ public class InstructionGroup extends AbstractInstruction implements Instruction
@Override
public Ftile createFtile(FtileFactory factory) {
Ftile tmp = list.createFtile(factory);
if (note != null) {
tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam());
}
if (note != null)
tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam(), VerticalAlignment.CENTER);
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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -141,7 +142,7 @@ public class InstructionIf extends WithNote implements Instruction, InstructionC
elseBranch.updateFtile(factory);
Ftile result = factory.createIf(swimlane, thens, elseBranch, outColor, topInlinkRendering, url);
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<>();
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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -125,7 +126,7 @@ public class InstructionList extends WithNote implements Instruction, Instructio
return new FtileEmpty(factory.skinParam(), defaultSwimlane);
}
final List<WeldingPoint> breaks = new ArrayList<>();
Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn());
Ftile result = eventuallyAddNote(factory, null, getSwimlaneIn(), VerticalAlignment.CENTER);
for (Instruction ins : all) {
Ftile cur = ins.createFtile(factory);
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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
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);
if (backwardNotes.size() > 0)
result = factory.addNote(result, swimlaneBackward, backwardNotes);
result = factory.addNote(result, swimlaneBackward, backwardNotes, VerticalAlignment.CENTER);
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.Stereotype;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
public class InstructionSimple extends MonoSwimable implements Instruction {
@ -104,7 +105,7 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
if (url != null) {
result = factory.addUrl(result, url);
}
result = eventuallyAddNote(factory, result, result.getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
if (killed) {
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.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -72,7 +73,7 @@ public class InstructionSpot extends MonoSwimable implements Instruction {
@Override
public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.spot(getSwimlaneIn(), spot, color);
result = eventuallyAddNote(factory, result, result.getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
if (killed)
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.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class InstructionStart extends MonoSwimable implements Instruction {
@ -69,7 +70,7 @@ public class InstructionStart extends MonoSwimable implements Instruction {
@Override
public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.start(getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
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.command.CommandExecutionResult;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
public class InstructionStop extends MonoSwimable implements Instruction {
@ -69,7 +70,7 @@ public class InstructionStop extends MonoSwimable implements Instruction {
@Override
public Ftile createFtile(FtileFactory factory) {
Ftile result = factory.stop(getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn());
result = eventuallyAddNote(factory, result, result.getSwimlaneIn(), VerticalAlignment.CENTER);
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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
@ -72,11 +73,10 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override
public boolean containsBreak() {
for (Branch branch : switches) {
if (branch.containsBreak()) {
for (Branch branch : switches)
if (branch.containsBreak())
return true;
}
}
return false;
}
@ -91,9 +91,9 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override
public CommandExecutionResult add(Instruction ins) {
if (current == null) {
if (current == null)
return CommandExecutionResult.error("No 'case' in this switch");
}
return current.add(ins);
}
@ -116,7 +116,9 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
for (Branch branch : switches)
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
@ -132,12 +134,12 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override
public Set<Swimlane> getSwimlanes() {
final Set<Swimlane> result = new HashSet<>();
if (swimlane != null) {
if (swimlane != null)
result.add(swimlane);
}
for (Branch branch : switches) {
for (Branch branch : switches)
result.addAll(branch.getSwimlanes());
}
return Collections.unmodifiableSet(result);
}
@ -177,11 +179,11 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct
@Override
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);
} else {
else
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.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
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);
Ftile tmp = repeatList.createFtile(factory);
tmp = factory.createWhile(outColor, swimlane, tmp, test, yes, color, specialOut, back, incoming1, incoming2);
if (getPositionedNotes().size() > 0) {
tmp = FtileWithNoteOpale.create(tmp, getPositionedNotes(), skinParam, false);
}
if (killed || specialOut != null) {
if (getPositionedNotes().size() > 0)
tmp = FtileWithNoteOpale.create(tmp, getPositionedNotes(), skinParam, false, VerticalAlignment.CENTER);
if (killed || specialOut != null)
return new FtileKilled(tmp);
}
return tmp;
}
@ -153,12 +154,11 @@ public class InstructionWhile extends WithNote implements Instruction, Instructi
@Override
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);
} else {
else
return repeatList.addNote(note, position, type, colors, swimlaneNote);
}
}
@Override
public Set<Swimlane> getSwimlanes() {

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

View File

@ -35,10 +35,8 @@
*/
package net.sourceforge.plantuml.activitydiagram3.command;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
@ -89,32 +87,18 @@ public class CommandPartition3 extends SingleLineCommand2<ActivityDiagram3> {
}
private USymbol getUSymbol(String type) {
if ("card".equalsIgnoreCase(type)) {
if ("card".equalsIgnoreCase(type))
return USymbols.CARD;
}
if ("package".equalsIgnoreCase(type)) {
if ("package".equalsIgnoreCase(type))
return USymbols.PACKAGE;
}
if ("rectangle".equalsIgnoreCase(type)) {
if ("rectangle".equalsIgnoreCase(type))
return USymbols.RECTANGLE;
}
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) {
return ColorParser.simpleColor(ColorType.BACK, id);
}

View File

@ -36,7 +36,6 @@
package net.sourceforge.plantuml.activitydiagram3.command;
import java.util.List;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.StringLocated;
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.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
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 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);

View File

@ -55,6 +55,7 @@ import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.SName;
@ -140,8 +141,9 @@ public class FtileFactoryDelegator implements FtileFactory {
return factory.activity(label, swimlane, style, colors, stereotype);
}
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes) {
return factory.addNote(ftile, swimlane, notes);
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes,
VerticalAlignment verticalAlignment) {
return factory.addNote(ftile, swimlane, notes, verticalAlignment);
}
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.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
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.FtileFactoryDelegator;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.sequencediagram.NoteType;
public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
@ -52,22 +53,23 @@ public class FtileFactoryDelegatorAddNote extends FtileFactoryDelegator {
}
@Override
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes) {
if (notes.size() == 0) {
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes,
VerticalAlignment verticalAlignment) {
if (notes.size() == 0)
throw new IllegalArgumentException();
}
// if (notes.size() > 1) {
// if (notes.size() > 1)
// throw new IllegalArgumentException();
// }
ISkinParam skinParam = skinParam();
if (ftile == null) {
final PositionedNote note = notes.iterator().next();
if (note.getColors() != null) {
if (note.getColors() != null)
skinParam = note.getColors().mute(skinParam);
}
return new FtileNoteAlone(skinParam.shadowing(null), note.getDisplay(), skinParam,
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 net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.ugraphic.color.HColor;
@ -58,12 +58,10 @@ public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
@Override
public Ftile createGroup(Ftile list, Display name, HColor backColor, HColor titleColor, PositionedNote note,
HColor borderColor, USymbol type, double roundCorner) {
final HColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.arrow);
Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor,
type, roundCorner);
if (note != null) {
result = new FtileWithNotes(result, Collections.singleton(note), skinParam());
}
Ftile result = new FtileGroup(list, name, backColor, titleColor, skinParam(), borderColor, type, roundCorner);
if (note != null)
result = new FtileWithNotes(result, Collections.singleton(note), skinParam(), VerticalAlignment.CENTER);
return result;
}

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.Collection;
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.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.Collections;
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.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
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);
}
public FtileGroup(Ftile inner, Display title, Display displayNote, HColor arrowColor, HColor backColor,
HColor titleColor, ISkinParam skinParam, HColor borderColor, USymbol type, double roundCorner) {
public FtileGroup(Ftile inner, Display title, HColor backColor, HColor titleColor, ISkinParam skinParam,
HColor borderColor, USymbol type, double roundCorner) {
super(inner.skinParam());
this.roundCorner = roundCorner;
this.type = type;
@ -109,10 +109,10 @@ public class FtileGroup extends AbstractFtile {
else
this.name = title.create(fc, HorizontalAlignment.LEFT, skinParam);
if (Display.isNull(displayNote))
// if (Display.isNull(displayNote))
this.headerNote = TextBlockUtils.empty(0, 0);
else
this.headerNote = new FloatingNote(displayNote, skinParam);
// else
// this.headerNote = new FloatingNote(displayNote, skinParam);
this.stroke = thickness == null ? new UStroke(2) : thickness;
}

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
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.vertical.FtileDiamond;
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.StringBounder;
import net.sourceforge.plantuml.svek.ConditionEndStyle;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
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.Swimlane;
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.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
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.vertical.FtileDiamond;
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.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
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.FtileDiamondInside;
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.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.Collections;
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.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.Collection;
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.Swimlane;
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.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
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.FtileDiamondInside;
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.graphic.FontConfiguration;
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.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.style.PName;
@ -79,6 +80,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
private final Ftile tile;
private final Opale opale;
private final VerticalAlignment verticalAlignment;
private final NotePosition notePosition;
private final double suppSpace = 20;
@ -110,18 +112,21 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
return Collections.singleton(tile);
}
public static Ftile create(Ftile tile, Collection<PositionedNote> notes, ISkinParam skinParam, boolean withLink) {
if (notes.size() > 1) {
return new FtileWithNotes(tile, notes, skinParam);
}
if (notes.size() == 0) {
public static Ftile create(Ftile tile, Collection<PositionedNote> notes, ISkinParam skinParam, boolean withLink,
VerticalAlignment verticalAlignment) {
if (notes.size() > 1)
return new FtileWithNotes(tile, notes, skinParam, verticalAlignment);
if (notes.size() == 0)
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());
this.verticalAlignment = verticalAlignment;
this.swimlaneNote = note.getSwimlaneNote();
if (note.getColors() != null)
skinParam = note.getColors().mute(skinParam);
@ -155,11 +160,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
final double yForFtile = (dimTotal.getHeight() - dimTile.getHeight()) / 2;
final double marge;
if (notePosition == NotePosition.LEFT) {
if (notePosition == NotePosition.LEFT)
marge = dimNote.getWidth() + suppSpace;
} else {
else
marge = 0;
}
return new UTranslate(marge, yForFtile);
}
@ -177,22 +181,25 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Dimension2D dimTotal = 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);
}
final double dx = dimTotal.getWidth() - dimNote.getWidth();
return new UTranslate(dx, yForNote);
}
public void drawU(UGraphic ug) {
final Swimlane intoSw;
if (ug instanceof UGraphicInterceptorOneSwimlane) {
if (ug instanceof UGraphicInterceptorOneSwimlane)
intoSw = ((UGraphicInterceptorOneSwimlane) ug).getSwimlane();
} else {
else
intoSw = null;
}
final StringBounder stringBounder = ug.getStringBounder();
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);
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)));
}
ug.apply(getTranslate(stringBounder)).draw(tile);
}
@ -219,10 +227,10 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final FtileGeometry orig = tile.calculateDimension(stringBounder);
final UTranslate translate = getTranslate(stringBounder);
if (orig.hasPointOut()) {
if (orig.hasPointOut())
return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy(),
orig.getOutY() + translate.getDy());
}
return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy());
}

View File

@ -58,8 +58,8 @@ import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
@ -77,6 +77,7 @@ public class FtileWithNotes extends AbstractFtile {
private TextBlock left;
private TextBlock right;
private final VerticalAlignment verticalAlignment;
private final double suppSpace = 20;
@ -96,8 +97,10 @@ public class FtileWithNotes extends AbstractFtile {
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());
this.verticalAlignment = verticalAlignment;
this.tile = tile;
for (PositionedNote note : notes) {
@ -161,7 +164,11 @@ public class FtileWithNotes extends AbstractFtile {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
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);
}
@ -169,7 +176,11 @@ public class FtileWithNotes extends AbstractFtile {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final Dimension2D dimLeft = left.calculateDimension(stringBounder);
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);
}
@ -177,7 +188,11 @@ public class FtileWithNotes extends AbstractFtile {
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
final Dimension2D dimRight = right.calculateDimension(stringBounder);
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);
}

View File

@ -131,7 +131,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
final List<Connection> conns = new ArrayList<>();
final Swimlane swimlaneBlack = in;
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;
for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
@ -182,7 +182,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
@Override
protected Ftile doStep2(Ftile middle, Ftile result) {
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(),
barHeight);
if (label != null)
@ -205,9 +205,9 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
return result;
}
private HColor barColor() {
return getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
}
// private HColor barColor() {
// return getRose().getHtmlColor(skinParam(), ColorParam.activityBar);
// }
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {

View File

@ -73,9 +73,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
protected Ftile doStep1(Ftile inner) {
Ftile result = inner;
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;
for (Ftile tmp : list99) {
final Dimension2D dim = tmp.calculateDimension(getStringBounder());

View File

@ -40,7 +40,6 @@ import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
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.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.VerticalAlignment;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.skin.rose.Rose;
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);
}
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes) {
public Ftile addNote(Ftile ftile, Swimlane swimlane, Collection<PositionedNote> notes,
VerticalAlignment verticalAlignment) {
return ftile;
}

View File

@ -35,18 +35,17 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;
@ -66,12 +65,11 @@ public class FtileBlackBlock extends AbstractFtile {
private double width;
private double height;
private TextBlock label = TextBlockUtils.empty(0, 0);
private HColor colorBar;
private final Swimlane swimlane;
public FtileBlackBlock(ISkinParam skinParam, HColor colorBar, Swimlane swimlane) {
public FtileBlackBlock(ISkinParam skinParam, Swimlane swimlane) {
super(skinParam);
this.colorBar = colorBar;
this.swimlane = swimlane;
}
@ -103,7 +101,8 @@ public class FtileBlackBlock extends AbstractFtile {
final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final double shadowing = style.value(PName.Shadowing).asDouble();
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);
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.LineBreakStrategy;
import net.sourceforge.plantuml.SkinParamColors;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;

View File

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

View File

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

View File

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

View File

@ -35,10 +35,9 @@
*/
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.FtileGeometry;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;

View File

@ -35,10 +35,9 @@
*/
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.FtileGeometry;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.UGraphic;

View File

@ -35,14 +35,13 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,14 +35,13 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,13 +35,12 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,14 +35,13 @@
*/
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

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

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D;
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.MergeStrategy;
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.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic;

View File

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

View File

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

View File

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

View File

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

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Arrays;
import java.util.Collection;
@ -43,6 +42,7 @@ import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.Branch;
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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

@ -35,7 +35,6 @@
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@ -43,6 +42,7 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.activitydiagram3.Branch;
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.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockUtils;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,18 +35,15 @@
*/
package net.sourceforge.plantuml.activitydiagram3.gtile;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.Set;
import net.sourceforge.plantuml.AlignmentParam;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineBreakStrategy;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser;
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.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;

View File

@ -137,16 +137,14 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String ent1String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
final String ent2String = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
if (ent1String == null && ent2String == null) {
if (ent1String == null && ent2String == null)
return executeArgSpecial3(diagram, arg);
}
if (ent1String == null) {
if (ent1String == null)
return executeArgSpecial1(diagram, arg);
}
if (ent2String == null) {
if (ent2String == null)
return executeArgSpecial2(diagram, arg);
}
Ident ident1 = diagram.buildLeafIdentSpecial(ent1String);
Ident ident2 = diagram.buildLeafIdentSpecial(ent2String);
@ -205,11 +203,10 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg);
final int queue;
if (dir == Direction.LEFT || dir == Direction.RIGHT) {
if (dir == Direction.LEFT || dir == Direction.RIGHT)
queue = 1;
} else {
else
queue = getQueueLength(arg);
}
final Labels labels = new Labels(arg);
@ -223,9 +220,9 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
}
link.setPortMembers(port1, port2);
if (dir == Direction.LEFT || dir == Direction.UP) {
if (dir == Direction.LEFT || dir == Direction.UP)
link = link.getInv();
}
link.setLinkArrow(labels.getLinkArrow());
link.setColors(color().getColor(diagram.getSkinParam().getThemeStyle(), arg,
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) {
if (isGroupButNotTheCurrentGroup(diagram, code, ident)) {
if (diagram.V1972()) {
if (diagram.V1972())
return diagram.getGroupVerySmart(ident);
}
// final Code tap = ident.toCode(diagram);
return diagram.getGroup(code);
}
if (diagram.V1972()) {
final IEntity result = pure.size() == 1 ? diagram.getLeafVerySmart(ident) : diagram.getLeafStrict(ident);
if (result != null) {
if (result != null)
return result;
}
}
return diagram.getOrCreateLeaf(ident, code, null, null);
}
private boolean isGroupButNotTheCurrentGroup(AbstractClassOrObjectDiagram diagram, Code code, Ident ident) {
if (diagram.V1972()) {
if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName())) {
if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName()))
return false;
}
return diagram.isGroupVerySmart(ident);
} else {
if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName())) {
if (diagram.getCurrentGroup().getCodeGetName().equals(code.getName()))
return false;
}
return diagram.isGroup(code);
}
}
private Ident removeMemberPartIdentSpecial(AbstractClassOrObjectDiagram diagram, Ident ident) {
if (diagram.leafExistSmart(ident)) {
if (diagram.leafExistSmart(ident))
return null;
}
final Ident before = ident.parent();
if (before == null) {
if (before == null)
return null;
}
if (diagram.leafExistSmart(before) == false) {
if (diagram.leafExistSmart(before) == false)
return null;
}
return before;
}
private Ident removeMemberPartIdent(AbstractClassOrObjectDiagram diagram, Ident ident) {
if (diagram.leafExistSmart(ident)) {
if (diagram.leafExistSmart(ident))
return null;
}
final Ident before = ident.removeMemberPart();
if (before == null) {
if (before == null)
return null;
}
if (diagram.leafExistSmart(before) == false) {
if (diagram.leafExistSmart(before) == false)
return null;
}
return before;
}
private Code removeMemberPartLegacy1972(AbstractClassOrObjectDiagram diagram, Ident ident) {
if (diagram.leafExist(ident)) {
if (diagram.leafExist(ident))
return null;
}
final Ident before = ident.removeMemberPart();
if (before == null) {
if (before == null)
return null;
}
final Code code = before.toCode(diagram);
if (diagram.leafExist(code) == false) {
if (diagram.leafExist(code) == false)
return null;
}
return code;
}
@ -345,11 +342,10 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg);
final int queue;
if (dir == Direction.LEFT || dir == Direction.RIGHT) {
if (dir == Direction.LEFT || dir == Direction.RIGHT)
queue = 1;
} else {
else
queue = getQueueLength(arg);
}
final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 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 Code clName1A = diagram.buildCode(name1A);
final Code clName1B = diagram.buildCode(name1B);
if (diagram.leafExist(clName1A) == false) {
if (diagram.leafExist(clName1A) == false)
return CommandExecutionResult.error("No class " + clName1A);
}
if (diagram.leafExist(clName1B) == false) {
if (diagram.leafExist(clName1B) == false)
return CommandExecutionResult.error("No class " + clName1B);
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
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 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.ok();
}
@ -401,12 +395,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String name1B = arg.get("COUPLE1", 1);
final Ident ident1A = diagram.buildLeafIdent(name1A);
final Ident ident1B = diagram.buildLeafIdent(name1B);
if (diagram.leafExistSmart(ident1A) == false) {
if (diagram.leafExistSmart(ident1A) == false)
return CommandExecutionResult.error("No class " + ident1A.getName());
}
if (diagram.leafExistSmart(ident1B) == false) {
if (diagram.leafExistSmart(ident1B) == false)
return CommandExecutionResult.error("No class " + ident1B.getName());
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\"");
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 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.ok();
}
@ -428,12 +420,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final String name2B = arg.get("COUPLE2", 1);
final Ident ident2A = diagram.buildLeafIdent(name2A);
final Ident ident2B = diagram.buildLeafIdent(name2B);
if (diagram.leafExistSmart(ident2A) == false) {
if (diagram.leafExistSmart(ident2A) == false)
return CommandExecutionResult.error("No class " + ident2A.getName());
}
if (diagram.leafExistSmart(ident2B) == false) {
if (diagram.leafExistSmart(ident2B) == false)
return CommandExecutionResult.error("No class " + ident2B.getName());
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
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 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.ok();
}
@ -459,18 +449,17 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final Ident ident1B = diagram.buildLeafIdent(name1B);
final Ident ident2A = diagram.buildLeafIdent(name2A);
final Ident ident2B = diagram.buildLeafIdent(name2B);
if (diagram.leafExistSmart(ident1A) == false) {
if (diagram.leafExistSmart(ident1A) == false)
return CommandExecutionResult.error("No class " + ident1A.getName());
}
if (diagram.leafExistSmart(ident1B) == false) {
if (diagram.leafExistSmart(ident1B) == false)
return CommandExecutionResult.error("No class " + ident1B.getName());
}
if (diagram.leafExistSmart(ident2A) == false) {
if (diagram.leafExistSmart(ident2A) == false)
return CommandExecutionResult.error("No class " + ident2A.getName());
}
if (diagram.leafExistSmart(ident2B) == false) {
if (diagram.leafExistSmart(ident2B) == false)
return CommandExecutionResult.error("No class " + ident2B.getName());
}
final LinkType linkType = getLinkType(arg);
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 clName2A = diagram.buildCode(name2A);
final Code clName2B = diagram.buildCode(name2B);
if (diagram.leafExist(clName1A) == false) {
if (diagram.leafExist(clName1A) == false)
return CommandExecutionResult.error("No class " + clName1A);
}
if (diagram.leafExist(clName1B) == false) {
if (diagram.leafExist(clName1B) == false)
return CommandExecutionResult.error("No class " + clName1B);
}
if (diagram.leafExist(clName2A) == false) {
if (diagram.leafExist(clName2A) == false)
return CommandExecutionResult.error("No class " + clName2A);
}
if (diagram.leafExist(clName2B) == false) {
if (diagram.leafExist(clName2B) == false)
return CommandExecutionResult.error("No class " + clName2B);
}
final LinkType linkType = getLinkType(arg);
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 Code clName2A = diagram.buildCode(name2A);
final Code clName2B = diagram.buildCode(name2B);
if (diagram.leafExist(clName2A) == false) {
if (diagram.leafExist(clName2A) == false)
return CommandExecutionResult.error("No class " + clName2A);
}
if (diagram.leafExist(clName2B) == false) {
if (diagram.leafExist(clName2B) == false)
return CommandExecutionResult.error("No class " + clName2B);
}
final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT1", 0), "\"");
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 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.ok();
}
@ -542,110 +528,110 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return LinkDecor.NONE;
}
s = StringUtils.trin(s);
if ("<|".equals(s)) {
if ("<|".equals(s))
return LinkDecor.EXTENDS;
}
if ("<|:".equals(s)) {
if ("<|:".equals(s))
return LinkDecor.DEFINEDBY;
}
if ("<||".equals(s)) {
if ("<||".equals(s))
return LinkDecor.REDEFINES;
}
if ("}".equals(s)) {
if ("}".equals(s))
return LinkDecor.CROWFOOT;
}
if ("}o".equals(s)) {
if ("}o".equals(s))
return LinkDecor.CIRCLE_CROWFOOT;
}
if ("}|".equals(s)) {
if ("}|".equals(s))
return LinkDecor.LINE_CROWFOOT;
}
if ("|o".equals(s)) {
if ("|o".equals(s))
return LinkDecor.CIRCLE_LINE;
}
if ("||".equals(s)) {
if ("||".equals(s))
return LinkDecor.DOUBLE_LINE;
}
if ("<".equals(s)) {
if ("<".equals(s))
return LinkDecor.ARROW;
}
if ("^".equals(s)) {
if ("^".equals(s))
return LinkDecor.EXTENDS;
}
if ("+".equals(s)) {
if ("+".equals(s))
return LinkDecor.PLUS;
}
if ("o".equals(s)) {
if ("o".equals(s))
return LinkDecor.AGREGATION;
}
if ("x".equals(s)) {
if ("x".equals(s))
return LinkDecor.NOT_NAVIGABLE;
}
if ("*".equals(s)) {
if ("*".equals(s))
return LinkDecor.COMPOSITION;
}
if ("#".equals(s)) {
if ("#".equals(s))
return LinkDecor.SQUARE;
}
if (")".equals(s)) {
if (")".equals(s))
return LinkDecor.PARENTHESIS;
}
return LinkDecor.NONE;
}
private LinkDecor getDecors2(String s) {
if (s == null) {
if (s == null)
return LinkDecor.NONE;
}
s = StringUtils.trin(s);
if ("|>".equals(s)) {
if ("|>".equals(s))
return LinkDecor.EXTENDS;
}
if (":|>".equals(s)) {
if (":|>".equals(s))
return LinkDecor.DEFINEDBY;
}
if ("||>".equals(s)) {
if ("||>".equals(s))
return LinkDecor.REDEFINES;
}
if (">".equals(s)) {
if (">".equals(s))
return LinkDecor.ARROW;
}
if ("{".equals(s)) {
if ("{".equals(s))
return LinkDecor.CROWFOOT;
}
if ("o{".equals(s)) {
if ("o{".equals(s))
return LinkDecor.CIRCLE_CROWFOOT;
}
if ("|{".equals(s)) {
if ("|{".equals(s))
return LinkDecor.LINE_CROWFOOT;
}
if ("o|".equals(s)) {
if ("o|".equals(s))
return LinkDecor.CIRCLE_LINE;
}
if ("||".equals(s)) {
if ("||".equals(s))
return LinkDecor.DOUBLE_LINE;
}
if ("^".equals(s)) {
if ("^".equals(s))
return LinkDecor.EXTENDS;
}
if ("+".equals(s)) {
if ("+".equals(s))
return LinkDecor.PLUS;
}
if ("o".equals(s)) {
if ("o".equals(s))
return LinkDecor.AGREGATION;
}
if ("x".equals(s)) {
if ("x".equals(s))
return LinkDecor.NOT_NAVIGABLE;
}
if ("*".equals(s)) {
if ("*".equals(s))
return LinkDecor.COMPOSITION;
}
if ("#".equals(s)) {
if ("#".equals(s))
return LinkDecor.SQUARE;
}
if ("(".equals(s)) {
if ("(".equals(s))
return LinkDecor.PARENTHESIS;
}
return LinkDecor.NONE;
}
@ -654,19 +640,19 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
final LinkDecor decors2 = getDecors2(getArrowHead2(arg));
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();
}
final String middle = arg.get("INSIDE", 0);
if ("0".equals(middle)) {
if ("0".equals(middle))
result = result.withMiddleCircle();
} else if ("0)".equals(middle)) {
else if ("0)".equals(middle))
result = result.withMiddleCircleCircled1();
} else if ("(0".equals(middle)) {
else if ("(0".equals(middle))
result = result.withMiddleCircleCircled2();
} else if ("(0)".equals(middle)) {
else if ("(0)".equals(middle))
result = result.withMiddleCircleCircled();
}
return result;
}
@ -682,12 +668,11 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
String s = getFullArrow(arg);
s = s.replaceAll("[^-.=\\w]", "");
if (s.startsWith("o")) {
if (s.startsWith("o"))
s = s.substring(1);
}
if (s.endsWith("o")) {
if (s.endsWith("o"))
s = s.substring(0, s.length() - 1);
}
Direction result = StringUtils.getQueueDirection(s);
// if (isInversed(decors1, decors2) && s.matches(".*\\w.*")) {
@ -715,29 +700,9 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
}
public static String notNull(String s) {
if (s == null) {
if (s == null)
return "";
}
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;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
@ -243,8 +242,8 @@ public final class CommandFactoryNoteOnEntity implements SingleMultiFactoryComma
final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE,
ColorParam.noteBackground, ColorParam.noteBorder);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,
ColorParam.noteBorder);
note.setStereotype(stereotype);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -47,9 +47,7 @@ import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.UseStyle;
import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Bodier;
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.SuperGroup;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.skin.VisibilityModifier;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public final class EntityFactory {

View File

@ -666,9 +666,6 @@ final public class EntityImpl implements ILeaf, IGroup {
}
private FontParam getTitleFontParam() {
if (symbol != null) {
return symbol.getFontParam();
}
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.ugraphic.AffineTransformType;
import net.sourceforge.plantuml.ugraphic.PixelImage;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
public class PSystemDedication extends PlainDiagram {
@ -63,7 +64,12 @@ public class PSystemDedication extends PlainDiagram {
@Override
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) {

View File

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

View File

@ -264,8 +264,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
backColor = Cluster.getBackColor(backColor, skinParam, group.getStereotype(), umlDiagramType.getStyleName(),
group.getUSymbol());
final double roundCorner = group.getUSymbol() == null ? 0
: group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype());
final double roundCorner = style.value(PName.RoundCorner).asDouble();
// final double roundCorner = group.getUSymbol() == null ? 0
// : group.getUSymbol().getSkinParameter().getRoundCorner(skinParam, group.getStereotype());
final TextBlock ztitle = getTitleBlock(group);
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.List;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.LineParam;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
import net.sourceforge.plantuml.cucadiagram.Link;
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() {
final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, styleName, SName.arrow);
return signature.getMergedStyle(diagram.getCurrentStyleBuilder());

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,13 +35,13 @@
*/
package net.sourceforge.plantuml.graphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.SpriteContainer;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.sprite.Sprite;
import net.sourceforge.plantuml.ugraphic.UGraphic;
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;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.ugraphic.UEmpty;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UShapeIgnorableForCompression;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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