net.sourceforge.plantuml.anim.Animation 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.anim;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import net.sourceforge.plantuml.klimt.geom.MinMax;
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
public class Animation {
private final List all;
private Animation(List all) {
if (all.size() == 0) {
throw new IllegalArgumentException();
}
this.all = all;
}
public static Animation singleton(AffineTransformation affineTransformation) {
if (affineTransformation == null) {
return null;
}
return new Animation(Collections.singletonList(affineTransformation));
}
public static Animation create(List descriptions) {
final List all = new ArrayList<>();
for (String s : descriptions) {
final AffineTransformation tmp = AffineTransformation.create(s);
if (tmp != null) {
all.add(tmp);
}
}
return new Animation(all);
}
public Collection getAll() {
return Collections.unmodifiableCollection(all);
}
public void setDimension(XDimension2D dim) {
for (AffineTransformation affineTransform : all) {
affineTransform.setDimension(dim);
}
}
public AffineTransformation getFirst() {
return all.get(0);
}
public MinMax getMinMax(XDimension2D dim) {
MinMax result = MinMax.getEmpty(false);
for (AffineTransformation affineTransform : all) {
final MinMax m = affineTransform.getMinMax(dim);
result = result.addMinMax(m);
}
return result;
}
}