// Path: core/src/com/lostagain/nl/GWTish/ComplexPanel.java
// static public class Alignment {		
// 	HorizontalAlignment horizontal = null;
// 	VerticalAlignment   vert = null;
// 
// 	/**
// 	 * default middle center alignment
// 	 */
// 	public Alignment() {
// 				
// 		this.horizontal = HorizontalAlignment.Center;
// 		this.vert = VerticalAlignment.Middle;
// 				
// 	}			
// 	public Alignment(HorizontalAlignment horizontal,VerticalAlignment vert) {
// 				
// 		this.horizontal = horizontal;
// 		this.vert = vert;
// 				
// 	}			
// 						
// }
// 
// Path: core/src/com/lostagain/nl/GWTish/ComplexPanel.java
// public enum HorizontalAlignment {
// 	Left,Center,Right
// }
// 
// Path: core/src/com/lostagain/nl/GWTish/ComplexPanel.java
// public enum VerticalAlignment {
// 	Top,Middle,Bottom
// }


import java.util.logging.Logger;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.lostagain.nl.GWTish.ComplexPanel.Alignment;
import com.lostagain.nl.GWTish.ComplexPanel.HorizontalAlignment;
import com.lostagain.nl.GWTish.ComplexPanel.VerticalAlignment;
package com.lostagain.nl.GWTish;



/**
 * A panel that formats its child widgets using the default html-like layout behavior.
 * 
 * Note; currently alignment not supported
 * @author darkflame
 *
 */
public class FlowPanel extends CellPanel {
	final static String logstag = "GWTish.FlowPanel";
	public static Logger Log = Logger.getLogger(logstag); //not we are using this rather then gdxs to allow level control per tag

	//current stats
	float currentTotalWidgetWidth   = 0f;
	float currentTotalHeight   = 0f;
	
	//VerticalAlignment DefaultAlignmentinCell = VerticalAlignment.Middle;

	float maxWidth = -1; //no max width, means it acts much like a horizontal panel with the widgets alligned to the top


	public float getMaxWidth() {
		return maxWidth;
	}

	/**
	 * Creates a background and lets you position widgets vertical within it
	 * 
	 */
	public FlowPanel() {
		super(10,10); //default size and background
	}
	
	//maxWidth
	public FlowPanel(float maxWidth) {
		super(10,10); //default size and background
		this.maxWidth = maxWidth;

	}
	

	float widthOfCurrentRow     = 0;
	float maxHeightOfCurrentRow = 0;
	float rowsCurrentYHeight = 0;
	
	Vector3 getNextPosition(float incomingWidth,float incomingHeight,Widget widget){

		int index = contents.indexOf(widget);

		Alignment align = contentAlignments.get(widget);
		if (align == null) {
// Path: core/src/com/lostagain/nl/GWTish/ComplexPanel.java
// static public class Alignment {		
// 	HorizontalAlignment horizontal = null;
// 	VerticalAlignment   vert = null;
// 
// 	/**
// 	 * default middle center alignment
// 	 */
// 	public Alignment() {
// 				
// 		this.horizontal = HorizontalAlignment.Center;
// 		this.vert = VerticalAlignment.Middle;
// 				
// 	}			
// 	public Alignment(HorizontalAlignment horizontal,VerticalAlignment vert) {
// 				
// 		this.horizontal = horizontal;
// 		this.vert = vert;
// 				
// 	}			
// 						
// }
// 
// Path: core/src/com/lostagain/nl/GWTish/ComplexPanel.java
// public enum HorizontalAlignment {
// 	Left,Center,Right
// }
// 
// Path: core/src/com/lostagain/nl/GWTish/ComplexPanel.java
// public enum VerticalAlignment {
// 	Top,Middle,Bottom
// }


// Path: core/src/com/lostagain/nl/GWTish/FlowPanel.java
import java.util.logging.Logger;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.lostagain.nl.GWTish.ComplexPanel.Alignment;
import com.lostagain.nl.GWTish.ComplexPanel.HorizontalAlignment;
import com.lostagain.nl.GWTish.ComplexPanel.VerticalAlignment;

package com.lostagain.nl.GWTish;



/**
 * A panel that formats its child widgets using the default html-like layout behavior.
 * 
 * Note; currently alignment not supported
 * @author darkflame
 *
 */
public class FlowPanel extends CellPanel {
	final static String logstag = "GWTish.FlowPanel";
	public static Logger Log = Logger.getLogger(logstag); //not we are using this rather then gdxs to allow level control per tag

	//current stats
	float currentTotalWidgetWidth   = 0f;
	float currentTotalHeight   = 0f;
	
	//VerticalAlignment DefaultAlignmentinCell = VerticalAlignment.Middle;

	float maxWidth = -1; //no max width, means it acts much like a horizontal panel with the widgets alligned to the top


	public float getMaxWidth() {
		return maxWidth;
	}

	/**
	 * Creates a background and lets you position widgets vertical within it
	 * 
	 */
	public FlowPanel() {
		super(10,10); //default size and background
	}
	
	//maxWidth
	public FlowPanel(float maxWidth) {
		super(10,10); //default size and background
		this.maxWidth = maxWidth;

	}
	

	float widthOfCurrentRow     = 0;
	float maxHeightOfCurrentRow = 0;
	float rowsCurrentYHeight = 0;
	
	Vector3 getNextPosition(float incomingWidth,float incomingHeight,Widget widget){

		int index = contents.indexOf(widget);

		Alignment align = contentAlignments.get(widget);
		if (align == null) {
			align = new Alignment(HorizontalAlignment.Left,