net.sourceforge.plantuml.svek.image.EntityImageCircleEnd 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.klimt.UShape;
import net.sourceforge.plantuml.klimt.UTranslate;
import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.color.HColors;
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.klimt.shape.UEllipse;
import net.sourceforge.plantuml.style.ISkinParam;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignatureBasic;
import net.sourceforge.plantuml.svek.AbstractEntityImage;
import net.sourceforge.plantuml.svek.ShapeType;
public class EntityImageCircleEnd extends AbstractEntityImage {
private static final int SIZE = 20;
public StyleSignatureBasic getDefaultStyleDefinitionCircle() {
return StyleSignatureBasic.of(SName.root, SName.element, getSkinParam().getUmlDiagramType().getStyleName(),
SName.circle, SName.end);
}
public EntityImageCircleEnd(Entity entity, ISkinParam skinParam) {
super(entity, skinParam);
}
public XDimension2D calculateDimension(StringBounder stringBounder) {
return new XDimension2D(SIZE, SIZE);
}
final public void drawU(UGraphic ug) {
final UEllipse circle = UEllipse.build(SIZE, SIZE);
final Style style = getDefaultStyleDefinitionCircle().getMergedStyle(getSkinParam().getCurrentStyleBuilder());
HColor color = getEntity().getColors().getColor(ColorType.BACK);
if (color == null)
color = style.value(PName.LineColor).asColor(getSkinParam().getIHtmlColorSet());
final double shadowing = style.value(PName.Shadowing).asDouble();
circle.setDeltaShadow(shadowing);
ug.apply(HColors.none().bg()).apply(color).draw(circle);
final double delta = 4;
final UShape circleSmall = UEllipse.build(SIZE - delta * 2, SIZE - delta * 2);
ug.apply(color.bg()).apply(HColors.none()).apply(new UTranslate(delta + 0.5, delta + 0.5)).draw(circleSmall);
}
public ShapeType getShapeType() {
return ShapeType.CIRCLE;
}
}