mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-22 04:55:10 +00:00
wip refactoring
This commit is contained in:
parent
b0dbb29e2a
commit
9ab898fe1b
@ -35,10 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
|
||||
import java.awt.geom.Rectangle2D;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XRectangle2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.cucadiagram.DisplayPositioned;
|
||||
import net.sourceforge.plantuml.cucadiagram.DisplaySection;
|
||||
@ -110,7 +109,7 @@ public class AnnotatedWorker {
|
||||
final MinMax originalMinMax = TextBlockUtils.getMinMax(original, stringBounder, false);
|
||||
|
||||
final TextBlock title = mainFrame.create(fontConfiguration, HorizontalAlignment.CENTER, getSkinParam());
|
||||
final Dimension2D dimTitle = title.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTitle = title.calculateDimension(stringBounder);
|
||||
|
||||
final double width = x1 + Math.max(originalMinMax.getWidth(), dimTitle.getWidth()) + x2;
|
||||
final double height = dimTitle.getHeight() + y1 + originalMinMax.getHeight() + y2;
|
||||
@ -129,13 +128,13 @@ public class AnnotatedWorker {
|
||||
return TextBlockUtils.getMinMax(this, stringBounder, false);
|
||||
}
|
||||
|
||||
public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
||||
final Rectangle2D rect = original.getInnerPosition(member, stringBounder, strategy);
|
||||
return new Rectangle2D.Double(rect.getX() + x1, rect.getY() + y1 + dimTitle.getHeight(),
|
||||
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
|
||||
final XRectangle2D rect = original.getInnerPosition(member, stringBounder, strategy);
|
||||
return new XRectangle2D(rect.getX() + x1, rect.getY() + y1 + dimTitle.getHeight(),
|
||||
rect.getWidth(), rect.getHeight());
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return original.calculateDimension(stringBounder);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
|
||||
public enum Direction {
|
||||
RIGHT, LEFT, DOWN, UP;
|
||||
@ -89,7 +89,7 @@ public enum Direction {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
public static Direction leftOrRight(Point2D p1, Point2D p2) {
|
||||
public static Direction leftOrRight(XPoint2D p1, XPoint2D p2) {
|
||||
if (p1.getX() < p2.getX()) {
|
||||
return Direction.LEFT;
|
||||
}
|
||||
@ -99,7 +99,7 @@ public enum Direction {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public static Direction fromVector(Point2D p1, Point2D p2) {
|
||||
public static Direction fromVector(XPoint2D p1, XPoint2D p2) {
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
final double x2 = p2.getX();
|
||||
|
@ -41,7 +41,7 @@ import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.core.Diagram;
|
||||
import net.sourceforge.plantuml.creole.atom.Atom;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
@ -77,16 +77,16 @@ class EmbeddedDiagramDraw extends AbstractTextBlock implements Line, Atom {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
try {
|
||||
final BufferedImage im = getImage();
|
||||
return new Dimension2DDouble(im.getWidth(), im.getHeight());
|
||||
return new XDimension2D(im.getWidth(), im.getHeight());
|
||||
} catch (IOException e) {
|
||||
Logme.error(e);
|
||||
} catch (InterruptedException e) {
|
||||
Logme.error(e);
|
||||
}
|
||||
return new Dimension2DDouble(42, 42);
|
||||
return new XDimension2D(42, 42);
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
|
@ -43,7 +43,7 @@ import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.braille.BrailleCharFactory;
|
||||
import net.sourceforge.plantuml.braille.UGraphicBraille;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -157,7 +157,7 @@ public enum FileFormat {
|
||||
return "FileFormat::getSvgStringBounder";
|
||||
}
|
||||
|
||||
protected Dimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
protected XDimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
text = charSizeHack.transformStringForSizeHack(text);
|
||||
return getJavaDimension(font, text);
|
||||
}
|
||||
@ -172,18 +172,18 @@ public enum FileFormat {
|
||||
return "FileFormat::getNormalStringBounder";
|
||||
}
|
||||
|
||||
protected Dimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
protected XDimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
return getJavaDimension(font, text);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
static private Dimension2DDouble getJavaDimension(UFont font, String text) {
|
||||
static private XDimension2D getJavaDimension(UFont font, String text) {
|
||||
final Font javaFont = font.getUnderlayingFont();
|
||||
final FontMetrics fm = gg.getFontMetrics(javaFont);
|
||||
final Rectangle2D rect = fm.getStringBounds(text, gg);
|
||||
return new Dimension2DDouble(rect.getWidth(), rect.getHeight());
|
||||
return new XDimension2D(rect.getWidth(), rect.getHeight());
|
||||
}
|
||||
|
||||
private StringBounder getBrailleStringBounder() {
|
||||
@ -193,12 +193,12 @@ public enum FileFormat {
|
||||
return "FileFormat::getBrailleStringBounder";
|
||||
}
|
||||
|
||||
protected Dimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
protected XDimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
final int nb = BrailleCharFactory.build(text).size();
|
||||
final double quanta = UGraphicBraille.QUANTA;
|
||||
final double height = 5 * quanta;
|
||||
final double width = 3 * nb * quanta + 1;
|
||||
return new Dimension2DDouble(width, height);
|
||||
return new XDimension2D(width, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -215,11 +215,11 @@ public enum FileFormat {
|
||||
return "FileFormat::getTikzStringBounder";
|
||||
}
|
||||
|
||||
protected Dimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
protected XDimension2D calculateDimensionInternal(UFont font, String text) {
|
||||
text = text.replace("\t", " ");
|
||||
final Dimension2DDouble w1 = getJavaDimension(font.goTikz(-1), text);
|
||||
final Dimension2DDouble w2 = getJavaDimension(font.goTikz(0), text);
|
||||
final Dimension2DDouble w3 = getJavaDimension(font.goTikz(1), text);
|
||||
final XDimension2D w1 = getJavaDimension(font.goTikz(-1), text);
|
||||
final XDimension2D w2 = getJavaDimension(font.goTikz(0), text);
|
||||
final XDimension2D w3 = getJavaDimension(font.goTikz(1), text);
|
||||
final double factor = (w3.getWidth() - w1.getWidth()) / w2.getWidth();
|
||||
final double distortion = tikzFontDistortion.getDistortion();
|
||||
final double magnify = tikzFontDistortion.getMagnify();
|
||||
|
@ -47,8 +47,6 @@ import net.sourceforge.plantuml.security.SecurityUtils;
|
||||
|
||||
public class OptionFlags {
|
||||
|
||||
static public final boolean USE_KERMOR = false;
|
||||
|
||||
private static final OptionFlags singleton = new OptionFlags();
|
||||
|
||||
// static public final boolean PBBACK = false;
|
||||
|
@ -70,14 +70,20 @@ public class Pragma {
|
||||
return isDefine("usenewpackage");
|
||||
}
|
||||
|
||||
private boolean isTrue(final String s) {
|
||||
return "true".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s);
|
||||
}
|
||||
|
||||
public boolean useVerticalIf() {
|
||||
final String teoz = getValue("useverticalif");
|
||||
return "true".equalsIgnoreCase(teoz) || "on".equalsIgnoreCase(teoz);
|
||||
return isTrue(getValue("useverticalif"));
|
||||
}
|
||||
|
||||
public boolean useTeozLayout() {
|
||||
final String teoz = getValue("teoz");
|
||||
return "true".equalsIgnoreCase(teoz) || "on".equalsIgnoreCase(teoz);
|
||||
return isTrue(getValue("teoz"));
|
||||
}
|
||||
|
||||
public boolean useKermor() {
|
||||
return isTrue(getValue("kermor"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.api.ImageDataSimple;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.core.Diagram;
|
||||
import net.sourceforge.plantuml.error.PSystemError;
|
||||
import net.sourceforge.plantuml.log.Logme;
|
||||
@ -175,7 +176,7 @@ public abstract class SourceFileReaderAbstract implements ISourceFileReader {
|
||||
if (noerror && system instanceof PSystemError) {
|
||||
exportDiagrams = new ArrayList<FileImageData>();
|
||||
exportDiagrams.add(
|
||||
new FileImageData(null, new ImageDataSimple(new Dimension2DDouble(0, 0), FileImageData.ERROR)));
|
||||
new FileImageData(null, new ImageDataSimple(new XDimension2D(0, 0), FileImageData.ERROR)));
|
||||
} else
|
||||
exportDiagrams = PSystemUtils.exportDiagrams(system, suggested, fileFormatOption, checkMetadata);
|
||||
|
||||
|
@ -52,7 +52,7 @@ import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.api.ImageDataSimple;
|
||||
import net.sourceforge.plantuml.api.ThemeStyle;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.command.CommandExecutionResult;
|
||||
import net.sourceforge.plantuml.core.Diagram;
|
||||
import net.sourceforge.plantuml.core.ImageData;
|
||||
@ -133,7 +133,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
|
||||
|
||||
try {
|
||||
final ImageData imageData = exportDiagramInternal(os, index, fileFormatOption);
|
||||
this.lastInfo = new Dimension2DDouble(imageData.getWidth(), imageData.getHeight());
|
||||
this.lastInfo = new XDimension2D(imageData.getWidth(), imageData.getHeight());
|
||||
return imageData;
|
||||
} catch (NoStyleAvailableException e) {
|
||||
// Logme.error(e);
|
||||
@ -265,7 +265,7 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
|
||||
|
||||
}
|
||||
|
||||
private Dimension2D lastInfo;
|
||||
private XDimension2D lastInfo;
|
||||
|
||||
private ImageData exportDiagramInternalPdf(OutputStream os, int index) throws IOException {
|
||||
final File svg = FileUtils.createTempFileLegacy("pdf", ".svf");
|
||||
|
@ -37,11 +37,11 @@ package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import static net.sourceforge.plantuml.utils.ObjectUtils.instanceOfAny;
|
||||
|
||||
import java.awt.geom.Line2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.annotation.HaxeIgnored;
|
||||
import net.sourceforge.plantuml.awt.geom.XLine2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.MinMax;
|
||||
import net.sourceforge.plantuml.ugraphic.UBackground;
|
||||
@ -101,18 +101,18 @@ public class CollisionDetector extends UGraphicNo {
|
||||
final HColor color = HColors.BLACK;
|
||||
ug = ug.apply(color).apply(new UStroke(5));
|
||||
for (Snake snake : snakes)
|
||||
for (Line2D line : snake.getHorizontalLines())
|
||||
for (XLine2D line : snake.getHorizontalLines())
|
||||
if (collision(line))
|
||||
drawLine(ug, line);
|
||||
|
||||
}
|
||||
|
||||
private void drawLine(UGraphic ug, Line2D line) {
|
||||
private void drawLine(UGraphic ug, XLine2D line) {
|
||||
ug = ug.apply(new UTranslate(line.getX1(), line.getY1()));
|
||||
ug.draw(new ULine(line.getX2() - line.getX1(), line.getY2() - line.getY1()));
|
||||
}
|
||||
|
||||
private boolean collision(Line2D hline) {
|
||||
private boolean collision(XLine2D hline) {
|
||||
for (MinMax r : rectangles)
|
||||
if (collisionCheck(r, hline))
|
||||
return true;
|
||||
@ -122,7 +122,7 @@ public class CollisionDetector extends UGraphicNo {
|
||||
|
||||
private boolean collision(MinMax r) {
|
||||
for (Snake snake : snakes) {
|
||||
for (Line2D hline : snake.getHorizontalLines()) {
|
||||
for (XLine2D hline : snake.getHorizontalLines()) {
|
||||
if (collisionCheck(r, hline)) {
|
||||
return true;
|
||||
}
|
||||
@ -133,7 +133,7 @@ public class CollisionDetector extends UGraphicNo {
|
||||
|
||||
}
|
||||
|
||||
private static boolean collisionCheck(MinMax rect, Line2D hline) {
|
||||
private static boolean collisionCheck(MinMax rect, XLine2D hline) {
|
||||
if (hline.getY1() != hline.getY2())
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@ -48,6 +47,7 @@ import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -138,7 +138,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslated2(StringBounder stringBounder) {
|
||||
final Dimension2D dim1 = tile1.calculateDimension(stringBounder);
|
||||
final XDimension2D dim1 = tile1.calculateDimension(stringBounder);
|
||||
final double left = calculateDimension(stringBounder).getLeft();
|
||||
return new UTranslate(left - tile2.calculateDimension(stringBounder).getLeft(), dim1.getHeight());
|
||||
}
|
||||
|
@ -35,12 +35,11 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileGeometry extends Dimension2D {
|
||||
public class FtileGeometry extends XDimension2D {
|
||||
|
||||
private final double width;
|
||||
private final double height;
|
||||
@ -48,43 +47,43 @@ public class FtileGeometry extends Dimension2D {
|
||||
private final double inY;
|
||||
private final double outY;
|
||||
|
||||
public Point2D getPointA() {
|
||||
return new Point2D.Double(left, inY);
|
||||
public XPoint2D getPointA() {
|
||||
return new XPoint2D(left, inY);
|
||||
}
|
||||
|
||||
public Point2D getPointIn() {
|
||||
return new Point2D.Double(left, inY);
|
||||
public XPoint2D getPointIn() {
|
||||
return new XPoint2D(left, inY);
|
||||
}
|
||||
|
||||
public Point2D getPointB() {
|
||||
public XPoint2D getPointB() {
|
||||
if (outY == Double.MIN_NORMAL) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return new Point2D.Double(width, (inY + outY) / 2);
|
||||
return new XPoint2D(width, (inY + outY) / 2);
|
||||
}
|
||||
|
||||
public Point2D getPointC() {
|
||||
public XPoint2D getPointC() {
|
||||
if (outY == Double.MIN_NORMAL) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return new Point2D.Double(left, outY);
|
||||
return new XPoint2D(left, outY);
|
||||
}
|
||||
|
||||
public Point2D getPointD() {
|
||||
public XPoint2D getPointD() {
|
||||
if (outY == Double.MIN_NORMAL) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return new Point2D.Double(0, (inY + outY) / 2);
|
||||
return new XPoint2D(0, (inY + outY) / 2);
|
||||
}
|
||||
|
||||
public Point2D getPointOut() {
|
||||
public XPoint2D getPointOut() {
|
||||
if (outY == Double.MIN_NORMAL) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
return new Point2D.Double(left, outY);
|
||||
return new XPoint2D(left, outY);
|
||||
}
|
||||
|
||||
public FtileGeometry(Dimension2D dim, double left, double inY) {
|
||||
public FtileGeometry(XDimension2D dim, double left, double inY) {
|
||||
this(dim.getWidth(), dim.getHeight(), left, inY);
|
||||
}
|
||||
|
||||
@ -97,11 +96,6 @@ public class FtileGeometry extends Dimension2D {
|
||||
return "[" + width + "x" + height + " left=" + left + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSize(double width, double height) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public FtileGeometry(double width, double height, double left, double inY, double outY) {
|
||||
this.left = left;
|
||||
this.inY = inY;
|
||||
@ -139,7 +133,7 @@ public class FtileGeometry extends Dimension2D {
|
||||
hasPointOut() ? outY + missing1 : outY);
|
||||
}
|
||||
|
||||
public FtileGeometry(Dimension2D dim, double left, double inY, double outY) {
|
||||
public FtileGeometry(XDimension2D dim, double left, double inY, double outY) {
|
||||
this(dim.getWidth(), dim.getHeight(), left, inY, outY);
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -91,7 +91,7 @@ public class FtileHeightFixedCentered extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslate(StringBounder stringBounder) {
|
||||
final Dimension2D dim = tile.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = tile.calculateDimension(stringBounder);
|
||||
if (dim.getHeight() > fixedHeight) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
@ -35,10 +35,8 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorate;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -76,17 +74,17 @@ public class FtileMinWidthCentered extends FtileDecorate {
|
||||
return new FtileGeometry(getDimensionInternal(stringBounder), left, geo.getInY(), geo.getOutY());
|
||||
}
|
||||
|
||||
private Dimension2D getDimensionInternal(StringBounder stringBounder) {
|
||||
final Dimension2D dim = getFtileDelegated().calculateDimension(stringBounder);
|
||||
private XDimension2D getDimensionInternal(StringBounder stringBounder) {
|
||||
final XDimension2D dim = getFtileDelegated().calculateDimension(stringBounder);
|
||||
if (dim.getWidth() < minWidth) {
|
||||
return new Dimension2DDouble(minWidth, dim.getHeight());
|
||||
return new XDimension2D(minWidth, dim.getHeight());
|
||||
}
|
||||
return dim;
|
||||
}
|
||||
|
||||
private UTranslate getUTranslateInternal(final StringBounder stringBounder) {
|
||||
final Dimension2D dimTile = getFtileDelegated().calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = getDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTile = getFtileDelegated().calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = getDimensionInternal(stringBounder);
|
||||
final UTranslate change = UTranslate.dx((dimTotal.getWidth() - dimTile.getWidth()) / 2);
|
||||
return change;
|
||||
}
|
||||
@ -99,7 +97,7 @@ public class FtileMinWidthCentered extends FtileDecorate {
|
||||
}
|
||||
|
||||
private double getPoint2(double x, StringBounder stringBounder) {
|
||||
final Dimension2D dim = getFtileDelegated().calculateDimension(stringBounder);
|
||||
final XDimension2D dim = getFtileDelegated().calculateDimension(stringBounder);
|
||||
if (dim.getWidth() < minWidth) {
|
||||
final double diff = minWidth - dim.getWidth();
|
||||
return x + diff / 2;
|
||||
|
@ -35,9 +35,8 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicInterceptorGoto;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -56,7 +55,7 @@ public class GotoInterceptor extends AbstractTextBlock implements TextBlock {
|
||||
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return swinlanes.calculateDimension(stringBounder);
|
||||
}
|
||||
|
||||
|
@ -35,8 +35,7 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.Stencil;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -94,12 +93,12 @@ public class Hexagon {
|
||||
}
|
||||
|
||||
public double getStartingX(StringBounder stringBounder, double y) {
|
||||
final Dimension2D dim = tb.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = tb.calculateDimension(stringBounder);
|
||||
return -getDeltaX(dim.getHeight(), y);
|
||||
}
|
||||
|
||||
public double getEndingX(StringBounder stringBounder, double y) {
|
||||
final Dimension2D dim = tb.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = tb.calculateDimension(stringBounder);
|
||||
return dim.getWidth() + getDeltaX(dim.getHeight(), y);
|
||||
}
|
||||
};
|
||||
|
@ -35,9 +35,8 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.style.PName;
|
||||
@ -79,8 +78,8 @@ public class LaneDivider extends AbstractTextBlock {
|
||||
return style;
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new Dimension2DDouble(x1 + x2, height);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new XDimension2D(x1 + x2, height);
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
|
@ -35,9 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@ -45,6 +42,9 @@ import java.util.Objects;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XLine2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
@ -92,7 +92,7 @@ public class Snake implements UShape {
|
||||
|
||||
public Snake transformX(PiecewiseAffineTransform compressionTransform) {
|
||||
final Snake result = cloneEmpty();
|
||||
for (Point2D.Double pt : worm) {
|
||||
for (XPoint2D pt : worm) {
|
||||
final double x = compressionTransform.transform(pt.x);
|
||||
final double y = pt.y;
|
||||
result.addPoint(x, y);
|
||||
@ -102,7 +102,7 @@ public class Snake implements UShape {
|
||||
|
||||
public Snake move(double dx, double dy) {
|
||||
final Snake result = cloneEmpty();
|
||||
for (Point2D pt : worm)
|
||||
for (XPoint2D pt : worm)
|
||||
result.addPoint(pt.getX() + dx, pt.getY() + dy);
|
||||
|
||||
return result;
|
||||
@ -194,7 +194,7 @@ public class Snake implements UShape {
|
||||
worm.addPoint(x, y);
|
||||
}
|
||||
|
||||
public void addPoint(Point2D p) {
|
||||
public void addPoint(XPoint2D p) {
|
||||
addPoint(p.getX(), p.getY());
|
||||
}
|
||||
|
||||
@ -238,28 +238,28 @@ public class Snake implements UShape {
|
||||
private void drawInternalLabel(UGraphic ug) {
|
||||
for (Text text : texts)
|
||||
if (text.hasText(ug.getStringBounder())) {
|
||||
final Point2D position = getTextBlockPosition(ug.getStringBounder(), text);
|
||||
final XPoint2D position = getTextBlockPosition(ug.getStringBounder(), text);
|
||||
text.textBlock.drawU(ug.apply(new UTranslate(position)));
|
||||
}
|
||||
}
|
||||
|
||||
public double getMaxX(StringBounder stringBounder) {
|
||||
double result = -Double.MAX_VALUE;
|
||||
for (Point2D pt : worm)
|
||||
for (XPoint2D pt : worm)
|
||||
result = Math.max(result, pt.getX());
|
||||
|
||||
for (Text text : texts) {
|
||||
final Point2D position = getTextBlockPosition(stringBounder, text);
|
||||
final Dimension2D dim = text.textBlock.calculateDimension(stringBounder);
|
||||
final XPoint2D position = getTextBlockPosition(stringBounder, text);
|
||||
final XDimension2D dim = text.textBlock.calculateDimension(stringBounder);
|
||||
result = Math.max(result, position.getX() + dim.getWidth());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Point2D getTextBlockPosition(StringBounder stringBounder, Text text) {
|
||||
final Point2D pt1 = worm.get(0);
|
||||
final Point2D pt2 = worm.get(1);
|
||||
final Dimension2D dim = text.textBlock.calculateDimension(stringBounder);
|
||||
private XPoint2D getTextBlockPosition(StringBounder stringBounder, Text text) {
|
||||
final XPoint2D pt1 = worm.get(0);
|
||||
final XPoint2D pt2 = worm.get(1);
|
||||
final XDimension2D dim = text.textBlock.calculateDimension(stringBounder);
|
||||
double x = Math.max(pt1.getX(), pt2.getX()) + 4;
|
||||
final boolean zigzag = worm.getDirectionsCode().startsWith("DLD") || worm.getDirectionsCode().startsWith("DRD");
|
||||
double y = (pt1.getY() + pt2.getY()) / 2 - dim.getHeight() / 2;
|
||||
@ -270,7 +270,7 @@ public class Snake implements UShape {
|
||||
x = worm.getMinX();
|
||||
y = (worm.getFirst().getY() + worm.getLast().getY() - 10) / 2 - dim.getHeight() / 2;
|
||||
} else if (text.horizontalAlignment == HorizontalAlignment.CENTER && zigzag) {
|
||||
final Point2D pt3 = worm.get(2);
|
||||
final XPoint2D pt3 = worm.get(2);
|
||||
x = (pt2.getX() + pt3.getX()) / 2 - dim.getWidth() / 2;
|
||||
} else if (text.horizontalAlignment == HorizontalAlignment.RIGHT && zigzag) {
|
||||
x = Math.max(pt1.getX(), pt2.getX()) - dim.getWidth() - 4;
|
||||
@ -281,16 +281,16 @@ public class Snake implements UShape {
|
||||
x = Math.min(pt1.getX(), pt2.getX());
|
||||
y = (pt1.getY() + worm.get(2).getY()) / 2 - dim.getHeight() / 2;
|
||||
}
|
||||
return new Point2D.Double(x, y);
|
||||
return new XPoint2D(x, y);
|
||||
}
|
||||
|
||||
public List<Line2D> getHorizontalLines() {
|
||||
final List<Line2D> result = new ArrayList<>();
|
||||
public List<XLine2D> getHorizontalLines() {
|
||||
final List<XLine2D> result = new ArrayList<>();
|
||||
for (int i = 0; i < worm.size() - 1; i++) {
|
||||
final Point2D pt1 = worm.get(i);
|
||||
final Point2D pt2 = worm.get(i + 1);
|
||||
final XPoint2D pt1 = worm.get(i);
|
||||
final XPoint2D pt2 = worm.get(i + 1);
|
||||
if (pt1.getY() == pt2.getY()) {
|
||||
final Line2D line = new Line2D.Double(pt1, pt2);
|
||||
final XLine2D line = new XLine2D(pt1, pt2);
|
||||
result.add(line);
|
||||
}
|
||||
}
|
||||
@ -298,15 +298,15 @@ public class Snake implements UShape {
|
||||
|
||||
}
|
||||
|
||||
private Point2D getFirst() {
|
||||
private XPoint2D getFirst() {
|
||||
return worm.get(0);
|
||||
}
|
||||
|
||||
public Point2D getLast() {
|
||||
public XPoint2D getLast() {
|
||||
return worm.get(worm.size() - 1);
|
||||
}
|
||||
|
||||
static boolean same(Point2D pt1, Point2D pt2) {
|
||||
static boolean same(XPoint2D pt1, XPoint2D pt2) {
|
||||
return pt1.distance(pt2) < 0.001;
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
|
||||
public enum SnakeDirection {
|
||||
VERTICAL_THEN_HORIZONTAL, HORIZONTAL_THEN_VERTICAL;
|
||||
|
||||
public static SnakeDirection getDirection(Point2D pt1, Point2D pt2) {
|
||||
public static SnakeDirection getDirection(XPoint2D pt1, XPoint2D pt2) {
|
||||
if (pt1.getX() == pt2.getX()) {
|
||||
return VERTICAL_THEN_HORIZONTAL;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicIntercep
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.VCompactFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.gtile.GConnection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
@ -293,7 +293,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
|
||||
|
||||
drawTitlesBackground(ug);
|
||||
|
||||
final Dimension2D dimensionFull = full.calculateDimension(stringBounder);
|
||||
final XDimension2D dimensionFull = full.calculateDimension(stringBounder);
|
||||
int i = 0;
|
||||
assert dividers.size() == swimlanes().size() + 1;
|
||||
for (Swimlane swimlane : swimlanesSpecial()) {
|
||||
@ -380,7 +380,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
|
||||
}
|
||||
|
||||
final UTranslate titleHeightTranslate = getTitleHeightTranslate(stringBounder);
|
||||
final Dimension2D dimensionFull = full.calculateDimension(stringBounder);
|
||||
final XDimension2D dimensionFull = full.calculateDimension(stringBounder);
|
||||
|
||||
dividers.clear();
|
||||
double xpos = 0;
|
||||
@ -419,7 +419,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
|
||||
return swimlane.getMinMax().getWidth();
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return getMinMax(stringBounder).getDimension();
|
||||
}
|
||||
|
||||
|
@ -35,9 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.AbstractTextBlock;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -61,7 +61,7 @@ public class TextBlockInterceptorUDrawable extends AbstractTextBlock implements
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,10 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.Map;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.gtile.Gtile;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||
import net.sourceforge.plantuml.graphic.UGraphicDelegator;
|
||||
import net.sourceforge.plantuml.svek.UGraphicForSnake;
|
||||
@ -94,7 +94,7 @@ public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
|
||||
final HColor gotoColor = HColors.MY_RED;
|
||||
|
||||
final FtileGeometry geom = ftile.calculateDimension(getStringBounder());
|
||||
final Point2D pt = geom.getPointIn();
|
||||
final XPoint2D pt = geom.getPointIn();
|
||||
UGraphic ugGoto = getUg().apply(gotoColor).apply(gotoColor.bg());
|
||||
ugGoto = ugGoto.apply(new UTranslate(pt));
|
||||
final UTranslate posNow = getPosition();
|
||||
|
@ -35,8 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -45,6 +43,8 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.awt.geom.XLine2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.LinkStyle;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.style.Style;
|
||||
@ -57,9 +57,9 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
import net.sourceforge.plantuml.ugraphic.color.HColor;
|
||||
import net.sourceforge.plantuml.ugraphic.comp.CompressionMode;
|
||||
|
||||
public class Worm implements Iterable<Point2D.Double> {
|
||||
public class Worm implements Iterable<XPoint2D> {
|
||||
|
||||
private final List<Point2D.Double> points = new ArrayList<>();
|
||||
private final List<XPoint2D> points = new ArrayList<>();
|
||||
private final Style style;
|
||||
|
||||
public Worm(Style style) {
|
||||
@ -101,9 +101,9 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
|
||||
boolean drawn = false;
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final java.awt.geom.Point2D.Double p1 = points.get(i);
|
||||
final java.awt.geom.Point2D.Double p2 = points.get(i + 1);
|
||||
final Line2D line = new Line2D.Double(p1, p2);
|
||||
final XPoint2D p1 = points.get(i);
|
||||
final XPoint2D p2 = points.get(i + 1);
|
||||
final XLine2D line = new XLine2D(p1, p2);
|
||||
if (drawn == false && emphasizeDirection != null && Direction.fromVector(p1, p2) == emphasizeDirection) {
|
||||
drawLine(ug, line, emphasizeDirection);
|
||||
drawn = true;
|
||||
@ -124,7 +124,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
|
||||
if (startDecoration != null) {
|
||||
ug = ug.apply(new UStroke(1.5));
|
||||
final Point2D start = points.get(0);
|
||||
final XPoint2D start = points.get(0);
|
||||
if (ignoreForCompression)
|
||||
startDecoration.setCompressionMode(CompressionMode.ON_X);
|
||||
|
||||
@ -132,7 +132,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
}
|
||||
if (endDecoration != null) {
|
||||
ug = ug.apply(new UStroke(1.5));
|
||||
final Point2D end = points.get(points.size() - 1);
|
||||
final XPoint2D end = points.get(points.size() - 1);
|
||||
if (ignoreForCompression)
|
||||
endDecoration.setCompressionMode(CompressionMode.ON_X);
|
||||
|
||||
@ -140,7 +140,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
}
|
||||
}
|
||||
|
||||
private void drawLine(UGraphic ug, Line2D line, Direction direction) {
|
||||
private void drawLine(UGraphic ug, XLine2D line, Direction direction) {
|
||||
drawLine(ug, line.getX1(), line.getY1(), line.getX2(), line.getY2(), direction);
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
|
||||
public Worm move(double dx, double dy) {
|
||||
final Worm result = new Worm(style);
|
||||
for (Point2D pt : points)
|
||||
for (XPoint2D pt : points)
|
||||
result.addPoint(pt.getX() + dx, pt.getY() + dy);
|
||||
|
||||
return result;
|
||||
@ -235,15 +235,15 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
if (points.size() > 0) {
|
||||
final Point2D last = getLast();
|
||||
final XPoint2D last = getLast();
|
||||
if (last.getX() == x && last.getY() == y)
|
||||
return;
|
||||
|
||||
}
|
||||
this.points.add(new Point2D.Double(x, y));
|
||||
this.points.add(new XPoint2D(x, y));
|
||||
}
|
||||
|
||||
public void addPoint(Point2D pt) {
|
||||
public void addPoint(XPoint2D pt) {
|
||||
this.addPoint(pt.getX(), pt.getY());
|
||||
}
|
||||
|
||||
@ -280,14 +280,14 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
return Direction.fromVector(points.get(i), points.get(i + 1));
|
||||
}
|
||||
|
||||
public Iterator<Point2D.Double> iterator() {
|
||||
public Iterator<XPoint2D> iterator() {
|
||||
return Collections.unmodifiableCollection(points).iterator();
|
||||
}
|
||||
|
||||
public boolean doesHorizontalCross(MinMax area) {
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final Point2D.Double pt1 = get(i);
|
||||
final Point2D.Double pt2 = get(i + 1);
|
||||
final XPoint2D pt1 = get(i);
|
||||
final XPoint2D pt2 = get(i + 1);
|
||||
if (pt1.getY() == pt2.getY() && area.doesHorizontalCross(pt1, pt2))
|
||||
return true;
|
||||
|
||||
@ -299,7 +299,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
return this.points.size();
|
||||
}
|
||||
|
||||
public Point2D.Double get(int i) {
|
||||
public XPoint2D get(int i) {
|
||||
return this.points.get(i);
|
||||
}
|
||||
|
||||
@ -311,21 +311,21 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
this.points.remove(i);
|
||||
}
|
||||
|
||||
public void add(int i, Point2D.Double pt) {
|
||||
public void add(int i, XPoint2D pt) {
|
||||
this.points.add(i, pt);
|
||||
}
|
||||
|
||||
public Point2D getFirst() {
|
||||
public XPoint2D getFirst() {
|
||||
return points.get(0);
|
||||
}
|
||||
|
||||
public Point2D getLast() {
|
||||
public XPoint2D getLast() {
|
||||
return points.get(points.size() - 1);
|
||||
}
|
||||
|
||||
public double getMinX() {
|
||||
double result = points.get(0).getX();
|
||||
for (Point2D.Double pt : points)
|
||||
for (XPoint2D pt : points)
|
||||
result = Math.min(result, pt.getX());
|
||||
return result;
|
||||
}
|
||||
@ -389,7 +389,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
if (Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.RIGHT).equals(patternAt)
|
||||
|| Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.LEFT)
|
||||
.equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
final XPoint2D newPoint = new XPoint2D(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
@ -406,7 +406,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.RIGHT, Direction.DOWN, Direction.LEFT, Direction.DOWN).equals(patternAt)
|
||||
&& points.get(i + 3).x > points.get(i).x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 3).x, points.get(i).y);
|
||||
final XPoint2D newPoint = new XPoint2D(points.get(i + 3).x, points.get(i).y);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
@ -421,7 +421,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.RIGHT, Direction.DOWN, Direction.RIGHT, Direction.UP).equals(patternAt)
|
||||
|| Arrays.asList(Direction.LEFT, Direction.DOWN, Direction.LEFT, Direction.UP).equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 3).x, points.get(i + 1).y);
|
||||
final XPoint2D newPoint = new XPoint2D(points.get(i + 3).x, points.get(i + 1).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
@ -438,7 +438,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
if (Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.RIGHT).equals(patternAt)
|
||||
|| Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.LEFT)
|
||||
.equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
final XPoint2D newPoint = new XPoint2D(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
@ -454,10 +454,10 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
if (i >= 0) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.RIGHT).equals(patternAt)) {
|
||||
final Point2D.Double p1 = points.get(i + 1);
|
||||
final Point2D.Double p4 = points.get(i + 4);
|
||||
final XPoint2D p1 = points.get(i + 1);
|
||||
final XPoint2D p4 = points.get(i + 4);
|
||||
if (p4.x > p1.x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
final XPoint2D newPoint = new XPoint2D(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
@ -474,10 +474,10 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
if (i >= 0) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
|
||||
final Point2D.Double p1 = points.get(i + 1);
|
||||
final Point2D.Double p4 = points.get(i + 4);
|
||||
final XPoint2D p1 = points.get(i + 1);
|
||||
final XPoint2D p4 = points.get(i + 4);
|
||||
if (p4.x + 4 < p1.x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
final XPoint2D newPoint = new XPoint2D(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
@ -505,7 +505,7 @@ public class Worm implements Iterable<Point2D.Double> {
|
||||
if (Arrays.asList(Direction.LEFT, Direction.DOWN, Direction.LEFT, Direction.DOWN).equals(patternAt)
|
||||
|| Arrays.asList(Direction.RIGHT, Direction.DOWN, Direction.RIGHT, Direction.DOWN)
|
||||
.equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 3).x, points.get(i + 1).y);
|
||||
final XPoint2D newPoint = new XPoint2D(points.get(i + 3).x, points.get(i + 1).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
|
@ -35,11 +35,11 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -49,7 +49,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class WormTexted implements Iterable<Point2D.Double> {
|
||||
public class WormTexted implements Iterable<XPoint2D> {
|
||||
|
||||
private final Worm worm;
|
||||
private TextBlock textBlock;
|
||||
@ -62,7 +62,7 @@ public class WormTexted implements Iterable<Point2D.Double> {
|
||||
this.worm = worm;
|
||||
}
|
||||
|
||||
public Iterator<Point2D.Double> iterator() {
|
||||
public Iterator<XPoint2D> iterator() {
|
||||
return worm.iterator();
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ public class WormTexted implements Iterable<Point2D.Double> {
|
||||
return worm;
|
||||
}
|
||||
|
||||
public Point2D get(int i) {
|
||||
public XPoint2D get(int i) {
|
||||
return worm.get(i);
|
||||
}
|
||||
|
||||
@ -108,26 +108,26 @@ public class WormTexted implements Iterable<Point2D.Double> {
|
||||
return TextBlockUtils.isEmpty(textBlock, stringBounder);
|
||||
}
|
||||
|
||||
private Point2D getTextBlockPosition(StringBounder stringBounder) {
|
||||
final Point2D pt1 = get(0);
|
||||
final Point2D pt2 = get(1);
|
||||
final Dimension2D dim = textBlock.calculateDimension(stringBounder);
|
||||
private XPoint2D getTextBlockPosition(StringBounder stringBounder) {
|
||||
final XPoint2D pt1 = get(0);
|
||||
final XPoint2D pt2 = get(1);
|
||||
final XDimension2D dim = textBlock.calculateDimension(stringBounder);
|
||||
// if (worm.getDirectionsCode().startsWith("LD")) {
|
||||
// final double y = pt1.getY() - dim.getHeight();
|
||||
// return new Point2D.Double(Math.max(pt1.getX(), pt2.getX()) - dim.getWidth(), y);
|
||||
// return new XPoint2D(Math.max(pt1.getX(), pt2.getX()) - dim.getWidth(), y);
|
||||
// }
|
||||
final double y = (pt1.getY() + pt2.getY()) / 2 - dim.getHeight() / 2;
|
||||
return new Point2D.Double(Math.max(pt1.getX(), pt2.getX()) + 4, y);
|
||||
return new XPoint2D(Math.max(pt1.getX(), pt2.getX()) + 4, y);
|
||||
}
|
||||
|
||||
public double getMaxX(StringBounder stringBounder) {
|
||||
double result = -Double.MAX_VALUE;
|
||||
for (Point2D pt : this) {
|
||||
for (XPoint2D pt : this) {
|
||||
result = Math.max(result, pt.getX());
|
||||
}
|
||||
if (textBlock != null) {
|
||||
final Point2D position = getTextBlockPosition(stringBounder);
|
||||
final Dimension2D dim = textBlock.calculateDimension(stringBounder);
|
||||
final XPoint2D position = getTextBlockPosition(stringBounder);
|
||||
final XDimension2D dim = textBlock.calculateDimension(stringBounder);
|
||||
result = Math.max(result, position.getX() + dim.getWidth());
|
||||
}
|
||||
return result;
|
||||
@ -135,7 +135,7 @@ public class WormTexted implements Iterable<Point2D.Double> {
|
||||
|
||||
void drawInternalLabel(UGraphic ug) {
|
||||
if (textBlock != null) {
|
||||
final Point2D position = getTextBlockPosition(ug.getStringBounder());
|
||||
final XPoint2D position = getTextBlockPosition(ug.getStringBounder());
|
||||
textBlock.drawU(ug.apply(new UTranslate(position)));
|
||||
}
|
||||
}
|
||||
|
@ -35,13 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -50,12 +49,12 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class ConnectionVerticalDown extends AbstractConnection implements ConnectionTranslatable {
|
||||
|
||||
private final Point2D p1;
|
||||
private final Point2D p2;
|
||||
private final XPoint2D p1;
|
||||
private final XPoint2D p2;
|
||||
private final Rainbow color;
|
||||
private final TextBlock textBlock;
|
||||
|
||||
public ConnectionVerticalDown(Ftile ftile1, Ftile ftile2, Point2D p1, Point2D p2, Rainbow color,
|
||||
public ConnectionVerticalDown(Ftile ftile1, Ftile ftile2, XPoint2D p1, XPoint2D p2, Rainbow color,
|
||||
TextBlock textBlock) {
|
||||
super(ftile1, ftile2);
|
||||
if (color.size() == 0) {
|
||||
@ -87,8 +86,8 @@ public class ConnectionVerticalDown extends AbstractConnection implements Connec
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final Snake snake = Snake.create(getFtile1().skinParam(), color, Arrows.asToDown()).withLabel(textBlock,
|
||||
arrowHorizontalAlignment());
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -37,7 +37,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -89,7 +89,7 @@ public class FloatingNote extends AbstractTextBlock implements Stencil, TextBloc
|
||||
opale.drawU(ug);
|
||||
}
|
||||
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return opale.calculateDimension(stringBounder);
|
||||
}
|
||||
|
||||
|
@ -35,14 +35,13 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMargedRight;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -71,9 +70,9 @@ public class FtileFactoryDelegatorAssembly extends FtileFactoryDelegator {
|
||||
return result;
|
||||
}
|
||||
final UTranslate translate1 = result.getTranslateFor(tile1andSpace, stringBounder);
|
||||
final Point2D p1 = geo.translate(translate1).getPointOut();
|
||||
final XPoint2D p1 = geo.translate(translate1).getPointOut();
|
||||
final UTranslate translate2 = result.getTranslateFor(tile2, stringBounder);
|
||||
final Point2D p2 = tile2.calculateDimension(stringBounder).translate(translate2).getPointIn();
|
||||
final XPoint2D p2 = tile2.calculateDimension(stringBounder).translate(translate2).getPointIn();
|
||||
|
||||
final Rainbow color = getInLinkRenderingColor(tile2);
|
||||
|
||||
|
@ -37,7 +37,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.Pragma;
|
||||
import net.sourceforge.plantuml.Url;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
|
@ -51,7 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.WeldingPoint;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
@ -113,7 +113,7 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
|
||||
public void drawU(UGraphic ug) {
|
||||
final UTranslate tr1 = genealogy.getTranslate(ftileBreak, ug.getStringBounder());
|
||||
final UTranslate tr2 = genealogy.getTranslate(diamondBreak, ug.getStringBounder());
|
||||
final Dimension2D dimDiamond = diamondBreak.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimDiamond = diamondBreak.calculateDimension(ug.getStringBounder());
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToRight());
|
||||
snake.addPoint(tr1.getDx(), tr1.getDy());
|
||||
|
@ -53,7 +53,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond.FtileSwitch
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateInLabel;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDecorateOutLabel;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
@ -104,8 +104,8 @@ public class FtileFactoryDelegatorSwitch extends FtileFactoryDelegator {
|
||||
final Ftile diamond2 = getDiamond2(swimlane, branches.get(0));
|
||||
|
||||
for (Branch branch : branches) {
|
||||
final Dimension2D dimLabelIn = branch.getTextBlockPositive().calculateDimension(getStringBounder());
|
||||
final Dimension2D dimLabelOut = branch.getTextBlockSpecial().calculateDimension(getStringBounder());
|
||||
final XDimension2D dimLabelIn = branch.getTextBlockPositive().calculateDimension(getStringBounder());
|
||||
final XDimension2D dimLabelOut = branch.getTextBlockSpecial().calculateDimension(getStringBounder());
|
||||
ftiles.add(new FtileDecorateOutLabel(new FtileDecorateInLabel(branch.getFtile(), dimLabelIn), dimLabelOut));
|
||||
}
|
||||
|
||||
|
@ -42,12 +42,11 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -95,7 +94,7 @@ class FtileForkInner extends AbstractFtile {
|
||||
double xpos = 0;
|
||||
for (Ftile ftile : forks) {
|
||||
ug.apply(UTranslate.dx(xpos)).draw(ftile);
|
||||
final Dimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
xpos += dim.getWidth();
|
||||
}
|
||||
}
|
||||
@ -105,13 +104,13 @@ class FtileForkInner extends AbstractFtile {
|
||||
double height = 0;
|
||||
double width = 0;
|
||||
for (Ftile ftile : forks) {
|
||||
final Dimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
width += dim.getWidth();
|
||||
if (dim.getHeight() > height) {
|
||||
height = dim.getHeight();
|
||||
}
|
||||
}
|
||||
final Dimension2D dimTotal = new Dimension2DDouble(width, height);
|
||||
final XDimension2D dimTotal = new XDimension2D(width, height);
|
||||
return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());
|
||||
}
|
||||
|
||||
@ -121,7 +120,7 @@ class FtileForkInner extends AbstractFtile {
|
||||
if (ftile == searched) {
|
||||
return UTranslate.dx(xpos);
|
||||
}
|
||||
final Dimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
xpos += dim.getWidth();
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
|
@ -41,12 +41,11 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -98,14 +97,14 @@ class FtileForkInnerOverlapped extends AbstractFtile {
|
||||
double height = 0;
|
||||
double width = 0;
|
||||
for (Ftile ftile : forks) {
|
||||
final Dimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
// width += dim.getWidth();
|
||||
width = Math.max(width, dim.getWidth());
|
||||
if (dim.getHeight() > height) {
|
||||
height = dim.getHeight();
|
||||
}
|
||||
}
|
||||
final Dimension2D dimTotal = new Dimension2DDouble(width, height);
|
||||
final XDimension2D dimTotal = new XDimension2D(width, height);
|
||||
return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
@ -140,7 +140,7 @@ public class FtileGroup extends AbstractFtile {
|
||||
}
|
||||
|
||||
private double diffHeightTitle(StringBounder stringBounder) {
|
||||
final Dimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
return Math.max(25, dimTitle.getHeight() + 20);
|
||||
}
|
||||
|
||||
@ -161,8 +161,8 @@ public class FtileGroup extends AbstractFtile {
|
||||
|
||||
public double suppWidth(StringBounder stringBounder) {
|
||||
final FtileGeometry orig = getInnerDimension(stringBounder);
|
||||
final Dimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
final Dimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
final XDimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
|
||||
final double suppWidth = MathUtils.max(orig.getWidth(), dimTitle.getWidth() + 20, dimHeaderNote.getWidth() + 20)
|
||||
- orig.getWidth();
|
||||
return suppWidth;
|
||||
@ -210,7 +210,7 @@ public class FtileGroup extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
|
||||
final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow(shadowing)
|
||||
.withStroke(stroke).withCorner(roundCorner, 0);
|
||||
@ -220,7 +220,7 @@ public class FtileGroup extends AbstractFtile {
|
||||
type.asBig(name, align, TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext,
|
||||
skinParam().getStereotypeAlignment()).drawU(ug);
|
||||
|
||||
final Dimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
|
||||
final XDimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
|
||||
headerNote.drawU(ug.apply(new UTranslate(dimTotal.getWidth() - dimHeaderNote.getWidth() - 10,
|
||||
diffHeightTitle(ug.getStringBounder()) - 10)));
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@ -58,7 +57,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -164,15 +164,15 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
|
||||
private UTranslate getTranslateDiamond1(StringBounder stringBounder) {
|
||||
final double y1 = 0;
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
// final double x1 = getLeft(stringBounder) - dimDiamond1.getWidth() / 2;
|
||||
final double x1 = calculateDimension(stringBounder).getLeft() - dimDiamond1.getWidth() / 2;
|
||||
return new UTranslate(x1, y1);
|
||||
}
|
||||
|
||||
private UTranslate getTranslateStop(StringBounder stringBounder) {
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimStop = stop2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimStop = stop2.calculateDimension(stringBounder);
|
||||
final double y1 = (dimDiamond1.getHeight() - dimStop.getHeight()) / 2;
|
||||
final double x1 = calculateDimension(stringBounder).getLeft() + dimDiamond1.getWidth() / 2
|
||||
+ getDiamondStopDistance();
|
||||
@ -194,8 +194,8 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToRight());
|
||||
snake.addPoint(p1);
|
||||
@ -203,16 +203,16 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
final Dimension2D dimDiamond1 = getFtile1().calculateDimension(stringBounder);
|
||||
final Point2D p = new Point2D.Double(dimDiamond1.getWidth(), dimDiamond1.getHeight() / 2);
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final XDimension2D dimDiamond1 = getFtile1().calculateDimension(stringBounder);
|
||||
final XPoint2D p = new XPoint2D(dimDiamond1.getWidth(), dimDiamond1.getHeight() / 2);
|
||||
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
final Dimension2D dimStop = getFtile2().calculateDimension(stringBounder);
|
||||
final Point2D p = new Point2D.Double(0, dimStop.getHeight() / 2);
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final XDimension2D dimStop = getFtile2().calculateDimension(stringBounder);
|
||||
final XPoint2D p = new XPoint2D(0, dimStop.getHeight() / 2);
|
||||
return getTranslateStop(stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimStop2 = stop2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimStop2 = stop2.calculateDimension(stringBounder);
|
||||
final FtileGeometry dim1 = tile1.calculateDimension(stringBounder).addDim(0,
|
||||
getDiamondStopDistance() + dimStop2.getWidth());
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@ -60,7 +59,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.svek.ConditionEndStyle;
|
||||
@ -151,9 +151,9 @@ public class FtileIfDown extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
// p2 = new Point2D.Double(p2.getX(), p1.getY());
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
// p2 = new XPoint2D(p2.getX(), p1.getY());
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToRight());
|
||||
snake.addPoint(p1);
|
||||
@ -161,17 +161,17 @@ public class FtileIfDown extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = getFtile1().calculateDimension(stringBounder);
|
||||
final Point2D p = new Point2D.Double(dimDiamond1.getWidth(),
|
||||
final XPoint2D p = new XPoint2D(dimDiamond1.getWidth(),
|
||||
(dimDiamond1.getInY() + dimDiamond1.getOutY()) / 2);
|
||||
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
final Dimension2D dimStop = getFtile2().calculateDimension(stringBounder);
|
||||
final Point2D p = new Point2D.Double(0, dimStop.getHeight() / 2);
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final XDimension2D dimStop = getFtile2().calculateDimension(stringBounder);
|
||||
final XPoint2D p = new XPoint2D(0, dimStop.getHeight() / 2);
|
||||
return getTranslateOptionalStop(stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
@ -185,12 +185,12 @@ public class FtileIfDown extends AbstractFtile {
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder)
|
||||
.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateForThen(stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
@ -208,11 +208,11 @@ public class FtileIfDown extends AbstractFtile {
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -230,22 +230,22 @@ public class FtileIfDown extends AbstractFtile {
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateForThen(stringBounder)
|
||||
.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
|
||||
private Point2D getP2hline(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2hline(final StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond2 = getFtile2().calculateDimension(stringBounder);
|
||||
final double x = dimDiamond2.getWidth();
|
||||
final double half = (dimDiamond2.getOutY() - dimDiamond2.getInY()) / 2;
|
||||
return getTranslateDiamond2(stringBounder)
|
||||
.getTranslated(new Point2D.Double(x, dimDiamond2.getInY() + half));
|
||||
.getTranslated(new XPoint2D(x, dimDiamond2.getInY() + half));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -275,11 +275,11 @@ public class FtileIfDown extends AbstractFtile {
|
||||
}
|
||||
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -297,30 +297,30 @@ public class FtileIfDown extends AbstractFtile {
|
||||
this.endInlinkColor = endInlinkColor;
|
||||
}
|
||||
|
||||
protected Point2D getP1(StringBounder stringBounder) {
|
||||
protected XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final double x = dimDiamond1.getWidth();
|
||||
final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
|
||||
return getTranslateDiamond1(stringBounder)
|
||||
.getTranslated(new Point2D.Double(x, dimDiamond1.getInY() + half));
|
||||
.getTranslated(new XPoint2D(x, dimDiamond1.getInY() + half));
|
||||
}
|
||||
|
||||
protected Point2D getP2(final StringBounder stringBounder) {
|
||||
protected XPoint2D getP2(final StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x = dimDiamond2.getWidth();
|
||||
final double half = (dimDiamond2.getOutY() - dimDiamond2.getInY()) / 2;
|
||||
return getTranslateDiamond2(stringBounder)
|
||||
.getTranslated(new Point2D.Double(x, dimDiamond2.getInY() + half));
|
||||
.getTranslated(new XPoint2D(x, dimDiamond2.getInY() + half));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
if (calculateDimension(stringBounder).hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
@ -355,11 +355,11 @@ public class FtileIfDown extends AbstractFtile {
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
if (calculateDimension(stringBounder).hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
@ -401,7 +401,7 @@ public class FtileIfDown extends AbstractFtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Point2D getP2(final StringBounder stringBounder) {
|
||||
protected XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return calculateDimension(stringBounder).getPointOut();
|
||||
}
|
||||
|
||||
@ -416,38 +416,38 @@ public class FtileIfDown extends AbstractFtile {
|
||||
this.endInlinkColor = endInlinkColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final double x = dimDiamond1.getWidth();
|
||||
final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
|
||||
return getTranslateDiamond1(stringBounder)
|
||||
.getTranslated(new Point2D.Double(x, dimDiamond1.getInY() + half));
|
||||
.getTranslated(new XPoint2D(x, dimDiamond1.getInY() + half));
|
||||
}
|
||||
|
||||
protected Point2D getP2(final StringBounder stringBounder) {
|
||||
protected XPoint2D getP2(final StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x = dimDiamond2.getWidth();
|
||||
final double half = (dimDiamond2.getOutY() - dimDiamond2.getInY()) / 2;
|
||||
return getTranslateDiamond2(stringBounder)
|
||||
.getTranslated(new Point2D.Double(x, dimDiamond2.getInY() + half));
|
||||
.getTranslated(new XPoint2D(x, dimDiamond2.getInY() + half));
|
||||
}
|
||||
|
||||
// the bottom or south point of the diamond that we omitted
|
||||
protected Point2D getP3(final StringBounder stringBounder) {
|
||||
protected XPoint2D getP3(final StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x = dimDiamond2.getWidth();
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new Point2D.Double(x, dimDiamond2.getOutY()));
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new XPoint2D(x, dimDiamond2.getOutY()));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
if (calculateDimension(stringBounder).hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final Point2D p3 = getP3(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p3 = getP3(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -44,7 +43,6 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
@ -62,7 +60,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
@ -255,8 +254,8 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToRight());
|
||||
snake.addPoint(p1);
|
||||
@ -264,17 +263,17 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = getFtile1().calculateDimension(stringBounder);
|
||||
final Point2D p = new Point2D.Double(dimDiamond1.getLeft() * 2,
|
||||
final XPoint2D p = new XPoint2D(dimDiamond1.getLeft() * 2,
|
||||
getYdiamontOutToLeft(dimDiamond1, stringBounder));
|
||||
|
||||
return getTranslateDiamond1(getFtile1(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = getFtile2().calculateDimension(stringBounder);
|
||||
final Point2D p = new Point2D.Double(0, getYdiamontOutToLeft(dimDiamond1, stringBounder));
|
||||
final XPoint2D p = new XPoint2D(0, getYdiamontOutToLeft(dimDiamond1, stringBounder));
|
||||
return getTranslateDiamond1(getFtile2(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
@ -295,9 +294,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final UTranslate tr = getTranslateDiamond1(getFtile2(), ug.getStringBounder());
|
||||
final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
|
||||
final XPoint2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
final Point2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn();
|
||||
final XPoint2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn();
|
||||
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p2.getX(), p1.getY());
|
||||
@ -317,9 +316,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final Point2D p1 = getP1(ug.getStringBounder());
|
||||
final XPoint2D p1 = getP1(ug.getStringBounder());
|
||||
final UTranslate tr2 = getTranslate2(ug.getStringBounder());
|
||||
final Point2D p2 = tr2.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
|
||||
final XPoint2D p2 = tr2.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p2.getX(), p1.getY());
|
||||
@ -327,9 +326,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = getFtile1().calculateDimension(stringBounder);
|
||||
final Point2D p = new Point2D.Double(dimDiamond1.getLeft() * 2,
|
||||
final XPoint2D p = new XPoint2D(dimDiamond1.getLeft() * 2,
|
||||
getYdiamontOutToLeft(dimDiamond1, stringBounder));
|
||||
return getTranslateDiamond1(getFtile1(), stringBounder).getTranslated(p);
|
||||
}
|
||||
@ -356,16 +355,16 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
if (dim.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p1 = tr1.getTranslated(dim.getPointOut());
|
||||
final XPoint2D p1 = tr1.getTranslated(dim.getPointOut());
|
||||
final FtileGeometry full = calculateDimensionInternal(stringBounder);
|
||||
final double totalHeight = full.getHeight();
|
||||
final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
|
||||
final XPoint2D p2 = new XPoint2D(p1.getX(), totalHeight);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(out2, arrowHorizontalAlignment());
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p2);
|
||||
if (nbOut == 0) {
|
||||
snake.addPoint(new Point2D.Double(full.getLeft(), totalHeight));
|
||||
snake.addPoint(new XPoint2D(full.getLeft(), totalHeight));
|
||||
}
|
||||
ug.draw(snake);
|
||||
}
|
||||
@ -383,8 +382,8 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown());
|
||||
snake.addPoint(p1);
|
||||
@ -392,25 +391,25 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
final Point2D p = getFtile1().calculateDimension(stringBounder).getPointOut();
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final XPoint2D p = getFtile1().calculateDimension(stringBounder).getPointOut();
|
||||
return getTranslateDiamond1(getFtile1(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
final Point2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final XPoint2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
|
||||
return getTranslate1(getFtile2(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final Point2D p1 = getP1(ug.getStringBounder());
|
||||
final Point2D p2 = getP2(ug.getStringBounder());
|
||||
final XPoint2D p1 = getP1(ug.getStringBounder());
|
||||
final XPoint2D p2 = getP2(ug.getStringBounder());
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown());
|
||||
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = mp1a.getY() + 4;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -435,11 +434,11 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final double totalHeight = calculateDimensionInternal(stringBounder).getHeight();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
if (p1 == null) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
|
||||
final XPoint2D p2 = new XPoint2D(p1.getX(), totalHeight);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()).withLabel(out2, arrowHorizontalAlignment());
|
||||
snake.addPoint(p1);
|
||||
@ -447,12 +446,12 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);
|
||||
if (geo.hasPointOut() == false) {
|
||||
return null;
|
||||
}
|
||||
final Point2D p = geo.getPointOut();
|
||||
final XPoint2D p = geo.getPointOut();
|
||||
return getTranslate1(getFtile1(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
@ -469,7 +468,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D totalDim = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D totalDim = calculateDimensionInternal(stringBounder);
|
||||
|
||||
final List<Ftile> allTiles = new ArrayList<>(couples);
|
||||
allTiles.add(tile2);
|
||||
@ -610,8 +609,8 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslate2(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dim2 = tile2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dim2 = tile2.calculateDimension(stringBounder);
|
||||
|
||||
final double x2 = dimTotal.getWidth() - dim2.getWidth();
|
||||
|
||||
@ -666,14 +665,14 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
}
|
||||
|
||||
private FtileGeometry calculateDimensionInternal(StringBounder stringBounder) {
|
||||
Dimension2D result = new Dimension2DDouble(0, 0);
|
||||
XDimension2D result = new XDimension2D(0, 0);
|
||||
for (Ftile couple : couples) {
|
||||
result = Dimension2DDouble.mergeLR(result, couple.calculateDimension(stringBounder));
|
||||
result = XDimension2D.mergeLR(result, couple.calculateDimension(stringBounder));
|
||||
}
|
||||
Dimension2D dimTile2 = tile2.calculateDimension(stringBounder);
|
||||
dimTile2 = Dimension2DDouble.delta(dimTile2, 0, getDiamondsHeight(stringBounder) / 2);
|
||||
result = Dimension2DDouble.mergeLR(result, dimTile2);
|
||||
result = Dimension2DDouble.delta(result, xSeparation * couples.size(), 100);
|
||||
XDimension2D dimTile2 = tile2.calculateDimension(stringBounder);
|
||||
dimTile2 = XDimension2D.delta(dimTile2, 0, getDiamondsHeight(stringBounder) / 2);
|
||||
result = XDimension2D.mergeLR(result, dimTile2);
|
||||
result = XDimension2D.delta(result, xSeparation * couples.size(), 100);
|
||||
|
||||
return new FtileGeometry(result, result.getWidth() / 2, 0);
|
||||
}
|
||||
@ -688,7 +687,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
|
||||
final List<Ftile> all = new ArrayList<>(tiles);
|
||||
all.add(tile2);
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -59,7 +58,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
@ -210,9 +210,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final UTranslate tr = getTranslateDiamond(getFtile2(), ug.getStringBounder());
|
||||
final Point2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
|
||||
final XPoint2D p2 = tr.getTranslated(getFtile2().calculateDimension(ug.getStringBounder()).getPointIn());
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
final Point2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn();
|
||||
final XPoint2D p1 = calculateDimensionInternal(ug.getStringBounder()).getPointIn();
|
||||
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p1.getX(), (p1.getY() + p2.getY()) / 2);
|
||||
@ -234,8 +234,8 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown());
|
||||
snake.addPoint(p1);
|
||||
@ -244,15 +244,15 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
final Dimension2D dimDiamond1 = getFtile1().calculateDimension(stringBounder);
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final XDimension2D dimDiamond1 = getFtile1().calculateDimension(stringBounder);
|
||||
final double diamondWidth = dimDiamond1.getWidth();
|
||||
return getTranslateDiamond(getFtile1(), stringBounder)
|
||||
.getTranslated(new Point2D.Double(diamondWidth, dimDiamond1.getHeight() / 2));
|
||||
.getTranslated(new XPoint2D(diamondWidth, dimDiamond1.getHeight() / 2));
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
final Point2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final XPoint2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
|
||||
return getTranslate1(getFtile2(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
@ -271,8 +271,8 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()).withLabel(label,
|
||||
VerticalAlignment.CENTER);
|
||||
@ -281,13 +281,13 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
final Point2D p = getFtile1().calculateDimension(stringBounder).getPointOut();
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final XPoint2D p = getFtile1().calculateDimension(stringBounder).getPointOut();
|
||||
return getTranslateFor(getFtile1(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
final Point2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final XPoint2D p = getFtile2().calculateDimension(stringBounder).getPointIn();
|
||||
return getTranslateFor(getFtile2(), stringBounder).getTranslated(p);
|
||||
}
|
||||
|
||||
@ -308,9 +308,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final UTranslate tr1 = getTranslateDiamond(getFtile1(), stringBounder);
|
||||
final FtileGeometry dimDiamond = getFtile1().calculateDimension(stringBounder);
|
||||
final Point2D p1 = tr1.getTranslated(dimDiamond.getPointOut());
|
||||
final XPoint2D p1 = tr1.getTranslated(dimDiamond.getPointOut());
|
||||
|
||||
final Point2D p2 = getTranslate2(stringBounder)
|
||||
final XPoint2D p2 = getTranslate2(stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(label,
|
||||
@ -339,8 +339,8 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
if (dim1.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p1 = getTranslate2(stringBounder).getTranslated(dim1.getPointOut());
|
||||
final Point2D p2 = getTranslateLastDiamond(stringBounder)
|
||||
final XPoint2D p1 = getTranslate2(stringBounder).getTranslated(dim1.getPointOut());
|
||||
final XPoint2D p2 = getTranslateLastDiamond(stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
@ -368,14 +368,14 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
if (dim1.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p1 = getTranslate1(getFtile1(), stringBounder).getTranslated(dim1.getPointOut());
|
||||
final XPoint2D p1 = getTranslate1(getFtile1(), stringBounder).getTranslated(dim1.getPointOut());
|
||||
|
||||
final FtileGeometry dimLastDiamond = getFtile2().calculateDimension(stringBounder);
|
||||
Point2D p2 = getTranslateLastDiamond(stringBounder)
|
||||
XPoint2D p2 = getTranslateLastDiamond(stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
p2 = new UTranslate(dimLastDiamond.getWidth() / 2, dimLastDiamond.getHeight() / 2).getTranslated(p2);
|
||||
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft());
|
||||
snake.addPoint(p1);
|
||||
@ -402,11 +402,11 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
if (dim1.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p1 = getTranslate1(getFtile1(), stringBounder).getTranslated(dim1.getPointOut());
|
||||
final XPoint2D p1 = getTranslate1(getFtile1(), stringBounder).getTranslated(dim1.getPointOut());
|
||||
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
|
||||
final Point2D p2 = new Point2D.Double(dimTotal.getWidth(), p1.getY() + 15);
|
||||
final XPoint2D p2 = new XPoint2D(dimTotal.getWidth(), p1.getY() + 15);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToRight());
|
||||
snake.addPoint(p1);
|
||||
@ -446,7 +446,7 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslateLastDiamond(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final FtileGeometry dimLast = lastDiamond.calculateDimension(stringBounder);
|
||||
final double x = (dimTotal.getWidth() - dimLast.getWidth()) / 2;
|
||||
return new UTranslate(x, dimTotal.getHeight() - dimLast.getHeight());
|
||||
@ -537,7 +537,7 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
|
||||
final List<Ftile> all = new ArrayList<>(tiles);
|
||||
all.add(tile2);
|
||||
|
@ -46,7 +46,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -127,14 +127,14 @@ public class FtileNoteAlone extends AbstractFtile implements Stencil, Styleable
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
if (withOutPoint) {
|
||||
return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());
|
||||
}
|
||||
return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0);
|
||||
}
|
||||
|
||||
private Dimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
private XDimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
return opale.calculateDimension(stringBounder);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@ -44,7 +43,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.ISkinSimple;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
@ -63,7 +61,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
@ -205,12 +204,12 @@ class FtileRepeat extends AbstractFtile {
|
||||
this.tbin = tbin;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getFtile1().calculateDimension(stringBounder).translate(getTranslateDiamond1(stringBounder))
|
||||
.getPointOut();
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getFtile2().calculateDimension(stringBounder).translate(getTranslateForRepeat(stringBounder))
|
||||
.getPointIn();
|
||||
}
|
||||
@ -220,13 +219,13 @@ class FtileRepeat extends AbstractFtile {
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).withLabel(tbin,
|
||||
arrowHorizontalAlignment());
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
snake.addPoint(p1);
|
||||
if (p1.getX() != p2.getX()) {
|
||||
final double my = (p1.getY() + p2.getY()) / 2;
|
||||
snake.addPoint(new Point2D.Double(p1.getX(), my));
|
||||
snake.addPoint(new Point2D.Double(p2.getX(), my));
|
||||
snake.addPoint(new XPoint2D(p1.getX(), my));
|
||||
snake.addPoint(new XPoint2D(p2.getX(), my));
|
||||
}
|
||||
snake.addPoint(p2);
|
||||
|
||||
@ -244,12 +243,12 @@ class FtileRepeat extends AbstractFtile {
|
||||
this.tbout = tbout;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateForRepeat(stringBounder)
|
||||
.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
@ -274,8 +273,8 @@ class FtileRepeat extends AbstractFtile {
|
||||
return;
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor);
|
||||
final Point2D mp1a = translate1.getTranslated(getP1(stringBounder));
|
||||
final Point2D mp2b = translate2.getTranslated(getP2(stringBounder));
|
||||
final XPoint2D mp1a = translate1.getTranslated(getP1(stringBounder));
|
||||
final XPoint2D mp2b = translate2.getTranslated(getP2(stringBounder));
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -300,12 +299,12 @@ class FtileRepeat extends AbstractFtile {
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -315,14 +314,14 @@ class FtileRepeat extends AbstractFtile {
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
final XDimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
|
||||
Point2D p1 = getP1(stringBounder);
|
||||
Point2D p2 = getP2(stringBounder);
|
||||
XPoint2D p1 = getP1(stringBounder);
|
||||
XPoint2D p2 = getP2(stringBounder);
|
||||
p1 = translate1.getTranslated(p1);
|
||||
p2 = translate2.getTranslated(p2);
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double y1 = p1.getY() + dimDiamond2.getHeight() / 2;
|
||||
double x2 = p2.getX() + dimDiamond1.getWidth();
|
||||
final double y2 = p2.getY() + dimDiamond1.getHeight() / 2;
|
||||
@ -366,21 +365,21 @@ class FtileRepeat extends AbstractFtile {
|
||||
this.tbback = tbback;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
final FtileGeometry dim = backward.calculateDimension(stringBounder);
|
||||
return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getOutY()));
|
||||
return getTranslateBackward(stringBounder).getTranslated(new XPoint2D(dim.getLeft(), dim.getOutY()));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x1 = p1.getX() + dimDiamond2.getWidth();
|
||||
final double y1 = p1.getY() + dimDiamond2.getHeight() / 2;
|
||||
final double x2 = p2.getX();
|
||||
@ -400,12 +399,12 @@ class FtileRepeat extends AbstractFtile {
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
Point2D p1 = getP1(stringBounder);
|
||||
Point2D p2 = getP2(stringBounder);
|
||||
XPoint2D p1 = getP1(stringBounder);
|
||||
XPoint2D p2 = getP2(stringBounder);
|
||||
p1 = translate1.getTranslated(p1);
|
||||
p2 = translate2.getTranslated(p2);
|
||||
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x1 = p1.getX() + dimDiamond2.getWidth();
|
||||
final double y1 = p1.getY() + dimDiamond2.getHeight() / 2;
|
||||
final double x2 = p2.getX();
|
||||
@ -433,25 +432,25 @@ class FtileRepeat extends AbstractFtile {
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
final FtileGeometry dim = backward.calculateDimension(stringBounder);
|
||||
return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getInY()));
|
||||
return getTranslateBackward(stringBounder).getTranslated(new XPoint2D(dim.getLeft(), dim.getInY()));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
Point2D p1 = getP1(stringBounder);
|
||||
Point2D p2 = getP2(stringBounder);
|
||||
XPoint2D p1 = getP1(stringBounder);
|
||||
XPoint2D p2 = getP2(stringBounder);
|
||||
p1 = translate1.getTranslated(p1);
|
||||
p2 = translate2.getTranslated(p2);
|
||||
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
@ -480,9 +479,9 @@ class FtileRepeat extends AbstractFtile {
|
||||
if (label != null) {
|
||||
snake = snake.withLabel(label, arrowHorizontalAlignment());
|
||||
}
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
final double x2 = p2.getX() + dimDiamond1.getWidth();
|
||||
@ -507,12 +506,12 @@ class FtileRepeat extends AbstractFtile {
|
||||
this.tbback = tbback;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -520,11 +519,11 @@ class FtileRepeat extends AbstractFtile {
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft())
|
||||
.emphasizeDirection(Direction.UP).withLabel(tbback, arrowHorizontalAlignment());
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x1 = p1.getX() + dimDiamond2.getWidth();
|
||||
final double y1 = p1.getY() + dimDiamond2.getHeight() / 2;
|
||||
final double x2 = p2.getX() + dimDiamond1.getWidth();
|
||||
@ -544,14 +543,14 @@ class FtileRepeat extends AbstractFtile {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToLeft())
|
||||
.emphasizeDirection(Direction.UP).withLabel(tbback, arrowHorizontalAlignment());
|
||||
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
final XDimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
|
||||
Point2D p1 = getP1(stringBounder);
|
||||
Point2D p2 = getP2(stringBounder);
|
||||
XPoint2D p1 = getP1(stringBounder);
|
||||
XPoint2D p2 = getP2(stringBounder);
|
||||
p1 = translate1.getTranslated(p1);
|
||||
p2 = translate2.getTranslated(p2);
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x1 = p1.getX() + dimDiamond2.getWidth();
|
||||
final double y1 = p1.getY() + dimDiamond2.getHeight() / 2;
|
||||
final double x2 = p2.getX() + dimDiamond1.getWidth();
|
||||
@ -581,14 +580,14 @@ class FtileRepeat extends AbstractFtile {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
return new FtileGeometry(dimTotal, getLeft(stringBounder), 0, dimTotal.getHeight());
|
||||
}
|
||||
|
||||
private Dimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
private XDimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
|
||||
final double w = tbTest.calculateDimension(stringBounder).getWidth();
|
||||
|
||||
@ -599,7 +598,7 @@ class FtileRepeat extends AbstractFtile {
|
||||
|
||||
final double height = dimDiamond1.getHeight() + dimRepeat.getHeight() + dimDiamond2.getHeight()
|
||||
+ 8 * Hexagon.hexagonHalfSize;
|
||||
return new Dimension2DDouble(width + 2 * Hexagon.hexagonHalfSize, height);
|
||||
return new XDimension2D(width + 2 * Hexagon.hexagonHalfSize, height);
|
||||
|
||||
}
|
||||
|
||||
@ -616,10 +615,10 @@ class FtileRepeat extends AbstractFtile {
|
||||
|
||||
private UTranslate getTranslateForRepeat(StringBounder stringBounder) {
|
||||
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
final double space = dimTotal.getHeight() - dimDiamond1.getHeight() - dimDiamond2.getHeight()
|
||||
- dimRepeat.getHeight();
|
||||
final double y = dimDiamond1.getHeight() + space / 2;
|
||||
@ -629,14 +628,14 @@ class FtileRepeat extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslateDiamond1(StringBounder stringBounder) {
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final double left = getLeft(stringBounder);
|
||||
return UTranslate.dx(left - dimDiamond1.getWidth() / 2);
|
||||
}
|
||||
|
||||
private UTranslate getTranslateBackward(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dimBackward = backward.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimBackward = backward.calculateDimension(stringBounder);
|
||||
final double x = dimTotal.getWidth() - dimBackward.getWidth();
|
||||
final double y = (dimTotal.getHeight() - dimBackward.getHeight()) / 2;
|
||||
|
||||
@ -644,16 +643,16 @@ class FtileRepeat extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslateDiamond2(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double y2 = dimTotal.getHeight() - dimDiamond2.getHeight();
|
||||
final double left = getLeft(stringBounder);
|
||||
return new UTranslate(left - dimDiamond2.getWidth() / 2, y2);
|
||||
}
|
||||
|
||||
private double getLeft(StringBounder stringBounder) {
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
double left1 = repeat.calculateDimension(stringBounder).getLeft();
|
||||
left1 = Math.max(left1, dimDiamond1.getWidth() / 2);
|
||||
double left2 = repeat.calculateDimension(stringBounder).getLeft();
|
||||
@ -662,9 +661,9 @@ class FtileRepeat extends AbstractFtile {
|
||||
}
|
||||
|
||||
private double getRight(StringBounder stringBounder) {
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
double right1 = dimRepeat.getWidth() - repeat.calculateDimension(stringBounder).getLeft();
|
||||
right1 = Math.max(right1, dimDiamond1.getWidth() / 2);
|
||||
double right2 = dimRepeat.getWidth() - repeat.calculateDimension(stringBounder).getLeft();
|
||||
|
@ -41,12 +41,11 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -96,7 +95,7 @@ class FtileSplit1 extends AbstractFtile {
|
||||
double height = 0;
|
||||
double width = 0;
|
||||
for (Ftile ftile : forks) {
|
||||
final Dimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = ftile.calculateDimension(stringBounder);
|
||||
if (dim.getWidth() > width) {
|
||||
width = dim.getWidth();
|
||||
}
|
||||
@ -104,12 +103,12 @@ class FtileSplit1 extends AbstractFtile {
|
||||
height = dim.getHeight();
|
||||
}
|
||||
}
|
||||
final Dimension2D dimTotal = new Dimension2DDouble(width, height);
|
||||
final XDimension2D dimTotal = new XDimension2D(width, height);
|
||||
return new FtileGeometry(dimTotal, dimTotal.getWidth() / 2, 0, dimTotal.getHeight());
|
||||
}
|
||||
|
||||
public UTranslate getTranslateFor(Ftile searched, StringBounder stringBounder) {
|
||||
final Dimension2D dim = searched.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = searched.calculateDimension(stringBounder);
|
||||
final double xpos = calculateDimension(stringBounder).getWidth() - dim.getWidth();
|
||||
return UTranslate.dx(xpos / 2);
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
@ -53,7 +52,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMinWidthCentered;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
@ -165,18 +164,18 @@ class FtileSwitch extends AbstractFtile {
|
||||
}
|
||||
|
||||
private FtileGeometry calculateDimensionInternal(StringBounder stringBounder) {
|
||||
Dimension2D result = new Dimension2DDouble(0, 0);
|
||||
XDimension2D result = new XDimension2D(0, 0);
|
||||
for (Ftile couple : tiles)
|
||||
result = Dimension2DDouble.mergeLR(result, couple.calculateDimension(stringBounder));
|
||||
result = XDimension2D.mergeLR(result, couple.calculateDimension(stringBounder));
|
||||
|
||||
result = Dimension2DDouble.delta(result, xSeparation * (tiles.size() - 1), 100);
|
||||
result = XDimension2D.delta(result, xSeparation * (tiles.size() - 1), 100);
|
||||
|
||||
return new FtileGeometry(result, result.getWidth() / 2, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
|
||||
final List<Ftile> all = new ArrayList<>(tiles);
|
||||
for (Ftile tmp : all)
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@ -62,7 +61,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
@ -142,7 +142,7 @@ class FtileWhile extends AbstractFtile {
|
||||
final Ftile special = specialOut == null ? null : specialOut.createFtile(ftileFactory);
|
||||
final FtileWhile result = new FtileWhile(whileBlock, diamond1, special, backward);
|
||||
|
||||
final Dimension2D dim = whileBlock.calculateDimension(ftileFactory.getStringBounder());
|
||||
final XDimension2D dim = whileBlock.calculateDimension(ftileFactory.getStringBounder());
|
||||
final TextBlock back1 = incoming1.getDisplay().create(fontArrow, HorizontalAlignment.LEFT,
|
||||
ftileFactory.skinParam());
|
||||
|
||||
@ -176,12 +176,12 @@ class FtileWhile extends AbstractFtile {
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder)
|
||||
.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateForWhile(stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
@ -199,12 +199,12 @@ class FtileWhile extends AbstractFtile {
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown())
|
||||
.withMerge(MergeStrategy.LIMITED);
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -224,7 +224,7 @@ class FtileWhile extends AbstractFtile {
|
||||
this.back = back;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
|
||||
if (geo.hasPointOut() == false) {
|
||||
return null;
|
||||
@ -237,19 +237,19 @@ class FtileWhile extends AbstractFtile {
|
||||
return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
if (p1 == null) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
@ -278,11 +278,11 @@ class FtileWhile extends AbstractFtile {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft())
|
||||
.withMerge(MergeStrategy.LIMITED);
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final Point2D ap1 = getP1(stringBounder);
|
||||
final Point2D ap2 = getP2(stringBounder);
|
||||
final Point2D p1 = translate1.getTranslated(ap1);
|
||||
final Point2D p2 = translate2.getTranslated(ap2);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XPoint2D ap1 = getP1(stringBounder);
|
||||
final XPoint2D ap2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = translate1.getTranslated(ap1);
|
||||
final XPoint2D p2 = translate2.getTranslated(ap2);
|
||||
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
|
||||
@ -320,7 +320,7 @@ class FtileWhile extends AbstractFtile {
|
||||
this.back = back;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
|
||||
if (geo.hasPointOut() == false) {
|
||||
return null;
|
||||
@ -333,19 +333,19 @@ class FtileWhile extends AbstractFtile {
|
||||
return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
final FtileGeometry dim = backward.calculateDimension(stringBounder);
|
||||
return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getOutY()));
|
||||
return getTranslateBackward(stringBounder).getTranslated(new XPoint2D(dim.getLeft(), dim.getOutY()));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
if (p1 == null) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
final double x2 = p2.getX();
|
||||
@ -374,13 +374,13 @@ class FtileWhile extends AbstractFtile {
|
||||
this.back = back;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
final FtileGeometry dim = backward.calculateDimension(stringBounder);
|
||||
return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getInY()));
|
||||
return getTranslateBackward(stringBounder).getTranslated(new XPoint2D(dim.getLeft(), dim.getInY()));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -389,8 +389,8 @@ class FtileWhile extends AbstractFtile {
|
||||
final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft()).withLabel(back,
|
||||
arrowHorizontalAlignment());
|
||||
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
@ -415,7 +415,7 @@ class FtileWhile extends AbstractFtile {
|
||||
this.endInlinkColor = endInlinkColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder)
|
||||
.getTranslated(diamond1.calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
@ -425,8 +425,8 @@ class FtileWhile extends AbstractFtile {
|
||||
return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -434,9 +434,9 @@ class FtileWhile extends AbstractFtile {
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), endInlinkColor, Arrows.asToLeft())
|
||||
.emphasizeDirection(Direction.UP);
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
@ -470,13 +470,13 @@ class FtileWhile extends AbstractFtile {
|
||||
this.afterEndwhileColor = afterEndwhileColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
final FtileGeometry dimTotal = calculateDimension(stringBounder);
|
||||
return new Point2D.Double(dimTotal.getLeft(), dimTotal.getHeight());
|
||||
return new XPoint2D(dimTotal.getLeft(), dimTotal.getHeight());
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
@ -486,8 +486,8 @@ class FtileWhile extends AbstractFtile {
|
||||
.emphasizeDirection(Direction.DOWN);
|
||||
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
|
||||
@ -518,11 +518,11 @@ class FtileWhile extends AbstractFtile {
|
||||
this.afterEndwhileColor = afterEndwhileColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateForSpecial(stringBounder)
|
||||
.getTranslated(specialOut.calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
@ -533,8 +533,8 @@ class FtileWhile extends AbstractFtile {
|
||||
final Snake snake = Snake.create(skinParam(), afterEndwhileColor, Arrows.asToDown());
|
||||
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
|
||||
@ -564,8 +564,8 @@ class FtileWhile extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslateBackward(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionFtile(stringBounder);
|
||||
final Dimension2D dimBackward = backward.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionFtile(stringBounder);
|
||||
final XDimension2D dimBackward = backward.calculateDimension(stringBounder);
|
||||
final double x = dimTotal.getWidth() - dimBackward.getWidth();
|
||||
final double y = (dimTotal.getHeight() - dimBackward.getHeight()) / 2;
|
||||
|
||||
|
@ -35,14 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.AlignmentParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
@ -51,7 +49,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -155,9 +154,9 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
|
||||
}
|
||||
|
||||
private UTranslate getTranslate(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final double yForFtile = (dimTotal.getHeight() - dimTile.getHeight()) / 2;
|
||||
final double marge;
|
||||
if (notePosition == NotePosition.LEFT)
|
||||
@ -178,8 +177,8 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
|
||||
|
||||
private UTranslate getTranslateForOpale(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final Dimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
|
||||
final double yForNote;
|
||||
if (verticalAlignment == VerticalAlignment.CENTER)
|
||||
@ -202,17 +201,17 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
|
||||
intoSw = null;
|
||||
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
final XDimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
|
||||
if (notePosition == NotePosition.LEFT) {
|
||||
final Direction strategy = Direction.RIGHT;
|
||||
final Point2D pp1 = new Point2D.Double(dimNote.getWidth(), dimNote.getHeight() / 2);
|
||||
final Point2D pp2 = new Point2D.Double(dimNote.getWidth() + suppSpace, dimNote.getHeight() / 2);
|
||||
final XPoint2D pp1 = new XPoint2D(dimNote.getWidth(), dimNote.getHeight() / 2);
|
||||
final XPoint2D pp2 = new XPoint2D(dimNote.getWidth() + suppSpace, dimNote.getHeight() / 2);
|
||||
opale.setOpale(strategy, pp1, pp2);
|
||||
} else {
|
||||
final Direction strategy = Direction.LEFT;
|
||||
final Point2D pp1 = new Point2D.Double(0, dimNote.getHeight() / 2);
|
||||
final Point2D pp2 = new Point2D.Double(-suppSpace, dimNote.getHeight() / 2);
|
||||
final XPoint2D pp1 = new XPoint2D(0, dimNote.getHeight() / 2);
|
||||
final XPoint2D pp2 = new XPoint2D(-suppSpace, dimNote.getHeight() / 2);
|
||||
opale.setOpale(strategy, pp1, pp2);
|
||||
}
|
||||
|
||||
@ -224,7 +223,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final FtileGeometry orig = tile.calculateDimension(stringBounder);
|
||||
final UTranslate translate = getTranslate(stringBounder);
|
||||
if (orig.hasPointOut())
|
||||
@ -234,11 +233,11 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
|
||||
return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy());
|
||||
}
|
||||
|
||||
private Dimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final Dimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
private XDimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final XDimension2D dimNote = opale.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final double height = Math.max(dimNote.getHeight(), dimTile.getHeight());
|
||||
return new Dimension2DDouble(dimTile.getWidth() + 1 * dimNote.getWidth() + suppSpace, height);
|
||||
return new XDimension2D(dimTile.getWidth() + 1 * dimNote.getWidth() + suppSpace, height);
|
||||
}
|
||||
|
||||
public double getStartingX(StringBounder stringBounder, double y) {
|
||||
|
@ -38,7 +38,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
||||
@ -46,7 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -161,8 +160,8 @@ public class FtileWithNotes extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslate(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final double xDelta = left.calculateDimension(stringBounder).getWidth();
|
||||
final double yDelta;
|
||||
if (verticalAlignment == VerticalAlignment.TOP)
|
||||
@ -173,8 +172,8 @@ public class FtileWithNotes extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslateForLeft(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final double xDelta = 0;
|
||||
final double yDelta;
|
||||
if (verticalAlignment == VerticalAlignment.TOP)
|
||||
@ -185,8 +184,8 @@ public class FtileWithNotes extends AbstractFtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslateForRight(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
final double xDelta = dimTotal.getWidth() - dimRight.getWidth();
|
||||
final double yDelta;
|
||||
if (verticalAlignment == VerticalAlignment.TOP)
|
||||
@ -205,7 +204,7 @@ public class FtileWithNotes extends AbstractFtile {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final FtileGeometry orig = tile.calculateDimension(stringBounder);
|
||||
final UTranslate translate = getTranslate(stringBounder);
|
||||
if (orig.hasPointOut()) {
|
||||
@ -215,12 +214,12 @@ public class FtileWithNotes extends AbstractFtile {
|
||||
return new FtileGeometry(dimTotal, orig.getLeft() + translate.getDx(), orig.getInY() + translate.getDy());
|
||||
}
|
||||
|
||||
private Dimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final Dimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final Dimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
private XDimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final XDimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final XDimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final XDimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
final double height = MathUtils.max(dimLeft.getHeight(), dimRight.getHeight(), dimTile.getHeight());
|
||||
return new Dimension2DDouble(dimTile.getWidth() + dimLeft.getWidth() + dimRight.getWidth(), height);
|
||||
return new XDimension2D(dimTile.getWidth() + dimLeft.getWidth() + dimRight.getWidth(), height);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -35,11 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
@ -54,7 +52,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -62,7 +61,6 @@ import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.style.Style;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
import net.sourceforge.plantuml.ugraphic.color.HColor;
|
||||
|
||||
public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
|
||||
@ -134,7 +132,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
final Ftile black = new FtileBlackBlock(skinParam(), swimlaneBlack);
|
||||
double x = 0;
|
||||
for (Ftile tmp : list99) {
|
||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
final XDimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
|
||||
final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def);
|
||||
conns.add(new ConnectionIn(black, tmp, x, rainbow));
|
||||
@ -155,7 +153,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
if (text == null)
|
||||
continue;
|
||||
|
||||
final Dimension2D dim = text.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = text.calculateDimension(stringBounder);
|
||||
result = Math.max(result, dim.getHeight());
|
||||
|
||||
}
|
||||
@ -169,7 +167,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
if (text == null)
|
||||
continue;
|
||||
|
||||
final Dimension2D dim = text.calculateDimension(stringBounder);
|
||||
final XDimension2D dim = text.calculateDimension(stringBounder);
|
||||
result = Math.max(result, dim.getHeight());
|
||||
}
|
||||
return result;
|
||||
@ -193,7 +191,7 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
final Style style = getStyleSignatureArrow().getMergedStyle(skinParam().getCurrentStyleBuilder());
|
||||
double x = 0;
|
||||
for (Ftile tmp : list99) {
|
||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
final XDimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
|
||||
final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def);
|
||||
if (tmp.calculateDimension(getStringBounder()).hasPointOut())
|
||||
@ -229,8 +227,8 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0);
|
||||
final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY());
|
||||
final XPoint2D p1 = new XPoint2D(geo2.getLeft(), 0);
|
||||
final XPoint2D p2 = new XPoint2D(geo2.getLeft(), geo2.getInY());
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
@ -240,15 +238,15 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
ug = ug.apply(UTranslate.dx(x));
|
||||
final FtileGeometry geo2 = getFtile2().calculateDimension(getStringBounder());
|
||||
final Point2D p1 = new Point2D.Double(geo2.getLeft(), 0);
|
||||
final Point2D p2 = new Point2D.Double(geo2.getLeft(), geo2.getInY());
|
||||
final XPoint2D p1 = new XPoint2D(geo2.getLeft(), 0);
|
||||
final XPoint2D p2 = new XPoint2D(geo2.getLeft(), geo2.getInY());
|
||||
|
||||
Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).ignoreForCompression();
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = mp1a.getY() + 4;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -283,8 +281,8 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D p1 = new Point2D.Double(geo1.getLeft(), barHeight + geo1.getOutY());
|
||||
final Point2D p2 = new Point2D.Double(geo1.getLeft(), justBeforeBar2);
|
||||
final XPoint2D p1 = new XPoint2D(geo1.getLeft(), barHeight + geo1.getOutY());
|
||||
final XPoint2D p2 = new XPoint2D(geo1.getLeft(), justBeforeBar2);
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
@ -297,15 +295,15 @@ public class ParallelBuilderFork extends AbstractParallelFtilesBuilder {
|
||||
if (geo.hasPointOut() == false)
|
||||
return;
|
||||
|
||||
final Point2D p1 = new Point2D.Double(geo.getLeft(), barHeight + geo.getOutY());
|
||||
final Point2D p2 = new Point2D.Double(geo.getLeft(), justBeforeBar2);
|
||||
final XPoint2D p1 = new XPoint2D(geo.getLeft(), barHeight + geo.getOutY());
|
||||
final XPoint2D p2 = new XPoint2D(geo.getLeft(), justBeforeBar2);
|
||||
|
||||
Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown()).ignoreForCompression();
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = mp2b.getY() - 14;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -35,11 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
@ -52,7 +50,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBlackBlock;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -77,7 +76,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
|
||||
final Ftile black = new FtileBlackBlock(skinParam(), list99.get(0).getSwimlaneIn());
|
||||
double x = 0;
|
||||
for (Ftile tmp : list99) {
|
||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
final XDimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
Style style = getStyleSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
|
||||
final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
|
||||
final Rainbow rainbow = tmp.getInLinkRendering().getRainbow(def);
|
||||
@ -108,7 +107,7 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
|
||||
|
||||
double x = 0;
|
||||
for (Ftile tmp : list99) {
|
||||
final Dimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
final XDimension2D dim = tmp.calculateDimension(getStringBounder());
|
||||
final UTranslate translate0 = new UTranslate(x, barHeight);
|
||||
final Rainbow def = Rainbow.build(style, skinParam().getIHtmlColorSet(), skinParam().getThemeStyle());
|
||||
final Rainbow rainbow = tmp.getOutLinkRendering().getRainbow(def);
|
||||
@ -137,8 +136,8 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder, p1.getX());
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder, p1.getX());
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
final double x2 = p2.getX();
|
||||
@ -161,22 +160,22 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
return translate0.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder, double startX) {
|
||||
private XPoint2D getP2(StringBounder stringBounder, double startX) {
|
||||
final UTranslate arrival = arrivalOnDiamond(stringBounder, startX);
|
||||
return arrival.getTranslated(getDiamondOut(stringBounder));
|
||||
}
|
||||
|
||||
public Point2D getDiamondOut(StringBounder stringBounder) {
|
||||
public XPoint2D getDiamondOut(StringBounder stringBounder) {
|
||||
return diamondTranslate.getTranslated(getFtile2().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
||||
public UTranslate arrivalOnDiamond(StringBounder stringBounder, double startX) {
|
||||
final Point2D result = getDiamondOut(stringBounder);
|
||||
final Dimension2D dim = getFtile2().calculateDimension(stringBounder);
|
||||
final XPoint2D result = getDiamondOut(stringBounder);
|
||||
final XDimension2D dim = getFtile2().calculateDimension(stringBounder);
|
||||
final double a = result.getX() - dim.getWidth() / 2;
|
||||
final double b = result.getX() + dim.getWidth() / 2;
|
||||
|
||||
@ -222,15 +221,15 @@ public class ParallelBuilderMerge extends AbstractParallelFtilesBuilder {
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
ug = ug.apply(UTranslate.dx(x));
|
||||
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
|
||||
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
|
||||
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
|
||||
final XPoint2D p1 = new XPoint2D(geo.getLeft(), 0);
|
||||
final XPoint2D p2 = new XPoint2D(geo.getLeft(), geo.getInY());
|
||||
|
||||
Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = mp1a.getY() + 4;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -52,6 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileThinSplit;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
@ -211,15 +211,15 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
ug = ug.apply(UTranslate.dx(x));
|
||||
final FtileGeometry geo = getFtile2().calculateDimension(getStringBounder());
|
||||
final Point2D p1 = new Point2D.Double(geo.getLeft(), 0);
|
||||
final Point2D p2 = new Point2D.Double(geo.getLeft(), geo.getInY());
|
||||
final XPoint2D p1 = new XPoint2D(geo.getLeft(), 0);
|
||||
final XPoint2D p2 = new XPoint2D(geo.getLeft(), geo.getInY());
|
||||
|
||||
Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = mp1a.getY() + 4;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -257,8 +257,8 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY()));
|
||||
final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height));
|
||||
final XPoint2D p1 = translate0.getTranslated(new XPoint2D(geo.getLeft(), geo.getOutY()));
|
||||
final XPoint2D p2 = translate0.getTranslated(new XPoint2D(geo.getLeft(), height));
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
@ -271,15 +271,15 @@ public class ParallelBuilderSplit extends AbstractParallelFtilesBuilder {
|
||||
if (geo.hasPointOut() == false)
|
||||
return;
|
||||
|
||||
final Point2D p1 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), geo.getOutY()));
|
||||
final Point2D p2 = translate0.getTranslated(new Point2D.Double(geo.getLeft(), height));
|
||||
final XPoint2D p1 = translate0.getTranslated(new XPoint2D(geo.getLeft(), geo.getOutY()));
|
||||
final XPoint2D p2 = translate0.getTranslated(new XPoint2D(geo.getLeft(), height));
|
||||
|
||||
Snake snake = Snake.create(skinParam(), arrowColor, Arrows.asToDown());
|
||||
if (Display.isNull(label) == false)
|
||||
snake = snake.withLabel(getTextBlock(label), arrowHorizontalAlignment());
|
||||
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = mp2b.getY() - 14;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -51,7 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileIfDown;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -199,8 +199,8 @@ public class ConditionalBuilder {
|
||||
final Ftile diamond2 = getShape2(branch1, branch2, false);
|
||||
final FtileIfWithDiamonds ftile = new FtileIfWithDiamonds(diamond1, tile1, tile2, diamond2, swimlane,
|
||||
stringBounder);
|
||||
final Dimension2D label1 = getLabelPositive(branch1).calculateDimension(stringBounder);
|
||||
final Dimension2D label2 = getLabelPositive(branch2).calculateDimension(stringBounder);
|
||||
final XDimension2D label1 = getLabelPositive(branch1).calculateDimension(stringBounder);
|
||||
final XDimension2D label2 = getLabelPositive(branch2).calculateDimension(stringBounder);
|
||||
final double diff1 = ftile.computeMarginNeedForBranchLabe1(stringBounder, label1);
|
||||
final double diff2 = ftile.computeMarginNeedForBranchLabe2(stringBounder, label2);
|
||||
Ftile result = FtileUtils.addHorizontalMargin(ftile, diff1, diff2);
|
||||
@ -219,8 +219,8 @@ public class ConditionalBuilder {
|
||||
final Ftile tmp2 = FtileUtils.addHorizontalMargin(tile2, 10);
|
||||
final FtileIfWithLinks ftile = new FtileIfWithLinks(diamond1, tmp1, tmp2, diamond2, swimlane, arrowColor,
|
||||
conditionEndStyle, stringBounder);
|
||||
final Dimension2D label1 = getLabelPositive(branch1).calculateDimension(stringBounder);
|
||||
final Dimension2D label2 = getLabelPositive(branch2).calculateDimension(stringBounder);
|
||||
final XDimension2D label1 = getLabelPositive(branch1).calculateDimension(stringBounder);
|
||||
final XDimension2D label2 = getLabelPositive(branch2).calculateDimension(stringBounder);
|
||||
final double diff1 = ftile.computeMarginNeedForBranchLabe1(stringBounder, label1);
|
||||
final double diff2 = ftile.computeMarginNeedForBranchLabe2(stringBounder, label2);
|
||||
final double suppHeight = ftile.computeVerticalMarginNeedForBranchs(stringBounder, label1, label2);
|
||||
|
@ -41,11 +41,10 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -101,8 +100,8 @@ public class FtileIfNude extends FtileDimensionMemoize {
|
||||
}
|
||||
|
||||
protected UTranslate getTranslate2(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final Dimension2D dim2 = tile2.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dim2 = tile2.calculateDimension(stringBounder);
|
||||
|
||||
final double x2 = dimTotal.getWidth() - dim2.getWidth();
|
||||
final double y2 = 0;
|
||||
@ -146,7 +145,7 @@ public class FtileIfNude extends FtileDimensionMemoize {
|
||||
final double innerMargin = widthInner(stringBounder);
|
||||
final double width = dim1.getLeft() + innerMargin + (dim2.getWidth() - dim2.getLeft());
|
||||
|
||||
final Dimension2D dim12 = Dimension2DDouble.mergeLR(dim1, dim2);
|
||||
final XDimension2D dim12 = XDimension2D.mergeLR(dim1, dim2);
|
||||
|
||||
return new FtileGeometry(width, dim12.getHeight(), dim1.getLeft() + innerMargin / 2, 0);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import java.util.Collection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -136,7 +136,7 @@ public class FtileIfWithDiamonds extends FtileIfNude {
|
||||
return new UTranslate(x2, y2);
|
||||
}
|
||||
|
||||
public double computeMarginNeedForBranchLabe1(StringBounder stringBounder, Dimension2D label1) {
|
||||
public double computeMarginNeedForBranchLabe1(StringBounder stringBounder, XDimension2D label1) {
|
||||
final double widthLabelBranch1 = label1.getWidth();
|
||||
final double dxDiamond = getTranslateDiamond1(stringBounder).getDx();
|
||||
final double diff = widthLabelBranch1 - dxDiamond;
|
||||
@ -146,7 +146,7 @@ public class FtileIfWithDiamonds extends FtileIfNude {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double computeMarginNeedForBranchLabe2(StringBounder stringBounder, Dimension2D label2) {
|
||||
public double computeMarginNeedForBranchLabe2(StringBounder stringBounder, XDimension2D label2) {
|
||||
final double widthLabelBranch2 = label2.getWidth();
|
||||
final double theoricalEndNeeded = getTranslateDiamond1(stringBounder).getDx()
|
||||
+ diamond1.calculateDimension(stringBounder).getWidth() + widthLabelBranch2;
|
||||
@ -157,8 +157,8 @@ public class FtileIfWithDiamonds extends FtileIfNude {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double computeVerticalMarginNeedForBranchs(StringBounder stringBounder, Dimension2D label1,
|
||||
Dimension2D label2) {
|
||||
public double computeVerticalMarginNeedForBranchs(StringBounder stringBounder, XDimension2D label1,
|
||||
XDimension2D label2) {
|
||||
final double heightLabels = Math.max(label1.getHeight(), label2.getHeight());
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final double dyDiamond = dimDiamond1.getHeight();
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -53,7 +52,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.UGraphicInterceptorOneSwimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -93,8 +93,8 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
final double x2 = p2.getX();
|
||||
@ -108,9 +108,9 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Point2D pt;
|
||||
final XPoint2D pt;
|
||||
if (getFtile2() == tile1) {
|
||||
pt = dimDiamond1.getPointD();
|
||||
} else if (getFtile2() == tile2) {
|
||||
@ -121,7 +121,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(pt);
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return translate(stringBounder).getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
|
||||
@ -138,15 +138,15 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
Point2D p1 = getP1(stringBounder);
|
||||
Point2D p2 = getP2(stringBounder);
|
||||
XPoint2D p1 = getP1(stringBounder);
|
||||
XPoint2D p2 = getP2(stringBounder);
|
||||
final Direction originalDirection = Direction.leftOrRight(p1, p2);
|
||||
p1 = translate1.getTranslated(p1);
|
||||
p2 = translate2.getTranslated(p2);
|
||||
final Direction newDirection = Direction.leftOrRight(p1, p2);
|
||||
if (originalDirection != newDirection) {
|
||||
final double delta = (originalDirection == Direction.RIGHT ? -1 : 1) * Hexagon.hexagonHalfSize;
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Snake small = Snake.create(skinParam(), color);
|
||||
small.addPoint(p1);
|
||||
small.addPoint(p1.getX() + delta, p1.getY());
|
||||
@ -181,8 +181,8 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
if (geo.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
@ -201,9 +201,9 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final Point2D pt;
|
||||
final XPoint2D pt;
|
||||
if (getFtile1() == tile1) {
|
||||
pt = dimDiamond2.getPointD();
|
||||
} else if (getFtile1() == tile2) {
|
||||
@ -231,19 +231,19 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
if (geo.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final Direction originalDirection = Direction.leftOrRight(p1, p2);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double x2 = p2.getX();
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final Direction newDirection = Direction.leftOrRight(mp1a, mp2b);
|
||||
final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft();
|
||||
if (originalDirection == newDirection) {
|
||||
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
|
||||
final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY());
|
||||
final XPoint2D mp2bc = new XPoint2D(mp2b.getX() + delta, mp2b.getY());
|
||||
final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED);
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
@ -258,7 +258,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
ug.draw(small);
|
||||
} else {
|
||||
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
|
||||
final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta,
|
||||
final XPoint2D mp2bb = new XPoint2D(mp2b.getX() + delta,
|
||||
mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize);
|
||||
final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED);
|
||||
snake.addPoint(mp1a);
|
||||
@ -295,8 +295,8 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
if (geo.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final Point2D p2 = new Point2D.Double(dimTotal.getLeft(), dimTotal.getHeight());
|
||||
final XPoint2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final XPoint2D p2 = new XPoint2D(dimTotal.getLeft(), dimTotal.getHeight());
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
@ -324,11 +324,11 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
if (geo.hasPointOut() == false) {
|
||||
return;
|
||||
}
|
||||
final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final Point2D p2 = new Point2D.Double(dimTotal.getLeft(), dimTotal.getHeight() - Hexagon.hexagonHalfSize);
|
||||
final XPoint2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final XPoint2D p2 = new XPoint2D(dimTotal.getLeft(), dimTotal.getHeight() - Hexagon.hexagonHalfSize);
|
||||
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), myArrowColor).withMerge(MergeStrategy.LIMITED);
|
||||
// snake.emphasizeDirection(Direction.DOWN);
|
||||
@ -377,14 +377,14 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
return;
|
||||
}
|
||||
|
||||
final Point2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
final XPoint2D p1 = geo.translate(translate(stringBounder)).getPointOut();
|
||||
|
||||
final double totalHeight = calculateDimensionInternal(stringBounder).getHeight();
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
if (p1 == null) {
|
||||
return;
|
||||
}
|
||||
final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
|
||||
final XPoint2D p2 = new XPoint2D(p1.getX(), totalHeight);
|
||||
|
||||
final Snake snake = Snake.create(skinParam(), color, Arrows.asToDown()).withLabel(out2,
|
||||
arrowHorizontalAlignment());
|
||||
@ -403,10 +403,10 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
/*
|
||||
* private Point2D getP1(StringBounder stringBounder) {
|
||||
* private XPoint2D getP1(StringBounder stringBounder) {
|
||||
*
|
||||
* final FtileGeometry geo = getFtile1().calculateDimension(stringBounder); if
|
||||
* (geo.hasPointOut() == false) { return null; } final Point2D p =
|
||||
* (geo.hasPointOut() == false) { return null; } final XPoint2D p =
|
||||
* geo.getPointOut(); return getTranslate1(stringBounder).getTranslated(p); }
|
||||
*/
|
||||
}
|
||||
@ -423,7 +423,7 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D totalDim = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D totalDim = calculateDimensionInternal(stringBounder);
|
||||
|
||||
final List<Ftile> allTiles = new ArrayList<>();
|
||||
allTiles.add(tile1);
|
||||
|
@ -41,11 +41,10 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -126,11 +125,11 @@ public class FtileSwitchNude extends FtileDimensionMemoize {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionInternalSlow(StringBounder stringBounder) {
|
||||
Dimension2D result = new Dimension2DDouble(0, 0);
|
||||
XDimension2D result = new XDimension2D(0, 0);
|
||||
for (Ftile couple : tiles)
|
||||
result = Dimension2DDouble.mergeLR(result, couple.calculateDimension(stringBounder));
|
||||
result = XDimension2D.mergeLR(result, couple.calculateDimension(stringBounder));
|
||||
|
||||
result = Dimension2DDouble.delta(result, xSeparation * (tiles.size() - 1), 100);
|
||||
result = XDimension2D.delta(result, xSeparation * (tiles.size() - 1), 100);
|
||||
|
||||
return new FtileGeometry(result, result.getWidth() / 2, 0);
|
||||
}
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -50,6 +49,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
@ -80,8 +80,8 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
@ -106,9 +106,9 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Point2D pt;
|
||||
final XPoint2D pt;
|
||||
if (getFtile2() == tiles.get(0))
|
||||
pt = dimDiamond1.getPointD();
|
||||
else if (isLast())
|
||||
@ -123,7 +123,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
return getFtile2() == tiles.get(tiles.size() - 1);
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateOf(getFtile2(), stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
@ -145,15 +145,15 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
if (geo.hasPointOut() == false)
|
||||
return;
|
||||
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
|
||||
final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final Point2D ptA = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointA());
|
||||
final Point2D ptB = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointB());
|
||||
final Point2D ptD = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointD());
|
||||
final Point2D p2;
|
||||
final XPoint2D ptA = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointA());
|
||||
final XPoint2D ptB = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointB());
|
||||
final XPoint2D ptD = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointD());
|
||||
final XPoint2D p2;
|
||||
final UPolygon arrow;
|
||||
final Direction direction;
|
||||
if (x1 < ptD.getX()) {
|
||||
@ -187,7 +187,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
return getTranslateOf(getFtile1(), stringBounder)
|
||||
.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
@ -207,11 +207,11 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final UTranslate translateDiamond1 = getTranslateDiamond1(stringBounder);
|
||||
final Point2D p1b = translateDiamond1.getTranslated(dimDiamond1.getPointB());
|
||||
final Point2D p1c = translateDiamond1.getTranslated(dimDiamond1.getPointC());
|
||||
final Point2D p1d = translateDiamond1.getTranslated(dimDiamond1.getPointD());
|
||||
final XPoint2D p1b = translateDiamond1.getTranslated(dimDiamond1.getPointB());
|
||||
final XPoint2D p1c = translateDiamond1.getTranslated(dimDiamond1.getPointC());
|
||||
final XPoint2D p1d = translateDiamond1.getTranslated(dimDiamond1.getPointD());
|
||||
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final double x2 = p2.getX();
|
||||
final double y2 = p2.getY();
|
||||
|
||||
@ -233,7 +233,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateOf(getFtile2(), stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
@ -251,18 +251,18 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final UTranslate translateDiamond2 = getTranslateDiamond2(stringBounder);
|
||||
final Point2D p2a = translateDiamond2.getTranslated(dimDiamond2.getPointA());
|
||||
final Point2D p2b = translateDiamond2.getTranslated(dimDiamond2.getPointB());
|
||||
final Point2D p2d = translateDiamond2.getTranslated(dimDiamond2.getPointD());
|
||||
final XPoint2D p2a = translateDiamond2.getTranslated(dimDiamond2.getPointA());
|
||||
final XPoint2D p2b = translateDiamond2.getTranslated(dimDiamond2.getPointB());
|
||||
final XPoint2D p2d = translateDiamond2.getTranslated(dimDiamond2.getPointD());
|
||||
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final UTranslate translateDiamond1 = getTranslateDiamond1(stringBounder);
|
||||
final Point2D p1b = translateDiamond1.getTranslated(dimDiamond1.getPointB());
|
||||
final Point2D p1c = translateDiamond1.getTranslated(dimDiamond1.getPointC());
|
||||
final Point2D p1d = translateDiamond1.getTranslated(dimDiamond1.getPointD());
|
||||
final XPoint2D p1b = translateDiamond1.getTranslated(dimDiamond1.getPointB());
|
||||
final XPoint2D p1c = translateDiamond1.getTranslated(dimDiamond1.getPointC());
|
||||
final XPoint2D p1d = translateDiamond1.getTranslated(dimDiamond1.getPointD());
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
@ -287,7 +287,7 @@ public class FtileSwitchWithManyLinks extends FtileSwitchWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
return getTranslateOf(getFtile1(), stringBounder)
|
||||
.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -48,6 +47,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -73,8 +73,8 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
final double x2 = p2.getX();
|
||||
@ -89,12 +89,12 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(dimDiamond1.getPointC());
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateOf(getFtile2(), stringBounder)
|
||||
.getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
}
|
||||
@ -108,8 +108,8 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Point2D p2 = getP2(stringBounder);
|
||||
final XPoint2D p1 = getP1(stringBounder);
|
||||
final XPoint2D p2 = getP2(stringBounder);
|
||||
final double x1 = p1.getX();
|
||||
final double y1 = p1.getY();
|
||||
final double x2 = p2.getX();
|
||||
@ -123,12 +123,12 @@ public class FtileSwitchWithOneLink extends FtileSwitchWithDiamonds {
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
private Point2D getP1(StringBounder stringBounder) {
|
||||
private XPoint2D getP1(StringBounder stringBounder) {
|
||||
return getTranslateOf(getFtile1(), stringBounder)
|
||||
.getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
}
|
||||
|
||||
private Point2D getP2(StringBounder stringBounder) {
|
||||
private XPoint2D getP2(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointA());
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractFtile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -105,7 +105,7 @@ public class FtileBlackBlock extends AbstractFtile {
|
||||
getIHtmlColorSet());
|
||||
|
||||
ug.apply(colorBar).apply(colorBar.bg()).draw(rect);
|
||||
final Dimension2D dimLabel = label.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimLabel = label.calculateDimension(ug.getStringBounder());
|
||||
label.drawU(ug.apply(new UTranslate(width + labelMargin, -dimLabel.getHeight() / 2)));
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.SkinParamColors;
|
||||
@ -49,7 +48,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -129,7 +128,7 @@ public class FtileBox extends AbstractFtile {
|
||||
}
|
||||
|
||||
public double getEndingX(StringBounder stringBounder, double y) {
|
||||
final Dimension2D dim = calculateDimension(stringBounder);
|
||||
final XDimension2D dim = calculateDimension(stringBounder);
|
||||
return dim.getWidth() - padding.getRight();
|
||||
}
|
||||
|
||||
@ -188,7 +187,7 @@ public class FtileBox extends AbstractFtile {
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||
final double widthTotal = dimTotal.getWidth();
|
||||
final double heightTotal = dimTotal.getHeight();
|
||||
final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);
|
||||
@ -211,21 +210,21 @@ public class FtileBox extends AbstractFtile {
|
||||
if (horizontalAlignment == HorizontalAlignment.LEFT) {
|
||||
tb.drawU(ug.apply(new UTranslate(padding.getLeft(), padding.getTop())));
|
||||
} else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
|
||||
final Dimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
tb.drawU(ug.apply(
|
||||
new UTranslate(dimTotal.getWidth() - dimTb.getWidth() - padding.getRight(), padding.getBottom())));
|
||||
} else if (horizontalAlignment == HorizontalAlignment.CENTER) {
|
||||
final Dimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
tb.drawU(ug.apply(new UTranslate((dimTotal.getWidth() - dimTb.getWidth()) / 2, padding.getBottom())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
Dimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
dimRaw = Dimension2DDouble.delta(dimRaw, padding.getLeft() + padding.getRight(),
|
||||
XDimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
dimRaw = XDimension2D.delta(dimRaw, padding.getLeft() + padding.getRight(),
|
||||
padding.getBottom() + padding.getTop());
|
||||
dimRaw = Dimension2DDouble.atLeast(dimRaw, minimumWidth, 0);
|
||||
dimRaw = XDimension2D.atLeast(dimRaw, minimumWidth, 0);
|
||||
return new FtileGeometry(dimRaw.getWidth() + boxStyle.getShield(), dimRaw.getHeight(), dimRaw.getWidth() / 2, 0,
|
||||
dimRaw.getHeight());
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.SkinParamColors;
|
||||
@ -49,7 +48,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -130,7 +129,7 @@ public class FtileBox2 extends AbstractFtile {
|
||||
}
|
||||
|
||||
public double getEndingX(StringBounder stringBounder, double y) {
|
||||
final Dimension2D dim = calculateDimension(stringBounder);
|
||||
final XDimension2D dim = calculateDimension(stringBounder);
|
||||
return dim.getWidth() - padding.getRight();
|
||||
}
|
||||
|
||||
@ -190,12 +189,12 @@ public class FtileBox2 extends AbstractFtile {
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final Dimension2D dimRaw = getDimRaw(ug.getStringBounder());
|
||||
final XDimension2D dimRaw = getDimRaw(ug.getStringBounder());
|
||||
final double widthTotal = dimRaw.getWidth();
|
||||
final double heightTotal = dimRaw.getHeight();
|
||||
final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);
|
||||
|
||||
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||
ug.draw(new UEmpty(dimTotal));
|
||||
|
||||
final UStroke thickness = style.getStroke();
|
||||
@ -217,28 +216,28 @@ public class FtileBox2 extends AbstractFtile {
|
||||
if (horizontalAlignment == HorizontalAlignment.LEFT) {
|
||||
tb.drawU(ug.apply(new UTranslate(padding.getLeft(), padding.getTop())));
|
||||
} else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
|
||||
final Dimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
tb.drawU(ug.apply(
|
||||
new UTranslate(dimRaw.getWidth() - dimTb.getWidth() - padding.getRight(), padding.getBottom())));
|
||||
} else if (horizontalAlignment == HorizontalAlignment.CENTER) {
|
||||
final Dimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
tb.drawU(ug.apply(new UTranslate((dimRaw.getWidth() - dimTb.getWidth()) / 2, padding.getBottom())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
Dimension2D dimRaw = getDimRaw(stringBounder);
|
||||
XDimension2D dimRaw = getDimRaw(stringBounder);
|
||||
return new FtileGeometry(dimRaw.getWidth() + margin.getLeft() + margin.getRight(),
|
||||
dimRaw.getHeight() + margin.getTop() + margin.getBottom(), margin.getLeft() + dimRaw.getWidth() / 2,
|
||||
margin.getTop(), margin.getTop() + dimRaw.getHeight());
|
||||
}
|
||||
|
||||
private Dimension2D getDimRaw(StringBounder stringBounder) {
|
||||
Dimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
dimRaw = Dimension2DDouble.delta(dimRaw, padding.getLeft() + padding.getRight() + boxStyle.getShield(),
|
||||
private XDimension2D getDimRaw(StringBounder stringBounder) {
|
||||
XDimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
dimRaw = XDimension2D.delta(dimRaw, padding.getLeft() + padding.getRight() + boxStyle.getShield(),
|
||||
padding.getBottom() + padding.getTop());
|
||||
dimRaw = Dimension2DDouble.atLeast(dimRaw, minimumWidth, 0);
|
||||
dimRaw = XDimension2D.atLeast(dimRaw, minimumWidth, 0);
|
||||
return dimRaw;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.SkinParamColors;
|
||||
@ -49,7 +48,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -127,7 +126,7 @@ public class FtileBoxOld extends AbstractFtile {
|
||||
}
|
||||
|
||||
public double getEndingX(StringBounder stringBounder, double y) {
|
||||
final Dimension2D dim = calculateDimension(stringBounder);
|
||||
final XDimension2D dim = calculateDimension(stringBounder);
|
||||
return dim.getWidth();
|
||||
// return dim.getWidth() - padding.getRight();
|
||||
}
|
||||
@ -188,7 +187,7 @@ public class FtileBoxOld extends AbstractFtile {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final double widthTotal = dimTotal.getWidth();
|
||||
final double heightTotal = dimTotal.getHeight();
|
||||
final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);
|
||||
@ -231,10 +230,10 @@ public class FtileBoxOld extends AbstractFtile {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
Dimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
XDimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
// dimRaw = Dimension2DDouble.delta(dimRaw, padding.getLeft() + padding.getRight(),
|
||||
// padding.getBottom() + padding.getTop());
|
||||
dimRaw = Dimension2DDouble.atLeast(dimRaw, minimumWidth, 0);
|
||||
dimRaw = XDimension2D.atLeast(dimRaw, minimumWidth, 0);
|
||||
return new FtileGeometry(dimRaw.getWidth() + boxStyle.getShield(), dimRaw.getHeight(), dimRaw.getWidth() / 2, 0,
|
||||
dimRaw.getHeight());
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -47,7 +47,7 @@ public class FtileDecorateInLabel extends FtileDecorate {
|
||||
final private double xl;
|
||||
final private double yl;
|
||||
|
||||
public FtileDecorateInLabel(Ftile ftile, Dimension2D dim) {
|
||||
public FtileDecorateInLabel(Ftile ftile, XDimension2D dim) {
|
||||
this(ftile, dim.getWidth(), dim.getHeight());
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
|
||||
@ -46,7 +46,7 @@ public class FtileDecorateOutLabel extends FtileDecorate {
|
||||
final private double xl;
|
||||
final private double yl;
|
||||
|
||||
public FtileDecorateOutLabel(Ftile ftile, Dimension2D dim) {
|
||||
public FtileDecorateOutLabel(Ftile ftile, XDimension2D dim) {
|
||||
this(ftile, dim.getWidth(), dim.getHeight());
|
||||
}
|
||||
|
||||
|
@ -35,13 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -97,10 +96,10 @@ public class FtileDiamond extends FtileDiamondWIP {
|
||||
// Diamond.diamondHalfSize) / 2,
|
||||
// 2 * Diamond.diamondHalfSize)));
|
||||
|
||||
final Dimension2D dimWeat1 = west.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimWeat1 = west.calculateDimension(ug.getStringBounder());
|
||||
west.drawU(ug.apply(new UTranslate(-dimWeat1.getWidth(), -dimWeat1.getHeight() + Hexagon.hexagonHalfSize)));
|
||||
|
||||
final Dimension2D dimEast1 = east.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimEast1 = east.calculateDimension(ug.getStringBounder());
|
||||
east.drawU(
|
||||
ug.apply(new UTranslate(Hexagon.hexagonHalfSize * 2, -dimEast1.getHeight() + Hexagon.hexagonHalfSize)));
|
||||
}
|
||||
@ -108,7 +107,7 @@ public class FtileDiamond extends FtileDiamondWIP {
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final double suppY1 = north.calculateDimension(stringBounder).getHeight();
|
||||
final Dimension2D dim = new Dimension2DDouble(Hexagon.hexagonHalfSize * 2,
|
||||
final XDimension2D dim = new XDimension2D(Hexagon.hexagonHalfSize * 2,
|
||||
Hexagon.hexagonHalfSize * 2 + suppY1);
|
||||
return new FtileGeometry(dim, dim.getWidth() / 2, suppY1, dim.getHeight());
|
||||
}
|
||||
@ -118,12 +117,12 @@ public class FtileDiamond extends FtileDiamondWIP {
|
||||
}
|
||||
|
||||
public double getEastLabelWidth(StringBounder stringBounder) {
|
||||
final Dimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
final XDimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
return dimEast.getWidth();
|
||||
}
|
||||
|
||||
public double getSouthLabelHeight(StringBounder stringBounder) {
|
||||
final Dimension2D dimSouth = south.calculateDimension(stringBounder);
|
||||
final XDimension2D dimSouth = south.calculateDimension(stringBounder);
|
||||
return dimSouth.getHeight();
|
||||
}
|
||||
|
||||
|
@ -35,13 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -84,8 +83,8 @@ public class FtileDiamondInside extends FtileDiamondWIP {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||
final XDimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||
ug = ug.apply(borderColor).apply(getThickness(getStyle())).apply(backColor.bg());
|
||||
ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
|
||||
@ -96,22 +95,22 @@ public class FtileDiamondInside extends FtileDiamondWIP {
|
||||
final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2;
|
||||
label.drawU(ug.apply(new UTranslate(lx, ly)));
|
||||
|
||||
final Dimension2D dimWest = west.calculateDimension(stringBounder);
|
||||
final XDimension2D dimWest = west.calculateDimension(stringBounder);
|
||||
west.drawU(ug.apply(new UTranslate(-dimWest.getWidth(), -dimWest.getHeight() + dimTotal.getHeight() / 2)));
|
||||
|
||||
final Dimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
final XDimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
east.drawU(ug.apply(new UTranslate(dimTotal.getWidth(), -dimEast.getHeight() + dimTotal.getHeight() / 2)));
|
||||
|
||||
}
|
||||
|
||||
private FtileGeometry calculateDimensionAlone(StringBounder stringBounder) {
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dim;
|
||||
final XDimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final XDimension2D dim;
|
||||
if (dimLabel.getWidth() == 0 || dimLabel.getHeight() == 0) {
|
||||
dim = new Dimension2DDouble(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
dim = new XDimension2D(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
} else {
|
||||
dim = Dimension2DDouble.delta(
|
||||
Dimension2DDouble.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2),
|
||||
dim = XDimension2D.delta(
|
||||
XDimension2D.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2),
|
||||
Hexagon.hexagonHalfSize * 2, 0);
|
||||
}
|
||||
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
|
||||
@ -120,19 +119,19 @@ public class FtileDiamondInside extends FtileDiamondWIP {
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final FtileGeometry dimDiamonAlone = calculateDimensionAlone(stringBounder);
|
||||
final Dimension2D dimWest = west.calculateDimension(stringBounder);
|
||||
final Dimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
final XDimension2D dimWest = west.calculateDimension(stringBounder);
|
||||
final XDimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
final double northHeight = north.calculateDimension(stringBounder).getHeight();
|
||||
return dimDiamonAlone.incHeight(northHeight);
|
||||
}
|
||||
|
||||
public double getEastLabelWidth(StringBounder stringBounder) {
|
||||
final Dimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
final XDimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
return dimEast.getWidth();
|
||||
}
|
||||
|
||||
public double getSouthLabelHeight(StringBounder stringBounder) {
|
||||
final Dimension2D dimSouth = south.calculateDimension(stringBounder);
|
||||
final XDimension2D dimSouth = south.calculateDimension(stringBounder);
|
||||
return dimSouth.getHeight();
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,11 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -79,8 +78,8 @@ public class FtileDiamondInside2 extends FtileDiamondWIP {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||
final XDimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionAlone(stringBounder);
|
||||
ug = ug.apply(borderColor).apply(getThickness(getStyle())).apply(backColor.bg());
|
||||
ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
|
||||
@ -91,22 +90,22 @@ public class FtileDiamondInside2 extends FtileDiamondWIP {
|
||||
final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2;
|
||||
label.drawU(ug.apply(new UTranslate(lx, ly)));
|
||||
|
||||
final Dimension2D dimWeat = west.calculateDimension(stringBounder);
|
||||
final XDimension2D dimWeat = west.calculateDimension(stringBounder);
|
||||
west.drawU(ug.apply(new UTranslate(-dimWeat.getWidth(), -dimWeat.getHeight() + dimTotal.getHeight() / 2)));
|
||||
|
||||
final Dimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
final XDimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
east.drawU(ug.apply(new UTranslate(dimTotal.getWidth(), -dimEast.getHeight() + dimTotal.getHeight() / 2)));
|
||||
|
||||
}
|
||||
|
||||
private FtileGeometry calculateDimensionAlone(StringBounder stringBounder) {
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dim;
|
||||
final XDimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final XDimension2D dim;
|
||||
if (dimLabel.getWidth() == 0 || dimLabel.getHeight() == 0) {
|
||||
dim = new Dimension2DDouble(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
dim = new XDimension2D(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
} else {
|
||||
dim = Dimension2DDouble.delta(
|
||||
Dimension2DDouble.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2),
|
||||
dim = XDimension2D.delta(
|
||||
XDimension2D.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2),
|
||||
Hexagon.hexagonHalfSize * 2, 0);
|
||||
}
|
||||
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
|
||||
@ -114,8 +113,8 @@ public class FtileDiamondInside2 extends FtileDiamondWIP {
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D diamond = calculateDimensionAlone(stringBounder);
|
||||
final Dimension2D north = this.north.calculateDimension(stringBounder);
|
||||
final XDimension2D diamond = calculateDimensionAlone(stringBounder);
|
||||
final XDimension2D north = this.north.calculateDimension(stringBounder);
|
||||
final double height = diamond.getHeight() + north.getHeight();
|
||||
final double left = diamond.getWidth() / 2;
|
||||
final double width = north.getWidth() > left ? left + north.getWidth() : diamond.getWidth();
|
||||
|
@ -35,13 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile.vertical;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -84,8 +83,8 @@ public class FtileDiamondSquare extends FtileDiamondWIP {
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimensionInternal(stringBounder);
|
||||
ug = ug.apply(borderColor).apply(getThickness(getStyle())).apply(backColor.bg());
|
||||
|
||||
ug.draw(Hexagon.asPolygonSquare(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
@ -98,27 +97,27 @@ public class FtileDiamondSquare extends FtileDiamondWIP {
|
||||
final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2;
|
||||
label.drawU(ug.apply(new UTranslate(lx, ly)));
|
||||
|
||||
final Dimension2D dimWeat = west.calculateDimension(stringBounder);
|
||||
final XDimension2D dimWeat = west.calculateDimension(stringBounder);
|
||||
west.drawU(ug.apply(new UTranslate(-dimWeat.getWidth(), -dimWeat.getHeight() + Hexagon.hexagonHalfSize)));
|
||||
|
||||
final Dimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
final XDimension2D dimEast = east.calculateDimension(stringBounder);
|
||||
east.drawU(ug.apply(new UTranslate(dimTotal.getWidth(), -dimEast.getHeight() + Hexagon.hexagonHalfSize)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FtileGeometry calculateDimensionFtile(StringBounder stringBounder) {
|
||||
final Dimension2D dim = calculateDimensionInternal(stringBounder);
|
||||
final XDimension2D dim = calculateDimensionInternal(stringBounder);
|
||||
return new FtileGeometry(dim, dim.getWidth() / 2, 0, dim.getHeight());
|
||||
}
|
||||
|
||||
private Dimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
private XDimension2D calculateDimensionInternal(StringBounder stringBounder) {
|
||||
final XDimension2D dimLabel = label.calculateDimension(stringBounder);
|
||||
if (dimLabel.getWidth() == 0 || dimLabel.getHeight() == 0)
|
||||
return new Dimension2DDouble(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
return new XDimension2D(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
|
||||
Dimension2D result = dimLabel;
|
||||
result = Dimension2DDouble.delta(result, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
XDimension2D result = dimLabel;
|
||||
result = XDimension2D.delta(result, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ import java.util.Set;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
@ -73,7 +73,7 @@ public abstract class AbstractGtile extends AbstractGtileRoot implements Gtile {
|
||||
|
||||
@Override
|
||||
protected UTranslate getCoordImpl(String name) {
|
||||
final Dimension2D dim = calculateDimension(stringBounder);
|
||||
final XDimension2D dim = calculateDimension(stringBounder);
|
||||
if (name.equals(GPoint.NORTH_HOOK))
|
||||
return new UTranslate(dim.getWidth() / 2, 0);
|
||||
if (name.equals(GPoint.SOUTH_HOOK))
|
||||
|
@ -35,15 +35,13 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -72,8 +70,8 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// final Snake snake = Snake.create(getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock,
|
||||
// HorizontalAlignment.LEFT);
|
||||
Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
|
||||
final Direction originalDirection = Direction.leftOrRight(p1, p2);
|
||||
p1 = translate1.getTranslated(p1);
|
||||
@ -83,7 +81,7 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
|
||||
final double delta = (originalDirection == Direction.RIGHT ? -1 : 1) * Hexagon.hexagonHalfSize;
|
||||
// final Dimension2D dimDiamond1 =
|
||||
// diamond1.calculateDimension(ug.getStringBounder());
|
||||
final Dimension2D dimDiamond1 = new Dimension2DDouble(0, 0);
|
||||
final XDimension2D dimDiamond1 = new XDimension2D(0, 0);
|
||||
final Snake small = Snake.create(skinParam(), getInLinkRenderingColor()).withLabel(textBlock, HorizontalAlignment.LEFT);
|
||||
small.addPoint(p1);
|
||||
small.addPoint(p1.getX() + delta, p1.getY());
|
||||
@ -106,10 +104,10 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
|
||||
public void drawU(UGraphic ug) {
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock,
|
||||
HorizontalAlignment.LEFT);
|
||||
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(new Point2D.Double(p2.getX(), p1.getY()));
|
||||
snake.addPoint(new XPoint2D(p2.getX(), p1.getY()));
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
}
|
||||
@ -154,8 +152,8 @@ public class GConnectionHorizontalThenVerticalDown extends GAbstractConnection {
|
||||
// @Override
|
||||
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT);
|
||||
// final Point2D mp1a = translate1.getTranslated(p1);
|
||||
// final Point2D mp2b = translate2.getTranslated(p2);
|
||||
// final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
// final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
// snake.addPoint(mp1a);
|
||||
// snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -35,11 +35,10 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -72,8 +71,8 @@ public class GConnectionSideThenVerticalThenSide extends GAbstractConnection {
|
||||
|
||||
@Override
|
||||
public void drawU(UGraphic ug) {
|
||||
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final Direction direction = p1.getY() < p2.getY() ? Direction.DOWN : Direction.UP;
|
||||
final UPolygon tmp = p1.getX() < p2.getX() ? Arrows.asToRight() : Arrows.asToLeft();
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), tmp).emphasizeDirection(direction)
|
||||
@ -81,8 +80,8 @@ public class GConnectionSideThenVerticalThenSide extends GAbstractConnection {
|
||||
// final double maxX = Math.max(p1.getX(), p2.getX());
|
||||
final double maxX = xpos;
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(new Point2D.Double(maxX, p1.getY()));
|
||||
snake.addPoint(new Point2D.Double(maxX, p2.getY()));
|
||||
snake.addPoint(new XPoint2D(maxX, p1.getY()));
|
||||
snake.addPoint(new XPoint2D(maxX, p2.getY()));
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
}
|
||||
@ -121,8 +120,8 @@ public class GConnectionSideThenVerticalThenSide extends GAbstractConnection {
|
||||
// @Override
|
||||
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT);
|
||||
// final Point2D mp1a = translate1.getTranslated(p1);
|
||||
// final Point2D mp2b = translate2.getTranslated(p2);
|
||||
// final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
// final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
// snake.addPoint(mp1a);
|
||||
// snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -35,10 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -63,10 +62,10 @@ public class GConnectionVerticalDown extends GAbstractConnection {
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock,
|
||||
HorizontalAlignment.LEFT);
|
||||
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), middle);
|
||||
@ -80,8 +79,8 @@ public class GConnectionVerticalDown extends GAbstractConnection {
|
||||
public void drawU(UGraphic ug) {
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), Arrows.asToDown()).withLabel(textBlock,
|
||||
HorizontalAlignment.LEFT);
|
||||
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
@ -123,8 +122,8 @@ public class GConnectionVerticalDown extends GAbstractConnection {
|
||||
// @Override
|
||||
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT);
|
||||
// final Point2D mp1a = translate1.getTranslated(p1);
|
||||
// final Point2D mp2b = translate2.getTranslated(p2);
|
||||
// final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
// final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
// snake.addPoint(mp1a);
|
||||
// snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -35,11 +35,10 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -65,19 +64,19 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection {
|
||||
|
||||
@Override
|
||||
public void drawU(UGraphic ug) {
|
||||
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final UPolygon arrow = Arrows.asToLeft();
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), arrow)
|
||||
.withLabel(textBlock, HorizontalAlignment.LEFT).emphasizeDirection(Direction.UP);
|
||||
|
||||
snake.addPoint(p1);
|
||||
final Point2D p1bis = UTranslate.dy(10).getTranslated(p1);
|
||||
final XPoint2D p1bis = UTranslate.dy(10).getTranslated(p1);
|
||||
snake.addPoint(p1bis);
|
||||
final double border = xpos;
|
||||
|
||||
snake.addPoint(new Point2D.Double(border, p1bis.getY()));
|
||||
snake.addPoint(new Point2D.Double(border, p2.getY()));
|
||||
snake.addPoint(new XPoint2D(border, p1bis.getY()));
|
||||
snake.addPoint(new XPoint2D(border, p2.getY()));
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
}
|
||||
@ -85,8 +84,8 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection {
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// throw new UnsupportedOperationException("wip");
|
||||
Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
|
||||
// final Direction originalDirection = Direction.leftOrRight(p1, p2);
|
||||
//
|
||||
@ -98,23 +97,23 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection {
|
||||
.withLabel(textBlock, HorizontalAlignment.LEFT).emphasizeDirection(Direction.UP);
|
||||
|
||||
snake.addPoint(p1);
|
||||
final Point2D p1bis = UTranslate.dy(10).getTranslated(p1);
|
||||
final XPoint2D p1bis = UTranslate.dy(10).getTranslated(p1);
|
||||
snake.addPoint(p1bis);
|
||||
snake.addPoint(new Point2D.Double(p2.getX() + 20, p1bis.getY()));
|
||||
snake.addPoint(new Point2D.Double(p2.getX() + 20, p2.getY()));
|
||||
snake.addPoint(new XPoint2D(p2.getX() + 20, p1bis.getY()));
|
||||
snake.addPoint(new XPoint2D(p2.getX() + 20, p2.getY()));
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
|
||||
//
|
||||
// final double x1 = p1.getX();
|
||||
// final double x2 = p2.getX();
|
||||
// final Point2D mp1a = translate1.getTranslated(p1);
|
||||
// final Point2D mp2b = translate2.getTranslated(p2);
|
||||
// final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
// final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
// final Direction newDirection = Direction.leftOrRight(mp1a, mp2b);
|
||||
// final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft();
|
||||
// if (originalDirection == newDirection) {
|
||||
// final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
|
||||
// final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY());
|
||||
// final XPoint2D mp2bc = new XPoint2D(mp2b.getX() + delta, mp2b.getY());
|
||||
// final Snake snake = Snake.create(getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED);
|
||||
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
// snake.addPoint(mp1a);
|
||||
@ -129,7 +128,7 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection {
|
||||
// ug.draw(small);
|
||||
// } else {
|
||||
// final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
|
||||
// final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize);
|
||||
// final XPoint2D mp2bb = new XPoint2D(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize);
|
||||
// final Snake snake = Snake.create(getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED);
|
||||
// snake.addPoint(mp1a);
|
||||
// snake.addPoint(mp1a.getX(), mp2bb.getY());
|
||||
@ -185,8 +184,8 @@ public class GConnectionVerticalDownThenBack extends GAbstractConnection {
|
||||
// @Override
|
||||
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT);
|
||||
// final Point2D mp1a = translate1.getTranslated(p1);
|
||||
// final Point2D mp2b = translate2.getTranslated(p2);
|
||||
// final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
// final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
// snake.addPoint(mp1a);
|
||||
// snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -35,13 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -65,8 +64,8 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
|
||||
|
||||
@Override
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
|
||||
final Direction originalDirection = Direction.leftOrRight(p1, p2);
|
||||
|
||||
@ -75,13 +74,13 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
|
||||
|
||||
final double x1 = p1.getX();
|
||||
final double x2 = p2.getX();
|
||||
final Point2D mp1a = translate1.getTranslated(p1);
|
||||
final Point2D mp2b = translate2.getTranslated(p2);
|
||||
final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
final Direction newDirection = Direction.leftOrRight(mp1a, mp2b);
|
||||
final UPolygon arrow = x2 > x1 ? Arrows.asToRight() : Arrows.asToLeft();
|
||||
if (originalDirection == newDirection) {
|
||||
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
|
||||
final Point2D mp2bc = new Point2D.Double(mp2b.getX() + delta, mp2b.getY());
|
||||
final XPoint2D mp2bc = new XPoint2D(mp2b.getX() + delta, mp2b.getY());
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED);
|
||||
final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
snake.addPoint(mp1a);
|
||||
@ -96,7 +95,7 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
|
||||
ug.draw(small);
|
||||
} else {
|
||||
final double delta = (x2 > x1 ? -1 : 1) * 1.5 * Hexagon.hexagonHalfSize;
|
||||
final Point2D mp2bb = new Point2D.Double(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize);
|
||||
final XPoint2D mp2bb = new XPoint2D(mp2b.getX() + delta, mp2b.getY() - 1.5 * Hexagon.hexagonHalfSize);
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor()).withMerge(MergeStrategy.LIMITED);
|
||||
snake.addPoint(mp1a);
|
||||
snake.addPoint(mp1a.getX(), mp2bb.getY());
|
||||
@ -114,13 +113,13 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
|
||||
|
||||
@Override
|
||||
public void drawU(UGraphic ug) {
|
||||
final Point2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final Point2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final XPoint2D p1 = pos1.getTranslated(gpoint1.getPoint2D());
|
||||
final XPoint2D p2 = pos2.getTranslated(gpoint2.getPoint2D());
|
||||
final UPolygon arrow = p1.getX() < p2.getX() ? Arrows.asToRight() : Arrows.asToLeft();
|
||||
final Snake snake = Snake.create(skinParam(), getInLinkRenderingColor(), arrow).withLabel(textBlock,
|
||||
HorizontalAlignment.LEFT);
|
||||
snake.addPoint(p1);
|
||||
snake.addPoint(new Point2D.Double(p1.getX(), p2.getY()));
|
||||
snake.addPoint(new XPoint2D(p1.getX(), p2.getY()));
|
||||
snake.addPoint(p2);
|
||||
ug.draw(snake);
|
||||
}
|
||||
@ -165,8 +164,8 @@ public class GConnectionVerticalDownThenHorizontal extends GAbstractConnection {
|
||||
// @Override
|
||||
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// final Snake snake = Snake.create(color, Arrows.asToDown()).withLabel(textBlock, HorizontalAlignment.LEFT);
|
||||
// final Point2D mp1a = translate1.getTranslated(p1);
|
||||
// final Point2D mp2b = translate2.getTranslated(p2);
|
||||
// final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
// final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
// snake.addPoint(mp1a);
|
||||
// snake.addPoint(mp1a.getX(), middle);
|
||||
|
@ -35,10 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class GPoint {
|
||||
@ -88,7 +87,7 @@ public class GPoint {
|
||||
return gtile.getCoord(name);
|
||||
}
|
||||
|
||||
public Point2D getPoint2D() {
|
||||
public XPoint2D getPoint2D() {
|
||||
return getCoord().getPosition();
|
||||
}
|
||||
|
||||
|
@ -38,9 +38,8 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
@ -74,11 +73,11 @@ public class GtileAssembly extends GtileTopDown {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D raw = super.calculateDimension(stringBounder);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D raw = super.calculateDimension(stringBounder);
|
||||
final double textBlockWidth = textBlock.calculateDimension(stringBounder).getWidth();
|
||||
final double pos1 = tile1.getCoord(GPoint.SOUTH_HOOK).compose(getPos1()).getDx();
|
||||
return Dimension2DDouble.atLeast(raw, pos1 + textBlockWidth, 0);
|
||||
return XDimension2D.atLeast(raw, pos1 + textBlockWidth, 0);
|
||||
}
|
||||
|
||||
protected final TextBlock getTextBlock(Display display) {
|
||||
|
@ -35,7 +35,6 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.SkinParamColors;
|
||||
@ -43,7 +42,7 @@ import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -108,7 +107,7 @@ public class GtileBox extends AbstractGtile {
|
||||
}
|
||||
|
||||
public double getEndingX(StringBounder stringBounder, double y) {
|
||||
final Dimension2D dim = calculateDimension(stringBounder);
|
||||
final XDimension2D dim = calculateDimension(stringBounder);
|
||||
return dim.getWidth() - padding.getRight();
|
||||
}
|
||||
|
||||
@ -165,7 +164,7 @@ public class GtileBox extends AbstractGtile {
|
||||
|
||||
@Override
|
||||
protected void drawUInternal(UGraphic ug) {
|
||||
final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTotal = calculateDimension(ug.getStringBounder());
|
||||
final double widthTotal = dimTotal.getWidth();
|
||||
final double heightTotal = dimTotal.getHeight();
|
||||
final UDrawable shape = boxStyle.getUDrawable(widthTotal, heightTotal, shadowing, roundCorner);
|
||||
@ -188,21 +187,21 @@ public class GtileBox extends AbstractGtile {
|
||||
if (horizontalAlignment == HorizontalAlignment.LEFT) {
|
||||
tb.drawU(ug.apply(new UTranslate(padding.getLeft(), padding.getTop())));
|
||||
} else if (horizontalAlignment == HorizontalAlignment.RIGHT) {
|
||||
final Dimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
tb.drawU(ug.apply(
|
||||
new UTranslate(dimTotal.getWidth() - dimTb.getWidth() - padding.getRight(), padding.getBottom())));
|
||||
} else if (horizontalAlignment == HorizontalAlignment.CENTER) {
|
||||
final Dimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
final XDimension2D dimTb = tb.calculateDimension(ug.getStringBounder());
|
||||
tb.drawU(ug.apply(new UTranslate((dimTotal.getWidth() - dimTb.getWidth()) / 2, padding.getBottom())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
Dimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
dimRaw = Dimension2DDouble.delta(dimRaw, padding.getLeft() + padding.getRight(),
|
||||
public final XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
XDimension2D dimRaw = tb.calculateDimension(stringBounder);
|
||||
dimRaw = XDimension2D.delta(dimRaw, padding.getLeft() + padding.getRight(),
|
||||
padding.getBottom() + padding.getTop());
|
||||
dimRaw = Dimension2DDouble.atLeast(dimRaw, minimumWidth, 0);
|
||||
dimRaw = XDimension2D.atLeast(dimRaw, minimumWidth, 0);
|
||||
return new FtileGeometry(dimRaw.getWidth() + boxStyle.getShield(), dimRaw.getHeight(), dimRaw.getWidth() / 2, 0,
|
||||
dimRaw.getHeight());
|
||||
}
|
||||
|
@ -36,12 +36,11 @@
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.SkinParamUtils;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.style.PName;
|
||||
@ -97,8 +96,8 @@ public class GtileCircleSpot extends AbstractGtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new Dimension2DDouble(SIZE, SIZE);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new XDimension2D(SIZE, SIZE);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -35,10 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.style.PName;
|
||||
import net.sourceforge.plantuml.style.SName;
|
||||
@ -76,8 +75,8 @@ public class GtileCircleStart extends AbstractGtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new Dimension2DDouble(SIZE, SIZE);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new XDimension2D(SIZE, SIZE);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,9 +40,8 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -58,7 +57,7 @@ public class GtileColumns extends AbstractGtile {
|
||||
protected final UTranslate getPosition(int pos) {
|
||||
double dx = 0;
|
||||
for (int i = 0; i < pos; i++) {
|
||||
final Dimension2D dim = gtiles.get(i).calculateDimension(getStringBounder());
|
||||
final XDimension2D dim = gtiles.get(i).calculateDimension(getStringBounder());
|
||||
dx += dim.getWidth() + margin;
|
||||
}
|
||||
return new UTranslate(dx, dy);
|
||||
@ -99,12 +98,12 @@ public class GtileColumns extends AbstractGtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
Dimension2D result = new Dimension2DDouble(0, 0);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
XDimension2D result = new XDimension2D(0, 0);
|
||||
for (int i = 0; i < gtiles.size(); i++) {
|
||||
final Dimension2D dim = gtiles.get(i).calculateDimension(stringBounder);
|
||||
final XDimension2D dim = gtiles.get(i).calculateDimension(stringBounder);
|
||||
final UTranslate pos = getPosition(i);
|
||||
final Dimension2D corner = pos.getTranslated(dim);
|
||||
final XDimension2D corner = pos.getTranslated(dim);
|
||||
result = MathUtils.max(result, corner);
|
||||
}
|
||||
return result;
|
||||
|
@ -35,10 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UEmpty;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -80,8 +79,8 @@ public class GtileEmpty extends AbstractGtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new Dimension2DDouble(width, height);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return new XDimension2D(width, height);
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
@ -40,12 +40,11 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.AlignmentParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FloatingNote;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
@ -83,9 +82,9 @@ public class GtileGroup extends AbstractGtileRoot {
|
||||
}
|
||||
|
||||
private double suppWidth(StringBounder stringBounder) {
|
||||
final Dimension2D orig = inner.calculateDimension(stringBounder);
|
||||
final Dimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
final Dimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
|
||||
final XDimension2D orig = inner.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
final XDimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
|
||||
final double suppWidth = MathUtils.max(orig.getWidth(), dimTitle.getWidth() + 20, dimHeaderNote.getWidth() + 20)
|
||||
- orig.getWidth();
|
||||
return suppWidth;
|
||||
@ -135,13 +134,13 @@ public class GtileGroup extends AbstractGtileRoot {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D orig = inner.calculateDimension(stringBounder);
|
||||
return Dimension2DDouble.delta(orig, 18, suppHeight(stringBounder));
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D orig = inner.calculateDimension(stringBounder);
|
||||
return XDimension2D.delta(orig, 18, suppHeight(stringBounder));
|
||||
}
|
||||
|
||||
private double suppHeight(StringBounder stringBounder) {
|
||||
final Dimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTitle = name.calculateDimension(stringBounder);
|
||||
return dimTitle.getHeight() + 30;
|
||||
}
|
||||
|
||||
@ -157,7 +156,7 @@ public class GtileGroup extends AbstractGtileRoot {
|
||||
@Override
|
||||
protected void drawUInternal(UGraphic ug) {
|
||||
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
|
||||
final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow(shadowing)
|
||||
.withStroke(stroke).withCorner(roundCorner, 0);
|
||||
|
@ -35,11 +35,10 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Hexagon;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -57,7 +56,7 @@ public class GtileHexagonInside extends AbstractGtile {
|
||||
protected final HColor borderColor;
|
||||
|
||||
protected final TextBlock label;
|
||||
protected final Dimension2D dimLabel;
|
||||
protected final XDimension2D dimLabel;
|
||||
|
||||
protected final double shadowing;
|
||||
|
||||
@ -97,13 +96,13 @@ public class GtileHexagonInside extends AbstractGtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D dim;
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D dim;
|
||||
if (dimLabel.getWidth() == 0 || dimLabel.getHeight() == 0) {
|
||||
dim = new Dimension2DDouble(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
dim = new XDimension2D(Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2);
|
||||
} else {
|
||||
dim = Dimension2DDouble.delta(
|
||||
Dimension2DDouble.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2),
|
||||
dim = XDimension2D.delta(
|
||||
XDimension2D.atLeast(dimLabel, Hexagon.hexagonHalfSize * 2, Hexagon.hexagonHalfSize * 2),
|
||||
Hexagon.hexagonHalfSize * 2, 0);
|
||||
}
|
||||
return dim;
|
||||
@ -112,7 +111,7 @@ public class GtileHexagonInside extends AbstractGtile {
|
||||
@Override
|
||||
protected void drawUInternal(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
ug = ug.apply(borderColor).apply(getThickness()).apply(backColor.bg());
|
||||
ug.draw(Hexagon.asPolygon(shadowing, dimTotal.getWidth(), dimTotal.getHeight()));
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -69,15 +69,15 @@ public class GtileHexagonInsideLabelled extends GtileWithMargin {
|
||||
}
|
||||
|
||||
private static double getNorthMargin(GtileHexagonInside diamond, TextBlock eastLabel, TextBlock westLabel) {
|
||||
final Dimension2D dimWest = westLabel.calculateDimension(diamond.getStringBounder());
|
||||
final Dimension2D dimEast = eastLabel.calculateDimension(diamond.getStringBounder());
|
||||
final XDimension2D dimWest = westLabel.calculateDimension(diamond.getStringBounder());
|
||||
final XDimension2D dimEast = eastLabel.calculateDimension(diamond.getStringBounder());
|
||||
final UTranslate east = diamond.getCoord(GPoint.EAST_HOOK);
|
||||
final UTranslate west = diamond.getCoord(GPoint.WEST_HOOK);
|
||||
return MathUtils.max(0, dimWest.getHeight() - west.getDy(), dimEast.getHeight() - east.getDy());
|
||||
}
|
||||
|
||||
private static double getSouthMargin(GtileHexagonInside diamond, TextBlock southLabel) {
|
||||
final Dimension2D dimSouth = southLabel.calculateDimension(diamond.getStringBounder());
|
||||
final XDimension2D dimSouth = southLabel.calculateDimension(diamond.getStringBounder());
|
||||
return dimSouth.getHeight();
|
||||
}
|
||||
|
||||
@ -92,20 +92,20 @@ public class GtileHexagonInsideLabelled extends GtileWithMargin {
|
||||
eastLabel.drawU(
|
||||
ug.apply(east.compose(UTranslate.dy(-eastLabel.calculateDimension(getStringBounder()).getHeight()))));
|
||||
|
||||
final Dimension2D tmp = westLabel.calculateDimension(getStringBounder());
|
||||
final XDimension2D tmp = westLabel.calculateDimension(getStringBounder());
|
||||
final UTranslate west = getCoord(GPoint.WEST_HOOK);
|
||||
westLabel.drawU(ug.apply(west.compose(new UTranslate(-tmp.getWidth(), -tmp.getHeight()))));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D tmp = super.calculateDimension(stringBounder);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D tmp = super.calculateDimension(stringBounder);
|
||||
final UTranslate south = getCoord(GPoint.SOUTH_HOOK);
|
||||
final Dimension2D southCorner = south.getTranslated(southLabel.calculateDimension(stringBounder));
|
||||
final XDimension2D southCorner = south.getTranslated(southLabel.calculateDimension(stringBounder));
|
||||
|
||||
final UTranslate east = getCoord(GPoint.EAST_HOOK);
|
||||
final Dimension2D eastCorner = east.getTranslated(eastLabel.calculateDimension(stringBounder));
|
||||
final XDimension2D eastCorner = east.getTranslated(eastLabel.calculateDimension(stringBounder));
|
||||
|
||||
return MathUtils.max(tmp, southCorner, eastCorner);
|
||||
}
|
||||
|
@ -38,11 +38,10 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -87,8 +86,8 @@ public class GtileIfAlone extends GtileTopDown3 {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return Dimension2DDouble.delta(super.calculateDimension(stringBounder), SUPP_WIDTH, 0);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return XDimension2D.delta(super.calculateDimension(stringBounder), SUPP_WIDTH, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,10 +39,9 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -83,11 +82,11 @@ public class GtileIfHexagon extends GtileColumns {
|
||||
this.shape2 = Gtiles.diamondEmpty(swimlane, getStringBounder(), skinParam(), getDefaultStyleDefinitionDiamond(),
|
||||
branches.get(0).getColor());
|
||||
|
||||
final Dimension2D dimShape1 = shape1.calculateDimension(stringBounder);
|
||||
final XDimension2D dimShape1 = shape1.calculateDimension(stringBounder);
|
||||
this.pushDown(dimShape1.getHeight());
|
||||
|
||||
final double posShape;
|
||||
final Dimension2D totalDim;
|
||||
final XDimension2D totalDim;
|
||||
if (branches.size() == 2) {
|
||||
final Gtile tile0 = branches.get(0).getGtile();
|
||||
final Gtile tile1 = branches.get(1).getGtile();
|
||||
@ -158,23 +157,23 @@ public class GtileIfHexagon extends GtileColumns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D rawDim = calculateDimensionRaw(stringBounder);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D rawDim = calculateDimensionRaw(stringBounder);
|
||||
if (branches.size() == 2) {
|
||||
final Dimension2D shape1Dim = shape1.calculateDimension(stringBounder);
|
||||
final XDimension2D shape1Dim = shape1.calculateDimension(stringBounder);
|
||||
final double shape1max = this.positionShape1.getDx() + shape1Dim.getWidth();
|
||||
return Dimension2DDouble.atLeast(rawDim, shape1max, 0);
|
||||
return XDimension2D.atLeast(rawDim, shape1max, 0);
|
||||
|
||||
}
|
||||
// return MathUtils.max(rawDim, shape1Dim);
|
||||
return rawDim;
|
||||
}
|
||||
|
||||
private Dimension2D calculateDimensionRaw(StringBounder stringBounder) {
|
||||
private XDimension2D calculateDimensionRaw(StringBounder stringBounder) {
|
||||
final double height2 = shape2.calculateDimension(stringBounder).getHeight();
|
||||
final Dimension2D nude = super.calculateDimension(stringBounder);
|
||||
final XDimension2D nude = super.calculateDimension(stringBounder);
|
||||
// +30 to be done only when branches.size()==1 ?
|
||||
return Dimension2DDouble.delta(nude, 0, height2 + 30);
|
||||
return XDimension2D.delta(nude, 0, height2 + 30);
|
||||
}
|
||||
|
||||
final public StyleSignatureBasic getDefaultStyleDefinitionActivity() {
|
||||
|
@ -40,10 +40,9 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -95,8 +94,8 @@ public class GtileRepeat extends GtileTopDown3 {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return Dimension2DDouble.delta(super.calculateDimension(stringBounder), SUPP_WIDTH, 0);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return XDimension2D.delta(super.calculateDimension(stringBounder), SUPP_WIDTH, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,9 +37,8 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.style.SName;
|
||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||
@ -90,8 +89,8 @@ public class GtileSplit extends GtileColumns {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return Dimension2DDouble.delta(super.calculateDimension(stringBounder), 0, 0);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
return XDimension2D.delta(super.calculateDimension(stringBounder), 0, 0);
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
@ -40,7 +40,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -51,8 +51,8 @@ public class GtileTopDown extends AbstractGtile {
|
||||
protected final Gtile tile1;
|
||||
protected final Gtile tile2;
|
||||
|
||||
private final Dimension2D dim1;
|
||||
private final Dimension2D dim2;
|
||||
private final XDimension2D dim1;
|
||||
private final XDimension2D dim2;
|
||||
|
||||
private final UTranslate pos1;
|
||||
private final UTranslate pos2;
|
||||
@ -115,9 +115,9 @@ public class GtileTopDown extends AbstractGtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D corner1 = getPos1().getTranslated(dim1);
|
||||
final Dimension2D corner2 = getPos2().getTranslated(dim2);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D corner1 = getPos1().getTranslated(dim1);
|
||||
final XDimension2D corner2 = getPos2().getTranslated(dim2);
|
||||
return MathUtils.max(corner1, corner2);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -52,9 +52,9 @@ public class GtileTopDown3 extends AbstractGtile {
|
||||
protected final Gtile tile2;
|
||||
protected final Gtile tile3;
|
||||
|
||||
private final Dimension2D dim1;
|
||||
private final Dimension2D dim2;
|
||||
private final Dimension2D dim3;
|
||||
private final XDimension2D dim1;
|
||||
private final XDimension2D dim2;
|
||||
private final XDimension2D dim3;
|
||||
|
||||
private final UTranslate pos1;
|
||||
private final UTranslate pos2;
|
||||
@ -117,10 +117,10 @@ public class GtileTopDown3 extends AbstractGtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D corner1 = getPos1().getTranslated(dim1);
|
||||
final Dimension2D corner2 = getPos2().getTranslated(dim2);
|
||||
final Dimension2D corner3 = getPos3().getTranslated(dim3);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D corner1 = getPos1().getTranslated(dim1);
|
||||
final XDimension2D corner2 = getPos2().getTranslated(dim2);
|
||||
final XDimension2D corner3 = getPos3().getTranslated(dim3);
|
||||
return MathUtils.max(corner1, corner2, corner3);
|
||||
}
|
||||
|
||||
|
@ -188,12 +188,12 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// this.arrowColor = arrowColor;
|
||||
// }
|
||||
//
|
||||
// private Point2D getP1(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder)
|
||||
// .getTranslated(getFtile1().calculateDimension(stringBounder).getPointOut());
|
||||
// }
|
||||
//
|
||||
// private Point2D getP2(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateForWhile(stringBounder)
|
||||
// .getTranslated(getFtile2().calculateDimension(stringBounder).getPointIn());
|
||||
// }
|
||||
@ -211,11 +211,11 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// @Override
|
||||
// public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
// final StringBounder stringBounder = ug.getStringBounder();
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final Point2D p2 = getP2(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p2 = getP2(stringBounder);
|
||||
// final Snake snake = Snake.create(arrowColor, Arrows.asToDown()).withMerge(MergeStrategy.LIMITED);
|
||||
// final Point2D mp1a = translate1.getTranslated(p1);
|
||||
// final Point2D mp2b = translate2.getTranslated(p2);
|
||||
// final XPoint2D mp1a = translate1.getTranslated(p1);
|
||||
// final XPoint2D mp2b = translate2.getTranslated(p2);
|
||||
// final double middle = (mp1a.getY() + mp2b.getY()) / 2.0;
|
||||
// snake.addPoint(mp1a);
|
||||
// snake.addPoint(mp1a.getX(), middle);
|
||||
@ -235,7 +235,7 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// this.back = back;
|
||||
// }
|
||||
//
|
||||
// private Point2D getP1(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
// final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
|
||||
// if (geo.hasPointOut() == false) {
|
||||
// return null;
|
||||
@ -248,19 +248,19 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
|
||||
// }
|
||||
//
|
||||
// private Point2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
// private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
// }
|
||||
//
|
||||
// public void drawU(UGraphic ug) {
|
||||
// final StringBounder stringBounder = ug.getStringBounder();
|
||||
//
|
||||
// final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
// if (p1 == null) {
|
||||
// return;
|
||||
// }
|
||||
// final Point2D p2 = getP2(stringBounder);
|
||||
// final XPoint2D p2 = getP2(stringBounder);
|
||||
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
//
|
||||
// final double x1 = p1.getX();
|
||||
@ -289,10 +289,10 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// final StringBounder stringBounder = ug.getStringBounder();
|
||||
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).withMerge(MergeStrategy.LIMITED);
|
||||
// final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
// final Point2D ap1 = getP1(stringBounder);
|
||||
// final Point2D ap2 = getP2(stringBounder);
|
||||
// final Point2D p1 = translate1.getTranslated(ap1);
|
||||
// final Point2D p2 = translate2.getTranslated(ap2);
|
||||
// final XPoint2D ap1 = getP1(stringBounder);
|
||||
// final XPoint2D ap2 = getP2(stringBounder);
|
||||
// final XPoint2D p1 = translate1.getTranslated(ap1);
|
||||
// final XPoint2D p2 = translate2.getTranslated(ap2);
|
||||
//
|
||||
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
//
|
||||
@ -330,7 +330,7 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// this.back = back;
|
||||
// }
|
||||
//
|
||||
// private Point2D getP1(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
// final FtileGeometry geo = whileBlock.calculateDimension(stringBounder);
|
||||
// if (geo.hasPointOut() == false) {
|
||||
// return null;
|
||||
@ -343,19 +343,19 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
|
||||
// }
|
||||
//
|
||||
// private Point2D getP2(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
// final FtileGeometry dim = backward.calculateDimension(stringBounder);
|
||||
// return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getOutY()));
|
||||
// return getTranslateBackward(stringBounder).getTranslated(new XPoint2D(dim.getLeft(), dim.getOutY()));
|
||||
// }
|
||||
//
|
||||
// public void drawU(UGraphic ug) {
|
||||
// final StringBounder stringBounder = ug.getStringBounder();
|
||||
//
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
// if (p1 == null) {
|
||||
// return;
|
||||
// }
|
||||
// final Point2D p2 = getP2(stringBounder);
|
||||
// final XPoint2D p2 = getP2(stringBounder);
|
||||
// final double x1 = p1.getX();
|
||||
// final double y1 = p1.getY();
|
||||
// final double x2 = p2.getX();
|
||||
@ -384,13 +384,13 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// this.back = back;
|
||||
// }
|
||||
//
|
||||
// private Point2D getP1(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
// final FtileGeometry dim = backward.calculateDimension(stringBounder);
|
||||
// return getTranslateBackward(stringBounder).getTranslated(new Point2D.Double(dim.getLeft(), dim.getInY()));
|
||||
// return getTranslateBackward(stringBounder).getTranslated(new XPoint2D(dim.getLeft(), dim.getInY()));
|
||||
// }
|
||||
//
|
||||
// private Point2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
// private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
// }
|
||||
//
|
||||
// public void drawU(UGraphic ug) {
|
||||
@ -399,8 +399,8 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).withLabel(back,
|
||||
// arrowHorizontalAlignment());
|
||||
//
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final Point2D p2 = getP2(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p2 = getP2(stringBounder);
|
||||
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
//
|
||||
// final double x1 = p1.getX();
|
||||
@ -425,7 +425,7 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// this.endInlinkColor = endInlinkColor;
|
||||
// }
|
||||
//
|
||||
// private Point2D getP1(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder)
|
||||
// .getTranslated(diamond1.calculateDimension(stringBounder).getPointOut());
|
||||
// }
|
||||
@ -435,8 +435,8 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// return getTranslateForWhile(stringBounder).getDy() + geo.getHeight();
|
||||
// }
|
||||
//
|
||||
// private Point2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
// private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
// }
|
||||
//
|
||||
// public void drawU(UGraphic ug) {
|
||||
@ -444,8 +444,8 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
//
|
||||
// final Snake snake = Snake.create(endInlinkColor, Arrows.asToLeft()).emphasizeDirection(Direction.UP);
|
||||
// final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final Point2D p2 = getP2(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p2 = getP2(stringBounder);
|
||||
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
//
|
||||
// final double x1 = p1.getX();
|
||||
@ -479,13 +479,13 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// this.afterEndwhileColor = afterEndwhileColor;
|
||||
// }
|
||||
//
|
||||
// private Point2D getP1(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
// private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
// }
|
||||
//
|
||||
// private Point2D getP2(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
// final FtileGeometry dimTotal = calculateDimension(stringBounder);
|
||||
// return new Point2D.Double(dimTotal.getLeft(), dimTotal.getHeight());
|
||||
// return new XPoint2D(dimTotal.getLeft(), dimTotal.getHeight());
|
||||
// }
|
||||
//
|
||||
// public void drawU(UGraphic ug) {
|
||||
@ -495,8 +495,8 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// .emphasizeDirection(Direction.DOWN);
|
||||
//
|
||||
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final Point2D p2 = getP2(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p2 = getP2(stringBounder);
|
||||
//
|
||||
// final double x1 = p1.getX();
|
||||
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
|
||||
@ -527,11 +527,11 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// this.afterEndwhileColor = afterEndwhileColor;
|
||||
// }
|
||||
//
|
||||
// private Point2D getP1(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
// private XPoint2D getP1(final StringBounder stringBounder) {
|
||||
// return getTranslateDiamond1(stringBounder).getTranslated(new XPoint2D(0, 0));
|
||||
// }
|
||||
//
|
||||
// private Point2D getP2(final StringBounder stringBounder) {
|
||||
// private XPoint2D getP2(final StringBounder stringBounder) {
|
||||
// return getTranslateForSpecial(stringBounder)
|
||||
// .getTranslated(specialOut.calculateDimension(stringBounder).getPointIn());
|
||||
// }
|
||||
@ -542,8 +542,8 @@ public class GtileWhile extends GtileTopDown3 {
|
||||
// final Snake snake = Snake.create(afterEndwhileColor, Arrows.asToDown());
|
||||
//
|
||||
// final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
// final Point2D p1 = getP1(stringBounder);
|
||||
// final Point2D p2 = getP2(stringBounder);
|
||||
// final XPoint2D p1 = getP1(stringBounder);
|
||||
// final XPoint2D p2 = getP2(stringBounder);
|
||||
//
|
||||
// final double x1 = p1.getX();
|
||||
// final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
|
||||
|
@ -39,9 +39,8 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -72,9 +71,9 @@ public class GtileWithMargin extends AbstractGtileRoot implements Gtile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D result = orig.calculateDimension(stringBounder);
|
||||
return Dimension2DDouble.delta(result, east, north + south);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D result = orig.calculateDimension(stringBounder);
|
||||
return XDimension2D.delta(result, east, north + south);
|
||||
}
|
||||
|
||||
private UTranslate getTranslate() {
|
||||
|
@ -38,12 +38,11 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.AlignmentParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -79,8 +78,8 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
|
||||
private final UTranslate positionNote;
|
||||
private final UTranslate positionTile;
|
||||
|
||||
private final Dimension2D dimNote;
|
||||
private final Dimension2D dimTile;
|
||||
private final XDimension2D dimNote;
|
||||
private final XDimension2D dimTile;
|
||||
|
||||
public StyleSignatureBasic getStyleSignature() {
|
||||
return StyleSignatureBasic.of(SName.root, SName.element, SName.activityDiagram, SName.note);
|
||||
@ -127,7 +126,7 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
|
||||
this.dimNote = opale.calculateDimension(stringBounder);
|
||||
this.dimTile = tile.calculateDimension(stringBounder);
|
||||
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
|
||||
if (note.getNotePosition() == NotePosition.LEFT) {
|
||||
this.positionNote = new UTranslate(0, (dimTotal.getHeight() - dimNote.getHeight()) / 2);
|
||||
@ -146,9 +145,9 @@ public class GtileWithNoteOpale extends AbstractGtile implements Stencil, Stylea
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final double height = Math.max(dimNote.getHeight(), dimTile.getHeight());
|
||||
return new Dimension2DDouble(dimTile.getWidth() + dimNote.getWidth() + suppSpace, height);
|
||||
return new XDimension2D(dimTile.getWidth() + dimNote.getWidth() + suppSpace, height);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,12 +38,11 @@ package net.sourceforge.plantuml.activitydiagram3.gtile;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.LineBreakStrategy;
|
||||
import net.sourceforge.plantuml.activitydiagram3.PositionedNote;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.creole.Parser;
|
||||
import net.sourceforge.plantuml.creole.Sheet;
|
||||
@ -161,24 +160,24 @@ public class GtileWithNotes extends AbstractGtile {
|
||||
}
|
||||
|
||||
private UTranslate getTranslate(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final double xDelta = left.calculateDimension(stringBounder).getWidth();
|
||||
final double yDelta = (dimTotal.getHeight() - dimTile.getHeight()) / 2;
|
||||
return new UTranslate(xDelta, yDelta);
|
||||
}
|
||||
|
||||
private UTranslate getTranslateForLeft(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final Dimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final double xDelta = 0;
|
||||
final double yDelta = (dimTotal.getHeight() - dimLeft.getHeight()) / 2;
|
||||
return new UTranslate(xDelta, yDelta);
|
||||
}
|
||||
|
||||
private UTranslate getTranslateForRight(StringBounder stringBounder) {
|
||||
final Dimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final Dimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
final XDimension2D dimTotal = calculateDimension(stringBounder);
|
||||
final XDimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
final double xDelta = dimTotal.getWidth() - dimRight.getWidth();
|
||||
final double yDelta = (dimTotal.getHeight() - dimRight.getHeight()) / 2;
|
||||
return new UTranslate(xDelta, yDelta);
|
||||
@ -205,12 +204,12 @@ public class GtileWithNotes extends AbstractGtile {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Dimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final Dimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final Dimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final Dimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
public XDimension2D calculateDimension(StringBounder stringBounder) {
|
||||
final XDimension2D dimTile = tile.calculateDimension(stringBounder);
|
||||
final XDimension2D dimLeft = left.calculateDimension(stringBounder);
|
||||
final XDimension2D dimRight = right.calculateDimension(stringBounder);
|
||||
final double height = MathUtils.max(dimLeft.getHeight(), dimRight.getHeight(), dimTile.getHeight());
|
||||
return new Dimension2DDouble(dimTile.getWidth() + dimLeft.getWidth() + dimRight.getWidth(), height);
|
||||
return new XDimension2D(dimTile.getWidth() + dimLeft.getWidth() + dimRight.getWidth(), height);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,14 +36,14 @@
|
||||
package net.sourceforge.plantuml.anim;
|
||||
|
||||
import java.awt.geom.AffineTransform;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.Objects;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.ugraphic.MinMax;
|
||||
|
||||
public class AffineTransformation {
|
||||
@ -55,7 +55,7 @@ public class AffineTransformation {
|
||||
static private final Pattern color = Pattern.compile("color\\s+.*");
|
||||
|
||||
private final AffineTransform affineTransform;
|
||||
private Dimension2D dimension;
|
||||
private XDimension2D dimension;
|
||||
|
||||
private AffineTransformation(AffineTransform affineTransform) {
|
||||
this.affineTransform = Objects.requireNonNull(affineTransform);
|
||||
@ -123,7 +123,7 @@ public class AffineTransformation {
|
||||
return getAffineTransform(dimension);
|
||||
}
|
||||
|
||||
private AffineTransform getAffineTransform(Dimension2D dimension) {
|
||||
private AffineTransform getAffineTransform(XDimension2D dimension) {
|
||||
if (dimension == null) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
@ -135,18 +135,20 @@ public class AffineTransformation {
|
||||
return at;
|
||||
}
|
||||
|
||||
public void setDimension(Dimension2D dim) {
|
||||
public void setDimension(XDimension2D dim) {
|
||||
this.dimension = dim;
|
||||
|
||||
}
|
||||
|
||||
public MinMax getMinMax(Dimension2D rect) {
|
||||
public MinMax getMinMax(XDimension2D rect) {
|
||||
MinMax result = MinMax.getEmpty(false);
|
||||
final AffineTransform tmp = getAffineTransform(rect);
|
||||
result = result.addPoint(tmp.transform(new Point2D.Double(0, 0), null));
|
||||
result = result.addPoint(tmp.transform(new Point2D.Double(0, rect.getHeight()), null));
|
||||
result = result.addPoint(tmp.transform(new Point2D.Double(rect.getWidth(), 0), null));
|
||||
result = result.addPoint(tmp.transform(new Point2D.Double(rect.getWidth(), rect.getHeight()), null));
|
||||
|
||||
result = result.addPoint(new XPoint2D(0, 0).getTransform(tmp));
|
||||
result = result.addPoint(new XPoint2D(0, rect.getHeight()).getTransform(tmp));
|
||||
result = result.addPoint(new XPoint2D(rect.getWidth(), 0).getTransform(tmp));
|
||||
result = result.addPoint(new XPoint2D(rect.getWidth(), rect.getHeight()).getTransform(tmp));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,12 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.anim;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.ugraphic.MinMax;
|
||||
|
||||
public class Animation {
|
||||
@ -76,7 +76,7 @@ public class Animation {
|
||||
return Collections.unmodifiableCollection(all);
|
||||
}
|
||||
|
||||
public void setDimension(Dimension2D dim) {
|
||||
public void setDimension(XDimension2D dim) {
|
||||
for (AffineTransformation affineTransform : all) {
|
||||
affineTransform.setDimension(dim);
|
||||
}
|
||||
@ -87,7 +87,7 @@ public class Animation {
|
||||
return all.get(0);
|
||||
}
|
||||
|
||||
public MinMax getMinMax(Dimension2D dim) {
|
||||
public MinMax getMinMax(XDimension2D dim) {
|
||||
MinMax result = MinMax.getEmpty(false);
|
||||
for (AffineTransformation affineTransform : all) {
|
||||
final MinMax m = affineTransform.getMinMax(dim);
|
||||
|
@ -36,7 +36,7 @@
|
||||
package net.sourceforge.plantuml.api;
|
||||
|
||||
import net.sourceforge.plantuml.annotation.HaxeIgnored;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.core.ImageData;
|
||||
|
||||
public abstract class ImageDataAbstract implements ImageData {
|
||||
@ -51,7 +51,7 @@ public abstract class ImageDataAbstract implements ImageData {
|
||||
}
|
||||
|
||||
@HaxeIgnored
|
||||
public ImageDataAbstract(Dimension2D dim) {
|
||||
public ImageDataAbstract(XDimension2D dim) {
|
||||
this((int) dim.getWidth(), (int) dim.getHeight());
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ package net.sourceforge.plantuml.api;
|
||||
|
||||
import net.sourceforge.plantuml.CMapData;
|
||||
import net.sourceforge.plantuml.annotation.HaxeIgnored;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
|
||||
public class ImageDataComplex extends ImageDataAbstract {
|
||||
|
||||
@ -46,13 +46,13 @@ public class ImageDataComplex extends ImageDataAbstract {
|
||||
|
||||
@SuppressWarnings("unused") // available publicly so retained for backwards compatibility
|
||||
@HaxeIgnored
|
||||
public ImageDataComplex(Dimension2D info, CMapData cmap, String warningOrError) {
|
||||
public ImageDataComplex(XDimension2D info, CMapData cmap, String warningOrError) {
|
||||
super(info);
|
||||
this.cmap = cmap;
|
||||
this.warningOrError = warningOrError;
|
||||
}
|
||||
|
||||
public ImageDataComplex(Dimension2D info, CMapData cmap, String warningOrError, int status) {
|
||||
public ImageDataComplex(XDimension2D info, CMapData cmap, String warningOrError, int status) {
|
||||
super(info);
|
||||
this.cmap = cmap;
|
||||
this.warningOrError = warningOrError;
|
||||
|
@ -36,7 +36,7 @@
|
||||
package net.sourceforge.plantuml.api;
|
||||
|
||||
import net.sourceforge.plantuml.annotation.HaxeIgnored;
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.core.ImageData;
|
||||
|
||||
public class ImageDataSimple extends ImageDataAbstract {
|
||||
@ -47,11 +47,11 @@ public class ImageDataSimple extends ImageDataAbstract {
|
||||
}
|
||||
|
||||
@HaxeIgnored
|
||||
public ImageDataSimple(Dimension2D dim) {
|
||||
public ImageDataSimple(XDimension2D dim) {
|
||||
super(dim);
|
||||
}
|
||||
|
||||
public ImageDataSimple(Dimension2D dim, int status) {
|
||||
public ImageDataSimple(XDimension2D dim, int status) {
|
||||
super(dim);
|
||||
setStatus(status);
|
||||
}
|
||||
|
@ -26,8 +26,14 @@
|
||||
package net.sourceforge.plantuml.argon2.blake2;
|
||||
|
||||
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.Assert.*;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.LittleEndian.*;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.Assert.assertFail;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.Assert.exclusiveLowerBound;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.Assert.inclusiveLowerBound;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.Assert.inclusiveUpperBound;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.LittleEndian.readInt;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.LittleEndian.readLong;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.LittleEndian.writeInt;
|
||||
import static net.sourceforge.plantuml.argon2.blake2.Blake2b.Engine.LittleEndian.writeLong;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.security.Key;
|
||||
|
@ -35,9 +35,7 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.asciiart;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.Component;
|
||||
import net.sourceforge.plantuml.style.Style;
|
||||
@ -45,10 +43,10 @@ import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||
|
||||
public abstract class AbstractComponentText implements Component {
|
||||
|
||||
public final Dimension2D getPreferredDimension(StringBounder stringBounder) {
|
||||
public final XDimension2D getPreferredDimension(StringBounder stringBounder) {
|
||||
final double w = getPreferredWidth(stringBounder);
|
||||
final double h = getPreferredHeight(stringBounder);
|
||||
return new Dimension2DDouble(w, h);
|
||||
return new XDimension2D(w, h);
|
||||
}
|
||||
|
||||
public Style[] getUsedStyles() {
|
||||
|
@ -35,9 +35,8 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.asciiart;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.FileFormat;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
import net.sourceforge.plantuml.skin.Context2D;
|
||||
@ -53,7 +52,7 @@ public class ComponentTextActiveLine extends AbstractComponentText {
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug, Area area, Context2D context) {
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final XDimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
|
||||
final int width = (int) dimensionToUse.getWidth();
|
||||
final int height = (int) dimensionToUse.getHeight();
|
||||
|
@ -35,10 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.asciiart;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.FileFormat;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
@ -62,7 +61,7 @@ public class ComponentTextActor extends AbstractComponentText {
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug, Area area, Context2D context) {
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final XDimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
|
||||
final int width = (int) dimensionToUse.getWidth();
|
||||
final int height = (int) dimensionToUse.getHeight();
|
||||
|
@ -35,13 +35,13 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.asciiart;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.sourceforge.plantuml.FileFormat;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.awt.geom.XPoint2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.sequencediagram.MessageNumber;
|
||||
@ -108,7 +108,7 @@ public class ComponentTextArrow extends AbstractComponentText implements ArrowCo
|
||||
if (config.isHidden()) {
|
||||
return;
|
||||
}
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final XDimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
|
||||
final int width = (int) dimensionToUse.getWidth();
|
||||
final int height = (int) dimensionToUse.getHeight();
|
||||
@ -153,12 +153,12 @@ public class ComponentTextArrow extends AbstractComponentText implements ArrowCo
|
||||
return width;
|
||||
}
|
||||
|
||||
public Point2D getStartPoint(StringBounder stringBounder, Dimension2D dimensionToUse) {
|
||||
return new Point2D.Double(0, 0);
|
||||
public XPoint2D getStartPoint(StringBounder stringBounder, XDimension2D dimensionToUse) {
|
||||
return new XPoint2D(0, 0);
|
||||
}
|
||||
|
||||
public Point2D getEndPoint(StringBounder stringBounder, Dimension2D dimensionToUse) {
|
||||
return new Point2D.Double(0, 0);
|
||||
public XPoint2D getEndPoint(StringBounder stringBounder, XDimension2D dimensionToUse) {
|
||||
return new XPoint2D(0, 0);
|
||||
}
|
||||
|
||||
public double getPaddingY() {
|
||||
|
@ -35,10 +35,9 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.asciiart;
|
||||
|
||||
import net.sourceforge.plantuml.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.FileFormat;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.awt.geom.XDimension2D;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.skin.Area;
|
||||
@ -56,7 +55,7 @@ public class ComponentTextDelay extends AbstractComponentText {
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug, Area area, Context2D context) {
|
||||
final Dimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final XDimension2D dimensionToUse = area.getDimensionToUse();
|
||||
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
|
||||
final int width = (int) dimensionToUse.getWidth();
|
||||
final int textWidth = StringUtils.getWcWidth(stringsToDisplay);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user