1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00
This commit is contained in:
Arnaud Roques 2022-07-29 14:43:01 +02:00
parent dd53272c19
commit 1b89a48f46
6 changed files with 22 additions and 21 deletions

View File

@ -61,7 +61,9 @@ public class SvgNanoParser implements Sprite {
if (s.contains("<path") || s.contains("<g ") || s.contains("<g>") || s.contains("</g>") if (s.contains("<path") || s.contains("<g ") || s.contains("<g>") || s.contains("</g>")
|| s.contains("<circle ") || s.contains("<ellipse ")) || s.contains("<circle ") || s.contains("<ellipse "))
data.add(s); data.add(s);
else else if (s.startsWith("<svg") || s.startsWith("</svg")) {
// Ignore
} else
System.err.println("???=" + s); System.err.println("???=" + s);
} }
} }

View File

@ -154,20 +154,17 @@ public class EntityImageClassHeader extends AbstractEntityImage {
final LeafType leafType = entity.getLeafType(); final LeafType leafType = entity.getLeafType();
final Style style = spotStyleSignature(leafType).getMergedStyle(skinParam.getCurrentStyleBuilder()); final Style style = spotStyleSignature(leafType).getMergedStyle(skinParam.getCurrentStyleBuilder());
HColor spotBorder = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), final HColor spotBorder = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
final HColor spotBackColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(), final HColor spotBackColor = style.value(PName.BackGroundColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
final HColor classBorder = SkinParamUtils.getColor(getSkinParam(), stereotype, ColorParam.classBorder);
final HColor fontColor = style.value(PName.FontColor).asColor(skinParam.getThemeStyle(), final HColor fontColor = style.value(PName.FontColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet()); skinParam.getIHtmlColorSet());
if (stereotype != null && stereotype.getCharacter() != 0) if (stereotype != null && stereotype.getCharacter() != 0)
return new CircledCharacter(stereotype.getCharacter(), getSkinParam().getCircledCharacterRadius(), font, return new CircledCharacter(stereotype.getCharacter(), getSkinParam().getCircledCharacterRadius(), font,
stereotype.getHtmlColor(), classBorder, fontColor); stereotype.getHtmlColor(), spotBorder, fontColor);
if (spotBorder == null)
spotBorder = classBorder;
char circledChar = 0; char circledChar = 0;
if (stereotype != null) if (stereotype != null)

View File

@ -107,19 +107,19 @@ public class Opale extends AbstractTextBlock implements TextBlock {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
ug = ug.apply(noteBackgroundColor.bg()).apply(borderColor); ug = ug.apply(noteBackgroundColor.bg()).apply(borderColor);
final UPath polygon; final UPath polygon;
if (withLink == false) { if (withLink == false)
polygon = getPolygonNormal(stringBounder); polygon = getPolygonNormal(stringBounder);
} else if (strategy == Direction.LEFT) { else if (strategy == Direction.LEFT)
polygon = getPolygonLeft(stringBounder, pp1, pp2); polygon = getPolygonLeft(stringBounder, pp1, pp2);
} else if (strategy == Direction.RIGHT) { else if (strategy == Direction.RIGHT)
polygon = getPolygonRight(stringBounder, pp1, pp2); polygon = getPolygonRight(stringBounder, pp1, pp2);
} else if (strategy == Direction.UP) { else if (strategy == Direction.UP)
polygon = getPolygonUp(stringBounder, pp1, pp2); polygon = getPolygonUp(stringBounder, pp1, pp2);
} else if (strategy == Direction.DOWN) { else if (strategy == Direction.DOWN)
polygon = getPolygonDown(stringBounder, pp1, pp2); polygon = getPolygonDown(stringBounder, pp1, pp2);
} else { else
throw new IllegalArgumentException(); throw new IllegalArgumentException();
}
polygon.setDeltaShadow(shadowing2); polygon.setDeltaShadow(shadowing2);
if (stroke != null) if (stroke != null)
ug = ug.apply(stroke); ug = ug.apply(stroke);

View File

@ -35,12 +35,12 @@
*/ */
package net.sourceforge.plantuml.ugraphic; package net.sourceforge.plantuml.ugraphic;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
@ -56,14 +56,16 @@ public class PlacementStrategyVisibility extends AbstractPlacementStrategy {
public Map<TextBlock, Point2D> getPositions(double width, double height) { public Map<TextBlock, Point2D> getPositions(double width, double height) {
final Map<TextBlock, Point2D> result = new LinkedHashMap<TextBlock, Point2D>(); final Map<TextBlock, Point2D> result = new LinkedHashMap<TextBlock, Point2D>();
double y = 0; double y = 0;
for (final Iterator<Map.Entry<TextBlock, Dimension2D>> it = getDimensions().entrySet().iterator(); it.hasNext();) { for (final Iterator<Map.Entry<TextBlock, Dimension2D>> it = getDimensions().entrySet().iterator(); it
.hasNext();) {
final Map.Entry<TextBlock, Dimension2D> ent1 = it.next(); final Map.Entry<TextBlock, Dimension2D> ent1 = it.next();
final Map.Entry<TextBlock, Dimension2D> ent2 = it.next(); final Map.Entry<TextBlock, Dimension2D> ent2 = it.next();
final double height1 = ent1.getValue().getHeight(); final double height1 = ent1.getValue().getHeight();
final double height2 = ent2.getValue().getHeight(); final double height2 = ent2.getValue().getHeight();
final double maxHeight12 = Math.max(height1, height2); final double maxHeight12 = Math.max(height1, height2);
// result.put(ent1.getKey(), new Point2D.Double(0, 2 + y + (maxHeight - height1) / 2));
result.put(ent1.getKey(), new Point2D.Double(0, 2 + y)); result.put(ent1.getKey(), new Point2D.Double(0, 2 + y + (maxHeight12 - height1) / 2));
result.put(ent2.getKey(), new Point2D.Double(col2, y + (maxHeight12 - height2) / 2)); result.put(ent2.getKey(), new Point2D.Double(col2, y + (maxHeight12 - height2) / 2));
y += maxHeight12; y += maxHeight12;
} }

View File

@ -69,9 +69,9 @@ public class ULayoutGroup {
public Rectangle2D getInnerPosition(String member, double width, double height, StringBounder stringBounder) { public Rectangle2D getInnerPosition(String member, double width, double height, StringBounder stringBounder) {
final Set<Entry<TextBlock, Point2D>> all = placementStrategy.getPositions(width, height).entrySet(); final Set<Entry<TextBlock, Point2D>> all = placementStrategy.getPositions(width, height).entrySet();
Rectangle2D result = tryOne(all, member, stringBounder, InnerStrategy.STRICT); Rectangle2D result = tryOne(all, member, stringBounder, InnerStrategy.STRICT);
if (result == null) { if (result == null)
result = tryOne(all, member, stringBounder, InnerStrategy.LAZZY); result = tryOne(all, member, stringBounder, InnerStrategy.LAZZY);
}
return result; return result;
} }

View File

@ -80,7 +80,7 @@ public class Version {
} }
public static int beta() { public static int beta() {
final int beta = 8; final int beta = 9;
return beta; return beta;
} }