net.sourceforge.plantuml.klimt.drawing.svg.DriverPixelSvg 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.svg;
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.color.HColorGradient;
import net.sourceforge.plantuml.klimt.drawing.UDriver;
import net.sourceforge.plantuml.klimt.shape.UPixel;
public class DriverPixelSvg implements UDriver {
// ::remove file when __HAXE__
public void draw(UPixel pixel, double x, double y, ColorMapper mapper, UParam param, SvgGraphics svg) {
final HColor color = param.getColor();
if (color instanceof HColorGradient) {
final HColorGradient gr = (HColorGradient) color;
svg.setStrokeColor(gr.getColor1().toSvg(mapper));
} else {
svg.setStrokeColor(color.toSvg(mapper));
}
svg.setStrokeWidth(0.5, "");
svg.svgRectangle(x, y, 0.5, 0.5, 0, 0, 0, null, null);
}
}