1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 13:05:09 +00:00

Minor fixes

This commit is contained in:
Arnaud Roques 2021-11-24 18:55:06 +01:00
parent d83b8f76f7
commit 160a356c68
3 changed files with 17 additions and 2 deletions

View File

@ -40,6 +40,7 @@ import java.util.List;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.command.Command; import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandFootboxIgnored;
import net.sourceforge.plantuml.command.PSystemCommandFactory; import net.sourceforge.plantuml.command.PSystemCommandFactory;
import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.DiagramType;
import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.core.UmlSource;
@ -68,6 +69,7 @@ public class NwDiagramFactory extends PSystemCommandFactory {
cmds.add(new CommandLink()); cmds.add(new CommandLink());
cmds.add(new CommandProperty()); cmds.add(new CommandProperty());
cmds.add(new CommandEndSomething()); cmds.add(new CommandEndSomething());
cmds.add(new CommandFootboxIgnored());
return cmds; return cmds;
} }

View File

@ -67,7 +67,9 @@ import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.svek.AbstractEntityImage; import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.Ports;
import net.sourceforge.plantuml.svek.ShapeType; import net.sourceforge.plantuml.svek.ShapeType;
import net.sourceforge.plantuml.svek.WithPorts;
import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2; import net.sourceforge.plantuml.ugraphic.PlacementStrategyY1Y2;
import net.sourceforge.plantuml.ugraphic.Shadowable; import net.sourceforge.plantuml.ugraphic.Shadowable;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
@ -79,7 +81,7 @@ import net.sourceforge.plantuml.ugraphic.UStroke;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColor;
public class EntityImageObject extends AbstractEntityImage implements Stencil { public class EntityImageObject extends AbstractEntityImage implements Stencil, WithPorts {
final private TextBlock name; final private TextBlock name;
final private TextBlock stereo; final private TextBlock stereo;
@ -241,6 +243,9 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil {
} }
public ShapeType getShapeType() { public ShapeType getShapeType() {
if (((ILeaf) getEntity()).getPortShortNames().size() > 0) {
return ShapeType.RECTANGLE_HTML_FOR_PORTS;
}
return ShapeType.RECTANGLE; return ShapeType.RECTANGLE;
} }
@ -252,4 +257,12 @@ public class EntityImageObject extends AbstractEntityImage implements Stencil {
return calculateDimension(stringBounder).getWidth(); return calculateDimension(stringBounder).getWidth();
} }
@Override
public Ports getPorts(StringBounder stringBounder) {
final Dimension2D dimHeader = getNameAndSteretypeDimension(stringBounder);
if (fields instanceof WithPorts)
return ((WithPorts) fields).getPorts(stringBounder).translateY(dimHeader.getHeight());
return new Ports();
}
} }

View File

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