1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-15 01:44:05 +00:00
This commit is contained in:
Arnaud Roques 2023-03-04 10:34:43 +01:00
parent 690fa349ba
commit 5cdd5c76e5
146 changed files with 325 additions and 249 deletions

View File

@ -1014,22 +1014,22 @@ try {
points.get__(7).y = tp.y; points.get__(7).y = tp.y;
} }
else { /* up */ else { /* up */
UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp; points.get__(0).___(tp);
UNSUPPORTED("43w0zont6q3y1axlcy96rzm5x"); // points[1].x = uminx; points.get__(1).x = uminx;
UNSUPPORTED("285u4l65puy5nr3pgq6acl4i2"); // points[1].y = tp.y; points.get__(1).y = tp.y;
UNSUPPORTED("uctdrwzmec4w6vmirs9on197"); // points[2].x = uminx; points.get__(2).x = uminx;
UNSUPPORTED("d9b8e2upja8koam9memys7nj1"); // points[2].y = maxy; points.get__(2).y = maxy;
UNSUPPORTED("e8a8ucdpq7sgmbi3qyldleb1s"); // points[3].x = umaxx; points.get__(3).x = umaxx;
UNSUPPORTED("d7xd9vzbdbezltrxsp9a3byuc"); // points[3].y = maxy; points.get__(3).y = maxy;
UNSUPPORTED("59abeyxxk9ow1g6m45t4ahih7"); // points[4].x = umaxx; points.get__(4).x = umaxx;
UNSUPPORTED("2lzgl5468xguophz9d5wyer2x"); // points[4].y = hp.y; points.get__(4).y = hp.y;
UNSUPPORTED("41u0uroraw4xanvpgg6l74kyh"); // points[5].x = hp.x; points.get__(5).x = hp.x;
UNSUPPORTED("cwkk5bnko3e1udrx4cb720zss"); // points[5].y = hp.y; points.get__(5).y = hp.y;
UNSUPPORTED("eev7hf3617k74bnq18uiedyb0"); // points[6].x = hp.x; points.get__(6).x = hp.x;
UNSUPPORTED("aqxt1dvgfq5zcptjwgx1b3mmq"); // points[6].y = maxy + 6; points.get__(6).y = maxy + 6;
UNSUPPORTED("5s3o04yf5lzca6ruuygfxngj2"); // points[7].x = tp.x; points.get__(7).x = tp.x;
UNSUPPORTED("56zheeat0b8mo4uvlcbvgbu80"); // points[7].y = maxy + 6; points.get__(7).y = maxy + 6;
UNSUPPORTED("7un2qk34mmmhqi296vl50bacs"); // maxy += + 6; maxy += + 6;
} }
poly.pn = 8; poly.pn = 8;
poly.ps = points; poly.ps = points;

View File

@ -207,7 +207,8 @@ try {
rv.nrows = i; rv.nrows = i;
rv.ncols = j; rv.ncols = j;
// Arnaud 15/09/2022: the j+1 is needed in some case to avoid ArrayIndexOutOfBoundsException // Arnaud 15/09/2022: the j+1 is needed in some case to avoid ArrayIndexOutOfBoundsException
rv.data = new int[i][j+1]; // Or maybe new int[j][i] ? // Arnaud 02/03/2023: the j+3 is needed in some case to avoid ArrayIndexOutOfBoundsException
rv.data = new int[i][j+3]; // Or maybe new int[j][i] ?
return rv; return rv;
} finally { } finally {
LEAVING("756bre1tpxb1tq68p7xhkrxkc","new_matrix"); LEAVING("756bre1tpxb1tq68p7xhkrxkc","new_matrix");

View File

@ -53,6 +53,48 @@ import net.sourceforge.plantuml.utils.Log;
// Do not move // Do not move
public class StringUtils { public class StringUtils {
public static String goUpperCase(String s) {
// ::comment when __HAXE__
return s.toUpperCase(Locale.ENGLISH);
// ::done
// ::uncomment when __HAXE__
// return s.toUpperCase();
// ::done
}
public static String eventuallyRemoveStartingAndEndingDoubleQuote(String s, String format) {
if (s == null)
return null;
if (format.contains("\"") && s.length() > 1 && isDoubleQuote(s.charAt(0))
&& isDoubleQuote(s.charAt(s.length() - 1)))
return s.substring(1, s.length() - 1);
if (format.contains("(") && s.startsWith("(") && s.endsWith(")"))
return s.substring(1, s.length() - 1);
if (format.contains("[") && s.startsWith("[") && s.endsWith("]"))
return s.substring(1, s.length() - 1);
if (format.contains(":") && s.startsWith(":") && s.endsWith(":"))
return s.substring(1, s.length() - 1);
return s;
}
public static String eventuallyRemoveStartingAndEndingDoubleQuote(String s) {
if (s == null)
return s;
return eventuallyRemoveStartingAndEndingDoubleQuote(s, "\"([:");
}
private static boolean isDoubleQuote(char c) {
return c == '\"' || c == '\u201c' || c == '\u201d' || c == '\u00ab' || c == '\u00bb';
}
// ::comment when __HAXE__
public static final char USER_NEWLINE = '\uEE00'; public static final char USER_NEWLINE = '\uEE00';
public static final char USER_TAB = '\uEE01'; public static final char USER_TAB = '\uEE01';
@ -108,7 +150,6 @@ public class StringUtils {
} }
// ::comment when __HAXE__
final static public List<String> getSplit(Pattern2 pattern, String line) { final static public List<String> getSplit(Pattern2 pattern, String line) {
final Matcher2 m = pattern.matcher(line); final Matcher2 m = pattern.matcher(line);
if (m.find() == false) if (m.find() == false)
@ -120,7 +161,6 @@ public class StringUtils {
return result; return result;
} }
// ::done
public static boolean isNotEmpty(CharSequence s) { public static boolean isNotEmpty(CharSequence s) {
return !isEmpty(s); return !isEmpty(s);
@ -175,7 +215,6 @@ public class StringUtils {
return result.toString(); return result.toString();
} }
// ::comment when __HAXE__
public static String unicodeForHtml(Display display) { public static String unicodeForHtml(Display display) {
final StringBuilder result = new StringBuilder(); final StringBuilder result = new StringBuilder();
for (int i = 0; i < display.size(); i++) { for (int i = 0; i < display.size(); i++) {
@ -186,7 +225,6 @@ public class StringUtils {
} }
return result.toString(); return result.toString();
} }
// ::done
public static String manageArrowForSequence(String s) { public static String manageArrowForSequence(String s) {
s = s.replace('=', '-').toLowerCase(); s = s.replace('=', '-').toLowerCase();
@ -197,10 +235,6 @@ public class StringUtils {
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase(); return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
} }
public static String goUpperCase(String s) {
return s.toUpperCase(Locale.ENGLISH);
}
public static char goUpperCase(char c) { public static char goUpperCase(char c) {
return goUpperCase("" + c).charAt(0); return goUpperCase("" + c).charAt(0);
} }
@ -291,44 +325,11 @@ public class StringUtils {
// return Code.of(eventuallyRemoveStartingAndEndingDoubleQuote(s.getCode())); // return Code.of(eventuallyRemoveStartingAndEndingDoubleQuote(s.getCode()));
// } // }
public static String eventuallyRemoveStartingAndEndingDoubleQuote(String s, String format) {
if (s == null)
return null;
if (format.contains("\"") && s.length() > 1 && isDoubleQuote(s.charAt(0))
&& isDoubleQuote(s.charAt(s.length() - 1)))
return s.substring(1, s.length() - 1);
if (format.contains("(") && s.startsWith("(") && s.endsWith(")"))
return s.substring(1, s.length() - 1);
if (format.contains("[") && s.startsWith("[") && s.endsWith("]"))
return s.substring(1, s.length() - 1);
if (format.contains(":") && s.startsWith(":") && s.endsWith(":"))
return s.substring(1, s.length() - 1);
return s;
}
public static String eventuallyRemoveStartingAndEndingDoubleQuote(String s) {
if (s == null)
return s;
return eventuallyRemoveStartingAndEndingDoubleQuote(s, "\"([:");
}
private static boolean isDoubleQuote(char c) {
return c == '\"' || c == '\u201c' || c == '\u201d' || c == '\u00ab' || c == '\u00bb';
}
// ::comment when __HAXE__
public static boolean isCJK(char c) { public static boolean isCJK(char c) {
final Character.UnicodeBlock block = Character.UnicodeBlock.of(c); final Character.UnicodeBlock block = Character.UnicodeBlock.of(c);
Log.println("block=" + block); Log.println("block=" + block);
return false; return false;
} }
// ::done
public static char hiddenLesserThan() { public static char hiddenLesserThan() {
return '\u0005'; return '\u0005';
@ -359,31 +360,13 @@ public class StringUtils {
// return result; // return result;
// } // }
// ::comment when __CORE__ or __HAXE__
public static int getWcWidth(Display stringsToDisplay) {
int result = 1;
for (CharSequence s : stringsToDisplay) {
if (s == null)
continue;
final int length = Wcwidth.length(s);
if (result < length)
result = length;
}
return result;
}
// ::done
public static int getHeight(List<? extends CharSequence> stringsToDisplay) { public static int getHeight(List<? extends CharSequence> stringsToDisplay) {
return stringsToDisplay.size(); return stringsToDisplay.size();
} }
// ::comment when __HAXE__
public static int getHeight(Display stringsToDisplay) { public static int getHeight(Display stringsToDisplay) {
return stringsToDisplay.size(); return stringsToDisplay.size();
} }
// ::done
public static boolean isDiagramCacheable(String uml) { public static boolean isDiagramCacheable(String uml) {
if (uml.length() < 35) if (uml.length() < 35)
@ -437,7 +420,6 @@ public class StringUtils {
return Integer.parseInt(uml.substring(x1, x2)); return Integer.parseInt(uml.substring(x1, x2));
} }
// ::comment when __HAXE__
public static List<String> splitComma(String s) { public static List<String> splitComma(String s) {
s = trin(s); s = trin(s);
final List<String> result = new ArrayList<>(); final List<String> result = new ArrayList<>();
@ -448,7 +430,6 @@ public class StringUtils {
return Collections.unmodifiableList(result); return Collections.unmodifiableList(result);
} }
// ::done
public static String getUid(String uid1, int uid2) { public static String getUid(String uid1, int uid2) {
return uid1 + String.format("%04d", uid2); return uid1 + String.format("%04d", uid2);
@ -573,6 +554,23 @@ public class StringUtils {
s = s.substring(s.length() - 6); s = s.substring(s.length() - 6);
return "#" + s; return "#" + s;
} }
// ::done
// ::comment when __CORE__ or __HAXE__
public static int getWcWidth(Display stringsToDisplay) {
int result = 1;
for (CharSequence s : stringsToDisplay) {
if (s == null)
continue;
final int length = Wcwidth.length(s);
if (result < length)
result = length;
}
return result;
}
// ::done
// http://docs.oracle.com/javase/tutorial/i18n/format/dateFormat.html // http://docs.oracle.com/javase/tutorial/i18n/format/dateFormat.html
} }

View File

@ -66,7 +66,7 @@ public class CollisionDetector extends UGraphicNo {
private final Context context; private final Context context;
private static CollisionDetector create(StringBounder stringBounder) { private static CollisionDetector create(StringBounder stringBounder) {
return new CollisionDetector(stringBounder, new UTranslate(), new Context()); return new CollisionDetector(stringBounder, UTranslate.none(), new Context());
} }
private CollisionDetector(StringBounder stringBounder, UTranslate translate, Context context) { private CollisionDetector(StringBounder stringBounder, UTranslate translate, Context context) {

View File

@ -97,6 +97,7 @@ public class FtileGeometry extends XDimension2D {
} }
public FtileGeometry(double width, double height, double left, double inY, double outY) { public FtileGeometry(double width, double height, double left, double inY, double outY) {
super(width, height);
this.left = left; this.left = left;
this.inY = inY; this.inY = inY;
this.outY = outY; this.outY = outY;

View File

@ -98,7 +98,7 @@ public class FtileMargedRight extends AbstractFtile {
@Override @Override
public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) { public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
if (child == tile) if (child == tile)
return new UTranslate(); return UTranslate.none();
return super.getTranslateFor(child, stringBounder); return super.getTranslateFor(child, stringBounder);
} }

View File

@ -76,7 +76,7 @@ public class Genealogy {
public UTranslate getTranslate(Ftile child, StringBounder stringBounder) { public UTranslate getTranslate(Ftile child, StringBounder stringBounder) {
Ftile current = child; Ftile current = child;
UTranslate result = new UTranslate(); UTranslate result = UTranslate.none();
while (current != root) { while (current != root) {
final Ftile father = getMyFather(current); final Ftile father = getMyFather(current);
final UTranslate tr = father.getTranslateFor(current, stringBounder); final UTranslate tr = father.getTranslateFor(current, stringBounder);

View File

@ -239,7 +239,7 @@ public class Snake implements UShape {
for (Text text : texts) for (Text text : texts)
if (text.hasText(ug.getStringBounder())) { if (text.hasText(ug.getStringBounder())) {
final XPoint2D position = getTextBlockPosition(ug.getStringBounder(), text); final XPoint2D position = getTextBlockPosition(ug.getStringBounder(), text);
text.textBlock.drawU(ug.apply(new UTranslate(position))); text.textBlock.drawU(ug.apply(UTranslate.point(position)));
} }
} }
@ -290,7 +290,7 @@ public class Snake implements UShape {
final XPoint2D pt1 = worm.get(i); final XPoint2D pt1 = worm.get(i);
final XPoint2D pt2 = worm.get(i + 1); final XPoint2D pt2 = worm.get(i + 1);
if (pt1.getY() == pt2.getY()) { if (pt1.getY() == pt2.getY()) {
final XLine2D line = new XLine2D(pt1, pt2); final XLine2D line = XLine2D.line(pt1, pt2);
result.add(line); result.add(line);
} }
} }

View File

@ -51,7 +51,7 @@ public class Swimlane implements SpecificBackcolorable, Comparable<Swimlane> {
private final int order; private final int order;
private Display display; private Display display;
private UTranslate translate = new UTranslate(); private UTranslate translate = UTranslate.none();
private double actualWidth; private double actualWidth;
public Swimlane(String name, int order) { public Swimlane(String name, int order) {

View File

@ -99,7 +99,7 @@ public class UGraphicInterceptorUDrawable2 extends UGraphicDelegator {
final FtileGeometry geom = ftile.calculateDimension(getStringBounder()); final FtileGeometry geom = ftile.calculateDimension(getStringBounder());
final XPoint2D pt = geom.getPointIn(); final XPoint2D pt = geom.getPointIn();
UGraphic ugGoto = getUg().apply(gotoColor).apply(gotoColor.bg()); UGraphic ugGoto = getUg().apply(gotoColor).apply(gotoColor.bg());
ugGoto = ugGoto.apply(new UTranslate(pt)); ugGoto = ugGoto.apply(UTranslate.point(pt));
final UTranslate posNow = getPosition(); final UTranslate posNow = getPosition();
final UTranslate dest = positions.get(ftile.getName()); final UTranslate dest = positions.get(ftile.getName());
if (dest == null) if (dest == null)

View File

@ -106,7 +106,7 @@ public class Worm implements Iterable<XPoint2D> {
for (int i = 0; i < points.size() - 1; i++) { for (int i = 0; i < points.size() - 1; i++) {
final XPoint2D p1 = points.get(i); final XPoint2D p1 = points.get(i);
final XPoint2D p2 = points.get(i + 1); final XPoint2D p2 = points.get(i + 1);
final XLine2D line = new XLine2D(p1, p2); final XLine2D line = XLine2D.line(p1, p2);
if (drawn == false && emphasizeDirection != null && Direction.fromVector(p1, p2) == emphasizeDirection) { if (drawn == false && emphasizeDirection != null && Direction.fromVector(p1, p2) == emphasizeDirection) {
drawLine(ug, line, emphasizeDirection); drawLine(ug, line, emphasizeDirection);
drawn = true; drawn = true;
@ -131,7 +131,7 @@ public class Worm implements Iterable<XPoint2D> {
if (ignoreForCompression) if (ignoreForCompression)
startDecoration.setCompressionMode(CompressionMode.ON_X); startDecoration.setCompressionMode(CompressionMode.ON_X);
ug.apply(new UTranslate(start)).apply(UStroke.simple()).draw(startDecoration); ug.apply(UTranslate.point(start)).apply(UStroke.simple()).draw(startDecoration);
} }
if (endDecoration != null) { if (endDecoration != null) {
ug = ug.apply(UStroke.withThickness(1.5)); ug = ug.apply(UStroke.withThickness(1.5));
@ -139,7 +139,7 @@ public class Worm implements Iterable<XPoint2D> {
if (ignoreForCompression) if (ignoreForCompression)
endDecoration.setCompressionMode(CompressionMode.ON_X); endDecoration.setCompressionMode(CompressionMode.ON_X);
ug.apply(new UTranslate(end)).apply(UStroke.simple()).draw(endDecoration); ug.apply(UTranslate.point(end)).apply(UStroke.simple()).draw(endDecoration);
} }
} }

View File

@ -51,7 +51,7 @@ import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.utils.Direction; import net.sourceforge.plantuml.utils.Direction;
public class WormTexted implements Iterable<XPoint2D> { public class WormTexted implements Iterable<XPoint2D> {
// ::remove folder when __HAXE__ // ::remove folder when __HAXE__
private final Worm worm; private final Worm worm;
private TextBlock textBlock; private TextBlock textBlock;
@ -138,7 +138,7 @@ public class WormTexted implements Iterable<XPoint2D> {
void drawInternalLabel(UGraphic ug) { void drawInternalLabel(UGraphic ug) {
if (textBlock != null) { if (textBlock != null) {
final XPoint2D position = getTextBlockPosition(ug.getStringBounder()); final XPoint2D position = getTextBlockPosition(ug.getStringBounder());
textBlock.drawU(ug.apply(new UTranslate(position))); textBlock.drawU(ug.apply(UTranslate.point(position)));
} }
} }

View File

@ -63,7 +63,7 @@ public class ZadBuilder extends UGraphicNo {
} }
public ZadBuilder(StringBounder stringBounder) { public ZadBuilder(StringBounder stringBounder) {
super(stringBounder, new UTranslate()); super(stringBounder, UTranslate.none());
this.context = new Context(); this.context = new Context();
} }

View File

@ -169,7 +169,7 @@ public class FtileWithNoteOpale extends AbstractFtile implements Stencil, Stylea
@Override @Override
public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) { public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
if (child == tile) if (child == tile)
return new UTranslate(); return UTranslate.none();
return super.getTranslateFor(child, stringBounder); return super.getTranslateFor(child, stringBounder);
} }

View File

@ -130,7 +130,7 @@ public abstract class FtileDecorate extends AbstractTextBlock implements Ftile {
@Override @Override
public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) { public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
if (child == ftile) if (child == ftile)
return new UTranslate(); return UTranslate.none();
return ftile.getTranslateFor(child, stringBounder); return ftile.getTranslateFor(child, stringBounder);
} }

View File

@ -103,7 +103,7 @@ public class GtileColumns extends AbstractGtile {
for (int i = 0; i < gtiles.size(); i++) { for (int i = 0; i < gtiles.size(); i++) {
final XDimension2D dim = gtiles.get(i).calculateDimension(stringBounder); final XDimension2D dim = gtiles.get(i).calculateDimension(stringBounder);
final UTranslate pos = getPosition(i); final UTranslate pos = getPosition(i);
final XDimension2D corner = pos.getTranslated(dim); final XDimension2D corner = dim.applyTranslate(pos);
result = MathUtils.max(result, corner); result = MathUtils.max(result, corner);
} }
return result; return result;

View File

@ -102,10 +102,10 @@ public class GtileHexagonInsideLabelled extends GtileWithMargin {
public XDimension2D calculateDimension(StringBounder stringBounder) { public XDimension2D calculateDimension(StringBounder stringBounder) {
final XDimension2D tmp = super.calculateDimension(stringBounder); final XDimension2D tmp = super.calculateDimension(stringBounder);
final UTranslate south = getCoord(GPoint.SOUTH_HOOK); final UTranslate south = getCoord(GPoint.SOUTH_HOOK);
final XDimension2D southCorner = south.getTranslated(southLabel.calculateDimension(stringBounder)); final XDimension2D southCorner = southLabel.calculateDimension(stringBounder).applyTranslate(south);
final UTranslate east = getCoord(GPoint.EAST_HOOK); final UTranslate east = getCoord(GPoint.EAST_HOOK);
final XDimension2D eastCorner = east.getTranslated(eastLabel.calculateDimension(stringBounder)); final XDimension2D eastCorner = eastLabel.calculateDimension(stringBounder).applyTranslate(east);
return MathUtils.max(tmp, southCorner, eastCorner); return MathUtils.max(tmp, southCorner, eastCorner);
} }

View File

@ -79,7 +79,7 @@ public class GtileTopDown extends AbstractGtile {
} }
protected UTranslate supplementaryMove() { protected UTranslate supplementaryMove() {
return new UTranslate(); return UTranslate.none();
} }
@Override @Override
@ -116,8 +116,8 @@ public class GtileTopDown extends AbstractGtile {
@Override @Override
public XDimension2D calculateDimension(StringBounder stringBounder) { public XDimension2D calculateDimension(StringBounder stringBounder) {
final XDimension2D corner1 = getPos1().getTranslated(dim1); final XDimension2D corner1 = dim1.applyTranslate(getPos1());
final XDimension2D corner2 = getPos2().getTranslated(dim2); final XDimension2D corner2 = dim2.applyTranslate(getPos2());
return MathUtils.max(corner1, corner2); return MathUtils.max(corner1, corner2);
} }

View File

@ -118,9 +118,9 @@ public class GtileTopDown3 extends AbstractGtile {
@Override @Override
public XDimension2D calculateDimension(StringBounder stringBounder) { public XDimension2D calculateDimension(StringBounder stringBounder) {
final XDimension2D corner1 = getPos1().getTranslated(dim1); final XDimension2D corner1 = dim1.applyTranslate(getPos1());
final XDimension2D corner2 = getPos2().getTranslated(dim2); final XDimension2D corner2 = dim2.applyTranslate(getPos2());
final XDimension2D corner3 = getPos3().getTranslated(dim3); final XDimension2D corner3 = dim3.applyTranslate(getPos3());
return MathUtils.max(corner1, corner2, corner3); return MathUtils.max(corner1, corner2, corner3);
} }

View File

@ -170,7 +170,7 @@ public class GridArray implements UDrawable {
private void drawArrow(UGraphic ug, XPoint2D pt1, XPoint2D pt2) { private void drawArrow(UGraphic ug, XPoint2D pt1, XPoint2D pt2) {
ug = ug.apply(HColors.BLUE); ug = ug.apply(HColors.BLUE);
final ULine line = new ULine(pt2.getX() - pt1.getX(), pt2.getY() - pt1.getY()); final ULine line = new ULine(pt2.getX() - pt1.getX(), pt2.getY() - pt1.getY());
ug.apply(new UTranslate(pt1)).draw(line); ug.apply(UTranslate.point(pt1)).draw(line);
} }
private XPoint2D getCenterOf(StringBounder stringBounder, int c, int l) { private XPoint2D getCenterOf(StringBounder stringBounder, int c, int l) {

View File

@ -231,7 +231,9 @@ public class BodierLikeClassOrObject implements Bodier {
if (type == LeafType.OBJECT) { if (type == LeafType.OBJECT) {
if (showFields == false) if (showFields == false)
return new TextBlockLineBefore(style.value(PName.LineThickness).asDouble(), TextBlockUtils.empty(0, 0)); // return new TextBlockLineBefore(style.value(PName.LineThickness).asDouble(),
// TextBlockUtils.empty(0, 0));
return TextBlockUtils.empty(0, 0);
return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT), return BodyFactory.create1(skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
rawBodyWithoutHidden(), skinParam, stereotype, leaf, style); rawBodyWithoutHidden(), skinParam, stereotype, leaf, style);

View File

@ -133,17 +133,6 @@ public class BodyEnhanced1 extends BodyEnhancedAbstract implements TextBlock, Wi
Display display = null; Display display = null;
for (ListIterator<CharSequence> it = rawBody2.iterator(); it.hasNext();) { for (ListIterator<CharSequence> it = rawBody2.iterator(); it.hasNext();) {
final CharSequence cs = it.next(); final CharSequence cs = it.next();
// if (cs instanceof EmbeddedDiagram) {
// if (display == null)
// display = Display.empty();
// if (display.size() > 0 || separator != 0) {
// blocks.add(buildTextBlock(display, separator, title, stringBounder));
// separator = 0;
// title = null;
// display = null;
// }
// blocks.add(TextBlockUtils.withMargin(((EmbeddedDiagram) cs).asDraw(), 2, 2));
// } else {
final String s = cs.toString(); final String s = cs.toString();
if (isBlockSeparator(s)) { if (isBlockSeparator(s)) {
if (display == null) if (display == null)

View File

@ -202,7 +202,7 @@ public class USymbolFolder extends USymbol {
return new UTranslate(0, htitle * how); return new UTranslate(0, htitle * how);
} }
return new UTranslate(); return UTranslate.none();
} }
}; };

View File

@ -112,7 +112,7 @@ public class Neighborhood {
poly.addPoint(7, 20); poly.addPoint(7, 20);
poly.addPoint(-7, 20); poly.addPoint(-7, 20);
poly.rotate(theta); poly.rotate(theta);
final UTranslate translate = new UTranslate(contact); final UTranslate translate = UTranslate.point(contact);
ug.apply(translate).draw(poly); ug.apply(translate).draw(poly);
final XPoint2D p1 = translate.getTranslated(poly.getPoints().get(1)); final XPoint2D p1 = translate.getTranslated(poly.getPoints().get(1));
final XPoint2D p2 = translate.getTranslated(poly.getPoints().get(2)); final XPoint2D p2 = translate.getTranslated(poly.getPoints().get(2));

View File

@ -147,7 +147,7 @@ public class PSystemColors extends PlainDiagram implements UDrawable {
private void drawOneHexa(UGraphic ug, String colorName, int i, int j, UPolygon hexa) { private void drawOneHexa(UGraphic ug, String colorName, int i, int j, UPolygon hexa) {
final HColor color = colors.getColorOrWhite(colorName); final HColor color = colors.getColorOrWhite(colorName);
ug = applyColor(ug, color); ug = applyColor(ug, color);
ug = ug.apply(new UTranslate(centerHexa(i, j))); ug = ug.apply(UTranslate.point(centerHexa(i, j)));
ug.draw(hexa); ug.draw(hexa);
final UFont font = UFont.sansSerif(14).bold(); final UFont font = UFont.sansSerif(14).bold();

View File

@ -277,7 +277,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
zstereo, rectangleArea, stroke); zstereo, rectangleArea, stroke);
final HColor borderColor = HColors.BLACK; final HColor borderColor = HColors.BLACK;
decoration.drawU(ug.apply(new UTranslate(corner)), backColor, borderColor, shadowing, roundCorner, decoration.drawU(ug.apply(UTranslate.point(corner)), backColor, borderColor, shadowing, roundCorner,
skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null), skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false, null),
skinParam.getStereotypeAlignment(), 0); skinParam.getStereotypeAlignment(), 0);
@ -305,7 +305,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
final XPoint2D corner = getPosition(elkNode); final XPoint2D corner = getPosition(elkNode);
// Print the node image at right coord // Print the node image at right coord
image.drawU(ug.apply(new UTranslate(corner))); image.drawU(ug.apply(UTranslate.point(corner)));
} }
private void drawSingleEdge(UGraphic ug, Link link, ElkEdge edge) { private void drawSingleEdge(UGraphic ug, Link link, ElkEdge edge) {
@ -322,7 +322,7 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
} }
final ElkPath elkPath = new ElkPath(diagram, SName.classDiagram, link, edge, getLabel(link), final ElkPath elkPath = new ElkPath(diagram, SName.classDiagram, link, edge, getLabel(link),
getQuantifier(link, 1), getQuantifier(link, 2), magicY2); getQuantifier(link, 1), getQuantifier(link, 2), magicY2);
elkPath.drawU(ug.apply(new UTranslate(translate))); elkPath.drawU(ug.apply(UTranslate.point(translate)));
} }
public XDimension2D calculateDimension(StringBounder stringBounder) { public XDimension2D calculateDimension(StringBounder stringBounder) {

View File

@ -173,13 +173,13 @@ public class ElkPath implements UDrawable {
private UDrawable getDecors(LinkDecor decors, double angle, HColor backColor) { private UDrawable getDecors(LinkDecor decors, double angle, HColor backColor) {
// For legacy reason, extends are treated differently // For legacy reason, extends are treated differently
if (decors == LinkDecor.EXTENDS) if (decors == LinkDecor.EXTENDS)
return new ExtremityFactoryExtends(backColor).createUDrawable(new XPoint2D(), angle, null); return new ExtremityFactoryExtends(backColor).createUDrawable(new XPoint2D(0, 0), angle, null);
final ExtremityFactory extremityFactory = decors.getExtremityFactory(backColor); final ExtremityFactory extremityFactory = decors.getExtremityFactory(backColor);
if (extremityFactory == null) if (extremityFactory == null)
return null; return null;
return extremityFactory.createUDrawable(new XPoint2D(), angle, null); return extremityFactory.createUDrawable(new XPoint2D(0, 0), angle, null);
} }
private void drawLabels(UGraphic ug) { private void drawLabels(UGraphic ug) {

View File

@ -112,7 +112,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(new UTranslate(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(new UEllipse(2 * size, 2 * size));
} }

View File

@ -40,6 +40,7 @@ import java.awt.image.AffineTransformOp;
public enum AffineTransformType { public enum AffineTransformType {
TYPE_NEAREST_NEIGHBOR, TYPE_BILINEAR; TYPE_NEAREST_NEIGHBOR, TYPE_BILINEAR;
// ::comment when __HAXE__
public int toLegacyInt() { public int toLegacyInt() {
switch (this) { switch (this) {
case TYPE_BILINEAR: case TYPE_BILINEAR:
@ -49,5 +50,6 @@ public enum AffineTransformType {
} }
throw new AssertionError(); throw new AssertionError();
} }
// ::done
} }

View File

@ -57,7 +57,7 @@ public class UMotif {
} }
public UMotif(String s) { public UMotif(String s) {
XPoint2D last = new XPoint2D(); XPoint2D last = new XPoint2D(0, 0);
for (int i = 0; i < s.length(); i++) { for (int i = 0; i < s.length(); i++) {
final XPoint2D read = convertPoint(s.charAt(i)); final XPoint2D read = convertPoint(s.charAt(i));
last = last.move(read); last = last.move(read);

View File

@ -40,8 +40,6 @@ import net.sourceforge.plantuml.klimt.geom.XPoint2D;
import net.sourceforge.plantuml.klimt.geom.XRectangle2D; import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
public class UTranslate implements UChange { public class UTranslate implements UChange {
// ::remove file when __HAXE__
private final double dx; private final double dx;
private final double dy; private final double dy;
@ -67,12 +65,8 @@ public class UTranslate implements UChange {
return new UTranslate(0, dy); return new UTranslate(0, dy);
} }
public UTranslate(XPoint2D p) { public static UTranslate point(XPoint2D p) {
this(p.getX(), p.getY()); return new UTranslate(p.getX(), p.getY());
}
public UTranslate() {
this(0, 0);
} }
public double getDx() { public double getDx() {
@ -94,10 +88,6 @@ public class UTranslate implements UChange {
return new XPoint2D(p.getX() + dx, p.getY() + dy); return new XPoint2D(p.getX() + dx, p.getY() + dy);
} }
public XDimension2D getTranslated(XDimension2D dim) {
return new XDimension2D(dim.getWidth() + dx, dim.getHeight() + dy);
}
public UTranslate scaled(double scale) { public UTranslate scaled(double scale) {
return new UTranslate(dx * scale, dy * scale); return new UTranslate(dx * scale, dy * scale);
} }

View File

@ -71,7 +71,7 @@ public class SlotFinder extends UGraphicNo {
private final CompressionMode mode; private final CompressionMode mode;
public static SlotFinder create(CompressionMode mode, StringBounder stringBounder) { public static SlotFinder create(CompressionMode mode, StringBounder stringBounder) {
return new SlotFinder(stringBounder, new UTranslate(), new SlotSet(), mode); return new SlotFinder(stringBounder, UTranslate.none(), new SlotSet(), mode);
} }
private SlotFinder(StringBounder stringBounder, UTranslate translate, SlotSet slot, CompressionMode mode) { private SlotFinder(StringBounder stringBounder, UTranslate translate, SlotSet slot, CompressionMode mode) {

View File

@ -71,7 +71,7 @@ public class UGraphicCompressOnXorY extends UGraphicDelegator {
public static UGraphicCompressOnXorY create(CompressionMode mode, UGraphic ug, public static UGraphicCompressOnXorY create(CompressionMode mode, UGraphic ug,
PiecewiseAffineTransform compressionTransform) { PiecewiseAffineTransform compressionTransform) {
return new UGraphicCompressOnXorY(mode, ug, compressionTransform, new UTranslate()); return new UGraphicCompressOnXorY(mode, ug, compressionTransform, UTranslate.none());
} }
private UGraphicCompressOnXorY(CompressionMode mode, UGraphic ug, PiecewiseAffineTransform compressionTransform, private UGraphicCompressOnXorY(CompressionMode mode, UGraphic ug, PiecewiseAffineTransform compressionTransform,

View File

@ -64,7 +64,7 @@ public abstract class AbstractCommonUGraphic implements UGraphic {
private boolean enlargeClip = false; private boolean enlargeClip = false;
private final StringBounder stringBounder; private final StringBounder stringBounder;
private UTranslate translate = new UTranslate(); private UTranslate translate = UTranslate.none();
private final ColorMapper colorMapper; private final ColorMapper colorMapper;
private UClip clip; private UClip clip;

View File

@ -43,7 +43,7 @@ import net.sourceforge.plantuml.klimt.shape.UHorizontalLine;
public abstract class AbstractUGraphicHorizontalLine extends UGraphicDelegator { public abstract class AbstractUGraphicHorizontalLine extends UGraphicDelegator {
private UTranslate translate = new UTranslate(); private UTranslate translate = UTranslate.none();
public UGraphic apply(UChange change) { public UGraphic apply(UChange change) {
final AbstractUGraphicHorizontalLine result; final AbstractUGraphicHorizontalLine result;

View File

@ -87,7 +87,7 @@ public final class LimitFinder extends UGraphicNo {
private UClip clip; private UClip clip;
public static LimitFinder create(StringBounder stringBounder, boolean initToZero) { public static LimitFinder create(StringBounder stringBounder, boolean initToZero) {
final LimitFinder result = new LimitFinder(stringBounder, new UTranslate(), MinMaxMutable.getEmpty(initToZero)); final LimitFinder result = new LimitFinder(stringBounder, UTranslate.none(), MinMaxMutable.getEmpty(initToZero));
result.clip = null; result.clip = null;
return result; return result;
} }

View File

@ -62,7 +62,7 @@ public class TextLimitFinder extends UGraphicNo {
} }
public static TextLimitFinder create(StringBounder stringBounder, boolean initToZero) { public static TextLimitFinder create(StringBounder stringBounder, boolean initToZero) {
return new TextLimitFinder(stringBounder, new UTranslate(), MinMaxMutable.getEmpty(initToZero)); return new TextLimitFinder(stringBounder, UTranslate.none(), MinMaxMutable.getEmpty(initToZero));
} }
private TextLimitFinder(StringBounder stringBounder, UTranslate translate, MinMaxMutable minmax) { private TextLimitFinder(StringBounder stringBounder, UTranslate translate, MinMaxMutable minmax) {

View File

@ -51,7 +51,7 @@ public class UPathHand {
final UPath result = new UPath(); final UPath result = new UPath();
XPoint2D last = new XPoint2D(); XPoint2D last = new XPoint2D(0, 0);
for (USegment segment : source) { for (USegment segment : source) {
final USegmentType type = segment.getSegmentType(); final USegmentType type = segment.getSegmentType();

View File

@ -52,6 +52,7 @@ import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
public class FontConfiguration { public class FontConfiguration {
// ::remove file when __HAXE__
private final EnumSet<FontStyle> styles; private final EnumSet<FontStyle> styles;
private final UFont currentFont; private final UFont currentFont;
@ -237,7 +238,7 @@ public class FontConfiguration {
public FontConfiguration changeFamily(String family) { public FontConfiguration changeFamily(String family) {
return new FontConfiguration(styles, motherFont, motherColor, return new FontConfiguration(styles, motherFont, motherColor,
new UFont(family, currentFont.getStyle(), currentFont.getSize()), currentColor, extendedColor, UFont.build(family, currentFont.getStyle(), currentFont.getSize()), currentColor, extendedColor,
fontPosition, svgAttributes, hyperlinkColor, hyperlinkUnderlineStroke, tabSize); fontPosition, svgAttributes, hyperlinkColor, hyperlinkUnderlineStroke, tabSize);
} }

View File

@ -42,6 +42,8 @@ import net.sourceforge.plantuml.style.ISkinParam;
import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.StyleSignatureBasic; import net.sourceforge.plantuml.style.StyleSignatureBasic;
// ::remove file when __HAXE__
interface FontParamConstant { interface FontParamConstant {
String FAMILY = "SansSerif"; String FAMILY = "SansSerif";
String COLOR = "black"; String COLOR = "black";

View File

@ -48,6 +48,8 @@ public enum FontPosition {
return 0; return 0;
} }
// ::comment when __HAXE__
public UFont mute(UFont font) { public UFont mute(UFont font) {
if (this == NORMAL) if (this == NORMAL)
return font; return font;
@ -68,5 +70,6 @@ public enum FontPosition {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
// ::done
} }

View File

@ -44,6 +44,7 @@ import net.sourceforge.plantuml.regex.Matcher2;
import net.sourceforge.plantuml.regex.MyPattern; import net.sourceforge.plantuml.regex.MyPattern;
public enum FontStyle { public enum FontStyle {
// :: remove file when __HAXE__
PLAIN, ITALIC, BOLD, UNDERLINE, STRIKE, WAVE, BACKCOLOR; PLAIN, ITALIC, BOLD, UNDERLINE, STRIKE, WAVE, BACKCOLOR;
public UFont mutateFont(UFont font) { public UFont mutateFont(UFont font) {

View File

@ -38,11 +38,12 @@ package net.sourceforge.plantuml.klimt.font;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public interface StringBounder { public interface StringBounder {
// ::remove folder when __HAXE__
// ::comment when __HAXE__
public XDimension2D calculateDimension(UFont font, String text); public XDimension2D calculateDimension(UFont font, String text);
public double getDescent(UFont font, String text); public double getDescent(UFont font, String text);
// ::done
public boolean matchesProperty(String propertyName); public boolean matchesProperty(String propertyName);

View File

@ -43,6 +43,7 @@ import net.sourceforge.plantuml.text.RichText;
import net.sourceforge.plantuml.text.StyledString; import net.sourceforge.plantuml.text.StyledString;
public abstract class StringBounderRaw implements StringBounder { public abstract class StringBounderRaw implements StringBounder {
// ::remove file when __HAXE__
private final FontRenderContext frc; private final FontRenderContext frc;

View File

@ -41,13 +41,13 @@ import java.util.HashSet;
import java.util.Set; import java.util.Set;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.font.Roboto;
public class UFont { public class UFont {
private final Font font; private final Font font;
private final String family; private final String family;
// ::comment when __HAXE__
private static final Set<String> names = new HashSet<>(); private static final Set<String> names = new HashSet<>();
static { static {
@ -58,8 +58,8 @@ public class UFont {
// } // }
for (String name : GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()) for (String name : GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames())
names.add(name.toLowerCase()); names.add(name.toLowerCase());
} }
// ::done
public String toStringDebug() { public String toStringDebug() {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
@ -69,8 +69,13 @@ public class UFont {
return sb.toString(); return sb.toString();
} }
public UFont(String fontFamily, int fontStyle, int fontSize) { public static UFont build(String fontFamily, int fontStyle, int fontSize) {
this(buildFont(fontFamily, fontStyle, fontSize), fontFamily); return new UFont(buildFont(fontFamily, fontStyle, fontSize), fontFamily);
}
private UFont(Font font, String family) {
this.font = font;
this.family = family;
} }
private static Font buildFont(String fontFamily, int fontStyle, int fontSize) { private static Font buildFont(String fontFamily, int fontStyle, int fontSize) {
@ -86,19 +91,24 @@ public class UFont {
} }
private static boolean doesFamilyExists(String name) { private static boolean doesFamilyExists(String name) {
// ::comment when __HAXE__
return names.contains(name.toLowerCase()); return names.contains(name.toLowerCase());
// ::done
// ::uncomment when __HAXE__
// return true;
// ::done
} }
public static UFont serif(int size) { public static UFont serif(int size) {
return new UFont("Serif", Font.PLAIN, size); return UFont.build("Serif", Font.PLAIN, size);
} }
public static UFont sansSerif(int size) { public static UFont sansSerif(int size) {
return new UFont("SansSerif", Font.PLAIN, size); return UFont.build("SansSerif", Font.PLAIN, size);
} }
public static UFont courier(int size) { public static UFont courier(int size) {
return new UFont("Courier", Font.PLAIN, size); return UFont.build("Courier", Font.PLAIN, size);
} }
public static UFont byDefault(int size) { public static UFont byDefault(int size) {
@ -110,12 +120,7 @@ public class UFont {
} }
public static UFont monospaced(int size) { public static UFont monospaced(int size) {
return new UFont("Monospaced", Font.PLAIN, size); return UFont.build("Monospaced", Font.PLAIN, size);
}
private UFont(Font font, String family) {
this.font = font;
this.family = family;
} }
public final Font getUnderlayingFont(UFontContext context) { public final Font getUnderlayingFont(UFontContext context) {
@ -194,6 +199,8 @@ public class UFont {
return font.toString()/* + " " + font.getPSName() */; return font.toString()/* + " " + font.getPSName() */;
} }
// ::comment when __HAXE__
@Override @Override
public int hashCode() { public int hashCode() {
return font.hashCode(); return font.hashCode();
@ -206,5 +213,6 @@ public class UFont {
return this.font.equals(((UFont) obj).font); return this.font.equals(((UFont) obj).font);
} }
// ::done
} }

View File

@ -41,8 +41,10 @@ import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.klimt.shape.UText; import net.sourceforge.plantuml.klimt.shape.UText;
public enum UFontContext { public enum UFontContext {
EPS, SVG, G2D, TIKZ; EPS, SVG, G2D, TIKZ;
// ::comment when __HAXE__
public TextLayout createTextLayout(UText shape) { public TextLayout createTextLayout(UText shape) {
return createTextLayout(shape.getFontConfiguration().getFont(), shape.getText()); return createTextLayout(shape.getFontConfiguration().getFont(), shape.getText());
} }
@ -50,5 +52,5 @@ public enum UFontContext {
public TextLayout createTextLayout(UFont font, String string) { public TextLayout createTextLayout(UFont font, String string) {
return new TextLayout(string, font.getUnderlayingFont(this), FileFormat.gg.getFontRenderContext()); return new TextLayout(string, font.getUnderlayingFont(this), FileFormat.gg.getFontRenderContext());
} }
// ::done
} }

View File

@ -44,6 +44,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public class UnusedSpace { public class UnusedSpace {
// ::remove file when __HAXE__
static class Point { static class Point {
final private double x; final private double x;

View File

@ -43,8 +43,6 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.shape.TextBlock; import net.sourceforge.plantuml.klimt.shape.TextBlock;
public enum HorizontalAlignment { public enum HorizontalAlignment {
// :: remove file when __HAXE__
LEFT, CENTER, RIGHT; LEFT, CENTER, RIGHT;
public static HorizontalAlignment fromString(String s) { public static HorizontalAlignment fromString(String s) {
@ -73,6 +71,7 @@ public enum HorizontalAlignment {
return result; return result;
} }
// ::comment when __HAXE__
public String getGraphVizValue() { public String getGraphVizValue() {
return toString().substring(0, 1).toLowerCase(); return toString().substring(0, 1).toLowerCase();
} }
@ -89,5 +88,6 @@ public enum HorizontalAlignment {
} }
} }
// ::done
} }

View File

@ -43,7 +43,7 @@ public class MagneticBorderNone implements MagneticBorder {
@Override @Override
public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position) { public UTranslate getForceAt(StringBounder stringBounder, XPoint2D position) {
return new UTranslate(); return UTranslate.none();
} }
} }

View File

@ -58,7 +58,7 @@ public class ULayoutGroup {
for (Map.Entry<TextBlock, XPoint2D> ent : placementStrategy.getPositions(width, height).entrySet()) { for (Map.Entry<TextBlock, XPoint2D> ent : placementStrategy.getPositions(width, height).entrySet()) {
final TextBlock block = ent.getKey(); final TextBlock block = ent.getKey();
final XPoint2D pos = ent.getValue(); final XPoint2D pos = ent.getValue();
block.drawU(ug.apply(new UTranslate(pos))); block.drawU(ug.apply(UTranslate.point(pos)));
} }
} }
@ -82,7 +82,7 @@ public class ULayoutGroup {
final TextBlock block = ent.getKey(); final TextBlock block = ent.getKey();
final XRectangle2D result = block.getInnerPosition(member, stringBounder, mode); final XRectangle2D result = block.getInnerPosition(member, stringBounder, mode);
if (result != null) { if (result != null) {
final UTranslate translate = new UTranslate(ent.getValue()); final UTranslate translate = UTranslate.point(ent.getValue());
return translate.apply(result); return translate.apply(result);
} }
} }

View File

@ -35,10 +35,13 @@
*/ */
package net.sourceforge.plantuml.klimt.geom; package net.sourceforge.plantuml.klimt.geom;
// ::comment when __HAXE__
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
// ::done
import java.util.Arrays; import java.util.Arrays;
public class USegment { public class USegment {
// ::remove file when __HAXE__
private final double coord[]; private final double coord[];
private final USegmentType pathType; private final USegmentType pathType;
@ -75,6 +78,7 @@ public class USegment {
return new USegment(new double[] { p1.getX(), p1.getY() }, pathType); return new USegment(new double[] { p1.getX(), p1.getY() }, pathType);
} }
// ::comment when __HAXE__
public USegment rotate(double theta) { public USegment rotate(double theta) {
if (coord.length != 2) if (coord.length != 2)
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
@ -105,5 +109,6 @@ public class USegment {
return new USegment(new double[] { p1.getX(), p1.getY() }, pathType); return new USegment(new double[] { p1.getX(), p1.getY() }, pathType);
} }
// ::done
} }

View File

@ -39,6 +39,7 @@ import java.awt.geom.PathIterator;
import java.util.EnumSet; import java.util.EnumSet;
public enum USegmentType { public enum USegmentType {
// ::remove file when __HAXE__
SEG_MOVETO(PathIterator.SEG_MOVETO), // SEG_MOVETO(PathIterator.SEG_MOVETO), //
SEG_LINETO(PathIterator.SEG_LINETO), // SEG_LINETO(PathIterator.SEG_LINETO), //

View File

@ -35,8 +35,11 @@
*/ */
package net.sourceforge.plantuml.klimt.geom; package net.sourceforge.plantuml.klimt.geom;
// ::comment when __HAXE__
import java.awt.Dimension; import java.awt.Dimension;
// ::done
import net.sourceforge.plantuml.klimt.UTranslate;
import net.sourceforge.plantuml.utils.MathUtils; import net.sourceforge.plantuml.utils.MathUtils;
public class XDimension2D { public class XDimension2D {
@ -44,10 +47,6 @@ public class XDimension2D {
final private double width; final private double width;
final private double height; final private double height;
public XDimension2D() {
this(0, 0);
}
public XDimension2D(double width, double height) { public XDimension2D(double width, double height) {
if (Double.isNaN(width) || Double.isNaN(height)) if (Double.isNaN(width) || Double.isNaN(height))
throw new IllegalArgumentException(); throw new IllegalArgumentException();
@ -77,6 +76,10 @@ public class XDimension2D {
return new XDimension2D(newWidth, height); return new XDimension2D(newWidth, height);
} }
public XDimension2D applyTranslate(UTranslate translate) {
return new XDimension2D(width + translate.getDx(), height + translate.getDy());
}
public XDimension2D delta(double deltaWidth, double deltaHeight) { public XDimension2D delta(double deltaWidth, double deltaHeight) {
if (deltaHeight == 0 && deltaWidth == 0) if (deltaHeight == 0 && deltaWidth == 0)
return this; return this;
@ -119,11 +122,11 @@ public class XDimension2D {
return new XDimension2D(w, h); return new XDimension2D(w, h);
} }
// ::comment when __HAXE__
public static XDimension2D fromDimension(Dimension dimension) { public static XDimension2D fromDimension(Dimension dimension) {
return new XDimension2D(dimension.getWidth(), dimension.getHeight()); return new XDimension2D(dimension.getWidth(), dimension.getHeight());
} }
// ::comment when __HAXE__
public static XDimension2D mergeLayoutT12B3(XDimension2D top1, XDimension2D top2, XDimension2D bottom) { public static XDimension2D mergeLayoutT12B3(XDimension2D top1, XDimension2D top2, XDimension2D bottom) {
final double width = MathUtils.max(top1.getWidth(), top2.getWidth(), bottom.getWidth()); final double width = MathUtils.max(top1.getWidth(), top2.getWidth(), bottom.getWidth());
final double height = top1.getHeight() + top2.getHeight() + bottom.getHeight(); final double height = top1.getHeight() + top2.getHeight() + bottom.getHeight();

View File

@ -6,17 +6,12 @@ import net.sourceforge.plantuml.klimt.shape.UDrawable;
import net.sourceforge.plantuml.klimt.shape.ULine; import net.sourceforge.plantuml.klimt.shape.ULine;
public class XLine2D implements UDrawable { public class XLine2D implements UDrawable {
// :: remove file when __HAXE__
final public double x1; final public double x1;
final public double y1; final public double y1;
final public double x2; final public double x2;
final public double y2; final public double y2;
public XLine2D() {
this(0, 0, 0, 0);
}
public XLine2D(double x1, double y1, double x2, double y2) { public XLine2D(double x1, double y1, double x2, double y2) {
this.x1 = x1; this.x1 = x1;
this.y1 = y1; this.y1 = y1;
@ -24,8 +19,8 @@ public class XLine2D implements UDrawable {
this.y2 = y2; this.y2 = y2;
} }
public XLine2D(XPoint2D p1, XPoint2D p2) { public static XLine2D line(XPoint2D p1, XPoint2D p2) {
this(p1.getX(), p1.getY(), p2.getX(), p2.getY()); return new XLine2D(p1.getX(), p1.getY(), p2.getX(), p2.getY());
} }
public XPoint2D getMiddle() { public XPoint2D getMiddle() {
@ -150,11 +145,13 @@ public class XLine2D implements UDrawable {
return null; return null;
} }
// ::comment when __HAXE__
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
ug = ug.apply(new UTranslate(x1, y1)); ug = ug.apply(new UTranslate(x1, y1));
final ULine line = new ULine(x2 - x1, y2 - y1); final ULine line = new ULine(x2 - x1, y2 - y1);
ug.draw(line); ug.draw(line);
} }
// ::done
public double getAngle() { public double getAngle() {
return Math.atan2(y2 - y1, x2 - x1); return Math.atan2(y2 - y1, x2 - x1);

View File

@ -1,17 +1,15 @@
package net.sourceforge.plantuml.klimt.geom; package net.sourceforge.plantuml.klimt.geom;
// ::comment when __HAXE__
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
// ::done
public class XPoint2D { public class XPoint2D {
final public double x; final public double x;
final public double y; final public double y;
public XPoint2D() {
this(0, 0);
}
@Override @Override
public String toString() { public String toString() {
return "(" + x + "," + y + ")"; return "(" + x + "," + y + ")";
@ -22,6 +20,7 @@ public class XPoint2D {
this.y = y; this.y = y;
} }
// ::comment when __HAXE__
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
final XPoint2D other = (XPoint2D) obj; final XPoint2D other = (XPoint2D) obj;
@ -33,6 +32,13 @@ public class XPoint2D {
return Double.valueOf(x).hashCode() + Double.valueOf(y).hashCode(); return Double.valueOf(x).hashCode() + Double.valueOf(y).hashCode();
} }
public XPoint2D transform(AffineTransform rotate) {
final Point2D.Double tmp = new Point2D.Double(x, y);
rotate.transform(tmp, tmp);
return new XPoint2D(tmp.x, tmp.y);
}
// ::done
public final double getX() { public final double getX() {
return x; return x;
} }
@ -69,14 +75,8 @@ public class XPoint2D {
return new XPoint2D(x + dx, y + dy); return new XPoint2D(x + dx, y + dy);
} }
public XPoint2D transform(AffineTransform rotate) {
final Point2D.Double tmp = new Point2D.Double(x, y);
rotate.transform(tmp, tmp);
return new XPoint2D(tmp.x, tmp.y);
}
public XPoint2D move(XPoint2D delta) { public XPoint2D move(XPoint2D delta) {
return new XPoint2D(delta.x, delta.y); return new XPoint2D(x + delta.x, y + delta.y);
} }
} }

View File

@ -1,7 +1,6 @@
package net.sourceforge.plantuml.klimt.geom; package net.sourceforge.plantuml.klimt.geom;
public class XRectangle2D { public class XRectangle2D {
// :: remove file when __HAXE__
public final double x; public final double x;
public final double y; public final double y;
@ -80,10 +79,10 @@ public class XRectangle2D {
final XPoint2D b = new XPoint2D(x + width, y); final XPoint2D b = new XPoint2D(x + width, y);
final XPoint2D c = new XPoint2D(x + width, y + height); final XPoint2D c = new XPoint2D(x + width, y + height);
final XPoint2D d = new XPoint2D(x, y + height); final XPoint2D d = new XPoint2D(x, y + height);
final XLine2D line1 = new XLine2D(a, b); final XLine2D line1 = XLine2D.line(a, b);
final XLine2D line2 = new XLine2D(b, c); final XLine2D line2 = XLine2D.line(b, c);
final XLine2D line3 = new XLine2D(c, d); final XLine2D line3 = XLine2D.line(c, d);
final XLine2D line4 = new XLine2D(d, a); final XLine2D line4 = XLine2D.line(d, a);
XPoint2D result = line.intersect(line1); XPoint2D result = line.intersect(line1);
if (result != null) if (result != null)

View File

@ -44,6 +44,7 @@ import net.sourceforge.plantuml.klimt.geom.MinMax;
import net.sourceforge.plantuml.klimt.geom.XRectangle2D; import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
public abstract class AbstractTextBlock implements TextBlock { public abstract class AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
@Override @Override
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) { public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {

View File

@ -46,6 +46,8 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class BigFrame extends AbstractTextBlock { public class BigFrame extends AbstractTextBlock {
// ::remove file when __HAXE__
private final TextBlock title; private final TextBlock title;
private final double width; private final double width;
private final double height; private final double height;

View File

@ -43,6 +43,7 @@ import net.sourceforge.plantuml.klimt.font.UFont;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class CircledCharacter extends AbstractTextBlock implements TextBlock { public class CircledCharacter extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final String c; private final String c;
private final UFont font; private final UFont font;

View File

@ -62,6 +62,7 @@ import net.sourceforge.plantuml.klimt.geom.XCubicCurve2D;
import net.sourceforge.plantuml.klimt.geom.XPoint2D; import net.sourceforge.plantuml.klimt.geom.XPoint2D;
public class DotPath implements UShape, Moveable { public class DotPath implements UShape, Moveable {
// ::remove file when __HAXE__
public static class TriPoints { public static class TriPoints {
public TriPoints(XPoint2D p1, XPoint2D p2, XPoint2D p) { public TriPoints(XPoint2D p1, XPoint2D p2, XPoint2D p) {

View File

@ -59,6 +59,7 @@ import net.sourceforge.plantuml.svek.Margins;
import net.sourceforge.plantuml.svek.ShapeType; import net.sourceforge.plantuml.svek.ShapeType;
public class GraphicStrings extends AbstractTextBlock implements IEntityImage { public class GraphicStrings extends AbstractTextBlock implements IEntityImage {
// ::remove file when __HAXE__
private final double margin = 5; private final double margin = 5;

View File

@ -42,6 +42,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
class SimpleTextBlockBordered extends AbstractTextBlock implements TextBlock { class SimpleTextBlockBordered extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final TextBlock textBlock; private final TextBlock textBlock;
private final HColor color; private final HColor color;

View File

@ -56,6 +56,7 @@ import net.sourceforge.plantuml.klimt.sprite.SpriteContainer;
import net.sourceforge.plantuml.url.Url; import net.sourceforge.plantuml.url.Url;
public class SingleLine extends AbstractTextBlock implements Line { public class SingleLine extends AbstractTextBlock implements Line {
// ::remove file when __HAXE__
private final List<TextBlock> blocs = new ArrayList<>(); private final List<TextBlock> blocs = new ArrayList<>();
private final HorizontalAlignment horizontalAlignment; private final HorizontalAlignment horizontalAlignment;

View File

@ -48,6 +48,7 @@ public interface TextBlock extends UDrawable, UShape {
public XDimension2D calculateDimension(StringBounder stringBounder); public XDimension2D calculateDimension(StringBounder stringBounder);
// ::comment when __HAXE__
public MinMax getMinMax(StringBounder stringBounder); public MinMax getMinMax(StringBounder stringBounder);
public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy); public XRectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy);
@ -55,5 +56,6 @@ public interface TextBlock extends UDrawable, UShape {
public MagneticBorder getMagneticBorder(); public MagneticBorder getMagneticBorder();
public HColor getBackcolor(); public HColor getBackcolor();
// ::done
} }

View File

@ -46,6 +46,7 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.utils.Direction; import net.sourceforge.plantuml.utils.Direction;
public class TextBlockArrow extends AbstractTextBlock implements TextBlock { public class TextBlockArrow extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final double size; private final double size;
private final Direction arrow; private final Direction arrow;

View File

@ -47,6 +47,7 @@ import net.sourceforge.plantuml.klimt.geom.XPoint2D;
import net.sourceforge.plantuml.svek.GuideLine; import net.sourceforge.plantuml.svek.GuideLine;
public class TextBlockArrow2 extends AbstractTextBlock implements TextBlock { public class TextBlockArrow2 extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final double size; private final double size;
private final GuideLine angle; private final GuideLine angle;

View File

@ -47,6 +47,7 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
public class TextBlockBordered extends AbstractTextBlock implements TextBlock { public class TextBlockBordered extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final double cornersize; private final double cornersize;
private final HColor backgroundColor; private final HColor backgroundColor;

View File

@ -40,6 +40,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TextBlockEmpty extends AbstractTextBlock { public class TextBlockEmpty extends AbstractTextBlock {
// ::remove file when __HAXE__
private final double width; private final double width;
private final double height; private final double height;

View File

@ -42,6 +42,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TextBlockGeneric extends AbstractTextBlock implements TextBlock { public class TextBlockGeneric extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final TextBlock textBlock; private final TextBlock textBlock;
private final HColor background; private final HColor background;

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.klimt.geom.VerticalAlignment;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TextBlockHorizontal extends AbstractTextBlock implements TextBlock { public class TextBlockHorizontal extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final List<TextBlock> blocks = new ArrayList<>(); private final List<TextBlock> blocks = new ArrayList<>();
private final VerticalAlignment alignment; private final VerticalAlignment alignment;

View File

@ -44,6 +44,7 @@ import net.sourceforge.plantuml.svek.image.ContainingEllipse;
import net.sourceforge.plantuml.svek.image.Footprint; import net.sourceforge.plantuml.svek.image.Footprint;
public class TextBlockInEllipse extends AbstractTextBlock implements TextBlock { public class TextBlockInEllipse extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final TextBlock text; private final TextBlock text;
private final ContainingEllipse ellipse; private final ContainingEllipse ellipse;

View File

@ -46,6 +46,7 @@ import net.sourceforge.plantuml.svek.Ports;
import net.sourceforge.plantuml.svek.WithPorts; import net.sourceforge.plantuml.svek.WithPorts;
public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock, WithPorts { public class TextBlockLineBefore extends AbstractTextBlock implements TextBlock, WithPorts {
// ::remove file when __HAXE__
private final TextBlock textBlock; private final TextBlock textBlock;
private final char separator; private final char separator;

View File

@ -46,6 +46,7 @@ import net.sourceforge.plantuml.svek.Ports;
import net.sourceforge.plantuml.svek.WithPorts; import net.sourceforge.plantuml.svek.WithPorts;
class TextBlockMarged extends AbstractTextBlock implements TextBlock, WithPorts { class TextBlockMarged extends AbstractTextBlock implements TextBlock, WithPorts {
// ::remove file when __HAXE__
private final TextBlock textBlock; private final TextBlock textBlock;
private final double top; private final double top;

View File

@ -42,6 +42,7 @@ import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
class TextBlockMinWidth extends AbstractTextBlock implements TextBlock { class TextBlockMinWidth extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final TextBlock textBlock; private final TextBlock textBlock;
private final double minWidth; private final double minWidth;

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TextBlockRaw extends AbstractTextBlock implements TextBlock { public class TextBlockRaw extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private List<Line> lines2; private List<Line> lines2;

View File

@ -43,6 +43,7 @@ import net.sourceforge.plantuml.klimt.geom.MinMax;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TextBlockRecentred extends AbstractTextBlock { public class TextBlockRecentred extends AbstractTextBlock {
// ::remove file when __HAXE__
private final TextBlock textBlock; private final TextBlock textBlock;

View File

@ -50,6 +50,7 @@ import net.sourceforge.plantuml.klimt.sprite.SpriteContainer;
import net.sourceforge.plantuml.regex.MyPattern; import net.sourceforge.plantuml.regex.MyPattern;
public final class TextBlockSimple extends AbstractTextBlock implements TextBlock { public final class TextBlockSimple extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private List<Line> lines; private List<Line> lines;

View File

@ -41,6 +41,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TextBlockSprited extends AbstractTextBlock { public class TextBlockSprited extends AbstractTextBlock {
// ::remove file when __HAXE__
private final TextBlock parent; private final TextBlock parent;
private final TextBlock sprite; private final TextBlock sprite;

View File

@ -53,6 +53,7 @@ import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
import net.sourceforge.plantuml.style.ISkinSimple; import net.sourceforge.plantuml.style.ISkinSimple;
public class TextBlockTitle implements TextBlock { public class TextBlockTitle implements TextBlock {
// ::remove file when __HAXE__
private final double outMargin = 2; private final double outMargin = 2;

View File

@ -53,6 +53,7 @@ import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft; import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
public class TextBlockUtils { public class TextBlockUtils {
// ::remove file when __HAXE__
public static final TextBlock EMPTY_TEXT_BLOCK = TextBlockUtils.empty(0, 0); public static final TextBlock EMPTY_TEXT_BLOCK = TextBlockUtils.empty(0, 0);

View File

@ -50,6 +50,7 @@ import net.sourceforge.plantuml.svek.Ports;
import net.sourceforge.plantuml.svek.WithPorts; import net.sourceforge.plantuml.svek.WithPorts;
public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock, WithPorts { public class TextBlockVertical2 extends AbstractTextBlock implements TextBlock, WithPorts {
// ::remove file when __HAXE__
private final List<TextBlock> blocks = new ArrayList<>(); private final List<TextBlock> blocks = new ArrayList<>();
private final HorizontalAlignment horizontalAlignment; private final HorizontalAlignment horizontalAlignment;

View File

@ -46,6 +46,7 @@ import net.sourceforge.plantuml.klimt.geom.XRectangle2D;
import net.sourceforge.plantuml.url.Url; import net.sourceforge.plantuml.url.Url;
public class TextBlockWithUrl implements TextBlock { public class TextBlockWithUrl implements TextBlock {
// ::remove file when __HAXE__
private final TextBlock block; private final TextBlock block;
private final Url url; private final Url url;

View File

@ -47,6 +47,7 @@ import net.sourceforge.plantuml.klimt.geom.ImgValign;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TileImage extends AbstractTextBlock implements TextBlock { public class TileImage extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final BufferedImage image; private final BufferedImage image;
private final int vspace; private final int vspace;

View File

@ -40,6 +40,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class TileImageSvg extends AbstractTextBlock implements TextBlock { public class TileImageSvg extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final UImageSvg svg; private final UImageSvg svg;
private final double scale; private final double scale;

View File

@ -46,6 +46,7 @@ import net.sourceforge.plantuml.url.Url;
import net.sourceforge.plantuml.utils.Log; import net.sourceforge.plantuml.utils.Log;
public class TileText extends AbstractTextBlock implements TextBlock { public class TileText extends AbstractTextBlock implements TextBlock {
// ::remove file when __HAXE__
private final String text; private final String text;
private final FontConfiguration fontConfiguration; private final FontConfiguration fontConfiguration;

View File

@ -39,6 +39,7 @@ import net.sourceforge.plantuml.klimt.UShape;
import net.sourceforge.plantuml.klimt.font.UFont; import net.sourceforge.plantuml.klimt.font.UFont;
public class UCenteredCharacter implements UShape { public class UCenteredCharacter implements UShape {
// ::remove file when __HAXE__
private final char c; private final char c;
private final UFont font; private final UFont font;

View File

@ -39,6 +39,8 @@ import net.sourceforge.plantuml.klimt.drawing.UGraphic;
public interface UDrawable { public interface UDrawable {
// ::comment when __HAXE__
public void drawU(UGraphic ug); public void drawU(UGraphic ug);
// ::done
} }

View File

@ -41,6 +41,7 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.klimt.geom.XPoint2D; import net.sourceforge.plantuml.klimt.geom.XPoint2D;
public class UEllipse extends AbstractShadowable implements UShapeSized { public class UEllipse extends AbstractShadowable implements UShapeSized {
// ::remove file when __HAXE__
private final double width; private final double width;
private final double height; private final double height;

View File

@ -44,7 +44,7 @@ import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class UHorizontalLine implements UShape { public class UHorizontalLine implements UShape {
// ::remove folder when __HAXE__ // ::remove file when __HAXE__
private final double skipAtStart; private final double skipAtStart;
private final double skipAtEnd; private final double skipAtEnd;

View File

@ -42,6 +42,7 @@ import net.sourceforge.plantuml.klimt.MutableImage;
import net.sourceforge.plantuml.klimt.UShape; import net.sourceforge.plantuml.klimt.UShape;
public class UImage implements UShape { public class UImage implements UShape {
// ::remove file when __HAXE__
private final MutableImage image; private final MutableImage image;
private final String formula; private final String formula;

View File

@ -43,6 +43,7 @@ import net.sourceforge.plantuml.klimt.UShape;
import net.sourceforge.plantuml.utils.SignatureUtils; import net.sourceforge.plantuml.utils.SignatureUtils;
public class UImageSvg implements UShape { public class UImageSvg implements UShape {
// ::remove file when __HAXE__
private final String svg; private final String svg;
private final double scale; private final double scale;

View File

@ -35,7 +35,9 @@
*/ */
package net.sourceforge.plantuml.klimt.shape; package net.sourceforge.plantuml.klimt.shape;
//::comment when __HAXE__
import java.awt.geom.AffineTransform; import java.awt.geom.AffineTransform;
//::done
import net.sourceforge.plantuml.klimt.AbstractShadowable; import net.sourceforge.plantuml.klimt.AbstractShadowable;
import net.sourceforge.plantuml.klimt.UShapeSized; import net.sourceforge.plantuml.klimt.UShapeSized;
@ -55,6 +57,7 @@ public class ULine extends AbstractShadowable implements UShapeSized {
this.dy = dy; this.dy = dy;
} }
// ::comment when __HAXE__
public ULine rotate(double theta) { public ULine rotate(double theta) {
if (theta == 0) if (theta == 0)
return this; return this;
@ -62,6 +65,7 @@ public class ULine extends AbstractShadowable implements UShapeSized {
final XPoint2D tmp = new XPoint2D(dx, dy).transform(rot); final XPoint2D tmp = new XPoint2D(dx, dy).transform(rot);
return new ULine(tmp.getX(), tmp.getY()); return new ULine(tmp.getX(), tmp.getY());
} }
// ::done
public static ULine hline(double dx) { public static ULine hline(double dx) {
return new ULine(dx, 0); return new ULine(dx, 0);

View File

@ -45,6 +45,7 @@ import net.sourceforge.plantuml.klimt.geom.MinMax;
import net.sourceforge.plantuml.klimt.geom.XPoint2D; import net.sourceforge.plantuml.klimt.geom.XPoint2D;
public class UPolygon extends AbstractShadowable { public class UPolygon extends AbstractShadowable {
// ::remove file when __HAXE__
private final List<XPoint2D> all = new ArrayList<XPoint2D>(); private final List<XPoint2D> all = new ArrayList<XPoint2D>();
private final String name; private final String name;

View File

@ -48,6 +48,7 @@ import net.sourceforge.plantuml.klimt.geom.MinMax;
import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class URectangle extends AbstractShadowable implements UShapeSized, UShapeIgnorableForCompression { public class URectangle extends AbstractShadowable implements UShapeSized, UShapeIgnorableForCompression {
// ::remove file when __HAXE__
private final double width; private final double width;
private final double height; private final double height;

View File

@ -40,6 +40,7 @@ import net.sourceforge.plantuml.klimt.font.FontConfiguration;
import net.sourceforge.plantuml.klimt.font.StringBounder; import net.sourceforge.plantuml.klimt.font.StringBounder;
public class UText implements UShape { public class UText implements UShape {
// ::remove file when __HAXE__
private final String text; private final String text;
private final FontConfiguration font; private final FontConfiguration font;

View File

@ -195,7 +195,7 @@ class TurtleGraphicsPane {
} }
drawTurtle(ug); drawTurtle(ug);
if (message != null) { if (message != null) {
final FontConfiguration font = FontConfiguration.blackBlueTrue(new UFont("", Font.PLAIN, 14)); final FontConfiguration font = FontConfiguration.blackBlueTrue(UFont.build("", Font.PLAIN, 14));
final TextBlock text = Display.create(message).create(font, HorizontalAlignment.LEFT, final TextBlock text = Display.create(message).create(font, HorizontalAlignment.LEFT,
new SpriteContainerEmpty()); new SpriteContainerEmpty());
final XDimension2D dim = text.calculateDimension(ug.getStringBounder()); final XDimension2D dim = text.calculateDimension(ug.getStringBounder());

View File

@ -127,7 +127,7 @@ public class FingerImpl implements Finger, UDrawable {
else else
p2 = new XPoint2D(direction * (dimPhalanx.getWidth() + getX12()), stp.getY()); p2 = new XPoint2D(direction * (dimPhalanx.getWidth() + getX12()), stp.getY());
child.drawU(ug.apply(new UTranslate(p2))); child.drawU(ug.apply(UTranslate.point(p2)));
final HColor linkColor = getLinkColor(); final HColor linkColor = getLinkColor();
if (linkColor.isTransparent() == false) if (linkColor.isTransparent() == false)
drawLine(ug.apply(linkColor).apply(getUStroke()), p1, p2); drawLine(ug.apply(linkColor).apply(getUStroke()), p1, p2);

View File

@ -49,10 +49,10 @@ public class LineRectIntersection {
final XPoint2D p3 = new XPoint2D(rect.getMaxX(), rect.getMaxY()); final XPoint2D p3 = new XPoint2D(rect.getMaxX(), rect.getMaxY());
final XPoint2D p4 = new XPoint2D(rect.getMinX(), rect.getMaxY()); final XPoint2D p4 = new XPoint2D(rect.getMinX(), rect.getMaxY());
final XPoint2D inter1 = new LineSegmentIntersection(new XLine2D(p1, p2), line).getIntersection(); final XPoint2D inter1 = new LineSegmentIntersection(XLine2D.line(p1, p2), line).getIntersection();
final XPoint2D inter2 = new LineSegmentIntersection(new XLine2D(p2, p3), line).getIntersection(); final XPoint2D inter2 = new LineSegmentIntersection(XLine2D.line(p2, p3), line).getIntersection();
final XPoint2D inter3 = new LineSegmentIntersection(new XLine2D(p3, p4), line).getIntersection(); final XPoint2D inter3 = new LineSegmentIntersection(XLine2D.line(p3, p4), line).getIntersection();
final XPoint2D inter4 = new LineSegmentIntersection(new XLine2D(p4, p1), line).getIntersection(); final XPoint2D inter4 = new LineSegmentIntersection(XLine2D.line(p4, p1), line).getIntersection();
final XPoint2D o = line.getP1(); final XPoint2D o = line.getP1();
inter = getCloser(o, inter1, inter2, inter3, inter4); inter = getCloser(o, inter1, inter2, inter3, inter4);

View File

@ -49,7 +49,7 @@ public class RacorderFollowTangeanteOld extends RacorderAbstract implements Raco
final DotPath result = new DotPath(); final DotPath result = new DotPath();
final XPoint2D center = new XPoint2D(rect.getCenterX(), rect.getCenterY()); final XPoint2D center = new XPoint2D(rect.getCenterX(), rect.getCenterY());
final XLine2D line = new XLine2D(tangeante.getP1(), center); final XLine2D line = XLine2D.line(tangeante.getP1(), center);
final XPoint2D inter = BezierUtils.intersect(line, rect); final XPoint2D inter = BezierUtils.intersect(line, rect);
final XCubicCurve2D curv = new XCubicCurve2D(tangeante.getX1(), tangeante.getY1(), tangeante.getX2(), final XCubicCurve2D curv = new XCubicCurve2D(tangeante.getX1(), tangeante.getY1(), tangeante.getX2(),

View File

@ -49,7 +49,7 @@ public class RacorderInToCenter extends RacorderAbstract implements Racorder {
final DotPath result = new DotPath(); final DotPath result = new DotPath();
final XPoint2D center = new XPoint2D(rect.getCenterX(), rect.getCenterY()); final XPoint2D center = new XPoint2D(rect.getCenterX(), rect.getCenterY());
final XLine2D line = new XLine2D(tangeante.getP1(), center); final XLine2D line = XLine2D.line(tangeante.getP1(), center);
final XPoint2D inter = BezierUtils.intersect(line, rect); final XPoint2D inter = BezierUtils.intersect(line, rect);
final XCubicCurve2D curv = new XCubicCurve2D(line.getX1(), line.getY1(), line.getX1(), line.getY1(), final XCubicCurve2D curv = new XCubicCurve2D(line.getX1(), line.getY1(), line.getX1(), line.getY1(),

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