package eu.greenlightning.hypercubepdf.align;

enum HCPLineAlignment {

	BEGINNING {
		@Override
		public float align(float size, float start, float end) {
			return start;
		}
	},
	MIDDLE {
		@Override
		public float align(float size, float start, float end) {
			return (start + end - size) / 2;
		}
	},
	END {
		@Override
		public float align(float size, float start, float end) {
			return end - size;
		}
	};

	public abstract float align(float size, float start, float end);

}

@@ -44,32 +44,243 @@
 n;%0A%0A
-enum HCPLineAlignment %7B%0A
+/**%0A * One-dimensional alignment which is independent of the direction of the axis.%0A *%0A * @author Green Lightning%0A */%0Aenum HCPLineAlignment %7B%0A%0A%09/** The start of the child segment will be aligned with the start of the parent segment. */
 %0A%09BE
@@ -385,16 +385,113 @@
 %09%09%7D%0A%09%7D,%0A
+%09%0A%09/** The center of the child segment will be aligned with the center of the parent segment. */%0A
 %09MIDDLE 
@@ -607,16 +607,107 @@
 %09%09%7D%0A%09%7D,%0A
+%09%0A%09/** The end of the child segment will be aligned with the end of the parent segment. */%0A
 %09END %7B%0A%09
@@ -807,16 +807,862 @@
 %09%7D%0A%09%7D;%0A%0A
+%09/**%0A%09 * Aligns a segment of the specified size inside the segment specified by the %7B@code start%7D and %7B@code end%7D%0A%09 * coordinates.%0A%09 * %3Cp%3E%0A%09 * The %7B@code start%7D argument should define the smaller and the %7B@code end%7D argument the larger coordinate of the%0A%09 * parent segment. The %7B@code size%7D argument should define the length of the child segment (which should be%0A%09 * positive).%0A%09 * %3Cp%3E%0A%09 * If the arguments do not satisfy the given constraints the return value of this method is unspecified. Otherwise,%0A%09 * it returns the %3Ci%3Estart%3C/i%3E (the smaller) coordinate of the aligned segment based on the origin of %7B@code start%7D%0A%09 * and %7B@code end%7D.%0A%09 * %0A%09 * @param size should be %7B@literal %3E= 0%7D%0A%09 * @param start should be %7B@literal %3C= end%7D%0A%09 * @param end should be %7B@literal %3E= start%7D%0A%09 * @return the %3Ci%3Estart%3C/i%3E coordinate of the aligned segment%0A%09 */%0A
 %09public 

Document HCPLineAlignment.