net.sourceforge.plantuml.svek.extremity.ExtremityFactoryParenthesis 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.svek.extremity;
import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.klimt.geom.Side;
import net.sourceforge.plantuml.klimt.geom.XPoint2D;
import net.sourceforge.plantuml.klimt.shape.UDrawable;
import net.sourceforge.plantuml.svek.AbstractExtremityFactory;
public class ExtremityFactoryParenthesis extends AbstractExtremityFactory implements ExtremityFactory {
@Override
public UDrawable createUDrawable(XPoint2D p0, double angle, Side side) {
return new ExtremityParenthesis(p0, angle - Math.PI / 2);
}
@Override
public UDrawable createUDrawable(XPoint2D p0, XPoint2D p1, XPoint2D p2, Side side) {
final double ortho = atan2(p0, p2);
if (OptionFlags.USE_INTERFACE_EYE2) {
final XPoint2D center = new XPoint2D((p0.getX() + p2.getX()) / 2, (p0.getY() + p2.getY()) / 2);
return new ExtremityParenthesis2(center, ortho, p1);
}
return new ExtremityParenthesis(p1, ortho);
}
}