All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.openiconic.PSystemListOpenIconic Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// 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)");
	}

}