![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.plantuml.klimt.geom.PlacementStrategyX1X2 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.geom;
import java.util.LinkedHashMap;
import java.util.Map;
import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.klimt.shape.TextBlock;
public class PlacementStrategyX1X2 extends AbstractPlacementStrategy {
// ::remove file when __HAXE__
public PlacementStrategyX1X2(StringBounder stringBounder) {
super(stringBounder);
}
public Map getPositions(double width, double height) {
final double usedWidth = getSumWidth();
// double maxHeight = getMaxHeight();
final double space = (width - usedWidth) / (getDimensions().size() + 1);
final Map result = new LinkedHashMap<>();
double x = space;
for (Map.Entry ent : getDimensions().entrySet()) {
final double y = (height - ent.getValue().getHeight()) / 2;
result.put(ent.getKey(), new XPoint2D(x, y));
x += ent.getValue().getWidth() + space;
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy