net.sourceforge.plantuml.openiconic.PSystemListOpenIconic 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.openiconic;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
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.donors.PSystemDonors;
import net.sourceforge.plantuml.klimt.geom.VerticalAlignment;
import net.sourceforge.plantuml.klimt.shape.TextBlock;
import net.sourceforge.plantuml.klimt.shape.TextBlockHorizontal;
import net.sourceforge.plantuml.klimt.shape.UDrawable;
import net.sourceforge.plantuml.openiconic.data.DummyIcon;
public class PSystemListOpenIconic extends PlainDiagram {
// ::remove file when __CORE__
public PSystemListOpenIconic(UmlSource source) {
super(source);
}
@Override
protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IOException {
final List lines = new ArrayList<>();
lines.add("List Open Iconic");
lines.add("Credit to");
lines.add("https://useiconic.com/open");
lines.add(" ");
try (BufferedReader br = new BufferedReader(new InputStreamReader(getResourceAllTxt()))) {
String s = null;
while ((s = br.readLine()) != null) {
// lines.add("<¥> " + s);
// System.err.println("s=" + s);
lines.add("<&" + s + "> " + s);
}
}
final List cols = PSystemDonors.getCols(lines, 7, 0);
return new TextBlockHorizontal(cols, VerticalAlignment.TOP);
}
private InputStream getResourceAllTxt() {
return DummyIcon.class.getResourceAsStream("all.txt");
}
public DiagramDescription getDescription() {
return new DiagramDescription("(Open iconic)");
}
}