net.sourceforge.plantuml.klimt.drawing.tikz.DriverAtomTextTikz 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.klimt.drawing.tikz;
import net.sourceforge.plantuml.klimt.UParam;
import net.sourceforge.plantuml.klimt.color.ColorMapper;
import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.creole.legacy.AtomText;
import net.sourceforge.plantuml.klimt.drawing.UDriver;
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
import net.sourceforge.plantuml.klimt.font.FontStyle;
import net.sourceforge.plantuml.klimt.font.UFont;
import net.sourceforge.plantuml.tikz.TikzGraphics;
public class DriverAtomTextTikz implements UDriver {
// ::remove folder when __CORE__
public void draw(AtomText text, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
final FontConfiguration fontConfiguration = text.getFontConfiguration();
final UFont font = fontConfiguration.getFont();
final HColor col = fontConfiguration.getColor();
tikz.setStrokeColor(col);
final boolean underline = fontConfiguration.containsStyle(FontStyle.UNDERLINE);
final boolean italic = font.isItalic();
final boolean bold = font.isBold();
tikz.text(x, y, text.getText(), underline, italic, bold);
}
}