![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.sequencediagram.graphic.LifeDestroy 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.sequencediagram.graphic;
import net.sourceforge.plantuml.klimt.UTranslate;
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.Context2D;
public class LifeDestroy extends GraphicalElement {
private final ParticipantBox participant;
private final Component comp;
public LifeDestroy(double startingY, ParticipantBox participant, Component comp) {
super(startingY);
this.participant = participant;
this.comp = comp;
}
@Override
protected void drawInternalU(UGraphic ug, double maxX, Context2D context) {
final StringBounder stringBounder = ug.getStringBounder();
ug = ug.apply(new UTranslate(getStartingX(stringBounder), getStartingY()));
comp.drawU(ug, null, context);
}
@Override
public double getPreferredHeight(StringBounder stringBounder) {
return comp.getPreferredHeight(stringBounder);
}
@Override
public double getPreferredWidth(StringBounder stringBounder) {
return comp.getPreferredWidth(stringBounder);
}
@Override
public double getStartingX(StringBounder stringBounder) {
return participant.getCenterX(stringBounder) - getPreferredWidth(stringBounder) / 2.0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy