package eu.greenlightning.hypercubepdf.container;

import java.util.Collection;

import eu.greenlightning.hypercubepdf.HCPElement;
import eu.greenlightning.hypercubepdf.layout.*;

public final class HCPContainers {

	public static HCPElement getHorizontalFlow(Collection<? extends HCPElement> elements) {
		return getHorizontalContainer(HCPFlowLayout.getInstance(), elements);
	}

	public static HCPElement getHorizontalFlow(HCPElement... elements) {
		return getHorizontalContainer(HCPFlowLayout.getInstance(), elements);
	}

	public static HCPElement getVerticalFlow(Collection<? extends HCPElement> elements) {
		return getVerticalContainer(HCPFlowLayout.getInstance(), elements);
	}

	public static HCPElement getVerticalFlow(HCPElement... elements) {
		return getVerticalContainer(HCPFlowLayout.getInstance(), elements);
	}

	public static HCPElement getHorizontalFlow(float spacing, Collection<? extends HCPElement> elements) {
		return getHorizontalContainer(HCPFlowLayout.getInstance(spacing), elements);
	}

	public static HCPElement getHorizontalFlow(float spacing, HCPElement... elements) {
		return getHorizontalContainer(HCPFlowLayout.getInstance(spacing), elements);
	}

	public static HCPElement getVerticalFlow(float spacing, Collection<? extends HCPElement> elements) {
		return getVerticalContainer(HCPFlowLayout.getInstance(spacing), elements);
	}

	public static HCPElement getVerticalFlow(float spacing, HCPElement... elements) {
		return getVerticalContainer(HCPFlowLayout.getInstance(spacing), elements);
	}

	public static HCPElement getHorizontalSplit(Collection<? extends HCPElement> elements) {
		return getHorizontalContainer(HCPSplitLayout.getInstance(), elements);
	}

	public static HCPElement getHorizontalSplit(HCPElement... elements) {
		return getHorizontalContainer(HCPSplitLayout.getInstance(), elements);
	}

	public static HCPElement getVerticalSplit(Collection<? extends HCPElement> elements) {
		return getVerticalContainer(HCPSplitLayout.getInstance(), elements);
	}

	public static HCPElement getVerticalSplit(HCPElement... elements) {
		return getVerticalContainer(HCPSplitLayout.getInstance(), elements);
	}

	public static HCPElement getHorizontalSplit(float spacing, Collection<? extends HCPElement> elements) {
		return getHorizontalContainer(HCPSplitLayout.getInstance(spacing), elements);
	}

	public static HCPElement getHorizontalSplit(float spacing, HCPElement... elements) {
		return getHorizontalContainer(HCPSplitLayout.getInstance(spacing), elements);
	}

	public static HCPElement getVerticalSplit(float spacing, Collection<? extends HCPElement> elements) {
		return getVerticalContainer(HCPSplitLayout.getInstance(spacing), elements);
	}

	public static HCPElement getVerticalSplit(float spacing, HCPElement... elements) {
		return getVerticalContainer(HCPSplitLayout.getInstance(spacing), elements);
	}

	public static HCPElement getHorizontalStretch(Collection<? extends HCPElement> elements) {
		return getHorizontalContainer(HCPStretchLayout.getInstance(), elements);
	}

	public static HCPElement getHorizontalStretch(HCPElement... elements) {
		return getHorizontalContainer(HCPStretchLayout.getInstance(), elements);
	}

	public static HCPElement getVerticalStretch(Collection<? extends HCPElement> elements) {
		return getVerticalContainer(HCPStretchLayout.getInstance(), elements);
	}

	public static HCPElement getVerticalStretch(HCPElement... elements) {
		return getVerticalContainer(HCPStretchLayout.getInstance(), elements);
	}

	public static HCPElement getHorizontalStretch(float spacing, Collection<? extends HCPElement> elements) {
		return getHorizontalContainer(HCPStretchLayout.getInstance(spacing), elements);
	}

	public static HCPElement getHorizontalStretch(float spacing, HCPElement... elements) {
		return getHorizontalContainer(HCPStretchLayout.getInstance(spacing), elements);
	}

	public static HCPElement getVerticalStretch(float spacing, Collection<? extends HCPElement> elements) {
		return getVerticalContainer(HCPStretchLayout.getInstance(spacing), elements);
	}

	public static HCPElement getVerticalStretch(float spacing, HCPElement... elements) {
		return getVerticalContainer(HCPStretchLayout.getInstance(spacing), elements);
	}

	public static HCPElement getHorizontalContainer(HCPLayout layout,
			Collection<? extends HCPElement> elements) {
		return new HCPHorizontalContainer(layout, elements);
	}

	public static HCPElement getHorizontalContainer(HCPLayout layout, HCPElement... elements) {
		return new HCPHorizontalContainer(layout, elements);
	}

	public static HCPElement getVerticalContainer(HCPLayout layout, Collection<? extends HCPElement> elements) {
		return new HCPVerticalContainer(layout, elements);
	}

	public static HCPElement getVerticalContainer(HCPLayout layout, HCPElement... elements) {
		return new HCPVerticalContainer(layout, elements);
	}

	// Prevent instantiation
	private HCPContainers() {
		throw new UnsupportedOperationException();
	}

}

@@ -173,16 +173,953 @@
 out.*;%0A%0A
+/**%0A * Utility class for creating standard containers. Standard containers paint a group of %7B@link HCPElement%7Ds%0A * sequentially, applying a %7B@link HCPLayout%7D in one direction.%0A * %3Cp%3E%0A * The elements are painted in the order in which they were provided while creating the container, as long as enough%0A * space is available.%0A * %3Cp%3E%0A * Horizontal containers paint their elements from left to right and vertical containers paint from top to bottom.%0A * Right-to-left and bottom-to-top painting is not supported at the moment.%0A * %3Cp%3E%0A * The width of the elements in horizontal containers depends on the layout, however the elements are always painted%0A * using the height of the container. For vertical containers the opposite statement is true, i.&nbsp;e. the height of%0A * the elements in vertical containers depends on the layout, however the elements are always painted using the width of%0A * the container.%0A *%0A * @author Green Lightning%0A */%0A
 public f
@@ -5228,12 +5228,9 @@
 out,
-%0A%09%09%09
+ 
 Coll

Document HCPContainers.