1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-09-27 22:49:04 +00:00

Preprocessing with __MIT__ is now working

This commit is contained in:
Arnaud Roques 2023-03-12 12:15:51 +01:00
parent 957dfea0b5
commit 5febaa9aeb
242 changed files with 686 additions and 659 deletions

View File

@ -119,7 +119,7 @@ public class DirectDraw {
final StringBounder stringBounder = new StringBounderCanvas(g2d); final StringBounder stringBounder = new StringBounderCanvas(g2d);
final UGraphicG2d ug = new UGraphicG2d(back, ColorMapper.IDENTITY, stringBounder, g2d, 1.0, FileFormat.PNG); final UGraphicG2d ug = new UGraphicG2d(back, ColorMapper.IDENTITY, stringBounder, g2d, 1.0, FileFormat.PNG);
WasmLog.log("...cleaning..."); WasmLog.log("...cleaning...");
ug.apply(back).apply(back.bg()).draw(new URectangle(frameWidth, frameHeight)); ug.apply(back).apply(back.bg()).draw(URectangle.build(frameWidth, frameHeight));
WasmLog.log("...drawing..."); WasmLog.log("...drawing...");
system.exportDiagramGraphic(ug); system.exportDiagramGraphic(ug);

View File

@ -120,7 +120,7 @@ public class Raw {
} }
final UGraphicG2d ug = new UGraphicG2d(back, mapper, stringBounder, g2d, 1.0, FileFormat.RAW); final UGraphicG2d ug = new UGraphicG2d(back, mapper, stringBounder, g2d, 1.0, FileFormat.RAW);
WasmLog.log("...cleaning..."); WasmLog.log("...cleaning...");
ug.apply(back).apply(back.bg()).draw(new URectangle(MAX, MAX)); ug.apply(back).apply(back.bg()).draw(URectangle.build(MAX, MAX));
ug.resetMax(); ug.resetMax();
WasmLog.log("...drawing..."); WasmLog.log("...drawing...");
@ -204,7 +204,7 @@ public class Raw {
} }
final UGraphicG2d ug = new UGraphicG2d(back, mapper, stringBounder, g2d, 1.0, FileFormat.RAW); final UGraphicG2d ug = new UGraphicG2d(back, mapper, stringBounder, g2d, 1.0, FileFormat.RAW);
WasmLog.log("...cleaning..."); WasmLog.log("...cleaning...");
ug.apply(back).apply(back.bg()).draw(new URectangle(MAX, MAX)); ug.apply(back).apply(back.bg()).draw(URectangle.build(MAX, MAX));
ug.resetMax(); ug.resetMax();
WasmLog.log("...drawing..."); WasmLog.log("...drawing...");

View File

@ -98,6 +98,7 @@ import ext.plantuml.com.ctreber.aclib.sort.QuickSort;
*/ */
public class ACearth { public class ACearth {
// ::remove folder when __CORE__ // ::remove folder when __CORE__
// ::remove folder when __MIT__
public static final String VERSION = "1.1"; public static final String VERSION = "1.1";
public static final String BUILD = "22.11.2002 004"; public static final String BUILD = "22.11.2002 004";

View File

@ -26,6 +26,7 @@ import java.util.Hashtable;
public final class BarcodeFormat { public final class BarcodeFormat {
// ::remove folder when __HAXE__ // ::remove folder when __HAXE__
// ::remove folder when __CORE__ // ::remove folder when __CORE__
// ::remove folder when __MIT__
// No, we can't use an enum here. J2ME doesn't support it. // No, we can't use an enum here. J2ME doesn't support it.

View File

@ -50,6 +50,7 @@ import jcckit.util.Factory;
public class GraphicsPlotCanvas extends PlotCanvas { public class GraphicsPlotCanvas extends PlotCanvas {
// ::remove folder when __CORE__ // ::remove folder when __CORE__
// ::remove folder when __HAXE__ // ::remove folder when __HAXE__
// ::remove folder when __MIT__
/** Key of a configuration parameter. */ /** Key of a configuration parameter. */
public static final String BACKGROUND_KEY = "background"; public static final String BACKGROUND_KEY = "background";
public static final String FOREGROUND_KEY = "foreground"; public static final String FOREGROUND_KEY = "foreground";

View File

@ -330,7 +330,7 @@ public class ImageBuilder {
if (stroke == null) if (stroke == null)
return; return;
final URectangle rectangle = new URectangle(dim.getWidth() - stroke.getThickness(), final URectangle rectangle = URectangle.build(dim.getWidth() - stroke.getThickness(),
dim.getHeight() - stroke.getThickness()) dim.getHeight() - stroke.getThickness())
.rounded(skinParam.getRoundCorner(CornerParam.diagramBorder, null)); .rounded(skinParam.getRoundCorner(CornerParam.diagramBorder, null));
@ -344,7 +344,7 @@ public class ImageBuilder {
final int blue = rnd.nextInt(40); final int blue = rnd.nextInt(40);
final Color c = new Color(red, green, blue); final Color c = new Color(red, green, blue);
final HColor color = HColors.simple(c); final HColor color = HColors.simple(c);
ug2.apply(color).apply(color.bg()).draw(new URectangle(1, 1)); ug2.apply(color).apply(color.bg()).draw(URectangle.build(1, 1));
} }
private XDimension2D getFinalDimension() { private XDimension2D getFinalDimension() {
@ -487,7 +487,7 @@ public class ImageBuilder {
option = option.withSvgDimensionStyle(skinParam.svgDimensionStyle()); option = option.withSvgDimensionStyle(skinParam.svgDimensionStyle());
} }
final UGraphicSvg ug = new UGraphicSvg(option, false, seed, stringBounder); final UGraphicSvg ug = UGraphicSvg.build(option, false, seed, stringBounder);
return ug; return ug;
} }
@ -515,7 +515,7 @@ public class ImageBuilder {
// ::comment when __CORE__ // ::comment when __CORE__
final UGraphicG2d ug = new UGraphicG2d(backcolor, fileFormatOption.getColorMapper(), stringBounder, graphics2D, final UGraphicG2d ug = new UGraphicG2d(backcolor, fileFormatOption.getColorMapper(), stringBounder, graphics2D,
scaleFactor, affineTransforms == null ? null : affineTransforms.getFirst(), dx, dy, format); scaleFactor, dx, dy, format, affineTransforms == null ? null : affineTransforms.getFirst());
// ::done // ::done
// ::uncomment when __CORE__ // ::uncomment when __CORE__
// final UGraphicG2d ug = new UGraphicG2d(backcolor, // final UGraphicG2d ug = new UGraphicG2d(backcolor,
@ -526,7 +526,7 @@ public class ImageBuilder {
final BufferedImage im = ug.getBufferedImage(); final BufferedImage im = ug.getBufferedImage();
if (this.backcolor instanceof HColorGradient) if (this.backcolor instanceof HColorGradient)
ug.apply(this.backcolor.bg()) ug.apply(this.backcolor.bg())
.draw(new URectangle(im.getWidth() / scaleFactor, im.getHeight() / scaleFactor)); .draw(URectangle.build(im.getWidth() / scaleFactor, im.getHeight() / scaleFactor));
return ug; return ug;
} }

View File

@ -241,7 +241,7 @@ public abstract class AbstractPSystem implements Diagram {
public void exportDiagramGraphic(UGraphic ug) { public void exportDiagramGraphic(UGraphic ug) {
final UFont font = UFont.monospaced(14); final UFont font = UFont.monospaced(14);
final FontConfiguration fc = FontConfiguration.blackBlueTrue(font); final FontConfiguration fc = FontConfiguration.blackBlueTrue(font);
final UText text = new UText("Not implemented yet for " + getClass().getName(), fc); final UText text = UText.build("Not implemented yet for " + getClass().getName(), fc);
ug.apply(new UTranslate(10, 10)).draw(text); ug.apply(new UTranslate(10, 10)).draw(text);
} }

View File

@ -203,33 +203,36 @@ public class PSystemBuilder {
factories.add(new NwDiagramFactory(DiagramType.NW)); factories.add(new NwDiagramFactory(DiagramType.NW));
factories.add(new MindMapDiagramFactory()); factories.add(new MindMapDiagramFactory());
factories.add(new WBSDiagramFactory()); factories.add(new WBSDiagramFactory());
// ::uncomment when __CORE__ // ::uncomment when __CORE__
// factories.add(new PSystemSudokuFactory()); // factories.add(new PSystemSudokuFactory());
// ::done // ::done
// ::comment when __CORE__
// ::comment when __CORE__ or __MIT__
factories.add(new PSystemDitaaFactory()); factories.add(new PSystemDitaaFactory());
if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) { if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
factories.add(new PSystemJcckitFactory()); factories.add(new PSystemJcckitFactory());
// factories.add(new PSystemLogoFactory());
factories.add(new PSystemSudokuFactory()); factories.add(new PSystemSudokuFactory());
} }
// ::done
// ::comment when __CORE__
factories.add(new PSystemDefinitionFactory()); factories.add(new PSystemDefinitionFactory());
factories.add(new ListSpriteDiagramFactory()); factories.add(new ListSpriteDiagramFactory());
factories.add(new StdlibDiagramFactory()); factories.add(new StdlibDiagramFactory());
factories.add(new PSystemMathFactory(DiagramType.MATH)); factories.add(new PSystemMathFactory(DiagramType.MATH));
factories.add(new PSystemLatexFactory(DiagramType.LATEX)); factories.add(new PSystemLatexFactory(DiagramType.LATEX));
// factories.add(new PSystemStatsFactory());
factories.add(new PSystemCreoleFactory()); factories.add(new PSystemCreoleFactory());
factories.add(new PSystemEggFactory()); factories.add(new PSystemEggFactory());
factories.add(new PSystemAppleTwoFactory()); factories.add(new PSystemAppleTwoFactory());
factories.add(new PSystemRIPFactory()); factories.add(new PSystemRIPFactory());
// factories.add(new PSystemLostFactory());
if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE) if (SecurityUtils.getSecurityProfile() == SecurityProfile.UNSECURE)
factories.add(new PSystemPathFactory()); factories.add(new PSystemPathFactory());
factories.add(new PSystemOregonFactory()); factories.add(new PSystemOregonFactory());
// ::done // ::done
factories.add(new PSystemCharlieFactory()); factories.add(new PSystemCharlieFactory());
// ::comment when __CORE__ // ::comment when __CORE__ or __MIT__
if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) { if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
factories.add(new PSystemXearthFactory()); factories.add(new PSystemXearthFactory());
} }

View File

@ -83,7 +83,7 @@ public enum EntityPosition {
if (this == NORMAL) { if (this == NORMAL) {
throw new IllegalStateException(); throw new IllegalStateException();
} else if (this == ENTRY_POINT || this == EXIT_POINT) { } else if (this == ENTRY_POINT || this == EXIT_POINT) {
final Shadowable circle = new UEllipse(RADIUS * 2, RADIUS * 2); final Shadowable circle = UEllipse.build(RADIUS * 2, RADIUS * 2);
ug.draw(circle); ug.draw(circle);
if (this == EntityPosition.EXIT_POINT) { if (this == EntityPosition.EXIT_POINT) {
final double xc = 0 + RADIUS + .5; final double xc = 0 + RADIUS + .5;
@ -95,18 +95,18 @@ public enum EntityPosition {
getPointOnCircle(xc, yc, Math.PI - Math.PI / 4, radius)); getPointOnCircle(xc, yc, Math.PI - Math.PI / 4, radius));
} }
} else if (this == INPUT_PIN || this == OUTPUT_PIN /* || this == PORT */) { } else if (this == INPUT_PIN || this == OUTPUT_PIN /* || this == PORT */) {
final Shadowable rectangle = new URectangle(RADIUS * 2, RADIUS * 2); final Shadowable rectangle = URectangle.build(RADIUS * 2, RADIUS * 2);
ug.draw(rectangle); ug.draw(rectangle);
} else if (this == EXPANSION_INPUT || this == EXPANSION_OUTPUT) { } else if (this == EXPANSION_INPUT || this == EXPANSION_OUTPUT) {
if (rankdir == Rankdir.TOP_TO_BOTTOM) { if (rankdir == Rankdir.TOP_TO_BOTTOM) {
final Shadowable rectangle = new URectangle(RADIUS * 2 * 4, RADIUS * 2); final Shadowable rectangle = URectangle.build(RADIUS * 2 * 4, RADIUS * 2);
ug.draw(rectangle); ug.draw(rectangle);
final ULine vline = ULine.vline(RADIUS * 2); final ULine vline = ULine.vline(RADIUS * 2);
ug.apply(UTranslate.dx(RADIUS * 2)).draw(vline); ug.apply(UTranslate.dx(RADIUS * 2)).draw(vline);
ug.apply(UTranslate.dx(RADIUS * 2 * 2)).draw(vline); ug.apply(UTranslate.dx(RADIUS * 2 * 2)).draw(vline);
ug.apply(UTranslate.dx(RADIUS * 2 * 3)).draw(vline); ug.apply(UTranslate.dx(RADIUS * 2 * 3)).draw(vline);
} else { } else {
final Shadowable rectangle = new URectangle(RADIUS * 2, RADIUS * 2 * 4); final Shadowable rectangle = URectangle.build(RADIUS * 2, RADIUS * 2 * 4);
ug.apply(UTranslate.dy(0)).draw(rectangle); ug.apply(UTranslate.dy(0)).draw(rectangle);
final ULine hline = ULine.hline(RADIUS * 2); final ULine hline = ULine.hline(RADIUS * 2);
ug.apply(UTranslate.dy(RADIUS * 2)).draw(hline); ug.apply(UTranslate.dy(RADIUS * 2)).draw(hline);

View File

@ -59,6 +59,7 @@ import net.sourceforge.plantuml.core.UmlSource;
public class PSystemXearth extends AbstractPSystem { public class PSystemXearth extends AbstractPSystem {
// ::remove folder when __CORE__ // ::remove folder when __CORE__
// ::remove folder when __MIT__
final private int width; final private int width;
final private int height; final private int height;

View File

@ -50,7 +50,7 @@ public enum BoxStyle {
PLAIN(null, '\0', 0) { PLAIN(null, '\0', 0) {
@Override @Override
protected Shadowable getShape(double width, double height, double roundCorner) { protected Shadowable getShape(double width, double height, double roundCorner) {
return new URectangle(width, height).rounded(roundCorner); return URectangle.build(width, height).rounded(roundCorner);
} }
}, },
SDL_INPUT("input", '<', 10) { SDL_INPUT("input", '<', 10) {
@ -80,7 +80,7 @@ public enum BoxStyle {
SDL_PROCEDURE("procedure", '|', 0) { SDL_PROCEDURE("procedure", '|', 0) {
@Override @Override
protected void drawInternal(UGraphic ug, double width, double height, double shadowing, double roundCorner) { protected void drawInternal(UGraphic ug, double width, double height, double shadowing, double roundCorner) {
final URectangle rect = new URectangle(width, height); final URectangle rect = URectangle.build(width, height);
rect.setDeltaShadow(shadowing); rect.setDeltaShadow(shadowing);
ug.draw(rect); ug.draw(rect);
final ULine vline = ULine.vline(height); final ULine vline = ULine.vline(height);
@ -113,7 +113,7 @@ public enum BoxStyle {
SDL_CONTINUOUS("continuous", '}', 0) { SDL_CONTINUOUS("continuous", '}', 0) {
@Override @Override
protected Shadowable getShape(double width, double height, double roundCorner) { protected Shadowable getShape(double width, double height, double roundCorner) {
final UPath result = new UPath(); final UPath result = UPath.none();
final double c1[] = { DELTA_CONTINUOUS, 0 }; final double c1[] = { DELTA_CONTINUOUS, 0 };
final double c2[] = { 0, height / 2 }; final double c2[] = { 0, height / 2 };
final double c3[] = { DELTA_CONTINUOUS, height }; final double c3[] = { DELTA_CONTINUOUS, height };
@ -135,7 +135,7 @@ public enum BoxStyle {
SDL_TASK("task", ']', 0) { SDL_TASK("task", ']', 0) {
@Override @Override
protected Shadowable getShape(double width, double height, double roundCorner) { protected Shadowable getShape(double width, double height, double roundCorner) {
return new URectangle(width, height); return URectangle.build(width, height);
} }
}; };

View File

@ -83,7 +83,7 @@ public class LaneDivider extends AbstractTextBlock {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
// final UShape back = new URectangle(x1 + x2, height).ignoreForCompressionOnY(); // final UShape back = URectangle.build(x1 + x2, height).ignoreForCompressionOnY();
// ug.apply(UChangeColor.nnn(HColorUtils.BLUE)).draw(back); // ug.apply(UChangeColor.nnn(HColorUtils.BLUE)).draw(back);
final UShape back = new UEmpty(x1 + x2, 1); final UShape back = new UEmpty(x1 + x2, 1);
ug.draw(back); ug.draw(back);

View File

@ -311,7 +311,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
.apply(UTranslate.dx(xpos - divider1.getX2())); .apply(UTranslate.dx(xpos - divider1.getX2()));
final double width = swimlane.getActualWidth() + divider1.getX2() + divider2.getX1(); final double width = swimlane.getActualWidth() + divider1.getX2() + divider2.getX1();
final double height = dimensionFull.getHeight() + titleHeightTranslate.getDy(); final double height = dimensionFull.getHeight() + titleHeightTranslate.getDy();
background.draw(new URectangle(width, height).ignoreForCompressionOnX().ignoreForCompressionOnY()); background.draw(URectangle.build(width, height).ignoreForCompressionOnX().ignoreForCompressionOnY());
} }
full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane, swimlanes()).apply(swimlane.getTranslate()) full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane, swimlanes()).apply(swimlane.getTranslate())
@ -336,7 +336,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock, Styleable
if (color != null) { if (color != null) {
final double titleHeight = getTitlesHeight(ug.getStringBounder()); final double titleHeight = getTitlesHeight(ug.getStringBounder());
double fullWidth = swimlanesSpecial().get(swimlanesSpecial().size() - 1).getTranslate().getDx() - 2 * 5 - 1; double fullWidth = swimlanesSpecial().get(swimlanesSpecial().size() - 1).getTranslate().getDx() - 2 * 5 - 1;
final URectangle back = new URectangle(fullWidth, titleHeight).ignoreForCompressionOnX() final URectangle back = URectangle.build(fullWidth, titleHeight).ignoreForCompressionOnX()
.ignoreForCompressionOnY(); .ignoreForCompressionOnY();
ug.apply(UTranslate.dx(5)).apply(color.bg()).apply(color).draw(back); ug.apply(UTranslate.dx(5)).apply(color.bg()).apply(color).draw(back);
} }

View File

@ -106,8 +106,8 @@ public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
return; return;
final double dx = dest.getDx() - posNow.getDx(); final double dx = dest.getDx() - posNow.getDx();
final double dy = dest.getDy() - posNow.getDy(); final double dy = dest.getDy() - posNow.getDy();
ugGoto.draw(new UEllipse(3, 3)); ugGoto.draw(UEllipse.build(3, 3));
ugGoto.apply(new UTranslate(dx, dy)).draw(new UEllipse(3, 3)); ugGoto.apply(new UTranslate(dx, dy)).draw(UEllipse.build(3, 3));
ugGoto.draw(ULine.hline(dx)); ugGoto.draw(ULine.hline(dx));
ugGoto.apply(UTranslate.dx(dx)).draw(ULine.vline(dy)); ugGoto.apply(UTranslate.dx(dx)).draw(ULine.vline(dy));
// ugGoto.draw(new ULine(dx, dy)); // ugGoto.draw(new ULine(dx, dy));

View File

@ -96,7 +96,7 @@ public class FtileBlackBlock extends AbstractFtile {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final URectangle rect = new URectangle(width, height).rounded(5).ignoreForCompressionOnX(); final URectangle rect = URectangle.build(width, height).rounded(5).ignoreForCompressionOnX();
final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder()); final Style style = getSignature().getMergedStyle(skinParam().getCurrentStyleBuilder());
final double shadowing = style.value(PName.Shadowing).asDouble(); final double shadowing = style.value(PName.Shadowing).asDouble();

View File

@ -100,7 +100,7 @@ public class FtileCircleEnd extends AbstractFtile {
xTheoricalPosition = Math.round(xTheoricalPosition); xTheoricalPosition = Math.round(xTheoricalPosition);
yTheoricalPosition = Math.round(yTheoricalPosition); yTheoricalPosition = Math.round(yTheoricalPosition);
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = UEllipse.build(SIZE, SIZE);
circle.setDeltaShadow(shadowing); circle.setDeltaShadow(shadowing);
ug = ug.apply(borderColor); ug = ug.apply(borderColor);
final double thickness = 2.5; final double thickness = 2.5;

View File

@ -97,7 +97,7 @@ public class FtileCircleSpot extends AbstractFtile {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = UEllipse.build(SIZE, SIZE);
final HColor backColor = this.backColor == null ? style.value(PName.BackGroundColor).asColor(getIHtmlColorSet()) final HColor backColor = this.backColor == null ? style.value(PName.BackGroundColor).asColor(getIHtmlColorSet())
: this.backColor; : this.backColor;

View File

@ -92,7 +92,7 @@ public class FtileCircleStart extends AbstractFtile {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = UEllipse.build(SIZE, SIZE);
circle.setDeltaShadow(shadowing); circle.setDeltaShadow(shadowing);
ug.apply(borderColor).apply(backColor.bg()).draw(circle); ug.apply(borderColor).apply(backColor.bg()).draw(circle);
} }

View File

@ -94,13 +94,13 @@ public class FtileCircleStop extends AbstractFtile {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = UEllipse.build(SIZE, SIZE);
circle.setDeltaShadow(shadowing); circle.setDeltaShadow(shadowing);
ug.apply(borderColor).apply(backColor.bg()).draw(circle); ug.apply(borderColor).apply(backColor.bg()).draw(circle);
final double delta = 5; final double delta = 5;
final UEllipse circleSmall = new UEllipse(SIZE - delta * 2, SIZE - delta * 2); final UEllipse circleSmall = UEllipse.build(SIZE - delta * 2, SIZE - delta * 2);
// if (skinParam().shadowing(null)) { // if (skinParam().shadowing(null)) {
// circleSmall.setDeltaShadow(3); // circleSmall.setDeltaShadow(3);
// } // }

View File

@ -86,7 +86,7 @@ public class GtileCircleSpot extends AbstractGtile {
? SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground) ? SkinParamUtils.getColor(skinParam(), null, ColorParam.activityBackground)
: this.backColor; : this.backColor;
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = UEllipse.build(SIZE, SIZE);
circle.setDeltaShadow(shadowing); circle.setDeltaShadow(shadowing);
ug.apply(borderColor).apply(backColor.bg()).apply(getThickness()).draw(circle); ug.apply(borderColor).apply(backColor.bg()).apply(getThickness()).draw(circle);

View File

@ -70,7 +70,7 @@ public class GtileCircleStart extends AbstractGtile {
@Override @Override
protected void drawUInternal(UGraphic ug) { protected void drawUInternal(UGraphic ug) {
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = UEllipse.build(SIZE, SIZE);
circle.setDeltaShadow(shadowing); circle.setDeltaShadow(shadowing);
ug.apply(HColors.none()).apply(backColor.bg()).draw(circle); ug.apply(HColors.none()).apply(backColor.bg()).draw(circle);
} }

View File

@ -67,7 +67,7 @@ public class CardBox extends AbstractTextBlock {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final URectangle rect = new URectangle(calculateDimension(ug.getStringBounder())); final URectangle rect = URectangle.build(calculateDimension(ug.getStringBounder()));
rect.setDeltaShadow(1); rect.setDeltaShadow(1);
ug.apply(HColors.BLACK).apply(HColors.LIGHT_GRAY.bg()).draw(rect); ug.apply(HColors.BLACK).apply(HColors.LIGHT_GRAY.bg()).draw(rect);

View File

@ -76,7 +76,7 @@ public class BrailleDrawer implements UDrawable {
private void drawCircle(UGraphic ug, int x, int y) { private void drawCircle(UGraphic ug, int x, int y) {
final double cx = x * step; final double cx = x * step;
final double cy = y * step; final double cy = y * step;
ug.apply(new UTranslate(cx, cy)).draw(new UEllipse(spotSize, spotSize)); ug.apply(new UTranslate(cx, cy)).draw(UEllipse.build(spotSize, spotSize));
} }
} }

View File

@ -151,8 +151,8 @@ public class BrailleGrid {
drawPointInternal(x, y, bez.getP1()); drawPointInternal(x, y, bez.getP1());
drawPointInternal(x, y, bez.getP2()); drawPointInternal(x, y, bez.getP2());
if (bez.getP1().distance(bez.getP2()) > quanta) { if (bez.getP1().distance(bez.getP2()) > quanta) {
final XCubicCurve2D part1 = new XCubicCurve2D(); final XCubicCurve2D part1 = XCubicCurve2D.none();
final XCubicCurve2D part2 = new XCubicCurve2D(); final XCubicCurve2D part2 = XCubicCurve2D.none();
bez.subdivide(part1, part2); bez.subdivide(part1, part2);
drawCubic(x, y, part1); drawCubic(x, y, part1);
drawCubic(x, y, part2); drawCubic(x, y, part2);

View File

@ -61,16 +61,17 @@ public class UGraphicBraille extends AbstractUGraphic<BrailleGrid> implements Cl
@Override @Override
protected AbstractCommonUGraphic copyUGraphic() { protected AbstractCommonUGraphic copyUGraphic() {
return new UGraphicBraille(this); final UGraphicBraille result = new UGraphicBraille(this);
return result;
} }
public UGraphicBraille(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) { public UGraphicBraille(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) {
super(defaultBackground, colorMapper, stringBounder, new BrailleGrid(QUANTA)); copy(defaultBackground, colorMapper, stringBounder, new BrailleGrid(QUANTA));
register(); register();
} }
private UGraphicBraille(UGraphicBraille other) { private UGraphicBraille(UGraphicBraille other) {
super(other); copy(other);
register(); register();
} }

View File

@ -87,8 +87,8 @@ public class LinkConstraint {
return; return;
} }
ug = ug.apply(HColors.BLACK); ug = ug.apply(HColors.BLACK);
// ug.apply(new UTranslate(x1, y1)).draw(new URectangle(10, 10)); // ug.apply(new UTranslate(x1, y1)).draw(URectangle.build(10, 10));
// ug.apply(new UTranslate(x2, y2)).draw(new URectangle(10, 10)); // ug.apply(new UTranslate(x2, y2)).draw(URectangle.build(10, 10));
final ULine line = new ULine(x2 - x1, y2 - y1); final ULine line = new ULine(x2 - x1, y2 - y1);
ug = ug.apply(new UStroke(3, 3, 1)); ug = ug.apply(new UStroke(3, 3, 1));

View File

@ -189,7 +189,7 @@ public class TextBlockMap extends AbstractTextBlock implements WithPorts {
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UShape point = new UEllipse(getDiameter(), getDiameter()); final UShape point = UEllipse.build(getDiameter(), getDiameter());
ug = ug.apply(color).apply(color.bg()); ug = ug.apply(color).apply(color.bg());
ug.draw(point); ug.draw(point);
} }

View File

@ -60,7 +60,7 @@ class USymbolArtifact extends USymbol {
private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, double shadowing, private void drawArtifact(UGraphic ug, double widthTotal, double heightTotal, double shadowing,
double roundCorner) { double roundCorner) {
final URectangle form = new URectangle(widthTotal, heightTotal).rounded(roundCorner); final URectangle form = URectangle.build(widthTotal, heightTotal).rounded(roundCorner);
form.setDeltaShadow(shadowing); form.setDeltaShadow(shadowing);
ug.draw(form); ug.draw(form);

View File

@ -57,7 +57,7 @@ class USymbolCard extends USymbol {
} }
private void drawCard(UGraphic ug, double width, double height, double shadowing, double top, double roundCorner) { private void drawCard(UGraphic ug, double width, double height, double shadowing, double top, double roundCorner) {
final URectangle shape = new URectangle(width, height).rounded(roundCorner); final URectangle shape = URectangle.build(width, height).rounded(roundCorner);
shape.setDeltaShadow(shadowing); shape.setDeltaShadow(shadowing);
ug.draw(shape); ug.draw(shape);

View File

@ -95,7 +95,7 @@ class USymbolCloud extends USymbol {
points.add(points.get(0)); points.add(points.get(0));
final UPath result = new UPath(); final UPath result = UPath.none();
result.moveTo(points.get(0)); result.moveTo(points.get(0));
for (int i = 0; i < points.size() - 1; i++) { for (int i = 0; i < points.size() - 1; i++) {
if (DEBUG) { if (DEBUG) {
@ -188,7 +188,7 @@ class USymbolCloud extends USymbol {
if (NEW) { if (NEW) {
return getSpecificFrontierForCloudNew(width, height); return getSpecificFrontierForCloudNew(width, height);
} }
final UPath path = new UPath(); final UPath path = UPath.none();
path.moveTo(0, 10); path.moveTo(0, 10);
double x = 0; double x = 0;
for (int i = 0; i < width - 9; i += 10) { for (int i = 0; i < width - 9; i += 10) {

View File

@ -56,7 +56,7 @@ class USymbolCollections extends USymbol {
} }
private void drawCollections(UGraphic ug, double width, double height, double shadowing, double roundCorner) { private void drawCollections(UGraphic ug, double width, double height, double shadowing, double roundCorner) {
final URectangle small = new URectangle(width - getDeltaCollection(), height - getDeltaCollection()) final URectangle small = URectangle.build(width - getDeltaCollection(), height - getDeltaCollection())
.rounded(roundCorner); .rounded(roundCorner);
small.setDeltaShadow(shadowing); small.setDeltaShadow(shadowing);

View File

@ -59,11 +59,11 @@ class USymbolComponent1 extends USymbol {
private void drawComponent1(UGraphic ug, double widthTotal, double heightTotal, double shadowing, private void drawComponent1(UGraphic ug, double widthTotal, double heightTotal, double shadowing,
double roundCorner) { double roundCorner) {
final URectangle form = new URectangle(widthTotal, heightTotal).rounded(roundCorner); final URectangle form = URectangle.build(widthTotal, heightTotal).rounded(roundCorner);
form.setDeltaShadow(shadowing); form.setDeltaShadow(shadowing);
ug.draw(form); ug.draw(form);
final UShape small = new URectangle(10, 5); final UShape small = URectangle.build(10, 5);
// UML 1 Component Notation // UML 1 Component Notation
ug.apply(new UTranslate(-5, 5)).draw(small); ug.apply(new UTranslate(-5, 5)).draw(small);

View File

@ -59,11 +59,11 @@ class USymbolComponent2 extends USymbol {
private void drawComponent2(UGraphic ug, double widthTotal, double heightTotal, double shadowing, private void drawComponent2(UGraphic ug, double widthTotal, double heightTotal, double shadowing,
double roundCorner) { double roundCorner) {
final URectangle form = new URectangle(widthTotal, heightTotal).rounded(roundCorner); final URectangle form = URectangle.build(widthTotal, heightTotal).rounded(roundCorner);
form.setDeltaShadow(shadowing); form.setDeltaShadow(shadowing);
final UShape small = new URectangle(15, 10); final UShape small = URectangle.build(15, 10);
final UShape tiny = new URectangle(4, 2); final UShape tiny = URectangle.build(4, 2);
ug.draw(form); ug.draw(form);

View File

@ -59,7 +59,7 @@ class USymbolDatabase extends USymbol {
} }
private void drawDatabase(UGraphic ug, double width, double height, double shadowing) { private void drawDatabase(UGraphic ug, double width, double height, double shadowing) {
final UPath shape = new UPath(); final UPath shape = UPath.none();
shape.setDeltaShadow(shadowing); shape.setDeltaShadow(shadowing);
shape.moveTo(0, 10); shape.moveTo(0, 10);
@ -79,7 +79,7 @@ class USymbolDatabase extends USymbol {
} }
private UPath getClosingPath(double width) { private UPath getClosingPath(double width) {
final UPath closing = new UPath(); final UPath closing = UPath.none();
closing.moveTo(0, 10); closing.moveTo(0, 10);
closing.cubicTo(0, 20, width / 2, 20, width / 2, 20); closing.cubicTo(0, 20, width / 2, 20, width / 2, 20);
closing.cubicTo(width / 2, 20, width, 20, width, 10); closing.cubicTo(width / 2, 20, width, 20, width, 10);

View File

@ -73,7 +73,7 @@ class USymbolFile extends USymbol {
polygon.addPoint(0, 0); polygon.addPoint(0, 0);
out = polygon; out = polygon;
} else { } else {
final UPath path = new UPath(); final UPath path = UPath.none();
path.moveTo(0, roundCorner / 2); path.moveTo(0, roundCorner / 2);
path.lineTo(0, height - roundCorner / 2); path.lineTo(0, height - roundCorner / 2);
path.arcTo(new XPoint2D(roundCorner / 2, height), roundCorner / 2, 0, 0); path.arcTo(new XPoint2D(roundCorner / 2, height), roundCorner / 2, 0, 0);
@ -89,7 +89,7 @@ class USymbolFile extends USymbol {
out.setDeltaShadow(shadowing); out.setDeltaShadow(shadowing);
ug.draw(out); ug.draw(out);
final UPath path = new UPath(); final UPath path = UPath.none();
path.moveTo(width - cornersize, 0); path.moveTo(width - cornersize, 0);
if (roundCorner == 0) { if (roundCorner == 0) {
path.lineTo(width - cornersize, cornersize); path.lineTo(width - cornersize, cornersize);

View File

@ -101,7 +101,7 @@ public class USymbolFolder extends USymbol {
poly.addPoint(0, 0); poly.addPoint(0, 0);
shape = poly; shape = poly;
} else { } else {
final UPath path = new UPath(); final UPath path = UPath.none();
path.moveTo(roundCorner / 2, 0); path.moveTo(roundCorner / 2, 0);
path.lineTo(wtitle - roundCorner / 2, 0); path.lineTo(wtitle - roundCorner / 2, 0);
// path.lineTo(wtitle, roundCorner / 2); // path.lineTo(wtitle, roundCorner / 2);

View File

@ -67,7 +67,7 @@ class USymbolFrame extends USymbol {
private void drawFrame(UGraphic ug, double width, double height, XDimension2D dimTitle, double shadowing, private void drawFrame(UGraphic ug, double width, double height, XDimension2D dimTitle, double shadowing,
double roundCorner) { double roundCorner) {
final Shadowable rectangle = new URectangle(width, height).rounded(roundCorner).ignoreForCompressionOnX() final Shadowable rectangle = URectangle.build(width, height).rounded(roundCorner).ignoreForCompressionOnX()
.ignoreForCompressionOnY(); .ignoreForCompressionOnY();
rectangle.setDeltaShadow(shadowing); rectangle.setDeltaShadow(shadowing);
@ -84,7 +84,7 @@ class USymbolFrame extends USymbol {
} }
final double textHeight = getYpos(dimTitle); final double textHeight = getYpos(dimTitle);
final UPath line = new UPath(); final UPath line = UPath.none();
line.setIgnoreForCompressionOnX(); line.setIgnoreForCompressionOnX();
line.moveTo(textWidth, 0); line.moveTo(textWidth, 0);

View File

@ -81,8 +81,8 @@ public class USymbolHexagon extends USymbol {
private void drawRect(UGraphic ug, double width, double height, double shadowing, double roundCorner, private void drawRect(UGraphic ug, double width, double height, double shadowing, double roundCorner,
double diagonalCorner) { double diagonalCorner) {
// final UShape shape = new URectangle(width, height); // final UShape shape = URectangle.build(width, height);
final UPath shape = new UPath(); final UPath shape = UPath.none();
final double dx = width / 8; final double dx = width / 8;
shape.moveTo(0, height / 2); shape.moveTo(0, height / 2);
shape.lineTo(dx, 0); shape.lineTo(dx, 0);

View File

@ -57,8 +57,8 @@ class USymbolPerson extends USymbol {
} }
private void drawHeadAndBody(UGraphic ug, double shadowing, XDimension2D dimBody, double headSize) { private void drawHeadAndBody(UGraphic ug, double shadowing, XDimension2D dimBody, double headSize) {
final UEllipse head = new UEllipse(headSize, headSize); final UEllipse head = UEllipse.build(headSize, headSize);
final URectangle body = new URectangle(dimBody).rounded(headSize); final URectangle body = URectangle.build(dimBody).rounded(headSize);
body.setDeltaShadow(shadowing); body.setDeltaShadow(shadowing);
head.setDeltaShadow(shadowing); head.setDeltaShadow(shadowing);

View File

@ -61,7 +61,7 @@ class USymbolQueue extends USymbol {
private final double dx = 5; private final double dx = 5;
private void drawQueue(UGraphic ug, double width, double height, double shadowing) { private void drawQueue(UGraphic ug, double width, double height, double shadowing) {
final UPath shape = new UPath(); final UPath shape = UPath.none();
shape.setDeltaShadow(shadowing); shape.setDeltaShadow(shadowing);
shape.moveTo(dx, 0); shape.moveTo(dx, 0);
@ -81,7 +81,7 @@ class USymbolQueue extends USymbol {
} }
private UPath getClosingPath(double width, double height) { private UPath getClosingPath(double width, double height) {
final UPath closing = new UPath(); final UPath closing = UPath.none();
closing.moveTo(width - dx, 0); closing.moveTo(width - dx, 0);
closing.cubicTo(width - dx * 2, 0, width - dx * 2, height / 2, width - dx * 2, height / 2); closing.cubicTo(width - dx * 2, 0, width - dx * 2, height / 2, width - dx * 2, height / 2);
closing.cubicTo(width - dx * 2, height, width - dx, height, width - dx, height); closing.cubicTo(width - dx * 2, height, width - dx, height, width - dx, height);

View File

@ -64,7 +64,7 @@ class USymbolRectangle extends USymbol {
private void drawRect(UGraphic ug, double width, double height, double shadowing, double roundCorner, private void drawRect(UGraphic ug, double width, double height, double shadowing, double roundCorner,
double diagonalCorner) { double diagonalCorner) {
final URectangle rect = new URectangle(width, height); final URectangle rect = URectangle.build(width, height);
final Shadowable shape = diagonalCorner > 0 ? rect.diagonalCorner(diagonalCorner) : rect.rounded(roundCorner); final Shadowable shape = diagonalCorner > 0 ? rect.diagonalCorner(diagonalCorner) : rect.rounded(roundCorner);
shape.setDeltaShadow(shadowing); shape.setDeltaShadow(shadowing);
ug.draw(shape); ug.draw(shape);

View File

@ -61,10 +61,10 @@ class USymbolStack extends USymbol {
private void drawQueue(UGraphic ug, double width, double height, double shadowing, double roundCorner) { private void drawQueue(UGraphic ug, double width, double height, double shadowing, double roundCorner) {
final double border = 15; final double border = 15;
final URectangle rect = new URectangle(width - 2 * border, height).rounded(roundCorner); final URectangle rect = URectangle.build(width - 2 * border, height).rounded(roundCorner);
ug.apply(HColors.none()).apply(UTranslate.dx(border)).draw(rect); ug.apply(HColors.none()).apply(UTranslate.dx(border)).draw(rect);
final UPath path = new UPath(); final UPath path = UPath.none();
if (roundCorner == 0) { if (roundCorner == 0) {
path.moveTo(0, 0); path.moveTo(0, 0);
path.lineTo(border, 0); path.lineTo(border, 0);

View File

@ -56,7 +56,7 @@ class USymbolStorage extends USymbol {
} }
private void drawStorage(UGraphic ug, double width, double height, double shadowing) { private void drawStorage(UGraphic ug, double width, double height, double shadowing) {
final URectangle shape = new URectangle(width, height).rounded(70); final URectangle shape = URectangle.build(width, height).rounded(70);
shape.setDeltaShadow(shadowing); shape.setDeltaShadow(shadowing);
ug.draw(shape); ug.draw(shape);

View File

@ -75,7 +75,7 @@ public class BoxedCharacter extends AbstractTextBlock implements TextBlock {
} else { } else {
ug = ug.apply(innerCircle.bg()); ug = ug.apply(innerCircle.bg());
} }
ug.draw(new URectangle(2 * radius, 2 * radius)); ug.draw(URectangle.build(2 * radius, 2 * radius));
ug = ug.apply(fontColor); ug = ug.apply(fontColor);
ug = ug.apply(new UTranslate(radius, radius)); ug = ug.apply(new UTranslate(radius, radius));
ug.draw(new UCenteredCharacter(c.charAt(0), font)); ug.draw(new UCenteredCharacter(c.charAt(0), font));

View File

@ -121,8 +121,8 @@ public class EntityImageDesignedDomain extends AbstractEntityImage {
final double widthTotal = dimTotal.getWidth(); final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final URectangle rect = new URectangle(widthTotal, heightTotal); final URectangle rect = URectangle.build(widthTotal, heightTotal);
URectangle rect2 = new URectangle(4, heightTotal); URectangle rect2 = URectangle.build(4, heightTotal);
ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.designedBorder)); ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.designedBorder));
HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); HColor backcolor = getEntity().getColors().getColor(ColorType.BACK);

View File

@ -125,7 +125,7 @@ public class EntityImageDomain extends AbstractEntityImage {
final XDimension2D dimTag = getTagDimension(stringBounder); final XDimension2D dimTag = getTagDimension(stringBounder);
final double widthTotal = dimTotal.getWidth(); final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final URectangle rect = new URectangle(widthTotal, heightTotal); final URectangle rect = URectangle.build(widthTotal, heightTotal);
ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.domainBorder)); ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.domainBorder));
HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); HColor backcolor = getEntity().getColors().getColor(ColorType.BACK);

View File

@ -121,8 +121,8 @@ public class EntityImageMachine extends AbstractEntityImage {
final double widthTotal = dimTotal.getWidth(); final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final URectangle rect = new URectangle(widthTotal, heightTotal); final URectangle rect = URectangle.build(widthTotal, heightTotal);
URectangle rect2 = new URectangle(4, heightTotal); URectangle rect2 = URectangle.build(4, heightTotal);
ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.machineBorder)); ug = ug.apply(SkinParamUtils.getColor(getSkinParam(), getStereo(), ColorParam.machineBorder));
HColor backcolor = getEntity().getColors().getColor(ColorType.BACK); HColor backcolor = getEntity().getColors().getColor(ColorType.BACK);

View File

@ -85,7 +85,7 @@ public class CornerCurved implements UDrawable {
@Override @Override
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final UPath path = new UPath(); final UPath path = UPath.none();
final double a = delta / 4; final double a = delta / 4;
switch (type) { switch (type) {

View File

@ -108,7 +108,7 @@ public abstract class ETile extends AbstractTextBlock {
} }
static UPath getArrowToLeft() { static UPath getArrowToLeft() {
final UPath arrow = new UPath(); final UPath arrow = UPath.none();
arrow.moveTo(0, 0); arrow.moveTo(0, 0);
arrow.lineTo(0, -3); arrow.lineTo(0, -3);
arrow.lineTo(-6, 0); arrow.lineTo(-6, 0);
@ -119,7 +119,7 @@ public abstract class ETile extends AbstractTextBlock {
} }
static UPath getArrowToRight() { static UPath getArrowToRight() {
final UPath arrow = new UPath(); final UPath arrow = UPath.none();
arrow.moveTo(0, 0); arrow.moveTo(0, 0);
arrow.lineTo(0, -3); arrow.lineTo(0, -3);
arrow.lineTo(6, 0); arrow.lineTo(6, 0);
@ -130,7 +130,7 @@ public abstract class ETile extends AbstractTextBlock {
} }
static UPath getArrowToBottom() { static UPath getArrowToBottom() {
final UPath arrow = new UPath(); final UPath arrow = UPath.none();
arrow.moveTo(0, 0); arrow.moveTo(0, 0);
arrow.lineTo(3, 0); arrow.lineTo(3, 0);
arrow.lineTo(0, 6); arrow.lineTo(0, 6);
@ -141,7 +141,7 @@ public abstract class ETile extends AbstractTextBlock {
} }
static UPath getArrowToTop() { static UPath getArrowToTop() {
final UPath arrow = new UPath(); final UPath arrow = UPath.none();
arrow.moveTo(0, 0); arrow.moveTo(0, 0);
arrow.lineTo(3, 0); arrow.lineTo(3, 0);
arrow.lineTo(0, -6); arrow.lineTo(0, -6);

View File

@ -78,7 +78,7 @@ public class ETileBox extends ETile {
this.skinParam = skinParam; this.skinParam = skinParam;
this.value = value; this.value = value;
this.fc = fc; this.fc = fc;
this.utext = new UText(value, fc); this.utext = UText.build(value, fc);
this.style = style; this.style = style;
this.colorSet = colorSet; this.colorSet = colorSet;
} }
@ -155,17 +155,17 @@ public class ETileBox extends ETile {
final double posxBox = (dim.getWidth() - dimBox.getWidth()) / 2; final double posxBox = (dim.getWidth() - dimBox.getWidth()) / 2;
if (symbol == Symbol.TERMINAL_STRING1 || symbol == Symbol.TERMINAL_STRING2) { if (symbol == Symbol.TERMINAL_STRING1 || symbol == Symbol.TERMINAL_STRING2) {
final URectangle rect = new URectangle(dimBox); final URectangle rect = URectangle.build(dimBox);
ug.apply(new UTranslate(posxBox, posy)).apply(lineColor).apply(UStroke.withThickness(0.5)).draw(rect); ug.apply(new UTranslate(posxBox, posy)).apply(lineColor).apply(UStroke.withThickness(0.5)).draw(rect);
} else if (symbol == Symbol.SPECIAL_SEQUENCE) { } else if (symbol == Symbol.SPECIAL_SEQUENCE) {
final URectangle rect = new URectangle(dimBox); final URectangle rect = URectangle.build(dimBox);
ug.apply(new UTranslate(posxBox, posy)).apply(lineColor).apply(new UStroke(5, 5, 1)).draw(rect); ug.apply(new UTranslate(posxBox, posy)).apply(lineColor).apply(new UStroke(5, 5, 1)).draw(rect);
// final URectangle rect1 = new URectangle(dimBox.delta(2)).rounded(12); // final URectangle rect1 = URectangle.build(dimBox.delta(2)).rounded(12);
// final URectangle rect2 = new URectangle(dimBox.delta(-2)).rounded(8); // final URectangle rect2 = URectangle.build(dimBox.delta(-2)).rounded(8);
// ug.apply(new UTranslate(posxBox - 1, posy - 1)).apply(lineColor).apply(new UStroke(5.0, 5.0, 1.0)).draw(rect1); // ug.apply(new UTranslate(posxBox - 1, posy - 1)).apply(lineColor).apply(new UStroke(5.0, 5.0, 1.0)).draw(rect1);
// ug.apply(new UTranslate(posxBox + 1, posy + 1)).apply(lineColor).apply(UStroke.withThickness(0.5)).draw(rect2); // ug.apply(new UTranslate(posxBox + 1, posy + 1)).apply(lineColor).apply(UStroke.withThickness(0.5)).draw(rect2);
} else { } else {
final URectangle rect = new URectangle(dimBox).rounded(10); final URectangle rect = URectangle.build(dimBox).rounded(10);
ug.apply(new UTranslate(posxBox, posy)).apply(lineColor).apply(backgroundColor.bg()).apply(UStroke.withThickness(1.5)) ug.apply(new UTranslate(posxBox, posy)).apply(lineColor).apply(backgroundColor.bg()).apply(UStroke.withThickness(1.5))
.draw(rect); .draw(rect);
} }

View File

@ -56,7 +56,7 @@ public class ETileOneOrMore extends ETile {
public ETileOneOrMore(ETile orig, String loop, FontConfiguration fc, ISkinParam skinParam) { public ETileOneOrMore(ETile orig, String loop, FontConfiguration fc, ISkinParam skinParam) {
this.orig = orig; this.orig = orig;
this.fc = fc; this.fc = fc;
this.loop = loop == null ? null : new UText(loop, fc); this.loop = loop == null ? null : UText.build(loop, fc);
} }
public ETileOneOrMore(ETile orig) { public ETileOneOrMore(ETile orig) {
@ -92,7 +92,7 @@ public class ETileOneOrMore extends ETile {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final XDimension2D fullDim = calculateDimension(stringBounder); final XDimension2D fullDim = calculateDimension(stringBounder);
if (TRACE) if (TRACE)
ug.apply(HColors.RED).draw(new URectangle(fullDim)); ug.apply(HColors.RED).draw(URectangle.build(fullDim));
final double h1 = getH1(stringBounder); final double h1 = getH1(stringBounder);

View File

@ -93,7 +93,7 @@ public class ETileOptional extends ETile {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final XDimension2D dim = calculateDimension(stringBounder); final XDimension2D dim = calculateDimension(stringBounder);
if (TRACE) if (TRACE)
ug.apply(HColors.BLUE).draw(new URectangle(dim)); ug.apply(HColors.BLUE).draw(URectangle.build(dim));
final double linePos = getH1(stringBounder); final double linePos = getH1(stringBounder);

View File

@ -79,7 +79,7 @@ public class ETileWithCircles extends ETile {
ug = ug.apply(lineColor).apply(UStroke.withThickness(1.5)); ug = ug.apply(lineColor).apply(UStroke.withThickness(1.5));
orig.drawU(ug.apply(UTranslate.dx(deltax))); orig.drawU(ug.apply(UTranslate.dx(deltax)));
final UEllipse circle = new UEllipse(SIZE, SIZE); final UEllipse circle = UEllipse.build(SIZE, SIZE);
ug.apply(UStroke.withThickness(2)).apply(new UTranslate(0, linePos - SIZE / 2)).draw(circle); ug.apply(UStroke.withThickness(2)).apply(new UTranslate(0, linePos - SIZE / 2)).draw(circle);
ug.apply(UStroke.withThickness(1)).apply(new CopyForegroundColorToBackgroundColor()) ug.apply(UStroke.withThickness(1)).apply(new CopyForegroundColorToBackgroundColor())

View File

@ -78,9 +78,9 @@ public class ETileZeroOrMore extends ETile {
final XDimension2D fullDim = calculateDimension(stringBounder); final XDimension2D fullDim = calculateDimension(stringBounder);
if (TRACE) { if (TRACE) {
if (specialForAlternate) if (specialForAlternate)
ug.apply(HColors.COL_B38D22).draw(new URectangle(fullDim)); ug.apply(HColors.COL_B38D22).draw(URectangle.build(fullDim));
else else
ug.apply(HColors.GREEN).draw(new URectangle(fullDim)); ug.apply(HColors.GREEN).draw(URectangle.build(fullDim));
} }
final double linePos = getH1(stringBounder); final double linePos = getH1(stringBounder);

View File

@ -53,7 +53,7 @@ public class TitleBox extends AbstractTextBlock {
public TitleBox(String value, FontConfiguration fc) { public TitleBox(String value, FontConfiguration fc) {
this.value = value; this.value = value;
this.fc = fc.add(FontStyle.BOLD); this.fc = fc.add(FontStyle.BOLD);
this.utext = new UText(value, this.fc); this.utext = UText.build(value, this.fc);
} }
@Override @Override

View File

@ -244,7 +244,7 @@ public class PSystemColors extends PlainDiagram implements UDrawable {
for (String name : colors.names()) { for (String name : colors.names()) {
UGraphic tmp = getPositioned(ug, i, j); UGraphic tmp = getPositioned(ug, i, j);
final HColor color = colors.getColorOrWhite(name); final HColor color = colors.getColorOrWhite(name);
applyColor(tmp, color).draw(new URectangle(rectangleWidth, rectangleHeight)); applyColor(tmp, color).draw(URectangle.build(rectangleWidth, rectangleHeight));
final TextBlock tt = getTextName(font, name, color); final TextBlock tt = getTextName(font, name, color);
final XDimension2D dimText = tt.calculateDimension(ug.getStringBounder()); final XDimension2D dimText = tt.calculateDimension(ug.getStringBounder());
final double dy = (rectangleHeight - dimText.getHeight()) / 2; final double dy = (rectangleHeight - dimText.getHeight()) / 2;

View File

@ -247,7 +247,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
private void drawSingleCluster(UGraphic ug, Entity group, ElkNode elkNode) { private void drawSingleCluster(UGraphic ug, Entity group, ElkNode elkNode) {
final XPoint2D corner = getPosition(elkNode); final XPoint2D corner = getPosition(elkNode);
final URectangle rect = new URectangle(elkNode.getWidth(), elkNode.getHeight()); final URectangle rect = URectangle.build(elkNode.getWidth(), elkNode.getHeight());
PackageStyle packageStyle = group.getPackageStyle(); PackageStyle packageStyle = group.getPackageStyle();
final ISkinParam skinParam = diagram.getSkinParam(); final ISkinParam skinParam = diagram.getSkinParam();

View File

@ -232,7 +232,7 @@ public class SvgNanoParser implements Sprite {
final double ry = Double.parseDouble(extractData("r", s)) * scaley; final double ry = Double.parseDouble(extractData("r", s)) * scaley;
final UTranslate translate = new UTranslate(deltax + cx - rx, deltay + cy - ry); final UTranslate translate = new UTranslate(deltax + cx - rx, deltay + cy - ry);
ugs.apply(translate).draw(new UEllipse(rx * 2, ry * 2)); ugs.apply(translate).draw(UEllipse.build(rx * 2, ry * 2));
} }
private void drawEllipse(UGraphicWithScale ugs, String s, HColor colorForMonochrome) { private void drawEllipse(UGraphicWithScale ugs, String s, HColor colorForMonochrome) {
@ -245,7 +245,7 @@ public class SvgNanoParser implements Sprite {
final double rx = Double.parseDouble(extractData("rx", s)); final double rx = Double.parseDouble(extractData("rx", s));
final double ry = Double.parseDouble(extractData("ry", s)); final double ry = Double.parseDouble(extractData("ry", s));
UPath path = new UPath(); UPath path = UPath.none();
path.moveTo(0, ry); path.moveTo(0, ry);
if (debug) if (debug)
@ -289,7 +289,7 @@ public class SvgNanoParser implements Sprite {
final String text = m.group(1); final String text = m.group(1);
HColor color = HColorSet.instance().getColorOrWhite(fill); HColor color = HColorSet.instance().getColorOrWhite(fill);
final FontConfiguration fc = FontConfiguration.create(UFont.sansSerif(fontSize), color, color, null); final FontConfiguration fc = FontConfiguration.create(UFont.sansSerif(fontSize), color, color, null);
final UText utext = new UText(text, fc); final UText utext = UText.build(text, fc);
UGraphic ug = ugs.getUg(); UGraphic ug = ugs.getUg();
ug = ug.apply(new UTranslate(x, y)); ug = ug.apply(new UTranslate(x, y));
ug.draw(utext); ug.draw(utext);

View File

@ -50,6 +50,7 @@ import ext.plantuml.com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import net.sourceforge.plantuml.utils.Log; import net.sourceforge.plantuml.utils.Log;
public class FlashCodeUtilsZxing implements FlashCodeUtils { public class FlashCodeUtilsZxing implements FlashCodeUtils {
// ::remove file when __MIT__
private static final Lock lock = new ReentrantLock(); private static final Lock lock = new ReentrantLock();

View File

@ -89,7 +89,7 @@ public class ActivityBox extends AbstractTextBlock {
final double widthTotal = dimTotal.getWidth(); final double widthTotal = dimTotal.getWidth();
final double heightTotal = dimTotal.getHeight(); final double heightTotal = dimTotal.getHeight();
final Shadowable rect = new URectangle(widthTotal, heightTotal).rounded(CORNER); final Shadowable rect = URectangle.build(widthTotal, heightTotal).rounded(CORNER);
ug = ug.apply(HColors.MY_RED); ug = ug.apply(HColors.MY_RED);
ug = ug.apply(HColors.MY_YELLOW.bg()); ug = ug.apply(HColors.MY_YELLOW.bg());
ug.apply(UStroke.withThickness(1.5)).draw(rect); ug.apply(UStroke.withThickness(1.5)).draw(rect);

View File

@ -161,7 +161,7 @@ public class FlowDiagram extends UmlDiagram implements TextBlock {
} }
ug = ug.apply(HColors.MY_RED); ug = ug.apply(HColors.MY_RED);
ug = ug.apply(HColors.MY_RED.bg()); ug = ug.apply(HColors.MY_RED.bg());
final UShape arrow = new UEllipse(7, 7); final UShape arrow = UEllipse.build(7, 7);
for (Path p : field.getPaths()) { for (Path p : field.getPaths()) {
final TileArea start = p.getStart(); final TileArea start = p.getStart();
final TileArea dest = p.getDest(); final TileArea dest = p.getDest();

View File

@ -87,7 +87,7 @@ public class GitCurve {
public void drawCurve(HColor color, UGraphic ug) { public void drawCurve(HColor color, UGraphic ug) {
ug = ug.apply(new UStroke(2, 2, 1)); ug = ug.apply(new UStroke(2, 2, 1));
final UPath path = new UPath(); final UPath path = UPath.none();
path.moveTo(xMirror.invGit(points.get(0))); path.moveTo(xMirror.invGit(points.get(0)));

View File

@ -95,7 +95,7 @@ public class MagicBox {
final double moveY = comment.calculateDimension(ug.getStringBounder()).getHeight(); final double moveY = comment.calculateDimension(ug.getStringBounder()).getHeight();
final URectangle rect = new URectangle(sizeInDot.getWidth(), sizeInDot.getHeight() - moveY).rounded(8); final URectangle rect = URectangle.build(sizeInDot.getWidth(), sizeInDot.getHeight() - moveY).rounded(8);
ug.apply(UStroke.withThickness(1.5)).apply(UTranslate.dy(moveY)).draw(rect); ug.apply(UStroke.withThickness(1.5)).apply(UTranslate.dy(moveY)).draw(rect);
comment.drawU(ug); comment.drawU(ug);

View File

@ -87,8 +87,8 @@ public class Tile extends AbstractTextBlock implements TextBlock {
final double diffx2 = dimTotal.getWidth() - radius; final double diffx2 = dimTotal.getWidth() - radius;
final double diffy2 = dimTotal.getHeight() - radius; final double diffy2 = dimTotal.getHeight() - radius;
n.drawU(ug.apply(new UTranslate((diffx / 2), (diffy / 2)))); n.drawU(ug.apply(new UTranslate((diffx / 2), (diffy / 2))));
ug.draw(new URectangle(SIZE, SIZE)); ug.draw(URectangle.build(SIZE, SIZE));
ug.apply(new UTranslate(diffx2 / 2, diffy2 / 2)).draw(new UEllipse(radius, radius)); ug.apply(new UTranslate(diffx2 / 2, diffy2 / 2)).draw(UEllipse.build(radius, radius));
} }
public XDimension2D calculateDimension(StringBounder stringBounder) { public XDimension2D calculateDimension(StringBounder stringBounder) {

View File

@ -103,6 +103,7 @@ import java.util.Map;
public class Jasic { public class Jasic {
// ::remove folder when __HAXE__ // ::remove folder when __HAXE__
// ::remove folder when __CORE__ // ::remove folder when __CORE__
// ::remove folder when __MIT__
// Tokenizing (lexing) ----------------------------------------------------- // Tokenizing (lexing) -----------------------------------------------------

View File

@ -54,6 +54,7 @@ import net.sourceforge.plantuml.security.SImageIO;
public class PSystemJcckit extends AbstractPSystem { public class PSystemJcckit extends AbstractPSystem {
// ::remove folder when __CORE__ // ::remove folder when __CORE__
// ::remove folder when __MIT__
private final PropertiesBasedConfigData prop; private final PropertiesBasedConfigData prop;
private final int width; private final int width;

View File

@ -61,7 +61,7 @@ public class Arrow {
final XPoint2D p4 = getPoint(p1, alpha - Math.PI / 2, dist * factor); final XPoint2D p4 = getPoint(p1, alpha - Math.PI / 2, dist * factor);
final XPoint2D p11 = getPoint(p1, alpha, dist * factor2); final XPoint2D p11 = getPoint(p1, alpha, dist * factor2);
final UPath path = new UPath(); final UPath path = UPath.none();
path.moveTo(p4); path.moveTo(p4);
path.lineTo(p11); path.lineTo(p11);
path.lineTo(p3); path.lineTo(p3);

View File

@ -90,7 +90,7 @@ public class JsonCurve {
} }
public void drawCurve(HColor color, UGraphic ug) { public void drawCurve(HColor color, UGraphic ug) {
final UPath path = new UPath(); final UPath path = UPath.none();
path.moveTo(getVeryFirst()); path.moveTo(getVeryFirst());
path.lineTo(xMirror.invAndXYSwitch(points.get(0))); path.lineTo(xMirror.invAndXYSwitch(points.get(0)));
@ -113,7 +113,7 @@ public class JsonCurve {
public void drawSpot(UGraphic ug) { public void drawSpot(UGraphic ug) {
final double size = 3; final double size = 3;
ug = ug.apply(UTranslate.point(getVeryFirst()).compose(new UTranslate(-size, -size))); ug = ug.apply(UTranslate.point(getVeryFirst()).compose(new UTranslate(-size, -size)));
ug.apply(UStroke.simple()).draw(new UEllipse(2 * size, 2 * size)); ug.apply(UStroke.simple()).draw(UEllipse.build(2 * size, 2 * size));
} }
private XPoint2D getVeryFirst() { private XPoint2D getVeryFirst() {

View File

@ -275,7 +275,7 @@ public class TextBlockJson extends AbstractTextBlock {
trueWidth = 30; trueWidth = 30;
final double round = styleNode.value(PName.RoundCorner).asDouble(); final double round = styleNode.value(PName.RoundCorner).asDouble();
final URectangle fullNodeRectangle = new URectangle(trueWidth, y).rounded(round); final URectangle fullNodeRectangle = URectangle.build(trueWidth, y).rounded(round);
final HColor backColor = styleNode.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet()); final HColor backColor = styleNode.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet());
ugNode.apply(backColor.bg()).apply(backColor).draw(fullNodeRectangle); ugNode.apply(backColor.bg()).apply(backColor).draw(fullNodeRectangle);
@ -288,7 +288,7 @@ public class TextBlockJson extends AbstractTextBlock {
final UGraphic ugline = ugSeparator.apply(UTranslate.dy(y)); final UGraphic ugline = ugSeparator.apply(UTranslate.dy(y));
final double heightOfRow = line.getHeightOfRow(stringBounder); final double heightOfRow = line.getHeightOfRow(stringBounder);
if (line.highlighted != null) { if (line.highlighted != null) {
final URectangle back = new URectangle(trueWidth - 2, heightOfRow).rounded(4); final URectangle back = URectangle.build(trueWidth - 2, heightOfRow).rounded(4);
final Style styleNodeHighlight = StyleSignatureBasic final Style styleNodeHighlight = StyleSignatureBasic
.of(SName.root, SName.element, diagramType, SName.node, SName.highlight) .of(SName.root, SName.element, diagramType, SName.node, SName.highlight)
.withTOBECHANGED(line.highlighted.getStereotype()).getMergedStyle(styleBuilder); .withTOBECHANGED(line.highlighted.getStereotype()).getMergedStyle(styleBuilder);

View File

@ -35,7 +35,5 @@
package net.sourceforge.plantuml.klimt; package net.sourceforge.plantuml.klimt;
public interface ClipContainer { public interface ClipContainer {
// ::remove file when __HAXE__
public UClip getClip(); public UClip getClip();
} }

View File

@ -45,23 +45,32 @@ import net.sourceforge.plantuml.regex.MyPattern;
import net.sourceforge.plantuml.regex.Pattern2; import net.sourceforge.plantuml.regex.Pattern2;
public class SvgAttributes { public class SvgAttributes {
// ::remove file when __HAXE__
private final Map<String, String> attributes = new TreeMap<String, String>(); private final Map<String, String> attributes = new TreeMap<String, String>();
public SvgAttributes() { private SvgAttributes cloneMe() {
final SvgAttributes result = new SvgAttributes();
result.attributes.putAll(this.attributes);
return result;
} }
private SvgAttributes(SvgAttributes other) { private SvgAttributes() {
this.attributes.putAll(other.attributes);
} }
public SvgAttributes(String args) { public static SvgAttributes empty() {
return new SvgAttributes();
}
public static SvgAttributes build(String args) {
final SvgAttributes result = new SvgAttributes();
// ::comment when __HAXE__
final Pattern2 p = MyPattern.cmpile("(\\w+)\\s*=\\s*([%g][^%g]*[%g]|(?:\\w+))"); final Pattern2 p = MyPattern.cmpile("(\\w+)\\s*=\\s*([%g][^%g]*[%g]|(?:\\w+))");
final Matcher2 m = p.matcher(args); final Matcher2 m = p.matcher(args);
while (m.find()) { while (m.find())
attributes.put(m.group(1), StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m.group(2))); result.attributes.put(m.group(1), StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(m.group(2)));
} // ::done
return result;
} }
public Map<String, String> attributes() { public Map<String, String> attributes() {
@ -69,13 +78,13 @@ public class SvgAttributes {
} }
public SvgAttributes add(String key, String value) { public SvgAttributes add(String key, String value) {
final SvgAttributes result = new SvgAttributes(this); final SvgAttributes result = cloneMe();
result.attributes.put(key, value); result.attributes.put(key, value);
return result; return result;
} }
public SvgAttributes add(SvgAttributes toBeAdded) { public SvgAttributes add(SvgAttributes toBeAdded) {
final SvgAttributes result = new SvgAttributes(this); final SvgAttributes result = cloneMe();
result.attributes.putAll(toBeAdded.attributes); result.attributes.putAll(toBeAdded.attributes);
return result; return result;
} }

View File

@ -40,8 +40,6 @@ import java.awt.geom.Rectangle2D;
import net.sourceforge.plantuml.klimt.geom.XPoint2D; import net.sourceforge.plantuml.klimt.geom.XPoint2D;
public class UClip implements UChange { public class UClip implements UChange {
// ::remove file when __HAXE__
private final double x; private final double x;
private final double y; private final double y;
private final double width; private final double width;
@ -113,27 +111,28 @@ public class UClip implements UChange {
return true; return true;
} }
// ::comment when __HAXE__
public Rectangle2D.Double getClippedRectangle(Rectangle2D.Double r) { public Rectangle2D.Double getClippedRectangle(Rectangle2D.Double r) {
return (Rectangle2D.Double) r.createIntersection(new Rectangle2D.Double(x, y, width, height)); return (Rectangle2D.Double) r.createIntersection(new Rectangle2D.Double(x, y, width, height));
} }
public Line2D.Double getClippedLine(Line2D.Double line) { public Line2D.Double getClippedLine(Line2D.Double line) {
if (isInside(line.x1, line.y1) && isInside(line.x2, line.y2)) { if (isInside(line.x1, line.y1) && isInside(line.x2, line.y2))
return line; return line;
}
if (isInside(line.x1, line.y1) == false && isInside(line.x2, line.y2) == false) { if (isInside(line.x1, line.y1) == false && isInside(line.x2, line.y2) == false) {
if (line.x1 == line.x2) { if (line.x1 == line.x2) {
final double newy1 = getClippedY(line.y1); final double newy1 = getClippedY(line.y1);
final double newy2 = getClippedY(line.y2); final double newy2 = getClippedY(line.y2);
if (newy1 != newy2) { if (newy1 != newy2)
return new Line2D.Double(line.x1, newy1, line.x2, newy2); return new Line2D.Double(line.x1, newy1, line.x2, newy2);
}
} }
return null; return null;
} }
if (line.x1 != line.x2 && line.y1 != line.y2) { if (line.x1 != line.x2 && line.y1 != line.y2)
return null; return null;
}
assert line.x1 == line.x2 || line.y1 == line.y2; assert line.x1 == line.x2 || line.y1 == line.y2;
if (line.y1 == line.y2) { if (line.y1 == line.y2) {
final double newx1 = getClippedX(line.x1); final double newx1 = getClippedX(line.x1);
@ -148,28 +147,29 @@ public class UClip implements UChange {
throw new IllegalStateException(); throw new IllegalStateException();
} }
public boolean isInside(double x, double y, UPath shape) {
return isInside(x + shape.getMinX(), y + shape.getMinY()) && isInside(x + shape.getMaxX(), y + shape.getMaxY());
}
// ::done
private double getClippedX(double xp) { private double getClippedX(double xp) {
if (xp < x) { if (xp < x)
return x; return x;
}
if (xp > x + width) { if (xp > x + width)
return x + width; return x + width;
}
return xp; return xp;
} }
private double getClippedY(double yp) { private double getClippedY(double yp) {
if (yp < y) { if (yp < y)
return y; return y;
}
if (yp > y + height) { if (yp > y + height)
return y + height; return y + height;
}
return yp; return yp;
} }
public boolean isInside(double x, double y, UPath shape) {
return isInside(x + shape.getMinX(), y + shape.getMinY()) && isInside(x + shape.getMaxX(), y + shape.getMaxY());
}
} }

View File

@ -50,7 +50,6 @@ import net.sourceforge.plantuml.klimt.geom.USegmentType;
import net.sourceforge.plantuml.klimt.geom.XPoint2D; import net.sourceforge.plantuml.klimt.geom.XPoint2D;
public class UPath extends AbstractShadowable implements Iterable<USegment>, UShapeIgnorableForCompression { public class UPath extends AbstractShadowable implements Iterable<USegment>, UShapeIgnorableForCompression {
// ::remove file when __HAXE__
private final String comment; private final String comment;
private final String codeLine; private final String codeLine;
@ -66,8 +65,8 @@ public class UPath extends AbstractShadowable implements Iterable<USegment>, USh
this.codeLine = codeLine; this.codeLine = codeLine;
} }
public UPath() { public static UPath none() {
this(null, null); return new UPath(null, null);
} }
public void add(double[] coord, USegmentType pathType) { public void add(double[] coord, USegmentType pathType) {
@ -100,6 +99,7 @@ public class UPath extends AbstractShadowable implements Iterable<USegment>, USh
return result; return result;
} }
// ::comment when __HAXE__
public UPath rotate(double theta) { public UPath rotate(double theta) {
final UPath result = new UPath(comment, codeLine); final UPath result = new UPath(comment, codeLine);
for (USegment seg : segments) for (USegment seg : segments)
@ -115,6 +115,7 @@ public class UPath extends AbstractShadowable implements Iterable<USegment>, USh
return result; return result;
} }
// ::done
public void moveTo(XPoint2D pt) { public void moveTo(XPoint2D pt) {
moveTo(pt.getX(), pt.getY()); moveTo(pt.getX(), pt.getY());
@ -180,10 +181,12 @@ public class UPath extends AbstractShadowable implements Iterable<USegment>, USh
return minmax.getMinY(); return minmax.getMinY();
} }
// ::comment when __HAXE__
@Override @Override
public String toString() { public String toString() {
return segments.toString(); return segments.toString();
} }
// ::done
public Iterator<USegment> iterator() { public Iterator<USegment> iterator() {
return segments.iterator(); return segments.iterator();

View File

@ -38,6 +38,7 @@ package net.sourceforge.plantuml.klimt.compress;
import java.util.List; import java.util.List;
public class CompressionTransform implements PiecewiseAffineTransform { public class CompressionTransform implements PiecewiseAffineTransform {
// ::remove file when __HAXE__
private final List<Slot> all; private final List<Slot> all;

View File

@ -39,6 +39,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.shape.TextBlock; import net.sourceforge.plantuml.klimt.shape.TextBlock;
public class CompressionXorYBuilder { public class CompressionXorYBuilder {
// ::remove file when __HAXE__
public static TextBlock build(CompressionMode mode, TextBlock textBlock, StringBounder stringBounder) { public static TextBlock build(CompressionMode mode, TextBlock textBlock, StringBounder stringBounder) {
final PiecewiseAffineTransform affine = getPiecewiseAffineTransform(mode, textBlock, stringBounder); final PiecewiseAffineTransform affine = getPiecewiseAffineTransform(mode, textBlock, stringBounder);

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.klimt.compress; package net.sourceforge.plantuml.klimt.compress;
public class Expand implements Comparable<Expand> { public class Expand implements Comparable<Expand> {
// ::remove file when __HAXE__
private final double position; private final double position;
private final double extend; private final double extend;

View File

@ -39,7 +39,7 @@ import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
public class ExpandTransform implements PiecewiseAffineTransform { public class ExpandTransform implements PiecewiseAffineTransform {
// ::remove folder when __HAXE__ // ::remove file when __HAXE__
private final Set<Expand> all = new TreeSet<>(); private final Set<Expand> all = new TreeSet<>();

View File

@ -36,6 +36,7 @@
package net.sourceforge.plantuml.klimt.compress; package net.sourceforge.plantuml.klimt.compress;
public class PiecewiseAffineComposition implements PiecewiseAffineTransform { public class PiecewiseAffineComposition implements PiecewiseAffineTransform {
// ::remove file when __HAXE__
private final PiecewiseAffineComposition first; private final PiecewiseAffineComposition first;
private final PiecewiseAffineComposition second; private final PiecewiseAffineComposition second;

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.klimt.shape.TextBlock;
import net.sourceforge.plantuml.klimt.shape.TextBlockUtils; import net.sourceforge.plantuml.klimt.shape.TextBlockUtils;
public class PiecewiseAffineOnXorYBuilder extends AbstractTextBlock { public class PiecewiseAffineOnXorYBuilder extends AbstractTextBlock {
// ::remove file when __HAXE__
private final TextBlock textBlock; private final TextBlock textBlock;
private final CompressionMode mode; private final CompressionMode mode;

View File

@ -36,14 +36,15 @@
package net.sourceforge.plantuml.klimt.compress; package net.sourceforge.plantuml.klimt.compress;
public class Slot implements Comparable<Slot> { public class Slot implements Comparable<Slot> {
// ::remove file when __HAXE__
private final double start; private final double start;
private final double end; private final double end;
public Slot(double start, double end) { public Slot(double start, double end) {
if (start >= end) { if (start >= end)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
this.start = start; this.start = start;
this.end = end; this.end = end;
} }
@ -78,22 +79,22 @@ public class Slot implements Comparable<Slot> {
} }
public Slot intersect(double otherStart, double otherEnd) { public Slot intersect(double otherStart, double otherEnd) {
if (otherStart >= end) { if (otherStart >= end)
return null; return null;
}
if (otherEnd <= start) { if (otherEnd <= start)
return null; return null;
}
return new Slot(Math.max(start, otherStart), Math.min(end, otherEnd)); return new Slot(Math.max(start, otherStart), Math.min(end, otherEnd));
} }
public int compareTo(Slot other) { public int compareTo(Slot other) {
if (this.start < other.start) { if (this.start < other.start)
return -1; return -1;
}
if (this.start > other.start) { if (this.start > other.start)
return 1; return 1;
}
return 0; return 0;
} }

View File

@ -56,6 +56,7 @@ import net.sourceforge.plantuml.klimt.shape.URectangle;
import net.sourceforge.plantuml.klimt.shape.UText; import net.sourceforge.plantuml.klimt.shape.UText;
public class SlotFinder extends UGraphicNo { public class SlotFinder extends UGraphicNo {
// ::remove file when __HAXE__
@Override @Override
public UGraphic apply(UChange change) { public UGraphic apply(UChange change) {

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.shape.URectangle; import net.sourceforge.plantuml.klimt.shape.URectangle;
public class SlotSet implements Iterable<Slot> { public class SlotSet implements Iterable<Slot> {
// ::remove file when __HAXE__
private final List<Slot> all = new ArrayList<>(); private final List<Slot> all = new ArrayList<>();
@ -52,9 +53,9 @@ public class SlotSet implements Iterable<Slot> {
final SlotSet result = new SlotSet(); final SlotSet result = new SlotSet();
for (Slot slot : all) { for (Slot slot : all) {
final Slot intersec = slot.intersect(start, end); final Slot intersec = slot.intersect(start, end);
if (intersec != null) { if (intersec != null)
result.all.add(intersec); result.all.add(intersec);
}
} }
return result; return result;
} }
@ -73,18 +74,18 @@ public class SlotSet implements Iterable<Slot> {
collisions.add(s); collisions.add(s);
} }
} }
for (Slot s : collisions) { for (Slot s : collisions)
newSlot = newSlot.merge(s); newSlot = newSlot.merge(s);
}
all.add(newSlot); all.add(newSlot);
} }
public SlotSet smaller(double margin) { public SlotSet smaller(double margin) {
final SlotSet result = new SlotSet(); final SlotSet result = new SlotSet();
for (Slot sl : all) { for (Slot sl : all) {
if (sl.size() <= 2 * margin) { if (sl.size() <= 2 * margin)
continue; continue;
}
result.addSlot(sl.getStart() + margin, sl.getEnd() - margin); result.addSlot(sl.getStart() + margin, sl.getEnd() - margin);
} }
return result; return result;
@ -108,9 +109,9 @@ public class SlotSet implements Iterable<Slot> {
Collections.sort(all); Collections.sort(all);
Slot last = null; Slot last = null;
for (Slot slot : all) { for (Slot slot : all) {
if (last != null) { if (last != null)
result.addSlot(last.getEnd(), slot.getStart()); result.addSlot(last.getEnd(), slot.getStart());
}
last = slot; last = slot;
} }
return result; return result;
@ -118,7 +119,7 @@ public class SlotSet implements Iterable<Slot> {
public void drawDebugX(UGraphic ug, double size) { public void drawDebugX(UGraphic ug, double size) {
for (Slot slot : all) { for (Slot slot : all) {
final URectangle rect = new URectangle(slot.getEnd() - slot.getStart(), size); final URectangle rect = URectangle.build(slot.getEnd() - slot.getStart(), size);
ug.apply(UTranslate.dx(slot.getStart())).draw(rect); ug.apply(UTranslate.dx(slot.getStart())).draw(rect);
} }
} }

View File

@ -49,6 +49,7 @@ import net.sourceforge.plantuml.klimt.shape.ULine;
import net.sourceforge.plantuml.klimt.shape.URectangle; import net.sourceforge.plantuml.klimt.shape.URectangle;
public class UGraphicCompressOnXorY extends UGraphicDelegator { public class UGraphicCompressOnXorY extends UGraphicDelegator {
// ::remove file when __HAXE__
public UGraphic apply(UChange change) { public UGraphic apply(UChange change) {
if (change instanceof UTranslate) if (change instanceof UTranslate)

View File

@ -97,7 +97,7 @@ public class Position {
public void drawDebug(UGraphic ug) { public void drawDebug(UGraphic ug) {
ug = ug.apply(HColors.BLACK).apply(HColors.none().bg()); ug = ug.apply(HColors.BLACK).apply(HColors.none().bg());
ug = ug.apply(new UTranslate(x, y)); ug = ug.apply(new UTranslate(x, y));
ug.draw(new URectangle(dim)); ug.draw(URectangle.build(dim));
} }
public double getHeight() { public double getHeight() {

View File

@ -107,7 +107,7 @@ public class AtomTable extends AbstractAtom implements Atom {
final double x1 = getStartingX(0); final double x1 = getStartingX(0);
final double x2 = getStartingX(getNbCols()); final double x2 = getStartingX(getNbCols());
ug.apply(HColors.none()).apply(line.lineBackColor.bg()).apply(new UTranslate(x1, y1)) ug.apply(HColors.none()).apply(line.lineBackColor.bg()).apply(new UTranslate(x1, y1))
.draw(new URectangle(x2 - x1, y2 - y1)); .draw(URectangle.build(x2 - x1, y2 - y1));
} }
for (int j = 0; j < getNbCols(); j++) { for (int j = 0; j < getNbCols(); j++) {
if (j >= line.cells.size()) { if (j >= line.cells.size()) {
@ -126,7 +126,7 @@ public class AtomTable extends AbstractAtom implements Atom {
final double y1 = getStartingY(i); final double y1 = getStartingY(i);
final double y2 = getStartingY(i + 1); final double y2 = getStartingY(i + 1);
ug.apply(HColors.none()).apply(cellBackColor.bg()).apply(new UTranslate(x1, y1)) ug.apply(HColors.none()).apply(cellBackColor.bg()).apply(new UTranslate(x1, y1))
.draw(new URectangle(x2 - x1, y2 - y1)); .draw(URectangle.build(x2 - x1, y2 - y1));
} }
final Position pos = positions.get(cell); final Position pos = positions.get(cell);
final XDimension2D dimCell = cell.calculateDimension(ug.getStringBounder()); final XDimension2D dimCell = cell.calculateDimension(ug.getStringBounder());

View File

@ -60,10 +60,10 @@ public class Bullet extends AbstractAtom implements Atom {
ug = ug.apply(color).apply(color.bg()).apply(UStroke.withThickness(0)); ug = ug.apply(color).apply(color.bg()).apply(UStroke.withThickness(0));
if (order == 0) { if (order == 0) {
ug = ug.apply(UTranslate.dx(3)); ug = ug.apply(UTranslate.dx(3));
ug.draw(new UEllipse(5, 5)); ug.draw(UEllipse.build(5, 5));
} else { } else {
ug = ug.apply(UTranslate.dx(1 + 8 * order)); ug = ug.apply(UTranslate.dx(1 + 8 * order));
ug.draw(new URectangle(3.5, 3.5)); ug.draw(URectangle.build(3.5, 3.5));
} }
} }

View File

@ -85,7 +85,7 @@ public class CommandCreoleSvgAttributeChange implements Command {
final FontConfiguration fc1 = stripe.getActualFontConfiguration(); final FontConfiguration fc1 = stripe.getActualFontConfiguration();
FontConfiguration fc2 = fc1; FontConfiguration fc2 = fc1;
if (m.group(2) != null) { if (m.group(2) != null) {
fc2 = fc2.changeAttributes(new SvgAttributes(m.group(2))); fc2 = fc2.changeAttributes(SvgAttributes.build(m.group(2)));
} }
stripe.setActualFontConfiguration(fc2); stripe.setActualFontConfiguration(fc2);

View File

@ -51,7 +51,7 @@ class SvgAttributesChange implements FontChange {
if (m.find() == false) { if (m.find() == false) {
throw new IllegalStateException(); throw new IllegalStateException();
} }
attributes = new SvgAttributes(m.group(1)); attributes = SvgAttributes.build(m.group(1));
} }
public FontConfiguration apply(FontConfiguration initial) { public FontConfiguration apply(FontConfiguration initial) {

View File

@ -146,7 +146,7 @@ public final class AtomText extends AbstractAtom implements Atom {
} else { } else {
final XDimension2D dim = ug.getStringBounder().calculateDimension(fontConfiguration.getFont(), final XDimension2D dim = ug.getStringBounder().calculateDimension(fontConfiguration.getFont(),
s); s);
final UText utext = new UText(s, useFontConfiguration); final UText utext = UText.build(s, useFontConfiguration);
ug.apply(new UTranslate(x, ypos)).draw(utext); ug.apply(new UTranslate(x, ypos)).draw(utext);
x += dim.getWidth(); x += dim.getWidth();
} }

View File

@ -102,7 +102,7 @@ public class StripeCode implements StripeRaw {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
double y = 0; double y = 0;
for (String s : raw) { for (String s : raw) {
final UText shape = new UText(s, fontConfiguration); final UText shape = UText.build(s, fontConfiguration);
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final XDimension2D dim = stringBounder.calculateDimension(fontConfiguration.getFont(), s); final XDimension2D dim = stringBounder.calculateDimension(fontConfiguration.getFont(), s);
y += dim.getHeight(); y += dim.getHeight();

View File

@ -55,7 +55,6 @@ import net.sourceforge.plantuml.klimt.shape.UHidden;
import net.sourceforge.plantuml.url.Url; import net.sourceforge.plantuml.url.Url;
public abstract class AbstractCommonUGraphic implements UGraphic { public abstract class AbstractCommonUGraphic implements UGraphic {
// ::remove file when __HAXE__
private UStroke stroke = UStroke.simple(); private UStroke stroke = UStroke.simple();
private UPattern pattern = UPattern.FULL; private UPattern pattern = UPattern.FULL;
@ -64,13 +63,37 @@ public abstract class AbstractCommonUGraphic implements UGraphic {
private HColor color = HColors.none(); private HColor color = HColors.none();
private boolean enlargeClip = false; private boolean enlargeClip = false;
private final StringBounder stringBounder; private /*final*/ StringBounder stringBounder;
private UTranslate translate = UTranslate.none(); private UTranslate translate = UTranslate.none();
private final ColorMapper colorMapper; private /*final*/ ColorMapper colorMapper;
private UClip clip; private UClip clip;
private final HColor defaultBackground; private /*final*/ HColor defaultBackground;
public void basicCopy(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) {
this.colorMapper = colorMapper;
this.defaultBackground = Objects.requireNonNull(defaultBackground);
this.stringBounder = stringBounder;
}
protected void basicCopy(AbstractCommonUGraphic other) {
this.defaultBackground = Objects.requireNonNull(other.defaultBackground);
this.enlargeClip = other.enlargeClip;
this.colorMapper = other.colorMapper;
this.stringBounder = other.stringBounder;
this.translate = other.translate;
this.clip = other.clip;
this.stroke = other.stroke;
this.pattern = other.pattern;
this.hidden = other.hidden;
this.color = other.color;
this.backColor = other.backColor;
}
protected abstract AbstractCommonUGraphic copyUGraphic();
@Override @Override
public HColor getDefaultBackground() { public HColor getDefaultBackground() {
@ -116,34 +139,6 @@ public abstract class AbstractCommonUGraphic implements UGraphic {
this.enlargeClip = true; this.enlargeClip = true;
} }
public AbstractCommonUGraphic(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) {
if (defaultBackground == null)
throw new IllegalArgumentException();
this.colorMapper = colorMapper;
this.defaultBackground = defaultBackground;
this.stringBounder = stringBounder;
}
protected AbstractCommonUGraphic(AbstractCommonUGraphic other) {
this.defaultBackground = other.defaultBackground;
if (defaultBackground == null)
throw new IllegalArgumentException();
this.enlargeClip = other.enlargeClip;
this.colorMapper = other.colorMapper;
this.stringBounder = other.stringBounder;
this.translate = other.translate;
this.clip = other.clip;
this.stroke = other.stroke;
this.pattern = other.pattern;
this.hidden = other.hidden;
this.color = other.color;
this.backColor = other.backColor;
}
protected abstract AbstractCommonUGraphic copyUGraphic();
final public UParam getParam() { final public UParam getParam() {
return new UParam() { return new UParam() {

View File

@ -69,8 +69,8 @@ import net.sourceforge.plantuml.klimt.shape.UText;
public abstract class AbstractUGraphic<O> extends AbstractCommonUGraphic { public abstract class AbstractUGraphic<O> extends AbstractCommonUGraphic {
// ::remove file when __HAXE__ // ::remove file when __HAXE__
private final O graphic; private /*final*/ O graphic;
private final MinMaxMutable minmax; private /*final*/ MinMaxMutable minmax;
// It would be nice to do something like this but not sure how: // It would be nice to do something like this but not sure how:
// Map<Class<SHAPE>, UDriver<SHAPE, O>> // Map<Class<SHAPE>, UDriver<SHAPE, O>>
@ -78,19 +78,20 @@ public abstract class AbstractUGraphic<O> extends AbstractCommonUGraphic {
// https://stackoverflow.com/questions/416540/java-map-with-values-limited-by-keys-type-parameter // https://stackoverflow.com/questions/416540/java-map-with-values-limited-by-keys-type-parameter
private final Map<Class<? extends UShape>, UDriver<?, O>> drivers = new HashMap<>(); private final Map<Class<? extends UShape>, UDriver<?, O>> drivers = new HashMap<>();
public AbstractUGraphic(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, O graphic) { public void copy(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, O graphic) {
super(Objects.requireNonNull(defaultBackground), colorMapper, stringBounder); basicCopy(defaultBackground, colorMapper, stringBounder);
// super(Objects.requireNonNull(defaultBackground), colorMapper, stringBounder);
this.graphic = graphic; this.graphic = graphic;
this.minmax = MinMaxMutable.getEmpty(true); this.minmax = MinMaxMutable.getEmpty(true);
} }
protected AbstractUGraphic(AbstractUGraphic<O> other) { protected void copy(AbstractUGraphic<O> other) {
super(other); basicCopy(other);
this.graphic = other.graphic; this.graphic = other.graphic;
this.minmax = other.minmax; this.minmax = other.minmax;
// this.drivers.putAll(other.drivers);
} }
protected final O getGraphicObject() { protected final O getGraphicObject() {
return graphic; return graphic;
} }

View File

@ -74,5 +74,7 @@ public interface UGraphic {
public HColor getDefaultBackground(); public HColor getDefaultBackground();
// ::comment when __HAXE__
public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException; public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException;
// ::done
} }

View File

@ -48,15 +48,16 @@ public class UGraphicNull extends AbstractUGraphic<String> implements EnsureVisi
@Override @Override
protected AbstractCommonUGraphic copyUGraphic() { protected AbstractCommonUGraphic copyUGraphic() {
return new UGraphicNull(this); final UGraphicNull result = new UGraphicNull(this);
return result;
} }
private UGraphicNull(UGraphicNull other) { private UGraphicNull(UGraphicNull other) {
super(other); copy(other);
} }
public UGraphicNull() { public UGraphicNull() {
super(HColors.BLACK, ColorMapper.IDENTITY, FileFormat.PNG.getDefaultStringBounder(), "foo"); copy(HColors.BLACK, ColorMapper.IDENTITY, FileFormat.PNG.getDefaultStringBounder(), "foo");
} }
@Override @Override

View File

@ -80,13 +80,14 @@ public class UGraphicDebug extends AbstractCommonUGraphic implements ClipContain
@Override @Override
protected AbstractCommonUGraphic copyUGraphic() { protected AbstractCommonUGraphic copyUGraphic() {
return new UGraphicDebug(this, output, scaleFactor, dim, svgLinkTarget, hoverPathColorRGB, seed, final UGraphicDebug result = new UGraphicDebug(this, output, scaleFactor, dim, svgLinkTarget, hoverPathColorRGB, seed,
preserveAspectRatio); preserveAspectRatio);
return result;
} }
private UGraphicDebug(UGraphicDebug other, List<String> output, double scaleFactor, XDimension2D dim, private UGraphicDebug(UGraphicDebug other, List<String> output, double scaleFactor, XDimension2D dim,
String svgLinkTarget, String hoverPathColorRGB, long seed, String preserveAspectRatio) { String svgLinkTarget, String hoverPathColorRGB, long seed, String preserveAspectRatio) {
super(other); basicCopy(other);
this.output = output; this.output = output;
this.scaleFactor = scaleFactor; this.scaleFactor = scaleFactor;
this.dim = dim; this.dim = dim;
@ -98,7 +99,7 @@ public class UGraphicDebug extends AbstractCommonUGraphic implements ClipContain
public UGraphicDebug(double scaleFactor, XDimension2D dim, String svgLinkTarget, String hoverPathColorRGB, public UGraphicDebug(double scaleFactor, XDimension2D dim, String svgLinkTarget, String hoverPathColorRGB,
long seed, String preserveAspectRatio) { long seed, String preserveAspectRatio) {
super(HColors.WHITE, ColorMapper.IDENTITY, new StringBounderDebug()); basicCopy(HColors.WHITE, ColorMapper.IDENTITY, new StringBounderDebug());
this.output = new ArrayList<>(); this.output = new ArrayList<>();
this.scaleFactor = scaleFactor; this.scaleFactor = scaleFactor;
this.dim = dim; this.dim = dim;

View File

@ -62,18 +62,19 @@ public class UGraphicEps extends AbstractUGraphic<EpsGraphics> implements ClipCo
@Override @Override
protected AbstractCommonUGraphic copyUGraphic() { protected AbstractCommonUGraphic copyUGraphic() {
return new UGraphicEps(this); final UGraphicEps result = new UGraphicEps(this);
return result;
} }
protected UGraphicEps(UGraphicEps other) { protected UGraphicEps(UGraphicEps other) {
super(other); copy(other);
this.strategyTOBEREMOVED = other.strategyTOBEREMOVED; this.strategyTOBEREMOVED = other.strategyTOBEREMOVED;
register(); register();
} }
public UGraphicEps(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, public UGraphicEps(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder,
EpsStrategy strategy) { EpsStrategy strategy) {
super(defaultBackground, colorMapper, stringBounder, strategy.creatEpsGraphics()); copy(defaultBackground, colorMapper, stringBounder, strategy.creatEpsGraphics());
this.strategyTOBEREMOVED = strategy; this.strategyTOBEREMOVED = strategy;
register(); register();
} }

View File

@ -107,11 +107,12 @@ public class UGraphicG2d extends AbstractUGraphic<Graphics2D> implements EnsureV
@Override @Override
protected AbstractCommonUGraphic copyUGraphic() { protected AbstractCommonUGraphic copyUGraphic() {
return new UGraphicG2d(this); final UGraphicG2d result = new UGraphicG2d(this);
return result;
} }
private UGraphicG2d(UGraphicG2d other) { private UGraphicG2d(UGraphicG2d other) {
super(other); copy(other);
// ::comment when __CORE__ // ::comment when __CORE__
this.hasAffineTransform = other.hasAffineTransform; this.hasAffineTransform = other.hasAffineTransform;
// ::done // ::done
@ -126,25 +127,21 @@ public class UGraphicG2d extends AbstractUGraphic<Graphics2D> implements EnsureV
public UGraphicG2d(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, Graphics2D g2d, public UGraphicG2d(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, Graphics2D g2d,
double dpiFactor, FileFormat format) { double dpiFactor, FileFormat format) {
// ::comment when __CORE__ // ::revert when __CORE__
this(defaultBackground, colorMapper, stringBounder, g2d, dpiFactor, null, 0, 0, format); this(defaultBackground, colorMapper, stringBounder, g2d, dpiFactor, 0, 0, format, null);
// ::done
// ::uncomment when __CORE__
// this(defaultBackground, colorMapper, stringBounder, g2d, dpiFactor, 0, 0, // this(defaultBackground, colorMapper, stringBounder, g2d, dpiFactor, 0, 0,
// format); // format);
// ::done // ::done
} }
// ::comment when __CORE__ // ::revert when __CORE__
public UGraphicG2d(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, Graphics2D g2d, public UGraphicG2d(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder, Graphics2D g2d,
double dpiFactor, AffineTransformation affineTransform, double dx, double dy, FileFormat format) { double dpiFactor, double dx, double dy, FileFormat format, AffineTransformation affineTransform) {
// ::done
// ::uncomment when __CORE__
// public UGraphicG2d(HColor defaultBackground, ColorMapper colorMapper, // public UGraphicG2d(HColor defaultBackground, ColorMapper colorMapper,
// StringBounder stringBounder, Graphics2D g2d, // StringBounder stringBounder, Graphics2D g2d,
// double dpiFactor, double dx, double dy, FileFormat format) { // double dpiFactor, double dx, double dy, FileFormat format) {
// ::done // ::done
super(defaultBackground, colorMapper, stringBounder, g2d); copy(defaultBackground, colorMapper, stringBounder, g2d);
this.format = format; this.format = format;
this.dpiFactor = dpiFactor; this.dpiFactor = dpiFactor;
if (dpiFactor != 1.0) if (dpiFactor != 1.0)

View File

@ -121,8 +121,8 @@ public class HandJiggle {
final double flatness = curve.getFlatness(); final double flatness = curve.getFlatness();
final double dist = curve.getP1().distance(curve.getP2()); final double dist = curve.getP1().distance(curve.getP2());
if (flatness > 0.1 && dist > 20) { if (flatness > 0.1 && dist > 20) {
final XCubicCurve2D left = new XCubicCurve2D(); final XCubicCurve2D left = XCubicCurve2D.none();
final XCubicCurve2D right = new XCubicCurve2D(); final XCubicCurve2D right = XCubicCurve2D.none();
curve.subdivide(left, right); curve.subdivide(left, right);
curveTo(left); curveTo(left);
curveTo(right); curveTo(right);
@ -143,7 +143,7 @@ public class HandJiggle {
UPath path = null; UPath path = null;
for (XPoint2D p : points) { for (XPoint2D p : points) {
if (path == null) { if (path == null) {
path = new UPath(); path = UPath.none();
path.moveTo(p); path.moveTo(p);
} else { } else {
path.lineTo(p); path.lineTo(p);

View File

@ -49,7 +49,7 @@ public class UPathHand {
public UPathHand(UPath source, Random rnd) { public UPathHand(UPath source, Random rnd) {
final UPath result = new UPath(); final UPath result = UPath.none();
XPoint2D last = new XPoint2D(0, 0); XPoint2D last = new XPoint2D(0, 0);

View File

@ -56,7 +56,7 @@ public class UGraphicHtml5 extends AbstractUGraphic<Html5Drawer> implements Clip
} }
public UGraphicHtml5(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) { public UGraphicHtml5(HColor defaultBackground, ColorMapper colorMapper, StringBounder stringBounder) {
super(defaultBackground, colorMapper, stringBounder, new Html5Drawer()); copy(defaultBackground, colorMapper, stringBounder, new Html5Drawer());
registerDriver(URectangle.class, new DriverRectangleHtml5(this)); registerDriver(URectangle.class, new DriverRectangleHtml5(this));
// registerDriver(UText.class, new DriverTextEps(imDummy, this, strategy)); // registerDriver(UText.class, new DriverTextEps(imDummy, this, strategy));
ignoreShape(UText.class); ignoreShape(UText.class);

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