net.sourceforge.plantuml.definition.PSystemDefinition 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.definition;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.PlainDiagram;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.UmlSource;
import net.sourceforge.plantuml.klimt.color.HColors;
import net.sourceforge.plantuml.klimt.creole.Display;
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
import net.sourceforge.plantuml.klimt.font.UFont;
import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment;
import net.sourceforge.plantuml.klimt.shape.UDrawable;
import net.sourceforge.plantuml.klimt.sprite.SpriteContainerEmpty;
public class PSystemDefinition extends PlainDiagram implements UDrawable {
// ::remove folder when __HAXE__
// ::remove folder when __CORE__
private final List lines = new ArrayList<>();
private final String startLine;
public PSystemDefinition(UmlSource source, String startLine) {
super(source);
this.startLine = startLine;
}
public DiagramDescription getDescription() {
return new DiagramDescription("(Definition)");
}
@Override
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException {
return this;
}
public void drawU(UGraphic ug) {
final UFont font = UFont.sansSerif(14);
final FontConfiguration fc = FontConfiguration.create(font, HColors.BLACK, HColors.BLACK, null);
Display.getWithNewlines(startLine).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()).drawU(ug);
}
public void doCommandLine(String line) {
this.lines.add(line);
}
}