net.sourceforge.plantuml.svek.image.AbstractEntityImageBorder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.svek.image;
import net.sourceforge.plantuml.abel.Entity;
import net.sourceforge.plantuml.abel.EntityPosition;
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
import net.sourceforge.plantuml.klimt.font.FontParam;
import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
import net.sourceforge.plantuml.klimt.geom.Rankdir;
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.klimt.shape.TextBlock;
import net.sourceforge.plantuml.stereo.Stereotype;
import net.sourceforge.plantuml.style.ISkinParam;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.svek.Cluster;
import net.sourceforge.plantuml.svek.ShapeType;
public abstract class AbstractEntityImageBorder extends AbstractEntityImage {
public final EntityPosition entityPosition;
protected final Cluster parent;
protected final Bibliotekon bibliotekon;
protected final Rankdir rankdir;
protected abstract StyleSignatureBasic getSignature();
final protected Style getStyle() {
final Stereotype stereotype = getEntity().getStereotype();
return getSignature().withTOBECHANGED(stereotype).getMergedStyle(getSkinParam().getCurrentStyleBuilder());
}
AbstractEntityImageBorder(Entity leaf, ISkinParam skinParam, Cluster parent, Bibliotekon bibliotekon,
FontParam fontParam) {
super(leaf, skinParam);
this.parent = parent;
this.bibliotekon = bibliotekon;
this.entityPosition = leaf.getEntityPosition();
this.rankdir = skinParam.getRankdir();
if (entityPosition == EntityPosition.NORMAL)
throw new IllegalArgumentException();
}
protected final TextBlock getDesc() {
final Entity leaf = (Entity) getEntity();
final FontConfiguration fc = FontConfiguration.create(getSkinParam(), getStyle());
return leaf.getDisplay().create(fc, HorizontalAlignment.CENTER, getSkinParam());
}
public XDimension2D calculateDimension(StringBounder stringBounder) {
return entityPosition.getDimension(rankdir);
}
public ShapeType getShapeType() {
return entityPosition.getShapeType();
}
}