mirror of https://github.com/octoleo/plantuml.git
Version 1.2023.2
This commit is contained in:
parent
d55ae31b68
commit
52664342f6
|
@ -489,11 +489,11 @@ root {
|
||||||
HyperLinkColor blue
|
HyperLinkColor blue
|
||||||
FontColor white
|
FontColor white
|
||||||
LineColor #e7e7e7
|
LineColor #e7e7e7
|
||||||
BackGroundColor #303030
|
BackGroundColor #313139
|
||||||
}
|
}
|
||||||
|
|
||||||
document {
|
document {
|
||||||
BackGroundColor black
|
BackGroundColor #1B1B1B
|
||||||
header {
|
header {
|
||||||
FontColor #7
|
FontColor #7
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,6 @@ import net.sourceforge.plantuml.style.PName;
|
||||||
import net.sourceforge.plantuml.style.SName;
|
import net.sourceforge.plantuml.style.SName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.text.SvgCharSizeHack;
|
import net.sourceforge.plantuml.text.SvgCharSizeHack;
|
||||||
import net.sourceforge.plantuml.url.CMapData;
|
import net.sourceforge.plantuml.url.CMapData;
|
||||||
import net.sourceforge.plantuml.url.Url;
|
import net.sourceforge.plantuml.url.Url;
|
||||||
|
@ -175,8 +174,8 @@ public class ImageBuilder {
|
||||||
|
|
||||||
public ImageBuilder drawable(UDrawable drawable) {
|
public ImageBuilder drawable(UDrawable drawable) {
|
||||||
this.udrawable = drawable;
|
this.udrawable = drawable;
|
||||||
if (backcolor == null && drawable instanceof TextBlockBackcolored)
|
if (backcolor == null && drawable instanceof TextBlock)
|
||||||
backcolor = ((TextBlockBackcolored) drawable).getBackcolor();
|
backcolor = ((TextBlock) drawable).getBackcolor();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.BigFrame;
|
import net.sourceforge.plantuml.klimt.shape.BigFrame;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
||||||
|
@ -60,7 +61,6 @@ import net.sourceforge.plantuml.style.SName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.svek.DecorateEntityImage;
|
import net.sourceforge.plantuml.svek.DecorateEntityImage;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class AnnotatedBuilder {
|
public class AnnotatedBuilder {
|
||||||
|
|
||||||
|
@ -125,17 +125,13 @@ public class AnnotatedBuilder {
|
||||||
|
|
||||||
final TextBlock frame = new BigFrame(title, width, height, symbolContext);
|
final TextBlock frame = new BigFrame(title, width, height, symbolContext);
|
||||||
|
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
frame.drawU(ug.apply(margin.getTranslate()));
|
frame.drawU(ug.apply(margin.getTranslate()));
|
||||||
original.drawU(ug.apply(margin.getTranslate().compose(padding.getTranslate().compose(delta))));
|
original.drawU(ug.apply(margin.getTranslate().compose(padding.getTranslate().compose(delta))));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
||||||
final XRectangle2D rect = original.getInnerPosition(member, stringBounder, strategy);
|
final XRectangle2D rect = original.getInnerPosition(member, stringBounder, strategy);
|
||||||
return new XRectangle2D(dx + rect.getX() + margin.getLeft() + padding.getLeft(),
|
return new XRectangle2D(dx + rect.getX() + margin.getLeft() + padding.getLeft(),
|
||||||
|
|
|
@ -41,7 +41,6 @@ import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.style.ISkinParam;
|
import net.sourceforge.plantuml.style.ISkinParam;
|
||||||
import net.sourceforge.plantuml.svek.DecorateEntityImage;
|
import net.sourceforge.plantuml.svek.DecorateEntityImage;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class AnnotatedWorker {
|
public class AnnotatedWorker {
|
||||||
|
|
||||||
|
@ -58,13 +57,13 @@ public class AnnotatedWorker {
|
||||||
this.builder = builder;
|
this.builder = builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextBlockBackcolored addAdd(TextBlock result) {
|
public TextBlock addAdd(TextBlock result) {
|
||||||
result = builder.decoreWithFrame(result);
|
result = builder.decoreWithFrame(result);
|
||||||
result = addLegend(result);
|
result = addLegend(result);
|
||||||
result = addTitle(result);
|
result = addTitle(result);
|
||||||
result = addCaption(result);
|
result = addCaption(result);
|
||||||
result = builder.addHeaderAndFooter(result);
|
result = builder.addHeaderAndFooter(result);
|
||||||
return (TextBlockBackcolored) result;
|
return (TextBlock) result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextBlock addLegend(TextBlock original) {
|
public TextBlock addLegend(TextBlock original) {
|
||||||
|
|
|
@ -51,9 +51,9 @@ import net.sourceforge.plantuml.core.Diagram;
|
||||||
import net.sourceforge.plantuml.core.DiagramDescription;
|
import net.sourceforge.plantuml.core.DiagramDescription;
|
||||||
import net.sourceforge.plantuml.core.ImageData;
|
import net.sourceforge.plantuml.core.ImageData;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.preproc.Defines;
|
import net.sourceforge.plantuml.preproc.Defines;
|
||||||
import net.sourceforge.plantuml.security.SFile;
|
import net.sourceforge.plantuml.security.SFile;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.Log;
|
import net.sourceforge.plantuml.utils.Log;
|
||||||
|
|
||||||
public class SourceStringReader {
|
public class SourceStringReader {
|
||||||
|
@ -230,7 +230,7 @@ public class SourceStringReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageData noStartumlFound(OutputStream os, FileFormatOption fileFormatOption) throws IOException {
|
public ImageData noStartumlFound(OutputStream os, FileFormatOption fileFormatOption) throws IOException {
|
||||||
final TextBlockBackcolored error = GraphicStrings.createForError(Arrays.asList("No @startuml/@enduml found"),
|
final TextBlock error = GraphicStrings.createForError(Arrays.asList("No @startuml/@enduml found"),
|
||||||
fileFormatOption.isUseRedForError());
|
fileFormatOption.isUseRedForError());
|
||||||
|
|
||||||
return plainImageBuilder(error, fileFormatOption).write(os);
|
return plainImageBuilder(error, fileFormatOption).write(os);
|
||||||
|
|
|
@ -70,6 +70,7 @@ import net.sourceforge.plantuml.klimt.font.FontParam;
|
||||||
import net.sourceforge.plantuml.klimt.geom.GraphicPosition;
|
import net.sourceforge.plantuml.klimt.geom.GraphicPosition;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UImage;
|
import net.sourceforge.plantuml.klimt.shape.UImage;
|
||||||
import net.sourceforge.plantuml.log.Logme;
|
import net.sourceforge.plantuml.log.Logme;
|
||||||
|
@ -82,7 +83,6 @@ import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.style.NoStyleAvailableException;
|
import net.sourceforge.plantuml.style.NoStyleAvailableException;
|
||||||
import net.sourceforge.plantuml.svek.EmptySvgException;
|
import net.sourceforge.plantuml.svek.EmptySvgException;
|
||||||
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.Log;
|
import net.sourceforge.plantuml.utils.Log;
|
||||||
import net.sourceforge.plantuml.version.Version;
|
import net.sourceforge.plantuml.version.Version;
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
|
||||||
// ::done
|
// ::done
|
||||||
|
|
||||||
final BufferedImage im = im2;
|
final BufferedImage im = im2;
|
||||||
final TextBlockBackcolored graphicStrings = GraphicStrings.createBlackOnWhite(strings, IconLoader.getRandom(),
|
final TextBlock graphicStrings = GraphicStrings.createBlackOnWhite(strings, IconLoader.getRandom(),
|
||||||
GraphicPosition.BACKGROUND_CORNER_TOP_RIGHT);
|
GraphicPosition.BACKGROUND_CORNER_TOP_RIGHT);
|
||||||
|
|
||||||
final UDrawable drawable = (im == null) ? graphicStrings : new UDrawable() {
|
final UDrawable drawable = (im == null) ? graphicStrings : new UDrawable() {
|
||||||
|
|
|
@ -40,7 +40,6 @@ import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||||
|
@ -49,16 +48,14 @@ import net.sourceforge.plantuml.core.ImageData;
|
||||||
import net.sourceforge.plantuml.core.UmlSource;
|
import net.sourceforge.plantuml.core.UmlSource;
|
||||||
import net.sourceforge.plantuml.klimt.UStroke;
|
import net.sourceforge.plantuml.klimt.UStroke;
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
|
||||||
import net.sourceforge.plantuml.klimt.color.HColors;
|
import net.sourceforge.plantuml.klimt.color.HColors;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.ULine;
|
import net.sourceforge.plantuml.klimt.shape.ULine;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class BoardDiagram extends UmlDiagram {
|
public class BoardDiagram extends UmlDiagram {
|
||||||
|
|
||||||
|
@ -80,31 +77,19 @@ public class BoardDiagram extends UmlDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawMe(ug);
|
drawMe(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
final double width = 200;
|
final double width = 200;
|
||||||
final double height = 200;
|
final double height = 200;
|
||||||
return new XDimension2D(width, height);
|
return new XDimension2D(width, height);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.ULine;
|
import net.sourceforge.plantuml.klimt.shape.ULine;
|
||||||
import net.sourceforge.plantuml.skin.ColorParam;
|
import net.sourceforge.plantuml.skin.ColorParam;
|
||||||
|
@ -94,7 +95,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz
|
||||||
|
|
||||||
public TextBlock toTextBlock(ISkinParam skinParam) {
|
public TextBlock toTextBlock(ISkinParam skinParam) {
|
||||||
final TextBlock raw = toTextBlockInternal(skinParam);
|
final TextBlock raw = toTextBlockInternal(skinParam);
|
||||||
return new TextBlock() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
raw.drawU(ug);
|
raw.drawU(ug);
|
||||||
|
|
|
@ -37,9 +37,12 @@ package net.sourceforge.plantuml.bpm;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
import net.atmp.InnerStrategy;
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColors;
|
import net.sourceforge.plantuml.klimt.color.HColors;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
@ -122,4 +125,14 @@ public class ConnectorPuzzleEmpty extends AbstractConnectorPuzzle implements Pla
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorderNone();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HColor getBackcolor() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphicStencil;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphicStencil;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
|
@ -81,16 +82,11 @@ public class USymbolFolder extends USymbol {
|
||||||
return sname;
|
return sname;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawFolder(UGraphic ug, double width, double height, XDimension2D dimTitle, double shadowing,
|
private void drawFolder(UGraphic ug, double width, double height, XDimension2D dimName, double shadowing,
|
||||||
double roundCorner) {
|
double roundCorner) {
|
||||||
|
|
||||||
final double wtitle;
|
final double wtitle = getWTitle(width, dimName);
|
||||||
if (dimTitle.getWidth() == 0) {
|
final double htitle = getHTitle(dimName);
|
||||||
wtitle = Math.max(30, width / 4);
|
|
||||||
} else {
|
|
||||||
wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2;
|
|
||||||
}
|
|
||||||
final double htitle = getHTitle(dimTitle);
|
|
||||||
|
|
||||||
final Shadowable shape;
|
final Shadowable shape;
|
||||||
if (roundCorner == 0) {
|
if (roundCorner == 0) {
|
||||||
|
@ -128,13 +124,22 @@ public class USymbolFolder extends USymbol {
|
||||||
ug.apply(UTranslate.dy(htitle)).draw(ULine.hline(wtitle + marginTitleX3));
|
ug.apply(UTranslate.dy(htitle)).draw(ULine.hline(wtitle + marginTitleX3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double getWTitle(double width, XDimension2D dimTitle) {
|
||||||
|
final double wtitle;
|
||||||
|
if (dimTitle.getWidth() == 0)
|
||||||
|
wtitle = Math.max(30, width / 4);
|
||||||
|
else
|
||||||
|
wtitle = dimTitle.getWidth() + marginTitleX1 + marginTitleX2;
|
||||||
|
return wtitle;
|
||||||
|
}
|
||||||
|
|
||||||
private double getHTitle(XDimension2D dimTitle) {
|
private double getHTitle(XDimension2D dimTitle) {
|
||||||
final double htitle;
|
final double htitle;
|
||||||
if (dimTitle.getWidth() == 0) {
|
if (dimTitle.getWidth() == 0)
|
||||||
htitle = 10;
|
htitle = 10;
|
||||||
} else {
|
else
|
||||||
htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2;
|
htitle = dimTitle.getHeight() + marginTitleY1 + marginTitleY2;
|
||||||
}
|
|
||||||
return htitle;
|
return htitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,9 +162,9 @@ public class USymbolFolder extends USymbol {
|
||||||
symbolContext.getRoundCorner());
|
symbolContext.getRoundCorner());
|
||||||
final Margin margin = getMargin();
|
final Margin margin = getMargin();
|
||||||
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
|
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
|
||||||
if (showTitle) {
|
if (showTitle)
|
||||||
name.drawU(ug.apply(new UTranslate(4, 3)));
|
name.drawU(ug.apply(new UTranslate(4, 3)));
|
||||||
}
|
|
||||||
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + dimName.getHeight())));
|
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + dimName.getHeight())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +178,35 @@ public class USymbolFolder extends USymbol {
|
||||||
final XDimension2D dimStereo = stereotype.calculateDimension(stringBounder);
|
final XDimension2D dimStereo = stereotype.calculateDimension(stringBounder);
|
||||||
return getMargin().addDimension(dimName.mergeTB(dimStereo, dimLabel));
|
return getMargin().addDimension(dimName.mergeTB(dimStereo, dimLabel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorder() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position) {
|
||||||
|
final XDimension2D dim = calculateDimension(stringBounder);
|
||||||
|
final XDimension2D dimName = getDimName(stringBounder);
|
||||||
|
final double wtitle = getWTitle(dim.getWidth(), dimName);
|
||||||
|
final double htitle = getHTitle(dimName);
|
||||||
|
|
||||||
|
if (position.getX() >= wtitle && position.getY() >= 0 && position.getY() <= htitle)
|
||||||
|
return new UTranslate(0, htitle);
|
||||||
|
|
||||||
|
if (position.getY() <= 0 && position.getX() >= wtitle + marginTitleX3)
|
||||||
|
return new UTranslate(0, htitle);
|
||||||
|
|
||||||
|
if (position.getY() <= 0 && position.getX() >= wtitle - marginTitleX3) {
|
||||||
|
final double delta = position.getX() - (wtitle - marginTitleX3);
|
||||||
|
final double how = delta / (2 * marginTitleX3);
|
||||||
|
return new UTranslate(0, htitle * how);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new UTranslate();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,6 @@ import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UImage;
|
import net.sourceforge.plantuml.klimt.shape.UImage;
|
||||||
import net.sourceforge.plantuml.log.Logme;
|
import net.sourceforge.plantuml.log.Logme;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.text.BackSlash;
|
import net.sourceforge.plantuml.text.BackSlash;
|
||||||
import net.sourceforge.plantuml.version.PSystemVersion;
|
import net.sourceforge.plantuml.version.PSystemVersion;
|
||||||
|
|
||||||
|
@ -111,7 +110,7 @@ public class PSystemDonors extends PlainDiagram {
|
||||||
final List<TextBlock> cols = getCols(getDonors(), COLS, FREE_LINES);
|
final List<TextBlock> cols = getCols(getDonors(), COLS, FREE_LINES);
|
||||||
return new UDrawable() {
|
return new UDrawable() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
final TextBlockBackcolored header = GraphicStrings
|
final TextBlock header = GraphicStrings
|
||||||
.createBlackOnWhite(Arrays.asList("<b>Special thanks to our sponsors and donors !"));
|
.createBlackOnWhite(Arrays.asList("<b>Special thanks to our sponsors and donors !"));
|
||||||
header.drawU(ug);
|
header.drawU(ug);
|
||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
|
|
|
@ -57,7 +57,6 @@ import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.style.ISkinParam;
|
import net.sourceforge.plantuml.style.ISkinParam;
|
||||||
import net.sourceforge.plantuml.style.SName;
|
import net.sourceforge.plantuml.style.SName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.BlocLines;
|
import net.sourceforge.plantuml.utils.BlocLines;
|
||||||
import net.sourceforge.plantuml.utils.CharInspector;
|
import net.sourceforge.plantuml.utils.CharInspector;
|
||||||
|
|
||||||
|
@ -102,7 +101,7 @@ public class PSystemEbnf extends TitledDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
if (expressions.size() == 0) {
|
if (expressions.size() == 0) {
|
||||||
final Style style = ETile.getStyleSignature().getMergedStyle(getSkinParam().getCurrentStyleBuilder());
|
final Style style = ETile.getStyleSignature().getMergedStyle(getSkinParam().getCurrentStyleBuilder());
|
||||||
final FontConfiguration fc = style.getFontConfiguration(getSkinParam().getIHtmlColorSet());
|
final FontConfiguration fc = style.getFontConfiguration(getSkinParam().getIHtmlColorSet());
|
||||||
|
|
|
@ -45,8 +45,8 @@ import net.sourceforge.plantuml.core.DiagramDescription;
|
||||||
import net.sourceforge.plantuml.core.UmlSource;
|
import net.sourceforge.plantuml.core.UmlSource;
|
||||||
import net.sourceforge.plantuml.klimt.geom.GraphicPosition;
|
import net.sourceforge.plantuml.klimt.geom.GraphicPosition;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.version.PSystemVersion;
|
import net.sourceforge.plantuml.version.PSystemVersion;
|
||||||
|
|
||||||
public class PSystemWelcome extends PlainDiagram {
|
public class PSystemWelcome extends PlainDiagram {
|
||||||
|
@ -84,7 +84,7 @@ public class PSystemWelcome extends PlainDiagram {
|
||||||
return getGraphicStrings();
|
return getGraphicStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextBlockBackcolored getGraphicStrings() {
|
public TextBlock getGraphicStrings() {
|
||||||
if (position != null)
|
if (position != null)
|
||||||
return GraphicStrings.createBlackOnWhite(strings, PSystemVersion.getPlantumlImage(), position);
|
return GraphicStrings.createBlackOnWhite(strings, PSystemVersion.getPlantumlImage(), position);
|
||||||
|
|
||||||
|
|
|
@ -105,9 +105,9 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontParam;
|
import net.sourceforge.plantuml.klimt.font.FontParam;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.ClusterPosition;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.RectangleArea;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
|
@ -130,7 +130,6 @@ import net.sourceforge.plantuml.svek.GeneralImageBuilder;
|
||||||
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
||||||
import net.sourceforge.plantuml.svek.IEntityImage;
|
import net.sourceforge.plantuml.svek.IEntityImage;
|
||||||
import net.sourceforge.plantuml.svek.PackageStyle;
|
import net.sourceforge.plantuml.svek.PackageStyle;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some notes:
|
* Some notes:
|
||||||
|
@ -209,7 +208,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Drawing class does the real drawing
|
// The Drawing class does the real drawing
|
||||||
class Drawing extends AbstractTextBlock implements TextBlockBackcolored {
|
class Drawing extends AbstractTextBlock {
|
||||||
|
|
||||||
// min and max of all coord
|
// min and max of all coord
|
||||||
private final MinMax minMax;
|
private final MinMax minMax;
|
||||||
|
@ -273,9 +272,9 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
|
||||||
final TextBlock ztitle = getTitleBlock(group);
|
final TextBlock ztitle = getTitleBlock(group);
|
||||||
final TextBlock zstereo = TextBlockUtils.empty(0, 0);
|
final TextBlock zstereo = TextBlockUtils.empty(0, 0);
|
||||||
|
|
||||||
final ClusterPosition clusterPosition = new ClusterPosition(0, 0, elkNode.getWidth(), elkNode.getHeight());
|
final RectangleArea rectangleArea = new RectangleArea(0, 0, elkNode.getWidth(), elkNode.getHeight());
|
||||||
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(), ztitle,
|
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(), ztitle,
|
||||||
zstereo, clusterPosition, stroke);
|
zstereo, rectangleArea, stroke);
|
||||||
|
|
||||||
final HColor borderColor = HColors.BLACK;
|
final HColor borderColor = HColors.BLACK;
|
||||||
decoration.drawU(ug.apply(new UTranslate(corner)), backColor, borderColor, shadowing, roundCorner,
|
decoration.drawU(ug.apply(new UTranslate(corner)), backColor, borderColor, shadowing, roundCorner,
|
||||||
|
|
|
@ -48,8 +48,8 @@ import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class PSystemListEmoji extends PlainDiagram {
|
public class PSystemListEmoji extends PlainDiagram {
|
||||||
// ::remove file when CORE
|
// ::remove file when CORE
|
||||||
|
@ -60,7 +60,7 @@ public class PSystemListEmoji extends PlainDiagram {
|
||||||
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException {
|
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException {
|
||||||
return new UDrawable() {
|
return new UDrawable() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
final TextBlockBackcolored header = GraphicStrings
|
final TextBlock header = GraphicStrings
|
||||||
.createBlackOnWhite(Arrays.asList("<b><size:16>Emoji available on Unicode Block " + text,
|
.createBlackOnWhite(Arrays.asList("<b><size:16>Emoji available on Unicode Block " + text,
|
||||||
"(Blocks available: 26, 27, 1F3, 1F4, 1F5, 1F6, 1F9)"));
|
"(Blocks available: 26, 27, 1F3, 1F4, 1F5, 1F6, 1F9)"));
|
||||||
header.drawU(ug);
|
header.drawU(ug);
|
||||||
|
@ -92,7 +92,7 @@ public class PSystemListEmoji extends PlainDiagram {
|
||||||
sb.append("\"\"<U+003C>:" + shortcut + ":<U+003E> \"\"");
|
sb.append("\"\"<U+003C>:" + shortcut + ":<U+003E> \"\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
final TextBlockBackcolored tmp = GraphicStrings.createBlackOnWhite(Arrays.asList(sb.toString()));
|
final TextBlock tmp = GraphicStrings.createBlackOnWhite(Arrays.asList(sb.toString()));
|
||||||
tmp.drawU(ug);
|
tmp.drawU(ug);
|
||||||
ug = ug.apply(UTranslate.dy(tmp.calculateDimension(stringBounder).getHeight()));
|
ug = ug.apply(UTranslate.dy(tmp.calculateDimension(stringBounder).getHeight()));
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.atmp.ImageBuilder;
|
import net.atmp.ImageBuilder;
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.atmp.PixelImage;
|
import net.atmp.PixelImage;
|
||||||
import net.sourceforge.plantuml.ErrorUml;
|
import net.sourceforge.plantuml.ErrorUml;
|
||||||
import net.sourceforge.plantuml.FileFormat;
|
import net.sourceforge.plantuml.FileFormat;
|
||||||
|
@ -76,7 +75,7 @@ import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.VerticalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.VerticalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlockRaw;
|
import net.sourceforge.plantuml.klimt.shape.TextBlockRaw;
|
||||||
|
@ -86,7 +85,6 @@ import net.sourceforge.plantuml.klimt.shape.UImage;
|
||||||
import net.sourceforge.plantuml.klimt.sprite.SpriteContainerEmpty;
|
import net.sourceforge.plantuml.klimt.sprite.SpriteContainerEmpty;
|
||||||
import net.sourceforge.plantuml.security.SecurityUtils;
|
import net.sourceforge.plantuml.security.SecurityUtils;
|
||||||
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.text.BackSlash;
|
import net.sourceforge.plantuml.text.BackSlash;
|
||||||
import net.sourceforge.plantuml.text.StringLocated;
|
import net.sourceforge.plantuml.text.StringLocated;
|
||||||
import net.sourceforge.plantuml.utils.LineLocation;
|
import net.sourceforge.plantuml.utils.LineLocation;
|
||||||
|
@ -144,7 +142,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getGraphicalFormatted() {
|
private TextBlock getGraphicalFormatted() {
|
||||||
final FontConfiguration fc0 = GraphicStrings.sansSerif14(HColors.BLACK).bold();
|
final FontConfiguration fc0 = GraphicStrings.sansSerif14(HColors.BLACK).bold();
|
||||||
final FontConfiguration fc1 = GraphicStrings.sansSerif14(HColors.MY_GREEN).bold();
|
final FontConfiguration fc1 = GraphicStrings.sansSerif14(HColors.MY_GREEN).bold();
|
||||||
final FontConfiguration fc2 = GraphicStrings.sansSerif14(HColors.RED).bold();
|
final FontConfiguration fc2 = GraphicStrings.sansSerif14(HColors.RED).bold();
|
||||||
|
@ -247,7 +245,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException {
|
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException {
|
||||||
final TextBlockBackcolored result = getGraphicalFormatted();
|
final TextBlock result = getGraphicalFormatted();
|
||||||
|
|
||||||
TextBlock udrawable;
|
TextBlock udrawable;
|
||||||
if (getSource().getTotalLineCountLessThan5()) {
|
if (getSource().getTotalLineCountLessThan5()) {
|
||||||
|
@ -291,12 +289,12 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
return full.subList(full.size() - 1, full.size());
|
return full.subList(full.size() - 1, full.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getWelcome() throws IOException {
|
private TextBlock getWelcome() throws IOException {
|
||||||
return new PSystemWelcome(getSource(), GraphicPosition.BACKGROUND_CORNER_TOP_RIGHT).getGraphicStrings();
|
return new PSystemWelcome(getSource(), GraphicPosition.BACKGROUND_CORNER_TOP_RIGHT).getGraphicStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlock addWelcome(final TextBlockBackcolored result) throws IOException {
|
private TextBlock addWelcome(final TextBlock result) throws IOException {
|
||||||
final TextBlockBackcolored welcome = getWelcome();
|
final TextBlock welcome = getWelcome();
|
||||||
return TextBlockUtils.mergeTB(welcome, result, HorizontalAlignment.LEFT);
|
return TextBlockUtils.mergeTB(welcome, result, HorizontalAlignment.LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +351,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
}
|
}
|
||||||
// ::done
|
// ::done
|
||||||
|
|
||||||
private TextBlockBackcolored getMessageDedication() {
|
private TextBlock getMessageDedication() {
|
||||||
final HColorSimple backColor = (HColorSimple) HColorSet.instance().getColorOrWhite("#eae2c9");
|
final HColorSimple backColor = (HColorSimple) HColorSet.instance().getColorOrWhite("#eae2c9");
|
||||||
|
|
||||||
// ::comment when CORE
|
// ::comment when CORE
|
||||||
|
@ -382,7 +380,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getMessageAdopt() {
|
private TextBlock getMessageAdopt() {
|
||||||
final HColor backColor = HColorSet.instance().getColorOrWhite("#eff4d2");
|
final HColor backColor = HColorSet.instance().getColorOrWhite("#eff4d2");
|
||||||
|
|
||||||
final Display disp = Display.create("<b>Adopt-a-Word and put your message here!", " ",
|
final Display disp = Display.create("<b>Adopt-a-Word and put your message here!", " ",
|
||||||
|
@ -398,7 +396,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getMessagePatreon() {
|
private TextBlock getMessagePatreon() {
|
||||||
final UImage message = new UImage(
|
final UImage message = new UImage(
|
||||||
new PixelImage(PSystemVersion.getTime01(), AffineTransformType.TYPE_BILINEAR));
|
new PixelImage(PSystemVersion.getTime01(), AffineTransformType.TYPE_BILINEAR));
|
||||||
final Color back = new Color(message.getImage(1).getRGB(0, 0));
|
final Color back = new Color(message.getImage(1).getRGB(0, 0));
|
||||||
|
@ -424,7 +422,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
imHeight = Math.max(message.getHeight(), qrcode.getHeight() * scale + 10);
|
imHeight = Math.max(message.getHeight(), qrcode.getHeight() * scale + 10);
|
||||||
}
|
}
|
||||||
// ::done
|
// ::done
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
// ::comment when CORE
|
// ::comment when CORE
|
||||||
|
@ -441,10 +439,6 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
// ::done
|
// ::done
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
return new XDimension2D(imWidth + 1, imHeight + 1);
|
return new XDimension2D(imWidth + 1, imHeight + 1);
|
||||||
}
|
}
|
||||||
|
@ -460,7 +454,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getMessageLiberapay() {
|
private TextBlock getMessageLiberapay() {
|
||||||
final UImage message = new UImage(
|
final UImage message = new UImage(
|
||||||
new PixelImage(PSystemVersion.getTime15(), AffineTransformType.TYPE_BILINEAR));
|
new PixelImage(PSystemVersion.getTime15(), AffineTransformType.TYPE_BILINEAR));
|
||||||
final Color back = new Color(message.getImage(1).getRGB(0, 0));
|
final Color back = new Color(message.getImage(1).getRGB(0, 0));
|
||||||
|
@ -487,7 +481,7 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
}
|
}
|
||||||
// ::done
|
// ::done
|
||||||
|
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
// ::comment when CORE
|
// ::comment when CORE
|
||||||
|
@ -504,10 +498,6 @@ public abstract class PSystemError extends PlainDiagram {
|
||||||
// ::done
|
// ::done
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
return new XDimension2D(imWidth + 1, imHeight + 1);
|
return new XDimension2D(imWidth + 1, imHeight + 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,9 +58,12 @@ import net.sourceforge.plantuml.golem.TileGeometry;
|
||||||
import net.sourceforge.plantuml.golem.TilesField;
|
import net.sourceforge.plantuml.golem.TilesField;
|
||||||
import net.sourceforge.plantuml.klimt.UShape;
|
import net.sourceforge.plantuml.klimt.UShape;
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColors;
|
import net.sourceforge.plantuml.klimt.color.HColors;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
|
@ -229,4 +232,14 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
|
||||||
protected TextBlock getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorderNone();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HColor getBackcolor() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -38,20 +38,17 @@ import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
import net.sourceforge.plantuml.core.DiagramDescription;
|
import net.sourceforge.plantuml.core.DiagramDescription;
|
||||||
import net.sourceforge.plantuml.core.ImageData;
|
import net.sourceforge.plantuml.core.ImageData;
|
||||||
import net.sourceforge.plantuml.core.UmlSource;
|
import net.sourceforge.plantuml.core.UmlSource;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class GitDiagram extends UmlDiagram {
|
public class GitDiagram extends UmlDiagram {
|
||||||
|
|
||||||
|
@ -87,28 +84,17 @@ public class GitDiagram extends UmlDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawInternal(ug);
|
drawInternal(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.ScaleSimple;
|
import net.sourceforge.plantuml.ScaleSimple;
|
||||||
import net.sourceforge.plantuml.TitledDiagram;
|
import net.sourceforge.plantuml.TitledDiagram;
|
||||||
|
@ -47,7 +46,6 @@ import net.sourceforge.plantuml.core.ImageData;
|
||||||
import net.sourceforge.plantuml.core.UmlSource;
|
import net.sourceforge.plantuml.core.UmlSource;
|
||||||
import net.sourceforge.plantuml.json.JsonArray;
|
import net.sourceforge.plantuml.json.JsonArray;
|
||||||
import net.sourceforge.plantuml.json.JsonValue;
|
import net.sourceforge.plantuml.json.JsonValue;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
|
||||||
import net.sourceforge.plantuml.klimt.creole.Display;
|
import net.sourceforge.plantuml.klimt.creole.Display;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.hand.UGraphicHandwritten;
|
import net.sourceforge.plantuml.klimt.drawing.hand.UGraphicHandwritten;
|
||||||
|
@ -55,13 +53,11 @@ import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.font.UFont;
|
import net.sourceforge.plantuml.klimt.font.UFont;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.yaml.Highlighted;
|
import net.sourceforge.plantuml.yaml.Highlighted;
|
||||||
|
|
||||||
public class JsonDiagram extends TitledDiagram {
|
public class JsonDiagram extends TitledDiagram {
|
||||||
|
@ -117,28 +113,16 @@ public class JsonDiagram extends TitledDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawInternal(ug);
|
drawInternal(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
return TextBlockUtils.getMinMax(getTextBlock(), stringBounder, true).getDimension();
|
return TextBlockUtils.getMinMax(getTextBlock(), stringBounder, true).getDimension();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,11 +66,10 @@ import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleBuilder;
|
import net.sourceforge.plantuml.style.StyleBuilder;
|
||||||
import net.sourceforge.plantuml.style.StyleSignature;
|
import net.sourceforge.plantuml.style.StyleSignature;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.yaml.Highlighted;
|
import net.sourceforge.plantuml.yaml.Highlighted;
|
||||||
|
|
||||||
//See TextBlockMap
|
//See TextBlockMap
|
||||||
public class TextBlockJson extends AbstractTextBlock implements TextBlockBackcolored {
|
public class TextBlockJson extends AbstractTextBlock {
|
||||||
|
|
||||||
private final List<Line> lines = new ArrayList<>();
|
private final List<Line> lines = new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,8 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class PiecewiseAffineOnXorYBuilder extends AbstractTextBlock implements TextBlock, TextBlockBackcolored {
|
public class PiecewiseAffineOnXorYBuilder extends AbstractTextBlock {
|
||||||
|
|
||||||
private final TextBlock textBlock;
|
private final TextBlock textBlock;
|
||||||
private final CompressionMode mode;
|
private final CompressionMode mode;
|
||||||
|
|
|
@ -47,6 +47,7 @@ import net.sourceforge.plantuml.klimt.UPath;
|
||||||
import net.sourceforge.plantuml.klimt.UShape;
|
import net.sourceforge.plantuml.klimt.UShape;
|
||||||
import net.sourceforge.plantuml.klimt.color.ColorMapper;
|
import net.sourceforge.plantuml.klimt.color.ColorMapper;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
|
import net.sourceforge.plantuml.klimt.creole.legacy.AtomText;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMaxMutable;
|
import net.sourceforge.plantuml.klimt.geom.MinMaxMutable;
|
||||||
|
@ -142,6 +143,10 @@ public abstract class AbstractUGraphic<O> extends AbstractCommonUGraphic {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMinMax(UShape shape) {
|
private void updateMinMax(UShape shape) {
|
||||||
|
if (matchesProperty("SPECIALTXT") && shape instanceof AtomText) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final double x = getTranslate().getDx();
|
final double x = getTranslate().getDx();
|
||||||
final double y = getTranslate().getDy();
|
final double y = getTranslate().getDy();
|
||||||
if (shape instanceof UText) {
|
if (shape instanceof UText) {
|
||||||
|
@ -179,8 +184,7 @@ public abstract class AbstractUGraphic<O> extends AbstractCommonUGraphic {
|
||||||
} else if (shape instanceof UPixel) {
|
} else if (shape instanceof UPixel) {
|
||||||
addPoint(x, y);
|
addPoint(x, y);
|
||||||
} else {
|
} else {
|
||||||
System.err.println("ERROR ignoring " + shape.getClass().getName());
|
throw new UnsupportedOperationException(shape.getClass().getName());
|
||||||
// throw new UnsupportedOperationException(shape.getClass().getName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,9 +107,9 @@ public class UGraphicTikz extends AbstractUGraphic<TikzGraphics> implements Clip
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean matchesProperty(String propertyName) {
|
public boolean matchesProperty(String propertyName) {
|
||||||
if ("SPECIALTXT".equalsIgnoreCase(propertyName)) {
|
if ("SPECIALTXT".equalsIgnoreCase(propertyName))
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,13 +33,13 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package net.sourceforge.plantuml.svek;
|
package net.sourceforge.plantuml.klimt.geom;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
|
||||||
public interface TextBlockBackcolored extends TextBlock {
|
public interface MagneticBorder {
|
||||||
|
|
||||||
HColor getBackcolor();
|
public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position);
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
/* ========================================================================
|
||||||
|
* PlantUML : a free UML diagram generator
|
||||||
|
* ========================================================================
|
||||||
|
*
|
||||||
|
* (C) Copyright 2009-2024, Arnaud Roques
|
||||||
|
*
|
||||||
|
* Project Info: https://plantuml.com
|
||||||
|
*
|
||||||
|
* If you like this project or if you find it useful, you can support us at:
|
||||||
|
*
|
||||||
|
* https://plantuml.com/patreon (only 1$ per month!)
|
||||||
|
* https://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.klimt.geom;
|
||||||
|
|
||||||
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
|
||||||
|
public class MagneticBorderNone implements MagneticBorder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position) {
|
||||||
|
return new UTranslate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -37,26 +37,26 @@ package net.sourceforge.plantuml.klimt.geom;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
|
|
||||||
public class ClusterPosition {
|
public class RectangleArea {
|
||||||
|
|
||||||
private final double minX;
|
private final double minX;
|
||||||
private final double minY;
|
private final double minY;
|
||||||
private final double maxX;
|
private final double maxX;
|
||||||
private final double maxY;
|
private final double maxY;
|
||||||
|
|
||||||
public ClusterPosition(double minX, double minY, double maxX, double maxY) {
|
public RectangleArea(double minX, double minY, double maxX, double maxY) {
|
||||||
this.minX = minX;
|
this.minX = minX;
|
||||||
this.minY = minY;
|
this.minY = minY;
|
||||||
this.maxX = maxX;
|
this.maxX = maxX;
|
||||||
this.maxY = maxY;
|
this.maxY = maxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition(XPoint2D min, XPoint2D max) {
|
public RectangleArea(XPoint2D min, XPoint2D max) {
|
||||||
this(min.x, min.y, max.x, max.y);
|
this(min.x, min.y, max.x, max.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition move(double deltaX, double deltaY) {
|
public RectangleArea move(double deltaX, double deltaY) {
|
||||||
return new ClusterPosition(minX + deltaX, minY + deltaY, maxX + deltaX, maxY + deltaY);
|
return new RectangleArea(minX + deltaX, minY + deltaY, maxX + deltaX, maxY + deltaY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getWidth() {
|
public double getWidth() {
|
||||||
|
@ -71,15 +71,15 @@ public class ClusterPosition {
|
||||||
return x >= minX && x < maxX && y >= minY && y < maxY;
|
return x >= minX && x < maxX && y >= minY && y < maxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition merge(ClusterPosition other) {
|
public RectangleArea merge(RectangleArea other) {
|
||||||
return new ClusterPosition(Math.min(this.minX, other.minX), Math.min(this.minY, other.minY),
|
return new RectangleArea(Math.min(this.minX, other.minX), Math.min(this.minY, other.minY),
|
||||||
Math.max(this.maxX, other.maxX), Math.max(this.maxY, other.maxY));
|
Math.max(this.maxX, other.maxX), Math.max(this.maxY, other.maxY));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition merge(XPoint2D point) {
|
public RectangleArea merge(XPoint2D point) {
|
||||||
final double x = point.getX();
|
final double x = point.getX();
|
||||||
final double y = point.getY();
|
final double y = point.getY();
|
||||||
return new ClusterPosition(Math.min(this.minX, x), Math.min(this.minY, y), Math.max(this.maxX, x),
|
return new RectangleArea(Math.min(this.minX, x), Math.min(this.minY, y), Math.max(this.maxX, x),
|
||||||
Math.max(this.maxY, y));
|
Math.max(this.maxY, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,58 +135,58 @@ public class ClusterPosition {
|
||||||
return new XPoint2D((minX + maxX) / 2, (minY + maxY) / 2);
|
return new XPoint2D((minX + maxX) / 2, (minY + maxY) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition withMinX(double d) {
|
public RectangleArea withMinX(double d) {
|
||||||
return new ClusterPosition(d, minY, maxX, maxY);
|
return new RectangleArea(d, minY, maxX, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition withMaxX(double d) {
|
public RectangleArea withMaxX(double d) {
|
||||||
return new ClusterPosition(minX, minY, d, maxY);
|
return new RectangleArea(minX, minY, d, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition addMaxX(double d) {
|
public RectangleArea addMaxX(double d) {
|
||||||
return new ClusterPosition(minX, minY, maxX + d, maxY);
|
return new RectangleArea(minX, minY, maxX + d, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition addMaxY(double d) {
|
public RectangleArea addMaxY(double d) {
|
||||||
return new ClusterPosition(minX, minY, maxX, maxY + d);
|
return new RectangleArea(minX, minY, maxX, maxY + d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition addMinX(double d) {
|
public RectangleArea addMinX(double d) {
|
||||||
return new ClusterPosition(minX + d, minY, maxX, maxY);
|
return new RectangleArea(minX + d, minY, maxX, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition addMinY(double d) {
|
public RectangleArea addMinY(double d) {
|
||||||
return new ClusterPosition(minX, minY + d, maxX, maxY);
|
return new RectangleArea(minX, minY + d, maxX, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition withMinY(double d) {
|
public RectangleArea withMinY(double d) {
|
||||||
return new ClusterPosition(minX, d, maxX, maxY);
|
return new RectangleArea(minX, d, maxX, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition withMaxY(double d) {
|
public RectangleArea withMaxY(double d) {
|
||||||
return new ClusterPosition(minX, minY, maxX, d);
|
return new RectangleArea(minX, minY, maxX, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XPoint2D getProjectionOnFrontier(XPoint2D pt) {
|
// public XPoint2D getProjectionOnFrontier(XPoint2D pt) {
|
||||||
final double x = pt.getX();
|
// final double x = pt.getX();
|
||||||
final double y = pt.getY();
|
// final double y = pt.getY();
|
||||||
if (x > maxX && y >= minY && y <= maxY)
|
// if (x > maxX && y >= minY && y <= maxY)
|
||||||
return new XPoint2D(maxX - 1, y);
|
// return new XPoint2D(maxX - 1, y);
|
||||||
|
//
|
||||||
|
// if (x < minX && y >= minY && y <= maxY)
|
||||||
|
// return new XPoint2D(minX + 1, y);
|
||||||
|
//
|
||||||
|
// if (y > maxY && x >= minX && x <= maxX)
|
||||||
|
// return new XPoint2D(x, maxY - 1);
|
||||||
|
//
|
||||||
|
// if (y < minY && x >= minX && x <= maxX)
|
||||||
|
// return new XPoint2D(x, minY + 1);
|
||||||
|
//
|
||||||
|
// return new XPoint2D(x, y);
|
||||||
|
// }
|
||||||
|
|
||||||
if (x < minX && y >= minY && y <= maxY)
|
public RectangleArea delta(double m1, double m2) {
|
||||||
return new XPoint2D(minX + 1, y);
|
return new RectangleArea(minX, minY, maxX + m1, maxY + m2);
|
||||||
|
|
||||||
if (y > maxY && x >= minX && x <= maxX)
|
|
||||||
return new XPoint2D(x, maxY - 1);
|
|
||||||
|
|
||||||
if (y < minY && x >= minX && x <= maxX)
|
|
||||||
return new XPoint2D(x, minY + 1);
|
|
||||||
|
|
||||||
return new XPoint2D(x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClusterPosition delta(double m1, double m2) {
|
|
||||||
return new ClusterPosition(minX, minY, maxX + m1, maxY + m2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public XDimension2D getDimension() {
|
public XDimension2D getDimension() {
|
||||||
|
@ -197,12 +197,12 @@ public class ClusterPosition {
|
||||||
return new UTranslate(getMinX(), getMinY());
|
return new UTranslate(getMinX(), getMinY());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPointJustUpper(XPoint2D pt) {
|
// public boolean isPointJustUpper(XPoint2D pt) {
|
||||||
if (pt.getX() >= minX && pt.getX() <= maxX && pt.getY() <= minY) {
|
// if (pt.getX() >= minX && pt.getX() <= maxX && pt.getY() <= minY) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public Side getClosestSide(XPoint2D pt) {
|
public Side getClosestSide(XPoint2D pt) {
|
||||||
final double distNorth = Math.abs(minY - pt.getY());
|
final double distNorth = Math.abs(minY - pt.getY());
|
|
@ -36,7 +36,10 @@
|
||||||
package net.sourceforge.plantuml.klimt.shape;
|
package net.sourceforge.plantuml.klimt.shape;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
import net.atmp.InnerStrategy;
|
||||||
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
|
||||||
|
@ -51,4 +54,15 @@ public abstract class AbstractTextBlock implements TextBlock {
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
public MinMax getMinMax(StringBounder stringBounder) {
|
||||||
throw new UnsupportedOperationException(getClass().toString());
|
throw new UnsupportedOperationException(getClass().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorderNone();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HColor getBackcolor() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -49,8 +49,9 @@ import java.util.Set;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.klimt.UPath;
|
import net.sourceforge.plantuml.klimt.UPath;
|
||||||
import net.sourceforge.plantuml.klimt.UShape;
|
import net.sourceforge.plantuml.klimt.UShape;
|
||||||
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.geom.BezierUtils;
|
import net.sourceforge.plantuml.klimt.geom.BezierUtils;
|
||||||
import net.sourceforge.plantuml.klimt.geom.ClusterPosition;
|
import net.sourceforge.plantuml.klimt.geom.RectangleArea;
|
||||||
import net.sourceforge.plantuml.klimt.geom.EnsureVisible;
|
import net.sourceforge.plantuml.klimt.geom.EnsureVisible;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinFinder;
|
import net.sourceforge.plantuml.klimt.geom.MinFinder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
|
@ -193,6 +194,14 @@ public class DotPath implements UShape, Moveable {
|
||||||
beziers.get(0).ctrly1 = y;
|
beziers.get(0).ctrly1 = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void moveStartPoint(UTranslate move) {
|
||||||
|
moveStartPoint(move.getDx(), move.getDy());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void moveEndPoint(UTranslate move) {
|
||||||
|
moveEndPoint(move.getDx(), move.getDy());
|
||||||
|
}
|
||||||
|
|
||||||
public void moveStartPoint(double dx, double dy) {
|
public void moveStartPoint(double dx, double dy) {
|
||||||
beziers.get(0).x1 += dx;
|
beziers.get(0).x1 += dx;
|
||||||
beziers.get(0).y1 += dy;
|
beziers.get(0).y1 += dy;
|
||||||
|
@ -400,7 +409,7 @@ public class DotPath implements UShape, Moveable {
|
||||||
return Collections.unmodifiableList(beziers);
|
return Collections.unmodifiableList(beziers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DotPath simulateCompound(ClusterPosition head, ClusterPosition tail) {
|
public DotPath simulateCompound(RectangleArea head, RectangleArea tail) {
|
||||||
if (head == null && tail == null)
|
if (head == null && tail == null)
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ import net.sourceforge.plantuml.klimt.sprite.SpriteContainerEmpty;
|
||||||
import net.sourceforge.plantuml.svek.IEntityImage;
|
import net.sourceforge.plantuml.svek.IEntityImage;
|
||||||
import net.sourceforge.plantuml.svek.Margins;
|
import net.sourceforge.plantuml.svek.Margins;
|
||||||
import net.sourceforge.plantuml.svek.ShapeType;
|
import net.sourceforge.plantuml.svek.ShapeType;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
|
public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
|
||||||
|
|
||||||
|
@ -97,21 +96,20 @@ public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
|
||||||
return HColors.BLACK;
|
return HColors.BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextBlockBackcolored createGreenOnBlackMonospaced(List<String> strings) {
|
public static TextBlock createGreenOnBlackMonospaced(List<String> strings) {
|
||||||
return new GraphicStrings(strings, monospaced14(HColors.GREEN), HColors.BLACK, null, null,
|
return new GraphicStrings(strings, monospaced14(HColors.GREEN), HColors.BLACK, null, null,
|
||||||
CreoleMode.SIMPLE_LINE);
|
CreoleMode.SIMPLE_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextBlockBackcolored createBlackOnWhite(List<String> strings) {
|
public static TextBlock createBlackOnWhite(List<String> strings) {
|
||||||
return new GraphicStrings(strings, sansSerif12(HColors.BLACK), HColors.WHITE, null, null, CreoleMode.FULL);
|
return new GraphicStrings(strings, sansSerif12(HColors.BLACK), HColors.WHITE, null, null, CreoleMode.FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextBlockBackcolored createBlackOnWhiteMonospaced(List<String> strings) {
|
public static TextBlock createBlackOnWhiteMonospaced(List<String> strings) {
|
||||||
return new GraphicStrings(strings, monospaced14(HColors.BLACK), HColors.WHITE, null, null, CreoleMode.FULL);
|
return new GraphicStrings(strings, monospaced14(HColors.BLACK), HColors.WHITE, null, null, CreoleMode.FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextBlockBackcolored createBlackOnWhite(List<String> strings, BufferedImage image,
|
public static TextBlock createBlackOnWhite(List<String> strings, BufferedImage image, GraphicPosition position) {
|
||||||
GraphicPosition position) {
|
|
||||||
return new GraphicStrings(strings, sansSerif12(HColors.BLACK), HColors.WHITE, image, position,
|
return new GraphicStrings(strings, sansSerif12(HColors.BLACK), HColors.WHITE, image, position,
|
||||||
CreoleMode.FULL_BUT_UNDERSCORE);
|
CreoleMode.FULL_BUT_UNDERSCORE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,9 @@ package net.sourceforge.plantuml.klimt.shape;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
import net.atmp.InnerStrategy;
|
||||||
import net.sourceforge.plantuml.klimt.UShape;
|
import net.sourceforge.plantuml.klimt.UShape;
|
||||||
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
@ -50,4 +52,8 @@ public interface TextBlock extends UDrawable, UShape {
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy);
|
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy);
|
||||||
|
|
||||||
|
public MagneticBorder getMagneticBorder();
|
||||||
|
|
||||||
|
public HColor getBackcolor();
|
||||||
|
|
||||||
}
|
}
|
|
@ -41,9 +41,8 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBackcolored {
|
public class TextBlockRecentred extends AbstractTextBlock {
|
||||||
|
|
||||||
private final TextBlock textBlock;
|
private final TextBlock textBlock;
|
||||||
|
|
||||||
|
@ -80,10 +79,7 @@ public class TextBlockRecentred extends AbstractTextBlock implements TextBlockBa
|
||||||
}
|
}
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
public HColor getBackcolor() {
|
||||||
if (textBlock instanceof TextBlockBackcolored) {
|
return textBlock.getBackcolor();
|
||||||
return ((TextBlockBackcolored) textBlock).getBackcolor();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -38,14 +38,17 @@ package net.sourceforge.plantuml.klimt.shape;
|
||||||
import net.atmp.InnerStrategy;
|
import net.atmp.InnerStrategy;
|
||||||
import net.sourceforge.plantuml.klimt.LineBreakStrategy;
|
import net.sourceforge.plantuml.klimt.LineBreakStrategy;
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.creole.CreoleMode;
|
import net.sourceforge.plantuml.klimt.creole.CreoleMode;
|
||||||
import net.sourceforge.plantuml.klimt.creole.Display;
|
import net.sourceforge.plantuml.klimt.creole.Display;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
import net.sourceforge.plantuml.style.ISkinSimple;
|
import net.sourceforge.plantuml.style.ISkinSimple;
|
||||||
|
|
||||||
|
@ -83,4 +86,20 @@ public class TextBlockTitle implements TextBlock {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorder() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position) {
|
||||||
|
return textBlock.getMagneticBorder().getForceAt(stringBounder, position.move(-outMargin, 0));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HColor getBackcolor() {
|
||||||
|
return textBlock.getBackcolor();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ import net.sourceforge.plantuml.klimt.drawing.LimitFinder;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.Positionable;
|
import net.sourceforge.plantuml.klimt.geom.Positionable;
|
||||||
import net.sourceforge.plantuml.klimt.geom.PositionableImpl;
|
import net.sourceforge.plantuml.klimt.geom.PositionableImpl;
|
||||||
|
@ -50,7 +51,6 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
|
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class TextBlockUtils {
|
public class TextBlockUtils {
|
||||||
|
|
||||||
|
@ -176,11 +176,19 @@ public class TextBlockUtils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return bloc.getMagneticBorder();
|
||||||
|
}
|
||||||
|
|
||||||
|
public HColor getBackcolor() {
|
||||||
|
return bloc.getBackcolor();
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextBlockBackcolored addBackcolor(final TextBlock text, final HColor backColor) {
|
public static TextBlock addBackcolor(final TextBlock text, final HColor backColor) {
|
||||||
return new TextBlockBackcolored() {
|
return new TextBlock() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
text.drawU(ug);
|
text.drawU(ug);
|
||||||
}
|
}
|
||||||
|
@ -200,11 +208,15 @@ public class TextBlockUtils {
|
||||||
public HColor getBackcolor() {
|
public HColor getBackcolor() {
|
||||||
return backColor;
|
return backColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return text.getMagneticBorder();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextBlock fromUImage(final UImage image) {
|
public static TextBlock fromUImage(final UImage image) {
|
||||||
return new TextBlock() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
ug.draw(image);
|
ug.draw(image);
|
||||||
|
@ -218,10 +230,6 @@ public class TextBlockUtils {
|
||||||
return MinMax.fromMax(image.getWidth(), image.getHeight());
|
return MinMax.fromMax(image.getWidth(), image.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
import net.sourceforge.plantuml.svek.Ports;
|
import net.sourceforge.plantuml.svek.Ports;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.svek.WithPorts;
|
import net.sourceforge.plantuml.svek.WithPorts;
|
||||||
|
|
||||||
public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock, WithPorts {
|
public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock, WithPorts {
|
||||||
|
@ -100,13 +99,12 @@ public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock,
|
||||||
|
|
||||||
for (TextBlock block : blocks) {
|
for (TextBlock block : blocks) {
|
||||||
final XDimension2D dimb = block.calculateDimension(ug.getStringBounder());
|
final XDimension2D dimb = block.calculateDimension(ug.getStringBounder());
|
||||||
if (block instanceof TextBlockBackcolored) {
|
|
||||||
final HColor back = ((TextBlockBackcolored) block).getBackcolor();
|
|
||||||
if (back != null && back.isTransparent() == false)
|
|
||||||
ug.apply(UTranslate.dy(y)).apply(back).apply(back.bg())
|
|
||||||
.draw(new URectangle(dimtotal.getWidth(), dimb.getHeight()));
|
|
||||||
|
|
||||||
}
|
final HColor back = block.getBackcolor();
|
||||||
|
if (back != null && back.isTransparent() == false)
|
||||||
|
ug.apply(UTranslate.dy(y)).apply(back).apply(back.bg())
|
||||||
|
.draw(new URectangle(dimtotal.getWidth(), dimb.getHeight()));
|
||||||
|
|
||||||
if (horizontalAlignment == HorizontalAlignment.LEFT) {
|
if (horizontalAlignment == HorizontalAlignment.LEFT) {
|
||||||
block.drawU(ug.apply(UTranslate.dy(y)));
|
block.drawU(ug.apply(UTranslate.dy(y)));
|
||||||
} else if (horizontalAlignment == HorizontalAlignment.CENTER) {
|
} else if (horizontalAlignment == HorizontalAlignment.CENTER) {
|
||||||
|
|
|
@ -36,8 +36,10 @@
|
||||||
package net.sourceforge.plantuml.klimt.shape;
|
package net.sourceforge.plantuml.klimt.shape;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
import net.atmp.InnerStrategy;
|
||||||
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
@ -49,9 +51,9 @@ public class TextBlockWithUrl implements TextBlock {
|
||||||
private final Url url;
|
private final Url url;
|
||||||
|
|
||||||
public static TextBlock withUrl(TextBlock block, Url url) {
|
public static TextBlock withUrl(TextBlock block, Url url) {
|
||||||
if (url == null) {
|
if (url == null)
|
||||||
return block;
|
return block;
|
||||||
}
|
|
||||||
return new TextBlockWithUrl(block, url);
|
return new TextBlockWithUrl(block, url);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,4 +81,14 @@ public class TextBlockWithUrl implements TextBlock {
|
||||||
return block.getInnerPosition(member, stringBounder, strategy);
|
return block.getInnerPosition(member, stringBounder, strategy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return block.getMagneticBorder();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HColor getBackcolor() {
|
||||||
|
return block.getBackcolor();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -54,10 +54,10 @@ import net.sourceforge.plantuml.klimt.AffineTransformType;
|
||||||
import net.sourceforge.plantuml.klimt.MutableImage;
|
import net.sourceforge.plantuml.klimt.MutableImage;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.eps.EpsGraphics;
|
import net.sourceforge.plantuml.klimt.drawing.eps.EpsGraphics;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UImageSvg;
|
import net.sourceforge.plantuml.klimt.shape.UImageSvg;
|
||||||
import net.sourceforge.plantuml.log.Logme;
|
import net.sourceforge.plantuml.log.Logme;
|
||||||
import net.sourceforge.plantuml.security.SImageIO;
|
import net.sourceforge.plantuml.security.SImageIO;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.Log;
|
import net.sourceforge.plantuml.utils.Log;
|
||||||
|
|
||||||
public class ScientificEquationSafe {
|
public class ScientificEquationSafe {
|
||||||
|
@ -133,7 +133,7 @@ public class ScientificEquationSafe {
|
||||||
Logme.error(e);
|
Logme.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getRollback() {
|
private TextBlock getRollback() {
|
||||||
return GraphicStrings.createBlackOnWhiteMonospaced(Arrays.asList(formula));
|
return GraphicStrings.createBlackOnWhiteMonospaced(Arrays.asList(formula));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||||
|
@ -52,13 +51,12 @@ import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.creole.Display;
|
import net.sourceforge.plantuml.klimt.creole.Display;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.Rankdir;
|
import net.sourceforge.plantuml.klimt.geom.Rankdir;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.skin.SkinParam;
|
import net.sourceforge.plantuml.skin.SkinParam;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.Direction;
|
import net.sourceforge.plantuml.utils.Direction;
|
||||||
|
|
||||||
public class MindMapDiagram extends UmlDiagram {
|
public class MindMapDiagram extends UmlDiagram {
|
||||||
|
@ -89,8 +87,8 @@ public class MindMapDiagram extends UmlDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
for (MindMap mindmap : mindmaps) {
|
for (MindMap mindmap : mindmaps) {
|
||||||
|
@ -100,10 +98,6 @@ public class MindMapDiagram extends UmlDiagram {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
double width = 0;
|
double width = 0;
|
||||||
double height = 0;
|
double height = 0;
|
||||||
|
@ -115,13 +109,6 @@ public class MindMapDiagram extends UmlDiagram {
|
||||||
return new XDimension2D(width, height);
|
return new XDimension2D(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||||
|
@ -58,9 +57,8 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
||||||
|
@ -80,7 +78,6 @@ import net.sourceforge.plantuml.style.SName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleBuilder;
|
import net.sourceforge.plantuml.style.StyleBuilder;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class NwDiagram extends UmlDiagram {
|
public class NwDiagram extends UmlDiagram {
|
||||||
|
|
||||||
|
@ -263,28 +260,16 @@ public class NwDiagram extends UmlDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawMe(ug);
|
drawMe(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
return getTotalDimension(stringBounder);
|
return getTotalDimension(stringBounder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,11 @@ package net.sourceforge.plantuml.nwdiag.next;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
import net.atmp.InnerStrategy;
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
@ -126,4 +129,14 @@ public class GridTextBlockSimple implements TextBlock {
|
||||||
return skinParam;
|
return skinParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorderNone();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HColor getBackcolor() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormat;
|
import net.sourceforge.plantuml.FileFormat;
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.TitledDiagram;
|
import net.sourceforge.plantuml.TitledDiagram;
|
||||||
|
@ -68,9 +67,8 @@ import net.sourceforge.plantuml.klimt.creole.Display;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
||||||
import net.sourceforge.plantuml.klimt.shape.URectangle;
|
import net.sourceforge.plantuml.klimt.shape.URectangle;
|
||||||
|
@ -115,7 +113,6 @@ import net.sourceforge.plantuml.style.SName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprite {
|
public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprite {
|
||||||
|
|
||||||
|
@ -211,7 +208,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
|
||||||
return getTextBlock(stringBounder);
|
return getTextBlock(stringBounder);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getTextBlock(StringBounder stringBounder) {
|
private TextBlock getTextBlock(StringBounder stringBounder) {
|
||||||
if (printStart == null) {
|
if (printStart == null) {
|
||||||
initMinMax();
|
initMinMax();
|
||||||
} else {
|
} else {
|
||||||
|
@ -220,7 +217,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
|
||||||
}
|
}
|
||||||
final TimeHeader timeHeader = getTimeHeader();
|
final TimeHeader timeHeader = getTimeHeader();
|
||||||
initTaskAndResourceDraws(timeHeader.getTimeScale(), timeHeader.getFullHeaderHeight(), stringBounder);
|
initTaskAndResourceDraws(timeHeader.getTimeScale(), timeHeader.getFullHeaderHeight(), stringBounder);
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
try {
|
try {
|
||||||
|
@ -279,10 +276,6 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
return new XDimension2D(getTitlesColumnWidth(stringBounder) + getBarsColumnWidth(timeHeader),
|
return new XDimension2D(getTitlesColumnWidth(stringBounder) + getBarsColumnWidth(timeHeader),
|
||||||
getTotalHeight(timeHeader));
|
getTotalHeight(timeHeader));
|
||||||
|
@ -294,13 +287,6 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
|
||||||
return xmax - xmin;
|
return xmax - xmin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,6 @@ import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.style.ISkinParam;
|
import net.sourceforge.plantuml.style.ISkinParam;
|
||||||
import net.sourceforge.plantuml.style.PName;
|
import net.sourceforge.plantuml.style.PName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.BlocLines;
|
import net.sourceforge.plantuml.utils.BlocLines;
|
||||||
import net.sourceforge.plantuml.utils.CharInspector;
|
import net.sourceforge.plantuml.utils.CharInspector;
|
||||||
|
|
||||||
|
@ -127,7 +126,7 @@ public class PSystemRegex extends TitledDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
// while (stack.size() > 1)
|
// while (stack.size() > 1)
|
||||||
// concatenation();
|
// concatenation();
|
||||||
final ETile peekFirst = stack.peekFirst();
|
final ETile peekFirst = stack.peekFirst();
|
||||||
|
|
|
@ -42,7 +42,6 @@ import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormat;
|
import net.sourceforge.plantuml.FileFormat;
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.ScaleSimple;
|
import net.sourceforge.plantuml.ScaleSimple;
|
||||||
|
@ -61,9 +60,8 @@ import net.sourceforge.plantuml.klimt.color.HColors;
|
||||||
import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
|
import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.sprite.Sprite;
|
import net.sourceforge.plantuml.klimt.sprite.Sprite;
|
||||||
import net.sourceforge.plantuml.log.Logme;
|
import net.sourceforge.plantuml.log.Logme;
|
||||||
|
@ -89,7 +87,6 @@ import net.sourceforge.plantuml.salt.factory.ElementFactoryTextField;
|
||||||
import net.sourceforge.plantuml.salt.factory.ElementFactoryTree;
|
import net.sourceforge.plantuml.salt.factory.ElementFactoryTree;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
|
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.BlocLines;
|
import net.sourceforge.plantuml.utils.BlocLines;
|
||||||
import net.sourceforge.plantuml.utils.Log;
|
import net.sourceforge.plantuml.utils.Log;
|
||||||
|
|
||||||
|
@ -137,8 +134,8 @@ public class PSystemSalt extends TitledDiagram implements WithSprite {
|
||||||
return getTextBlock(salt, size);
|
return getTextBlock(salt, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getTextBlock(final Element salt, final XDimension2D size) {
|
private TextBlock getTextBlock(final Element salt, final XDimension2D size) {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
ug = ug.apply(getBlack());
|
ug = ug.apply(getBlack());
|
||||||
|
@ -150,14 +147,6 @@ public class PSystemSalt extends TitledDiagram implements WithSprite {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
public HColor getBackcolor() {
|
||||||
return getSkinParam().getBackgroundColor();
|
return getSkinParam().getBackgroundColor();
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,6 @@ import net.sourceforge.plantuml.svek.GeneralImageBuilder;
|
||||||
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
import net.sourceforge.plantuml.svek.GraphvizCrash;
|
||||||
import net.sourceforge.plantuml.svek.IEntityImage;
|
import net.sourceforge.plantuml.svek.IEntityImage;
|
||||||
import net.sourceforge.plantuml.svek.SvekNode;
|
import net.sourceforge.plantuml.svek.SvekNode;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import smetana.core.CString;
|
import smetana.core.CString;
|
||||||
import smetana.core.Globals;
|
import smetana.core.Globals;
|
||||||
import smetana.core.JUtils;
|
import smetana.core.JUtils;
|
||||||
|
@ -148,7 +147,7 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Drawing extends AbstractTextBlock implements TextBlockBackcolored {
|
class Drawing extends AbstractTextBlock {
|
||||||
|
|
||||||
private final YMirror ymirror;
|
private final YMirror ymirror;
|
||||||
private final MinMaxMutable minMax;
|
private final MinMaxMutable minMax;
|
||||||
|
|
|
@ -45,16 +45,14 @@ import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.klimt.UClip;
|
import net.sourceforge.plantuml.klimt.UClip;
|
||||||
import net.sourceforge.plantuml.klimt.UStroke;
|
import net.sourceforge.plantuml.klimt.UStroke;
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.txt.UGraphicTxt;
|
import net.sourceforge.plantuml.klimt.drawing.txt.UGraphicTxt;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.sequencediagram.Doll;
|
import net.sourceforge.plantuml.sequencediagram.Doll;
|
||||||
import net.sourceforge.plantuml.sequencediagram.Event;
|
import net.sourceforge.plantuml.sequencediagram.Event;
|
||||||
|
@ -245,7 +243,7 @@ public class DrawableSet {
|
||||||
}
|
}
|
||||||
|
|
||||||
TextBlock asTextBlock(final double delta, final double width, final Page page, final boolean showTail) {
|
TextBlock asTextBlock(final double delta, final double width, final Page page, final boolean showTail) {
|
||||||
return new TextBlock() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawU22(ug, delta, width, page, showTail);
|
drawU22(ug, delta, width, page, showTail);
|
||||||
|
@ -256,14 +254,6 @@ public class DrawableSet {
|
||||||
return new XDimension2D(width, height);
|
return new XDimension2D(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ import java.util.Objects;
|
||||||
import net.sourceforge.plantuml.abel.Entity;
|
import net.sourceforge.plantuml.abel.Entity;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
|
||||||
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.stereo.Stereotype;
|
import net.sourceforge.plantuml.stereo.Stereotype;
|
||||||
import net.sourceforge.plantuml.style.ISkinParam;
|
import net.sourceforge.plantuml.style.ISkinParam;
|
||||||
|
|
|
@ -67,8 +67,8 @@ import net.sourceforge.plantuml.klimt.color.HColorSet;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColors;
|
import net.sourceforge.plantuml.klimt.color.HColors;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.ClusterPosition;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.Moveable;
|
import net.sourceforge.plantuml.klimt.geom.Moveable;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.RectangleArea;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
|
@ -114,7 +114,7 @@ public class Cluster implements Moveable {
|
||||||
private XPoint2D xyNoteTop;
|
private XPoint2D xyNoteTop;
|
||||||
private XPoint2D xyNoteBottom;
|
private XPoint2D xyNoteBottom;
|
||||||
|
|
||||||
private ClusterPosition clusterPosition;
|
private RectangleArea rectangleArea;
|
||||||
|
|
||||||
public void moveSvek(double deltaX, double deltaY) {
|
public void moveSvek(double deltaX, double deltaY) {
|
||||||
if (this.xyNoteTop != null)
|
if (this.xyNoteTop != null)
|
||||||
|
@ -123,8 +123,8 @@ public class Cluster implements Moveable {
|
||||||
this.xyNoteBottom = this.xyNoteBottom.move(deltaX, deltaY);
|
this.xyNoteBottom = this.xyNoteBottom.move(deltaX, deltaY);
|
||||||
if (this.xyTitle != null)
|
if (this.xyTitle != null)
|
||||||
this.xyTitle = this.xyTitle.move(deltaX, deltaY);
|
this.xyTitle = this.xyTitle.move(deltaX, deltaY);
|
||||||
if (this.clusterPosition != null)
|
if (this.rectangleArea != null)
|
||||||
this.clusterPosition = this.clusterPosition.move(deltaX, deltaY);
|
this.rectangleArea = this.rectangleArea.move(deltaX, deltaY);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,8 +257,8 @@ public class Cluster implements Moveable {
|
||||||
return clusterHeader.getTitleAndAttributeHeight();
|
return clusterHeader.getTitleAndAttributeHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition getClusterPosition() {
|
public RectangleArea getRectangleArea() {
|
||||||
return clusterPosition;
|
return rectangleArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitlePosition(XPoint2D pos) {
|
public void setTitlePosition(XPoint2D pos) {
|
||||||
|
@ -339,7 +339,7 @@ public class Cluster implements Moveable {
|
||||||
group.getUSymbol(), skinParam.getCurrentStyleBuilder(), skinParam.getIHtmlColorSet());
|
group.getUSymbol(), skinParam.getCurrentStyleBuilder(), skinParam.getIHtmlColorSet());
|
||||||
|
|
||||||
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(),
|
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(),
|
||||||
clusterHeader.getTitle(), clusterHeader.getStereo(), clusterPosition, stroke);
|
clusterHeader.getTitle(), clusterHeader.getStereo(), rectangleArea, stroke);
|
||||||
decoration.drawU(ug, backColor, borderColor, shadowing, rounded,
|
decoration.drawU(ug, backColor, borderColor, shadowing, rounded,
|
||||||
skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null),
|
skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null),
|
||||||
skinParam.getStereotypeAlignment(), diagonalCorner);
|
skinParam.getStereotypeAlignment(), diagonalCorner);
|
||||||
|
@ -371,43 +371,44 @@ public class Cluster implements Moveable {
|
||||||
}
|
}
|
||||||
|
|
||||||
void manageEntryExitPoint(StringBounder stringBounder) {
|
void manageEntryExitPoint(StringBounder stringBounder) {
|
||||||
final Collection<ClusterPosition> insides = new ArrayList<>();
|
final Collection<RectangleArea> insides = new ArrayList<>();
|
||||||
final List<XPoint2D> points = new ArrayList<>();
|
final List<XPoint2D> points = new ArrayList<>();
|
||||||
for (SvekNode sh : nodes)
|
for (SvekNode sh : nodes)
|
||||||
if (isNormalPosition(sh))
|
if (isNormalPosition(sh))
|
||||||
insides.add(sh.getClusterPosition());
|
insides.add(sh.getRectangleArea());
|
||||||
else
|
else
|
||||||
points.add(sh.getClusterPosition().getPointCenter());
|
points.add(sh.getRectangleArea().getPointCenter());
|
||||||
|
|
||||||
for (Cluster in : children)
|
for (Cluster in : children)
|
||||||
insides.add(in.getClusterPosition());
|
insides.add(in.getRectangleArea());
|
||||||
|
|
||||||
final FrontierCalculator frontierCalculator = new FrontierCalculator(getClusterPosition(), insides, points);
|
final FrontierCalculator frontierCalculator = new FrontierCalculator(getRectangleArea(), insides, points,
|
||||||
|
skinParam.getRankdir());
|
||||||
if (getTitleAndAttributeWidth() > 0 && getTitleAndAttributeHeight() > 0)
|
if (getTitleAndAttributeWidth() > 0 && getTitleAndAttributeHeight() > 0)
|
||||||
frontierCalculator.ensureMinWidth(getTitleAndAttributeWidth() + 10);
|
frontierCalculator.ensureMinWidth(getTitleAndAttributeWidth() + 10);
|
||||||
|
|
||||||
this.clusterPosition = frontierCalculator.getSuggestedPosition();
|
this.rectangleArea = frontierCalculator.getSuggestedPosition();
|
||||||
|
|
||||||
final double widthTitle = clusterHeader.getTitle().calculateDimension(stringBounder).getWidth();
|
final double widthTitle = clusterHeader.getTitle().calculateDimension(stringBounder).getWidth();
|
||||||
final double minX = clusterPosition.getMinX();
|
final double minX = rectangleArea.getMinX();
|
||||||
final double minY = clusterPosition.getMinY();
|
final double minY = rectangleArea.getMinY();
|
||||||
this.xyTitle = new XPoint2D(minX + ((clusterPosition.getWidth() - widthTitle) / 2), minY + IEntityImage.MARGIN);
|
this.xyTitle = new XPoint2D(minX + ((rectangleArea.getWidth() - widthTitle) / 2), minY + IEntityImage.MARGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawSwinLinesState(UGraphic ug, HColor borderColor) {
|
private void drawSwinLinesState(UGraphic ug, HColor borderColor) {
|
||||||
clusterHeader.getTitle().drawU(ug.apply(UTranslate.dx(xyTitle.x)));
|
clusterHeader.getTitle().drawU(ug.apply(UTranslate.dx(xyTitle.x)));
|
||||||
|
|
||||||
final ULine line = ULine.vline(clusterPosition.getHeight());
|
final ULine line = ULine.vline(rectangleArea.getHeight());
|
||||||
ug = ug.apply(borderColor);
|
ug = ug.apply(borderColor);
|
||||||
ug.apply(UTranslate.dx(clusterPosition.getMinX())).draw(line);
|
ug.apply(UTranslate.dx(rectangleArea.getMinX())).draw(line);
|
||||||
ug.apply(UTranslate.dx(clusterPosition.getMaxX())).draw(line);
|
ug.apply(UTranslate.dx(rectangleArea.getMaxX())).draw(line);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupPngMakerState
|
// GroupPngMakerState
|
||||||
|
|
||||||
private void drawUState(UGraphic ug, UmlDiagramType umlDiagramType, double rounded, double shadowing) {
|
private void drawUState(UGraphic ug, UmlDiagramType umlDiagramType, double rounded, double shadowing) {
|
||||||
final XDimension2D total = clusterPosition.getDimension();
|
final XDimension2D total = rectangleArea.getDimension();
|
||||||
final double suppY = clusterHeader.getTitle().calculateDimension(ug.getStringBounder()).getHeight()
|
final double suppY = clusterHeader.getTitle().calculateDimension(ug.getStringBounder()).getHeight()
|
||||||
+ IEntityImage.MARGIN;
|
+ IEntityImage.MARGIN;
|
||||||
|
|
||||||
|
@ -438,23 +439,23 @@ public class Cluster implements Moveable {
|
||||||
final RoundedContainer r = new RoundedContainer(total, suppY,
|
final RoundedContainer r = new RoundedContainer(total, suppY,
|
||||||
attributeHeight + (attributeHeight > 0 ? IEntityImage.MARGIN : 0), borderColor, backColor, imgBackcolor,
|
attributeHeight + (attributeHeight > 0 ? IEntityImage.MARGIN : 0), borderColor, backColor, imgBackcolor,
|
||||||
stroke, rounded, shadowing);
|
stroke, rounded, shadowing);
|
||||||
r.drawU(ug.apply(clusterPosition.getPosition()));
|
r.drawU(ug.apply(rectangleArea.getPosition()));
|
||||||
|
|
||||||
clusterHeader.getTitle().drawU(ug.apply(new UTranslate(xyTitle)));
|
clusterHeader.getTitle().drawU(ug.apply(new UTranslate(xyTitle)));
|
||||||
|
|
||||||
if (attributeHeight > 0)
|
if (attributeHeight > 0)
|
||||||
attribute.drawU(ug.apply(new UTranslate(clusterPosition.getMinX() + IEntityImage.MARGIN,
|
attribute.drawU(ug.apply(new UTranslate(rectangleArea.getMinX() + IEntityImage.MARGIN,
|
||||||
clusterPosition.getMinY() + suppY + IEntityImage.MARGIN / 2.0)));
|
rectangleArea.getMinY() + suppY + IEntityImage.MARGIN / 2.0)));
|
||||||
|
|
||||||
final Stereotype stereotype = group.getStereotype();
|
final Stereotype stereotype = group.getStereotype();
|
||||||
final boolean withSymbol = stereotype != null && stereotype.isWithOOSymbol();
|
final boolean withSymbol = stereotype != null && stereotype.isWithOOSymbol();
|
||||||
if (withSymbol)
|
if (withSymbol)
|
||||||
EntityImageState.drawSymbol(ug.apply(borderColor), clusterPosition.getMaxX(), clusterPosition.getMaxY());
|
EntityImageState.drawSymbol(ug.apply(borderColor), rectangleArea.getMaxX(), rectangleArea.getMaxY());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPosition(XPoint2D min, XPoint2D max) {
|
public void setPosition(XPoint2D min, XPoint2D max) {
|
||||||
this.clusterPosition = new ClusterPosition(min, max);
|
this.rectangleArea = new RectangleArea(min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ::comment when CORE
|
// ::comment when CORE
|
||||||
|
@ -641,18 +642,18 @@ public class Cluster implements Moveable {
|
||||||
return backColor;
|
return backColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
double checkFolderPosition(XPoint2D pt, StringBounder stringBounder) {
|
// double checkFolderPosition(XPoint2D pt, StringBounder stringBounder) {
|
||||||
if (getClusterPosition().isPointJustUpper(pt)) {
|
// if (getClusterPosition().isPointJustUpper(pt)) {
|
||||||
|
//
|
||||||
final XDimension2D dimTitle = clusterHeader.getTitle().calculateDimension(stringBounder);
|
// final XDimension2D dimTitle = clusterHeader.getTitle().calculateDimension(stringBounder);
|
||||||
|
//
|
||||||
if (pt.getX() < getClusterPosition().getMinX() + dimTitle.getWidth())
|
// if (pt.getX() < getClusterPosition().getMinX() + dimTitle.getWidth())
|
||||||
return 0;
|
// return 0;
|
||||||
|
//
|
||||||
return getClusterPosition().getMinY() - pt.getY() + dimTitle.getHeight();
|
// return getClusterPosition().getMinY() - pt.getY() + dimTitle.getHeight();
|
||||||
}
|
// }
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public final int getColorNoteTop() {
|
public final int getColorNoteTop() {
|
||||||
return colorNoteTop;
|
return colorNoteTop;
|
||||||
|
|
|
@ -41,7 +41,7 @@ import net.sourceforge.plantuml.klimt.Fashion;
|
||||||
import net.sourceforge.plantuml.klimt.UStroke;
|
import net.sourceforge.plantuml.klimt.UStroke;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.geom.ClusterPosition;
|
import net.sourceforge.plantuml.klimt.geom.RectangleArea;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
|
|
||||||
|
@ -52,14 +52,14 @@ public class ClusterDecoration {
|
||||||
final private TextBlock title;
|
final private TextBlock title;
|
||||||
final private TextBlock stereo;
|
final private TextBlock stereo;
|
||||||
|
|
||||||
final private ClusterPosition clusterPosition;
|
final private RectangleArea rectangleArea;
|
||||||
|
|
||||||
public ClusterDecoration(PackageStyle style, USymbol symbol, TextBlock title, TextBlock stereo,
|
public ClusterDecoration(PackageStyle style, USymbol symbol, TextBlock title, TextBlock stereo,
|
||||||
ClusterPosition clusterPosition, UStroke stroke) {
|
RectangleArea rectangleArea, UStroke stroke) {
|
||||||
this.symbol = guess(symbol, style);
|
this.symbol = guess(symbol, style);
|
||||||
this.stereo = stereo;
|
this.stereo = stereo;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.clusterPosition = clusterPosition;
|
this.rectangleArea = rectangleArea;
|
||||||
this.defaultStroke = stroke;
|
this.defaultStroke = stroke;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ public class ClusterDecoration {
|
||||||
|
|
||||||
final Fashion symbolContext = biColor.withShadow(shadowing).withStroke(defaultStroke).withCorner(roundCorner,
|
final Fashion symbolContext = biColor.withShadow(shadowing).withStroke(defaultStroke).withCorner(roundCorner,
|
||||||
diagonalCorner);
|
diagonalCorner);
|
||||||
symbol.asBig(title, titleAlignment, stereo, clusterPosition.getWidth(), clusterPosition.getHeight(),
|
symbol.asBig(title, titleAlignment, stereo, rectangleArea.getWidth(), rectangleArea.getHeight(),
|
||||||
symbolContext, stereoAlignment).drawU(ug.apply(clusterPosition.getPosition()));
|
symbolContext, stereoAlignment).drawU(ug.apply(rectangleArea.getPosition()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ import net.sourceforge.plantuml.dot.CucaDiagramSimplifierState;
|
||||||
import net.sourceforge.plantuml.dot.DotData;
|
import net.sourceforge.plantuml.dot.DotData;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.log.Logme;
|
import net.sourceforge.plantuml.log.Logme;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
|
|
||||||
|
@ -101,7 +102,7 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker {
|
||||||
if (fileFormatOption.isDebugSvek() && os instanceof NamedOutputStream)
|
if (fileFormatOption.isDebugSvek() && os instanceof NamedOutputStream)
|
||||||
basefile = ((NamedOutputStream) os).getBasefile();
|
basefile = ((NamedOutputStream) os).getBasefile();
|
||||||
|
|
||||||
TextBlockBackcolored result = svek2.buildImage(basefile, diagram.getDotStringSkek());
|
TextBlock result = svek2.buildImage(basefile, diagram.getDotStringSkek());
|
||||||
if (result instanceof GraphvizCrash) {
|
if (result instanceof GraphvizCrash) {
|
||||||
svek2 = createDotDataImageBuilder(DotMode.NO_LEFT_RIGHT_AND_XLABEL, stringBounder);
|
svek2 = createDotDataImageBuilder(DotMode.NO_LEFT_RIGHT_AND_XLABEL, stringBounder);
|
||||||
result = svek2.buildImage(basefile, diagram.getDotStringSkek());
|
result = svek2.buildImage(basefile, diagram.getDotStringSkek());
|
||||||
|
|
|
@ -48,7 +48,7 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
|
|
||||||
public class DecorateEntityImage extends AbstractTextBlock implements TextBlockBackcolored {
|
public class DecorateEntityImage extends AbstractTextBlock {
|
||||||
|
|
||||||
private final TextBlock original;
|
private final TextBlock original;
|
||||||
private final HorizontalAlignment horizontal1;
|
private final HorizontalAlignment horizontal1;
|
||||||
|
@ -134,10 +134,7 @@ public class DecorateEntityImage extends AbstractTextBlock implements TextBlockB
|
||||||
}
|
}
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
public HColor getBackcolor() {
|
||||||
if (original instanceof TextBlockBackcolored)
|
return original.getBackcolor();
|
||||||
return ((TextBlockBackcolored) original).getBackcolor();
|
|
||||||
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
|
|
||||||
public class DecorateEntityImage3 extends AbstractTextBlock implements TextBlockBackcolored {
|
public class DecorateEntityImage3 extends AbstractTextBlock {
|
||||||
|
|
||||||
private final TextBlock original;
|
private final TextBlock original;
|
||||||
private final HColor color;
|
private final HColor color;
|
||||||
|
|
|
@ -448,9 +448,6 @@ public class DotStringFactory implements Moveable {
|
||||||
for (SvekLine line : bibliotekon.allLines())
|
for (SvekLine line : bibliotekon.allLines())
|
||||||
line.manageCollision(bibliotekon.allNodes());
|
line.manageCollision(bibliotekon.allNodes());
|
||||||
|
|
||||||
// corner1.manage(0, 0);
|
|
||||||
// return new ClusterPosition(corner1.getMinX(), corner1.getMinY(), fullWidth, fullHeight);
|
|
||||||
// // return new ClusterPosition(0, 0, fullWidth, fullHeight);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getClusterIndex(final String svg, int colorInt) {
|
private int getClusterIndex(final String svg, int colorInt) {
|
||||||
|
|
|
@ -40,8 +40,10 @@ import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.color.HColor;
|
import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UEmpty;
|
import net.sourceforge.plantuml.klimt.shape.UEmpty;
|
||||||
|
|
||||||
|
@ -87,6 +89,16 @@ public class EntityImageDegenerated implements IEntityImage {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorder() {
|
||||||
|
@Override
|
||||||
|
public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position) {
|
||||||
|
return orig.getMagneticBorder().getForceAt(stringBounder, position.move(delta, delta));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public ShapeType getShapeType() {
|
public ShapeType getShapeType() {
|
||||||
return orig.getShapeType();
|
return orig.getShapeType();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,19 +38,20 @@ package net.sourceforge.plantuml.svek;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.abel.EntityPosition;
|
import net.sourceforge.plantuml.abel.EntityPosition;
|
||||||
import net.sourceforge.plantuml.klimt.geom.ClusterPosition;
|
import net.sourceforge.plantuml.klimt.geom.Rankdir;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.RectangleArea;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
|
|
||||||
public class FrontierCalculator {
|
public class FrontierCalculator {
|
||||||
|
|
||||||
private static final double DELTA = 3 * EntityPosition.RADIUS;
|
private static final double DELTA = 3 * EntityPosition.RADIUS;
|
||||||
private ClusterPosition core;
|
private RectangleArea core;
|
||||||
private final ClusterPosition initial;
|
private final RectangleArea initial;
|
||||||
|
|
||||||
public FrontierCalculator(final ClusterPosition initial, Collection<ClusterPosition> insides,
|
public FrontierCalculator(RectangleArea initial, Collection<RectangleArea> insides, Collection<XPoint2D> points,
|
||||||
Collection<XPoint2D> points) {
|
Rankdir rankdir) {
|
||||||
this.initial = initial;
|
this.initial = initial;
|
||||||
for (ClusterPosition in : insides)
|
for (RectangleArea in : insides)
|
||||||
if (core == null)
|
if (core == null)
|
||||||
core = in;
|
core = in;
|
||||||
else
|
else
|
||||||
|
@ -58,7 +59,7 @@ public class FrontierCalculator {
|
||||||
|
|
||||||
if (core == null) {
|
if (core == null) {
|
||||||
final XPoint2D center = initial.getPointCenter();
|
final XPoint2D center = initial.getPointCenter();
|
||||||
core = new ClusterPosition(center.getX() - 1, center.getY() - 1, center.getX() + 1, center.getY() + 1);
|
core = new RectangleArea(center.getX() - 1, center.getY() - 1, center.getX() + 1, center.getY() + 1);
|
||||||
}
|
}
|
||||||
for (XPoint2D p : points)
|
for (XPoint2D p : points)
|
||||||
core = core.merge(p);
|
core = core.merge(p);
|
||||||
|
@ -116,11 +117,20 @@ public class FrontierCalculator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (XPoint2D p : points) {
|
for (XPoint2D p : points) {
|
||||||
if (p.getY() == core.getMinY() && (p.getX() == core.getMinX() || p.getX() == core.getMaxX()))
|
if (rankdir == Rankdir.LEFT_TO_RIGHT) {
|
||||||
pushMinY = false;
|
if (p.getX() == core.getMinX() && (p.getY() == core.getMinY() || p.getY() == core.getMaxY()))
|
||||||
|
pushMinX = false;
|
||||||
|
|
||||||
if (p.getY() == core.getMaxY() && (p.getX() == core.getMinX() || p.getX() == core.getMaxX()))
|
if (p.getX() == core.getMaxX() && (p.getY() == core.getMinY() || p.getY() == core.getMaxY()))
|
||||||
pushMaxY = false;
|
pushMaxX = false;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (p.getY() == core.getMinY() && (p.getX() == core.getMinX() || p.getX() == core.getMaxX()))
|
||||||
|
pushMinY = false;
|
||||||
|
|
||||||
|
if (p.getY() == core.getMaxY() && (p.getX() == core.getMinX() || p.getX() == core.getMaxX()))
|
||||||
|
pushMaxY = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (pushMaxX)
|
if (pushMaxX)
|
||||||
|
@ -137,7 +147,7 @@ public class FrontierCalculator {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition getSuggestedPosition() {
|
public RectangleArea getSuggestedPosition() {
|
||||||
return core;
|
return core;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,8 @@ import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
||||||
|
@ -372,6 +374,11 @@ public final class GeneralImageBuilder {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorderNone();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duplicate SvekResult / GeneralImageBuilder
|
// Duplicate SvekResult / GeneralImageBuilder
|
||||||
|
|
|
@ -37,8 +37,10 @@ package net.sourceforge.plantuml.svek;
|
||||||
|
|
||||||
import net.sourceforge.plantuml.abel.Hideable;
|
import net.sourceforge.plantuml.abel.Hideable;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
|
|
||||||
public interface IEntityImage extends Hideable, TextBlockBackcolored {
|
public interface IEntityImage extends Hideable, TextBlock {
|
||||||
|
|
||||||
public static final int CORNER = 25;
|
public static final int CORNER = 25;
|
||||||
public static final int MARGIN = 5;
|
public static final int MARGIN = 5;
|
||||||
|
@ -50,4 +52,6 @@ public interface IEntityImage extends Hideable, TextBlockBackcolored {
|
||||||
|
|
||||||
public double getOverscanX(StringBounder stringBounder);
|
public double getOverscanX(StringBounder stringBounder);
|
||||||
|
|
||||||
|
public MagneticBorder getMagneticBorder();
|
||||||
|
|
||||||
}
|
}
|
|
@ -56,7 +56,6 @@ import net.sourceforge.plantuml.decoration.LinkDecor;
|
||||||
import net.sourceforge.plantuml.decoration.LinkMiddleDecor;
|
import net.sourceforge.plantuml.decoration.LinkMiddleDecor;
|
||||||
import net.sourceforge.plantuml.decoration.LinkType;
|
import net.sourceforge.plantuml.decoration.LinkType;
|
||||||
import net.sourceforge.plantuml.decoration.Rainbow;
|
import net.sourceforge.plantuml.decoration.Rainbow;
|
||||||
import net.sourceforge.plantuml.decoration.symbol.USymbolFolder;
|
|
||||||
import net.sourceforge.plantuml.descdiagram.command.StringWithArrow;
|
import net.sourceforge.plantuml.descdiagram.command.StringWithArrow;
|
||||||
import net.sourceforge.plantuml.dot.DotSplines;
|
import net.sourceforge.plantuml.dot.DotSplines;
|
||||||
import net.sourceforge.plantuml.dot.GraphvizVersion;
|
import net.sourceforge.plantuml.dot.GraphvizVersion;
|
||||||
|
@ -74,6 +73,7 @@ import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.BezierUtils;
|
import net.sourceforge.plantuml.klimt.geom.BezierUtils;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.Moveable;
|
import net.sourceforge.plantuml.klimt.geom.Moveable;
|
||||||
import net.sourceforge.plantuml.klimt.geom.PointAndAngle;
|
import net.sourceforge.plantuml.klimt.geom.PointAndAngle;
|
||||||
import net.sourceforge.plantuml.klimt.geom.Positionable;
|
import net.sourceforge.plantuml.klimt.geom.Positionable;
|
||||||
|
@ -139,8 +139,8 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
private Positionable endHeadLabelXY;
|
private Positionable endHeadLabelXY;
|
||||||
private Positionable labelXY;
|
private Positionable labelXY;
|
||||||
|
|
||||||
private UDrawable extremity2;
|
|
||||||
private UDrawable extremity1;
|
private UDrawable extremity1;
|
||||||
|
private UDrawable extremity2;
|
||||||
|
|
||||||
private double dx;
|
private double dx;
|
||||||
private double dy;
|
private double dy;
|
||||||
|
@ -490,7 +490,7 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
return endUid.getPrefix();
|
return endUid.getPrefix();
|
||||||
}
|
}
|
||||||
|
|
||||||
private UDrawable getExtremity(LinkDecor decor, PointListIterator pointListIterator, final XPoint2D center,
|
private UDrawable getExtremity(final XPoint2D center, LinkDecor decor, PointListIterator pointListIterator,
|
||||||
double angle, Cluster cluster, SvekNode nodeContact) {
|
double angle, Cluster cluster, SvekNode nodeContact) {
|
||||||
final ExtremityFactory extremityFactory = decor.getExtremityFactory(backgroundColor);
|
final ExtremityFactory extremityFactory = decor.getExtremityFactory(backgroundColor);
|
||||||
|
|
||||||
|
@ -515,7 +515,7 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
final XPoint2D p2 = points.get(2);
|
final XPoint2D p2 = points.get(2);
|
||||||
Side side = null;
|
Side side = null;
|
||||||
if (nodeContact != null)
|
if (nodeContact != null)
|
||||||
side = nodeContact.getClusterPosition().getClosestSide(p1);
|
side = nodeContact.getRectangleArea().getClosestSide(p1);
|
||||||
|
|
||||||
return extremityFactory.createUDrawable(p0, p1, p2, side);
|
return extremityFactory.createUDrawable(p0, p1, p2, side);
|
||||||
} else if (decor == LinkDecor.NONE) {
|
} else if (decor == LinkDecor.NONE) {
|
||||||
|
@ -570,23 +570,23 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
// if (ltail != null)
|
// if (ltail != null)
|
||||||
// System.err.println("Line::solveLine ltail=" + ltail.getClusterPosition());
|
// System.err.println("Line::solveLine ltail=" + ltail.getClusterPosition());
|
||||||
}
|
}
|
||||||
dotPath = dotPath.simulateCompound(lhead == null ? null : lhead.getClusterPosition(),
|
dotPath = dotPath.simulateCompound(lhead == null ? null : lhead.getRectangleArea(),
|
||||||
ltail == null ? null : ltail.getClusterPosition());
|
ltail == null ? null : ltail.getRectangleArea());
|
||||||
|
|
||||||
final SvgResult lineSvg = fullSvg.substring(end);
|
final SvgResult lineSvg = fullSvg.substring(end);
|
||||||
PointListIterator pointListIterator = lineSvg.getPointsWithThisColor(lineColor);
|
PointListIterator pointListIterator = lineSvg.getPointsWithThisColor(lineColor);
|
||||||
|
|
||||||
final LinkType linkType = link.getType();
|
final LinkType linkType = link.getType();
|
||||||
this.extremity1 = getExtremity(linkType.getDecor2(), pointListIterator, dotPath.getStartPoint(),
|
this.extremity1 = getExtremity(dotPath.getStartPoint(), linkType.getDecor2(), pointListIterator,
|
||||||
dotPath.getStartAngle() + Math.PI, ltail, bibliotekon.getNode(link.getEntity1()));
|
dotPath.getStartAngle() + Math.PI, ltail, getSvekNode1());
|
||||||
this.extremity2 = getExtremity(linkType.getDecor1(), pointListIterator, dotPath.getEndPoint(),
|
this.extremity2 = getExtremity(dotPath.getEndPoint(), linkType.getDecor1(), pointListIterator,
|
||||||
dotPath.getEndAngle(), lhead, bibliotekon.getNode(link.getEntity2()));
|
dotPath.getEndAngle(), lhead, getSvekNode2());
|
||||||
|
|
||||||
if (link.getEntity1().getLeafType() == LeafType.LOLLIPOP_HALF)
|
if (link.getEntity1().getLeafType() == LeafType.LOLLIPOP_HALF)
|
||||||
bibliotekon.getNode(link.getEntity1()).addImpact(dotPath.getStartAngle() + Math.PI);
|
getSvekNode1().addImpact(dotPath.getStartAngle() + Math.PI);
|
||||||
|
|
||||||
if (link.getEntity2().getLeafType() == LeafType.LOLLIPOP_HALF)
|
if (link.getEntity2().getLeafType() == LeafType.LOLLIPOP_HALF)
|
||||||
bibliotekon.getNode(link.getEntity2()).addImpact(dotPath.getEndAngle());
|
getSvekNode2().addImpact(dotPath.getEndAngle());
|
||||||
|
|
||||||
if (extremity1 instanceof Extremity && extremity2 instanceof Extremity) {
|
if (extremity1 instanceof Extremity && extremity2 instanceof Extremity) {
|
||||||
final XPoint2D p1 = ((Extremity) extremity1).somePoint();
|
final XPoint2D p1 = ((Extremity) extremity1).somePoint();
|
||||||
|
@ -599,10 +599,10 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
final double dist2end = p2.distance(dotPath.getEndPoint());
|
final double dist2end = p2.distance(dotPath.getEndPoint());
|
||||||
if (dist1start > dist1end && dist2end > dist2start) {
|
if (dist1start > dist1end && dist2end > dist2start) {
|
||||||
pointListIterator = lineSvg.getPointsWithThisColor(lineColor);
|
pointListIterator = lineSvg.getPointsWithThisColor(lineColor);
|
||||||
this.extremity2 = getExtremity(linkType.getDecor1(), pointListIterator, dotPath.getEndPoint(),
|
this.extremity2 = getExtremity(dotPath.getEndPoint(), linkType.getDecor1(), pointListIterator,
|
||||||
dotPath.getEndAngle(), lhead, bibliotekon.getNode(link.getEntity2()));
|
dotPath.getEndAngle(), lhead, getSvekNode2());
|
||||||
this.extremity1 = getExtremity(linkType.getDecor2(), pointListIterator, dotPath.getStartPoint(),
|
this.extremity1 = getExtremity(dotPath.getStartPoint(), linkType.getDecor2(), pointListIterator,
|
||||||
dotPath.getStartAngle() + Math.PI, ltail, bibliotekon.getNode(link.getEntity1()));
|
dotPath.getStartAngle() + Math.PI, ltail, getSvekNode1());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -639,6 +639,14 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SvekNode getSvekNode2() {
|
||||||
|
return bibliotekon.getNode(link.getEntity2());
|
||||||
|
}
|
||||||
|
|
||||||
|
private SvekNode getSvekNode1() {
|
||||||
|
return bibliotekon.getNode(link.getEntity1());
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isOpalisable() {
|
private boolean isOpalisable() {
|
||||||
return dotPath.getBeziers().size() <= 1;
|
return dotPath.getBeziers().size() <= 1;
|
||||||
}
|
}
|
||||||
|
@ -679,8 +687,8 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
if (link.isAutoLinkOfAGroup()) {
|
if (link.isAutoLinkOfAGroup()) {
|
||||||
final Cluster cl = bibliotekon.getCluster((Entity) link.getEntity1());
|
final Cluster cl = bibliotekon.getCluster((Entity) link.getEntity1());
|
||||||
if (cl != null) {
|
if (cl != null) {
|
||||||
x += cl.getClusterPosition().getWidth();
|
x += cl.getRectangleArea().getWidth();
|
||||||
x -= dotPath.getStartPoint().getX() - cl.getClusterPosition().getMinX();
|
x -= dotPath.getStartPoint().getX() - cl.getRectangleArea().getMinX();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,37 +723,54 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
ug = ug.apply(stroke);
|
ug = ug.apply(stroke);
|
||||||
// double moveEndY = 0;
|
// double moveEndY = 0;
|
||||||
|
|
||||||
DotPath todraw = dotPath;
|
DotPath todraw = dotPath.copy();
|
||||||
if (link.getEntity2().isGroup() && link.getEntity2().getUSymbol() instanceof USymbolFolder) {
|
|
||||||
final Cluster endCluster = bibliotekon.getCluster((Entity) link.getEntity2());
|
UTranslate magneticForce1 = new UTranslate();
|
||||||
if (endCluster != null) {
|
if (getSvekNode1() != null) {
|
||||||
final double deltaFolderH = endCluster.checkFolderPosition(dotPath.getEndPoint(),
|
final MagneticBorder magneticBorder1 = getSvekNode1().getMagneticBorder();
|
||||||
ug.getStringBounder());
|
magneticForce1 = magneticBorder1.getForceAt(ug.getStringBounder(), todraw.getStartPoint());
|
||||||
todraw = dotPath.copy();
|
todraw.moveStartPoint(magneticForce1);
|
||||||
todraw.moveEndPoint(0, deltaFolderH);
|
|
||||||
// moveEndY = deltaFolderH;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extremity1 instanceof Extremity && extremity2 instanceof Extremity) {
|
UTranslate magneticForce2 = new UTranslate();
|
||||||
// http://forum.plantuml.net/9421/arrow-inversion-with-skinparam-linetype-ortho-missing-arrow
|
if (getSvekNode2() != null) {
|
||||||
final XPoint2D p1 = ((Extremity) extremity1)
|
final MagneticBorder magneticBorder2 = getSvekNode2().getMagneticBorder();
|
||||||
.isTooSmallSoGiveThePointCloserToThisOne(todraw.getStartPoint());
|
magneticForce2 = magneticBorder2.getForceAt(ug.getStringBounder(), todraw.getEndPoint());
|
||||||
if (p1 != null)
|
todraw.moveEndPoint(magneticForce2);
|
||||||
todraw.forceStartPoint(p1.getX(), p1.getY());
|
|
||||||
|
|
||||||
final XPoint2D p2 = ((Extremity) extremity2).isTooSmallSoGiveThePointCloserToThisOne(todraw.getEndPoint());
|
|
||||||
if (p2 != null)
|
|
||||||
todraw.forceEndPoint(p2.getX(), p2.getY());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// final MagneticBorder magneticBorder2 = getSvekNode2().getMagneticBorder();
|
||||||
|
|
||||||
|
// if (link.getEntity2().isGroup() && link.getEntity2().getUSymbol() instanceof USymbolFolder) {
|
||||||
|
// final Cluster endCluster = bibliotekon.getCluster((Entity) link.getEntity2());
|
||||||
|
// if (endCluster != null) {
|
||||||
|
// final double deltaFolderH = endCluster.checkFolderPosition(dotPath.getEndPoint(),
|
||||||
|
// ug.getStringBounder());
|
||||||
|
// todraw = dotPath.copy();
|
||||||
|
// todraw.moveEndPoint(0, deltaFolderH);
|
||||||
|
// // moveEndY = deltaFolderH;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (extremity1 instanceof Extremity && extremity2 instanceof Extremity) {
|
||||||
|
// // http://forum.plantuml.net/9421/arrow-inversion-with-skinparam-linetype-ortho-missing-arrow
|
||||||
|
// final XPoint2D p1 = ((Extremity) extremity1)
|
||||||
|
// .isTooSmallSoGiveThePointCloserToThisOne(todraw.getStartPoint());
|
||||||
|
// if (p1 != null)
|
||||||
|
// todraw.forceStartPoint(p1.getX(), p1.getY());
|
||||||
|
//
|
||||||
|
// final XPoint2D p2 = ((Extremity) extremity2).isTooSmallSoGiveThePointCloserToThisOne(todraw.getEndPoint());
|
||||||
|
// if (p2 != null)
|
||||||
|
// todraw.forceEndPoint(p2.getX(), p2.getY());
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
final String comment = link.idCommentForSvg();
|
final String comment = link.idCommentForSvg();
|
||||||
final String tmp = uniq(ids, comment);
|
final String tmp = uniq(ids, comment);
|
||||||
todraw.setCommentAndCodeLine(tmp, link.getCodeLine());
|
todraw.setCommentAndCodeLine(tmp, link.getCodeLine());
|
||||||
|
|
||||||
drawRainbow(ug.apply(new UTranslate(x, y)), color, arrowHeadColor, todraw, link.getSupplementaryColors(),
|
drawRainbow(ug.apply(new UTranslate(x, y)), color, arrowHeadColor, todraw, link.getSupplementaryColors(),
|
||||||
stroke);
|
stroke, magneticForce1, magneticForce2);
|
||||||
|
|
||||||
ug = ug.apply(new UStroke()).apply(color);
|
ug = ug.apply(new UStroke()).apply(color);
|
||||||
|
|
||||||
|
@ -779,7 +804,7 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
final double yConstraint = y + this.labelXY.getPosition().getY();
|
final double yConstraint = y + this.labelXY.getPosition().getY();
|
||||||
// ug.apply(new UTranslate(xConstraint, yConstraint)).draw(new URectangle(10, 10));
|
// ug.apply(new UTranslate(xConstraint, yConstraint)).draw(new URectangle(10, 10));
|
||||||
final List<XPoint2D> square = getSquare(xConstraint, yConstraint);
|
final List<XPoint2D> square = getSquare(xConstraint, yConstraint);
|
||||||
final Set<XPoint2D> bez = dotPath.sample();
|
final Set<XPoint2D> bez = todraw.sample();
|
||||||
XPoint2D minPt = null;
|
XPoint2D minPt = null;
|
||||||
double minDist = Double.MAX_VALUE;
|
double minDist = Double.MAX_VALUE;
|
||||||
for (XPoint2D pt : square)
|
for (XPoint2D pt : square)
|
||||||
|
@ -839,14 +864,14 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawRainbow(UGraphic ug, HColor color, HColor headColor, DotPath todraw,
|
private void drawRainbow(UGraphic ug, HColor color, HColor headColor, DotPath todraw,
|
||||||
List<Colors> supplementaryColors, UStroke stroke) {
|
List<Colors> supplementaryColors, UStroke stroke, UTranslate magneticForce1, UTranslate magneticForce2) {
|
||||||
ug.draw(todraw);
|
ug.draw(todraw);
|
||||||
final LinkType linkType = link.getType();
|
final LinkType linkType = link.getType();
|
||||||
|
|
||||||
if (headColor.isTransparent()) {
|
if (headColor.isTransparent()) {
|
||||||
if (this.extremity1 instanceof ExtremityArrow) {
|
if (this.extremity1 instanceof ExtremityArrow) {
|
||||||
final UGraphic ugHead = ug.apply(color).apply(stroke.onlyThickness());
|
final UGraphic ugHead = ug.apply(color).apply(stroke.onlyThickness());
|
||||||
((ExtremityArrow) this.extremity1).drawLineIfTransparent(ugHead);
|
((ExtremityArrow) this.extremity1).drawLineIfTransparent(ugHead.apply(magneticForce1));
|
||||||
}
|
}
|
||||||
} else if (this.extremity1 != null) {
|
} else if (this.extremity1 != null) {
|
||||||
UGraphic ugHead = ug.apply(headColor).apply(stroke.onlyThickness());
|
UGraphic ugHead = ug.apply(headColor).apply(stroke.onlyThickness());
|
||||||
|
@ -854,13 +879,13 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
ugHead = ugHead.apply(color.bg());
|
ugHead = ugHead.apply(color.bg());
|
||||||
else
|
else
|
||||||
ugHead = ugHead.apply(HColors.none().bg());
|
ugHead = ugHead.apply(HColors.none().bg());
|
||||||
this.extremity1.drawU(ugHead);
|
this.extremity1.drawU(ugHead.apply(magneticForce1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headColor.isTransparent()) {
|
if (headColor.isTransparent()) {
|
||||||
if (this.extremity2 instanceof ExtremityArrow) {
|
if (this.extremity2 instanceof ExtremityArrow) {
|
||||||
final UGraphic ugHead = ug.apply(color).apply(stroke.onlyThickness());
|
final UGraphic ugHead = ug.apply(color).apply(stroke.onlyThickness());
|
||||||
((ExtremityArrow) this.extremity2).drawLineIfTransparent(ugHead);
|
((ExtremityArrow) this.extremity2).drawLineIfTransparent(ugHead.apply(magneticForce2));
|
||||||
}
|
}
|
||||||
} else if (this.extremity2 != null) {
|
} else if (this.extremity2 != null) {
|
||||||
UGraphic ugHead = ug.apply(headColor).apply(stroke.onlyThickness());
|
UGraphic ugHead = ug.apply(headColor).apply(stroke.onlyThickness());
|
||||||
|
@ -868,7 +893,7 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
|
||||||
ugHead = ugHead.apply(color.bg());
|
ugHead = ugHead.apply(color.bg());
|
||||||
else
|
else
|
||||||
ugHead = ugHead.apply(HColors.none().bg());
|
ugHead = ugHead.apply(HColors.none().bg());
|
||||||
this.extremity2.drawU(ugHead);
|
this.extremity2.drawU(ugHead.apply(magneticForce2));
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
|
@ -43,14 +43,15 @@ import net.sourceforge.plantuml.abel.EntityPosition;
|
||||||
import net.sourceforge.plantuml.abel.Hideable;
|
import net.sourceforge.plantuml.abel.Hideable;
|
||||||
import net.sourceforge.plantuml.abel.Together;
|
import net.sourceforge.plantuml.abel.Together;
|
||||||
import net.sourceforge.plantuml.klimt.Shadowable;
|
import net.sourceforge.plantuml.klimt.Shadowable;
|
||||||
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.ClusterPosition;
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.Positionable;
|
import net.sourceforge.plantuml.klimt.geom.Positionable;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.RectangleArea;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UPolygon;
|
import net.sourceforge.plantuml.klimt.shape.UPolygon;
|
||||||
import net.sourceforge.plantuml.svek.image.EntityImageDescription;
|
|
||||||
import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterface;
|
import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterface;
|
||||||
import net.sourceforge.plantuml.svek.image.EntityImagePort;
|
import net.sourceforge.plantuml.svek.image.EntityImagePort;
|
||||||
import net.sourceforge.plantuml.svek.image.EntityImageStateBorder;
|
import net.sourceforge.plantuml.svek.image.EntityImageStateBorder;
|
||||||
|
@ -369,8 +370,8 @@ public class SvekNode implements Positionable, Hideable {
|
||||||
return getDimImage();
|
return getDimImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClusterPosition getClusterPosition() {
|
public RectangleArea getRectangleArea() {
|
||||||
return new ClusterPosition(minX, minY, minX + getWidth(), minY + getHeight());
|
return new RectangleArea(minX, minY, minX + getWidth(), minY + getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isShielded() {
|
public boolean isShielded() {
|
||||||
|
@ -400,21 +401,6 @@ public class SvekNode implements Positionable, Hideable {
|
||||||
return new XPoint2D(minX + x, minY + y);
|
return new XPoint2D(minX + x, minY + y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XPoint2D projection(XPoint2D pt, StringBounder stringBounder) {
|
|
||||||
if (getType() != ShapeType.FOLDER)
|
|
||||||
return pt;
|
|
||||||
|
|
||||||
final ClusterPosition clusterPosition = new ClusterPosition(minX, minY, minX + getWidth(), minY + getHeight());
|
|
||||||
if (clusterPosition.isPointJustUpper(pt)) {
|
|
||||||
final XDimension2D dimName = ((EntityImageDescription) image).getNameDimension(stringBounder);
|
|
||||||
if (pt.getX() < minX + dimName.getWidth())
|
|
||||||
return pt;
|
|
||||||
|
|
||||||
return new XPoint2D(pt.getX(), pt.getY() + dimName.getHeight() + 4);
|
|
||||||
}
|
|
||||||
return pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getOverscanX(StringBounder stringBounder) {
|
public double getOverscanX(StringBounder stringBounder) {
|
||||||
return image.getOverscanX(stringBounder);
|
return image.getOverscanX(stringBounder);
|
||||||
}
|
}
|
||||||
|
@ -427,10 +413,10 @@ public class SvekNode implements Positionable, Hideable {
|
||||||
if (leaf instanceof Entity == false)
|
if (leaf instanceof Entity == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drawList(ug, ((Entity) leaf).getKals(Direction.DOWN));
|
drawList(ug, leaf.getKals(Direction.DOWN));
|
||||||
drawList(ug, ((Entity) leaf).getKals(Direction.UP));
|
drawList(ug, leaf.getKals(Direction.UP));
|
||||||
drawList(ug, ((Entity) leaf).getKals(Direction.LEFT));
|
drawList(ug, leaf.getKals(Direction.LEFT));
|
||||||
drawList(ug, ((Entity) leaf).getKals(Direction.RIGHT));
|
drawList(ug, leaf.getKals(Direction.RIGHT));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,8 +424,8 @@ public class SvekNode implements Positionable, Hideable {
|
||||||
if (leaf instanceof Entity == false)
|
if (leaf instanceof Entity == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fixHoverlap(((Entity) leaf).getKals(Direction.DOWN));
|
fixHoverlap(leaf.getKals(Direction.DOWN));
|
||||||
fixHoverlap(((Entity) leaf).getKals(Direction.UP));
|
fixHoverlap(leaf.getKals(Direction.UP));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fixHoverlap(final List<Kal> list) {
|
private void fixHoverlap(final List<Kal> list) {
|
||||||
|
@ -459,4 +445,46 @@ public class SvekNode implements Positionable, Hideable {
|
||||||
for (Kal kal : list)
|
for (Kal kal : list)
|
||||||
kal.drawU(ug);
|
kal.drawU(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public XPoint2D projection(XPoint2D pt, StringBounder stringBounder) {
|
||||||
|
// if (getType() != ShapeType.FOLDER)
|
||||||
|
// return pt;
|
||||||
|
//
|
||||||
|
//// final ClusterPosition clusterPosition = new ClusterPosition(minX, minY, minX + getWidth(), minY + getHeight());
|
||||||
|
//// if (clusterPosition.isPointJustUpper(pt)) {
|
||||||
|
//// final XDimension2D dimName = ((EntityImageDescription) image).getNameDimension(stringBounder);
|
||||||
|
//// if (pt.getX() < minX + dimName.getWidth())
|
||||||
|
//// return pt;
|
||||||
|
////
|
||||||
|
//// return new XPoint2D(pt.getX(), pt.getY() + dimName.getHeight() + 4);
|
||||||
|
//// }
|
||||||
|
// return pt;
|
||||||
|
//}
|
||||||
|
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
return new MagneticBorder() {
|
||||||
|
public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position) {
|
||||||
|
final MagneticBorder orig = image.getMagneticBorder();
|
||||||
|
return orig.getForceAt(stringBounder, position.move(-minX, -minY));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// return image.getMagneticBorder();
|
||||||
|
// if (getType() != ShapeType.FOLDER)
|
||||||
|
// return new MagneticBorderNone();
|
||||||
|
//
|
||||||
|
// return new MagneticBorder() {
|
||||||
|
// @Override
|
||||||
|
// public UTranslate getForceAt(XPoint2D pt) {
|
||||||
|
// if ((pt.getX() >= minX && pt.getX() <= minX + getWidth() && pt.getY() <= minY)) {
|
||||||
|
// final XDimension2D dimName = ((EntityImageDescription) image).getNameDimension(stringBounder);
|
||||||
|
// if (pt.getX() < minX + dimName.getWidth())
|
||||||
|
// return new UTranslate();
|
||||||
|
//
|
||||||
|
// return new UTranslate(0, dimName.getHeight() + 4);
|
||||||
|
// }
|
||||||
|
// return new UTranslate();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,10 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphicStencil;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorder;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.MagneticBorderNone;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
|
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UComment;
|
import net.sourceforge.plantuml.klimt.shape.UComment;
|
||||||
|
@ -325,4 +328,26 @@ public class EntityImageDescription extends AbstractEntityImage {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MagneticBorder getMagneticBorder() {
|
||||||
|
if (shapeType == ShapeType.FOLDER)
|
||||||
|
return asSmall.getMagneticBorder();
|
||||||
|
// return new MagneticBorder() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public UTranslate getForceAt(StringBounder stringBounder, XPoint2D pt) {
|
||||||
|
// if ((pt.getX() >= 0 && pt.getX() <= 0 + calculateDimension(stringBounder).getWidth()
|
||||||
|
// && pt.getY() <= 0)) {
|
||||||
|
// final XDimension2D dimName = getNameDimension(stringBounder);
|
||||||
|
// if (pt.getX() < 0 + dimName.getWidth())
|
||||||
|
// return new UTranslate();
|
||||||
|
//
|
||||||
|
// return new UTranslate(0, dimName.getHeight() + 4);
|
||||||
|
// }
|
||||||
|
// return new UTranslate();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
return new MagneticBorderNone();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
|
||||||
import net.sourceforge.plantuml.klimt.font.FontParam;
|
import net.sourceforge.plantuml.klimt.font.FontParam;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.ClusterPosition;
|
import net.sourceforge.plantuml.klimt.geom.RectangleArea;
|
||||||
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
|
@ -149,9 +149,9 @@ public class EntityImageEmptyPackage extends AbstractEntityImage {
|
||||||
final double widthTotal = dimTotal.getWidth();
|
final double widthTotal = dimTotal.getWidth();
|
||||||
final double heightTotal = dimTotal.getHeight();
|
final double heightTotal = dimTotal.getHeight();
|
||||||
|
|
||||||
final ClusterPosition clusterPosition = new ClusterPosition(0, 0, widthTotal, heightTotal);
|
final RectangleArea rectangleArea = new RectangleArea(0, 0, widthTotal, heightTotal);
|
||||||
final ClusterDecoration decoration = new ClusterDecoration(getSkinParam().packageStyle(), null, desc,
|
final ClusterDecoration decoration = new ClusterDecoration(getSkinParam().packageStyle(), null, desc,
|
||||||
stereoBlock, clusterPosition, stroke);
|
stereoBlock, rectangleArea, stroke);
|
||||||
|
|
||||||
final HorizontalAlignment horizontalAlignment = getSkinParam()
|
final HorizontalAlignment horizontalAlignment = getSkinParam()
|
||||||
.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null);
|
.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null);
|
||||||
|
|
|
@ -206,26 +206,25 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
|
||||||
} else {
|
} else {
|
||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
DotPath path = opaleLine.getDotPath();
|
DotPath path = opaleLine.getDotPath();
|
||||||
|
|
||||||
|
final UTranslate force1 = getMagneticBorder().getForceAt(stringBounder, path.getStartPoint());
|
||||||
|
final UTranslate force2 = other.getMagneticBorder().getForceAt(stringBounder, path.getEndPoint());
|
||||||
|
|
||||||
path.moveSvek(-node.getMinX(), -node.getMinY());
|
path.moveSvek(-node.getMinX(), -node.getMinY());
|
||||||
XPoint2D p1 = path.getStartPoint();
|
|
||||||
XPoint2D p2 = path.getEndPoint();
|
|
||||||
final double textWidth = getTextWidth(stringBounder);
|
final double textWidth = getTextWidth(stringBounder);
|
||||||
final double textHeight = getTextHeight(stringBounder);
|
final double textHeight = getTextHeight(stringBounder);
|
||||||
final XPoint2D center = new XPoint2D(textWidth / 2, textHeight / 2);
|
final XPoint2D center = new XPoint2D(textWidth / 2, textHeight / 2);
|
||||||
if (p1.distance(center) > p2.distance(center)) {
|
if (path.getStartPoint().distance(center) > path.getEndPoint().distance(center))
|
||||||
path = path.reverse();
|
path = path.reverse();
|
||||||
p1 = path.getStartPoint();
|
|
||||||
// p2 = path.getEndPoint();
|
final Direction strategy = getOpaleStrategy(textWidth, textHeight, path.getStartPoint());
|
||||||
}
|
final XPoint2D pp1 = force1.getTranslated(path.getStartPoint());
|
||||||
final Direction strategy = getOpaleStrategy(textWidth, textHeight, p1);
|
final XPoint2D pp2 = force2.getTranslated(path.getEndPoint());
|
||||||
final XPoint2D pp1 = path.getStartPoint();
|
|
||||||
final XPoint2D pp2 = path.getEndPoint();
|
|
||||||
final XPoint2D newRefpp2 = move(pp2, node.getMinX(), node.getMinY());
|
|
||||||
final XPoint2D projection = move(other.projection(newRefpp2, stringBounder), -node.getMinX(),
|
|
||||||
-node.getMinY());
|
|
||||||
final Opale opale = new Opale(shadowing, borderColor, noteBackgroundColor, textBlock, true, getStroke());
|
final Opale opale = new Opale(shadowing, borderColor, noteBackgroundColor, textBlock, true, getStroke());
|
||||||
opale.setRoundCorner(getRoundCorner());
|
opale.setRoundCorner(getRoundCorner());
|
||||||
opale.setOpale(strategy, pp1, projection);
|
opale.setOpale(strategy, pp1, pp2);
|
||||||
final UGraphic stroked = applyStroke(ug2);
|
final UGraphic stroked = applyStroke(ug2);
|
||||||
opale.drawU(Colors.applyStroke(stroked, getEntity().getColors()));
|
opale.drawU(Colors.applyStroke(stroked, getEntity().getColors()));
|
||||||
}
|
}
|
||||||
|
@ -239,10 +238,6 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
|
||||||
return skinParam.getRoundCorner(CornerParam.DEFAULT, null);
|
return skinParam.getRoundCorner(CornerParam.DEFAULT, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static XPoint2D move(XPoint2D pt, double dx, double dy) {
|
|
||||||
return new XPoint2D(pt.getX() + dx, pt.getY() + dy);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawNormal(UGraphic ug) {
|
private void drawNormal(UGraphic ug) {
|
||||||
final StringBounder stringBounder = ug.getStringBounder();
|
final StringBounder stringBounder = ug.getStringBounder();
|
||||||
final UPath polygon = Opale.getPolygonNormal(getTextWidth(stringBounder), getTextHeight(stringBounder),
|
final UPath polygon = Opale.getPolygonNormal(getTextWidth(stringBounder), getTextHeight(stringBounder),
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class EntityImagePort extends AbstractEntityImageBorder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean upPosition() {
|
private boolean upPosition() {
|
||||||
final XPoint2D clusterCenter = parent.getClusterPosition().getPointCenter();
|
final XPoint2D clusterCenter = parent.getRectangleArea().getPointCenter();
|
||||||
final SvekNode node = bibliotekon.getNode(getEntity());
|
final SvekNode node = bibliotekon.getNode(getEntity());
|
||||||
return node.getMinY() < clusterCenter.getY();
|
return node.getMinY() < clusterCenter.getY();
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class EntityImageStateBorder extends AbstractEntityImageBorder {
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
final XPoint2D clusterCenter = parent.getClusterPosition().getPointCenter();
|
final XPoint2D clusterCenter = parent.getRectangleArea().getPointCenter();
|
||||||
final SvekNode node = bibliotekon.getNode(getEntity());
|
final SvekNode node = bibliotekon.getNode(getEntity());
|
||||||
return node.getMinY() < clusterCenter.getY();
|
return node.getMinY() < clusterCenter.getY();
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,10 +69,10 @@ import javax.swing.WindowConstants;
|
||||||
import net.atmp.ImageBuilder;
|
import net.atmp.ImageBuilder;
|
||||||
import net.sourceforge.plantuml.GeneratedImage;
|
import net.sourceforge.plantuml.GeneratedImage;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.log.Logme;
|
import net.sourceforge.plantuml.log.Logme;
|
||||||
import net.sourceforge.plantuml.security.SFile;
|
import net.sourceforge.plantuml.security.SFile;
|
||||||
import net.sourceforge.plantuml.security.SImageIO;
|
import net.sourceforge.plantuml.security.SImageIO;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.version.PSystemVersion;
|
import net.sourceforge.plantuml.version.PSystemVersion;
|
||||||
|
|
||||||
class ImageWindow extends JFrame {
|
class ImageWindow extends JFrame {
|
||||||
|
@ -334,7 +334,7 @@ class ImageWindow extends JFrame {
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
final String msg = "Error reading file: " + ex.toString();
|
final String msg = "Error reading file: " + ex.toString();
|
||||||
final TextBlockBackcolored error = GraphicStrings.createForError(Arrays.asList(msg), false);
|
final TextBlock error = GraphicStrings.createForError(Arrays.asList(msg), false);
|
||||||
try {
|
try {
|
||||||
final byte[] bytes = ImageBuilder.plainPngBuilder(error).writeByteArray();
|
final byte[] bytes = ImageBuilder.plainPngBuilder(error).writeByteArray();
|
||||||
image = SImageIO.read(bytes);
|
image = SImageIO.read(bytes);
|
||||||
|
|
|
@ -45,7 +45,6 @@ import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||||
|
@ -59,9 +58,8 @@ import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.creole.Display;
|
import net.sourceforge.plantuml.klimt.creole.Display;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.ULine;
|
import net.sourceforge.plantuml.klimt.shape.ULine;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
|
@ -70,7 +68,6 @@ import net.sourceforge.plantuml.style.PName;
|
||||||
import net.sourceforge.plantuml.style.SName;
|
import net.sourceforge.plantuml.style.SName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.timingdiagram.graphic.IntricatedPoint;
|
import net.sourceforge.plantuml.timingdiagram.graphic.IntricatedPoint;
|
||||||
import net.sourceforge.plantuml.timingdiagram.graphic.TimeArrow;
|
import net.sourceforge.plantuml.timingdiagram.graphic.TimeArrow;
|
||||||
|
|
||||||
|
@ -106,30 +103,19 @@ public class TimingDiagram extends UmlDiagram implements Clocks {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawInternal(ug);
|
drawInternal(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
final double withBeforeRuler = getPart1MaxWidth(stringBounder);
|
final double withBeforeRuler = getPart1MaxWidth(stringBounder);
|
||||||
final double totalWith = withBeforeRuler + ruler.getWidth() + marginX1 + marginX2;
|
final double totalWith = withBeforeRuler + ruler.getWidth() + marginX1 + marginX2;
|
||||||
return new XDimension2D(totalWith, getHeightTotal(stringBounder));
|
return new XDimension2D(totalWith, getHeightTotal(stringBounder));
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,9 @@ import net.sourceforge.plantuml.klimt.AffineTransformType;
|
||||||
import net.sourceforge.plantuml.klimt.UTranslate;
|
import net.sourceforge.plantuml.klimt.UTranslate;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
import net.sourceforge.plantuml.klimt.shape.GraphicStrings;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
import net.sourceforge.plantuml.klimt.shape.UDrawable;
|
||||||
import net.sourceforge.plantuml.klimt.shape.UImage;
|
import net.sourceforge.plantuml.klimt.shape.UImage;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class PSystemLicense extends PlainDiagram implements UDrawable {
|
public class PSystemLicense extends PlainDiagram implements UDrawable {
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ public class PSystemLicense extends PlainDiagram implements UDrawable {
|
||||||
super(source);
|
super(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextBlockBackcolored getGraphicStrings(List<String> strings) {
|
private TextBlock getGraphicStrings(List<String> strings) {
|
||||||
return GraphicStrings.createBlackOnWhite(strings);
|
return GraphicStrings.createBlackOnWhite(strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,20 +98,20 @@ public class PSystemLicense extends PlainDiagram implements UDrawable {
|
||||||
strings1.addAll(License.getCurrent().getText1(licenseInfo));
|
strings1.addAll(License.getCurrent().getText1(licenseInfo));
|
||||||
strings2.addAll(License.getCurrent().getText2(licenseInfo));
|
strings2.addAll(License.getCurrent().getText2(licenseInfo));
|
||||||
|
|
||||||
final TextBlockBackcolored result1 = getGraphicStrings(strings1);
|
final TextBlock result1 = getGraphicStrings(strings1);
|
||||||
result1.drawU(ug);
|
result1.drawU(ug);
|
||||||
ug = ug.apply(UTranslate.dy(4 + result1.calculateDimension(ug.getStringBounder()).getHeight()));
|
ug = ug.apply(UTranslate.dy(4 + result1.calculateDimension(ug.getStringBounder()).getHeight()));
|
||||||
UImage im = new UImage(new PixelImage(logo, AffineTransformType.TYPE_BILINEAR));
|
UImage im = new UImage(new PixelImage(logo, AffineTransformType.TYPE_BILINEAR));
|
||||||
ug.apply(UTranslate.dx(20)).draw(im);
|
ug.apply(UTranslate.dx(20)).draw(im);
|
||||||
|
|
||||||
ug = ug.apply(UTranslate.dy(im.getHeight()));
|
ug = ug.apply(UTranslate.dy(im.getHeight()));
|
||||||
final TextBlockBackcolored result2 = getGraphicStrings(strings2);
|
final TextBlock result2 = getGraphicStrings(strings2);
|
||||||
result2.drawU(ug);
|
result2.drawU(ug);
|
||||||
}
|
}
|
||||||
// ::done
|
// ::done
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TextBlockBackcolored getTextBlock(final LicenseInfo licenseInfo) {
|
protected TextBlock getTextBlock(final LicenseInfo licenseInfo) {
|
||||||
final List<String> strings = new ArrayList<>();
|
final List<String> strings = new ArrayList<>();
|
||||||
strings.addAll(License.getCurrent().getText1(licenseInfo));
|
strings.addAll(License.getCurrent().getText1(licenseInfo));
|
||||||
strings.addAll(License.getCurrent().getText2(licenseInfo));
|
strings.addAll(License.getCurrent().getText2(licenseInfo));
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class Version {
|
||||||
private static final int MAJOR_SEPARATOR = 1000000;
|
private static final int MAJOR_SEPARATOR = 1000000;
|
||||||
|
|
||||||
public static int version() {
|
public static int version() {
|
||||||
return 1202301;
|
return 1202302;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int versionPatched() {
|
public static int versionPatched() {
|
||||||
|
@ -81,7 +81,7 @@ public class Version {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int beta() {
|
public static int beta() {
|
||||||
final int beta = 7;
|
final int beta = 0;
|
||||||
return beta;
|
return beta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public class Version {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long compileTime() {
|
public static long compileTime() {
|
||||||
return 1674997136325L;
|
return 1677403547300L;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String compileTimeString() {
|
public static String compileTimeString() {
|
||||||
|
|
|
@ -42,7 +42,6 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||||
|
@ -57,9 +56,9 @@ import net.sourceforge.plantuml.klimt.creole.Display;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.AbstractCommonUGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.AbstractCommonUGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.mindmap.IdeaShape;
|
import net.sourceforge.plantuml.mindmap.IdeaShape;
|
||||||
import net.sourceforge.plantuml.regex.Matcher2;
|
import net.sourceforge.plantuml.regex.Matcher2;
|
||||||
import net.sourceforge.plantuml.regex.MyPattern;
|
import net.sourceforge.plantuml.regex.MyPattern;
|
||||||
|
@ -71,7 +70,6 @@ import net.sourceforge.plantuml.style.PName;
|
||||||
import net.sourceforge.plantuml.style.SName;
|
import net.sourceforge.plantuml.style.SName;
|
||||||
import net.sourceforge.plantuml.style.Style;
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
import net.sourceforge.plantuml.utils.Direction;
|
import net.sourceforge.plantuml.utils.Direction;
|
||||||
|
|
||||||
public class WBSDiagram extends UmlDiagram {
|
public class WBSDiagram extends UmlDiagram {
|
||||||
|
@ -98,28 +96,15 @@ public class WBSDiagram extends UmlDiagram {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlockBackcolored getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawMe(ug);
|
drawMe(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
return getDrawingElement().calculateDimension(stringBounder);
|
return getDrawingElement().calculateDimension(stringBounder);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.atmp.InnerStrategy;
|
|
||||||
import net.sourceforge.plantuml.FileFormat;
|
import net.sourceforge.plantuml.FileFormat;
|
||||||
import net.sourceforge.plantuml.FileFormatOption;
|
import net.sourceforge.plantuml.FileFormatOption;
|
||||||
import net.sourceforge.plantuml.UmlDiagram;
|
import net.sourceforge.plantuml.UmlDiagram;
|
||||||
|
@ -53,12 +52,10 @@ import net.sourceforge.plantuml.klimt.color.HColor;
|
||||||
import net.sourceforge.plantuml.klimt.creole.Display;
|
import net.sourceforge.plantuml.klimt.creole.Display;
|
||||||
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
|
||||||
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
import net.sourceforge.plantuml.klimt.font.StringBounder;
|
||||||
import net.sourceforge.plantuml.klimt.geom.MinMax;
|
|
||||||
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
|
||||||
import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
|
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
|
||||||
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
|
|
||||||
|
|
||||||
public class WireDiagram extends UmlDiagram {
|
public class WireDiagram extends UmlDiagram {
|
||||||
|
|
||||||
|
@ -84,29 +81,18 @@ public class WireDiagram extends UmlDiagram {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TextBlock getTextBlock() {
|
protected TextBlock getTextBlock() {
|
||||||
return new TextBlockBackcolored() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
drawMe(ug);
|
drawMe(ug);
|
||||||
}
|
}
|
||||||
|
|
||||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||||
// return getDrawingElement().calculateDimension(stringBounder);
|
// return getDrawingElement().calculateDimension(stringBounder);
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax getMinMax(StringBounder stringBounder) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public HColor getBackcolor() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue