All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.sequencediagram.graphic.GroupingGraphicalElement Maven / Gradle / Ivy

There is a newer version: 1.2025.0
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.sequencediagram.graphic;

import java.util.Objects;

import net.sourceforge.plantuml.klimt.font.StringBounder;
import net.sourceforge.plantuml.sequencediagram.InGroupableList;

abstract class GroupingGraphicalElement extends GraphicalElement {

	private final InGroupableList inGroupableList;

	public GroupingGraphicalElement(double currentY, InGroupableList inGroupableList) {
		super(currentY);
		this.inGroupableList = Objects.requireNonNull(inGroupableList);
	}

	final public double getActualWidth(StringBounder stringBounder) {
		return Math.max(getPreferredWidth(stringBounder), inGroupableList.getMaxX(stringBounder)
				- inGroupableList.getMinX(stringBounder) + 2 * InGroupableList.MARGIN10);
	}

	@Override
	final public double getStartingX(StringBounder stringBounder) {
		return inGroupableList.getMinX(stringBounder) - InGroupableList.MARGIN10;
	}

	protected final InGroupableList getInGroupableList() {
		return inGroupableList;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy