net.sourceforge.plantuml.utils.Position 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.utils;
import java.util.Objects;
import net.sourceforge.plantuml.klimt.geom.Rankdir;
public enum Position {
RIGHT, LEFT, BOTTOM, TOP;
public static Position fromString(String s) {
return Position.valueOf(s.toUpperCase());
}
public Position withRankdir(Rankdir rankdir) {
// Default
if (Objects.requireNonNull(rankdir) == Rankdir.TOP_TO_BOTTOM)
return this;
if (this == RIGHT)
return BOTTOM;
if (this == LEFT)
return TOP;
if (this == BOTTOM)
return RIGHT;
if (this == TOP)
return LEFT;
throw new IllegalStateException();
}
public Direction reverseDirection() {
if (this == LEFT)
return Direction.RIGHT;
if (this == RIGHT)
return Direction.LEFT;
throw new UnsupportedOperationException();
}
}