net.sourceforge.plantuml.golem.MinMaxGolem 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.golem;
public class MinMaxGolem {
private int minX = Integer.MAX_VALUE;
private int minY = Integer.MAX_VALUE;
private int maxX = Integer.MIN_VALUE;
private int maxY = Integer.MIN_VALUE;
public void manage(int x, int y) {
if (x < minX) {
minX = x;
}
if (y < minY) {
minY = y;
}
if (x > maxX) {
maxX = x;
}
if (y > maxY) {
maxY = y;
}
}
public void manage(Position position) {
manage(position.getXmin(), position.getYmin());
manage(position.getXmax(), position.getYmax());
}
public int getMinX() {
return minX;
}
public int getMinY() {
return minY;
}
public int getWidth() {
return maxX - minX + 1;
}
public int getHeight() {
return maxY - minY + 1;
}
}