net.sourceforge.plantuml.klimt.shape.UText 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.shape;
import net.sourceforge.plantuml.klimt.UShape;
import net.sourceforge.plantuml.klimt.font.FontConfiguration;
import net.sourceforge.plantuml.klimt.font.StringBounder;
public class UText implements UShape {
private final String text;
private final FontConfiguration font;
private final int orientation;
@Override
public String toString() {
return "UText[" + text + "]";
}
private UText(String text, FontConfiguration font, int orientation) {
assert text.indexOf('\t') == -1;
this.text = text;
this.font = font;
this.orientation = orientation;
}
public static UText build(String text, FontConfiguration font) {
return new UText(text, font, 0);
}
public UText withOrientation(int orientation) {
return new UText(text, font, orientation);
}
public String getText() {
return text;
}
public FontConfiguration getFontConfiguration() {
return font;
}
// ::comment when __HAXE__
public double getDescent(StringBounder stringBounder) {
return stringBounder.getDescent(font.getFont(), text);
}
public final int getOrientation() {
return orientation;
}
}