net.sourceforge.plantuml.sequencediagram.teoz.CommunicationTileNoteTop 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.teoz;
import net.sourceforge.plantuml.klimt.UTranslate;
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.UDrawable;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.Context2D;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.ISkinParam;
public class CommunicationTileNoteTop extends CommunicationTileNoteBottomTopAbstract {
public CommunicationTileNoteTop(Tile tile, AbstractMessage message, Rose skin, ISkinParam skinParam,
Note noteOnMessage, YGauge currentY) {
super(tile, message, skin, skinParam, noteOnMessage, currentY);
}
@Override
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Component comp = getComponent(stringBounder);
final XDimension2D dim = comp.getPreferredDimension(stringBounder);
final Area area = Area.create(dim.getWidth(), dim.getHeight());
((UDrawable) tile).drawU(ug.apply(UTranslate.dy(dim.getHeight() + spacey)));
if (YGauge.USE_ME)
ug = ug.apply(UTranslate.dy(getYGauge().getMin().getCurrentValue()));
final double middleMsg = (tile.getMinX().getCurrentValue() + tile.getMaxX().getCurrentValue()) / 2;
final double xNote = getNotePosition(stringBounder).getCurrentValue();
comp.drawU(ug.apply(UTranslate.dx(xNote)), area, (Context2D) ug);
drawLine(ug, middleMsg, tile.getContactPointRelative() + dim.getHeight() + spacey, xNote + dim.getWidth() / 2,
dim.getHeight() - 2 * Rose.paddingY);
}
}