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

net.sourceforge.plantuml.klimt.shape.SimpleTextBlockBordered 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.klimt.shape;

import net.sourceforge.plantuml.klimt.UTranslate;
import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.geom.XDimension2D;

class SimpleTextBlockBordered extends AbstractTextBlock implements TextBlock {
    // ::remove file when __HAXE__

	private final TextBlock textBlock;
	private final HColor color;

	public SimpleTextBlockBordered(TextBlock textBlock, HColor color) {
		this.textBlock = textBlock;
		this.color = color;
	}

	public XDimension2D calculateDimension(StringBounder stringBounder) {
		final XDimension2D dim = textBlock.calculateDimension(stringBounder);
		return dim.delta(1, 1);
	}

	public void drawU(UGraphic ug) {
		final XDimension2D dim = textBlock.calculateDimension(ug.getStringBounder());
		textBlock.drawU(ug.apply(new UTranslate(1, 1)));
		ug.apply(color).draw(URectangle.build(dim.getWidth(), dim.getHeight()));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy