// Path: EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/wrappers/AccessWrapper.java
// public abstract class AccessWrapper<T> {
// 	abstract public T getValue();
// 	abstract public void setValue(T item);
// 	
// 	/**
// 	 * Reflects whether the underlying value is an Integer or not
// 	 * 
// 	 * This provides an accessibility/performance bonus to some contexts
// 	 * 
// 	 * @return True/False as appropriate 
// 	 */
// 	abstract public boolean isInt();
// 	
// }
// 
// Path: EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/wrappers/MappedComponent.java
// public class MappedComponent {
// 	private DataFlow df;
// 	private AccessWrapper<String> linkedData;
// 	private JComponent comp;
// 		
// 	
// 	/**
// 	 * @param df Valid enum for what direction data flows between comp and linkedData
// 	 * 				Use DataFlow.STATIC for non-updating components
// 	 * @param linkedData AccessWrapper for interacting with the backend/character-data. This can be null if df==STATIC
// 	 * @param comp the JComponent being wrapped. If df is not STATIC, JComponent must extend JTextComponent
// 	 */
// 	public MappedComponent(DataFlow df, AccessWrapper<String> linkedData, JComponent comp) {
// 		super();
// 		this.df = df;		
// 		this.comp = comp;
// 		
// 		if (df!=DataFlow.STATIC && !(comp instanceof JTextComponent || comp instanceof JButton))
// 		{
// 			throw new IllegalArgumentException("Non-static DataFlow components must be JTextComponents or JButtons for MappedComponent");
// 		}
// 		
// 		this.linkedData = linkedData;
// 	}
// 
// 	public JComponent getComp() {
// 		return comp;
// 	}
// 
// 	/**
// 	 * Cause any attached JTextComponents to refresh their displayed text via pulling from linkedData
// 	 */
// 	public void refresh()
// 	{
// 		// STATIC Components don't update or refresh
// 		if (df==DataFlow.STATIC)
// 		{
// 			return;
// 		}
// 		else
// 		{	
// 			setCompText(linkedData.getValue());
// 		}
// 	}
// 
// 	public void update()
// 	{
// 		// STATIC Components don't update
// 		if (df==DataFlow.STATIC)
// 		{
// 			return;
// 		}
// 		
// 		if (df == DataFlow.PULL)
// 		{
// 			setCompText(linkedData.getValue());
// 		}
// 		else
// 		{
// 			// PUSH
// 			linkedData.setValue(getCompText());
// 		}
// 	}
// 	
// 	/**
// 	 * Resolves whether comp is JTextComponent or JButton and calls setText accordingly
// 	 * @param val Valid string to set on comp
// 	 */
// 	private void setCompText(String val)
// 	{
// 		if (comp instanceof JTextComponent)
// 		{
// 			((JTextComponent)comp).setText(val);
// 		}
// 		else if (comp instanceof JButton)
// 		{
// 			((JButton)comp).setText(val);
// 		}
// 		else
// 		{
// 			throw new IllegalStateException("Could not recognize what subclass JComponent comp is");
// 		}
// 	}
// 	
// 	/**
// 	 * Resolves whether comp is JTextComponent or JButton and calls getText accordingly
// 	 * @return Text contents of comp
// 	 */
// 	private String getCompText()
// 	{
// 		if (comp instanceof JTextComponent)
// 		{
// 			return ((JTextComponent)comp).getText();
// 		}
// 		else if (comp instanceof JButton)
// 		{
// 			return ((JButton)comp).getText();
// 		}
// 		else
// 		{
// 			throw new IllegalStateException("Could not recognize what subclass JComponent comp is");
// 		}
// 	}
// 	
// 	/**
// 	 * The nature of the DataFlow between comp and linkedData
// 	 * If STATIC, no behavior during updates
// 	 * If PULL, comp is setText to the result of linkedData.getValue()
// 	 * If PUSH, linkedData is set to comp.getText()
// 	 * @author Vigilant
// 	 *
// 	 */
// 	public enum DataFlow
// 	{
// 		PULL,PUSH,STATIC
// 	}
// }
// 
// Path: EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/wrappers/MappedComponent.java
// public enum DataFlow
// {
// 	PULL,PUSH,STATIC
// }


import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.UIManager;
import com.github.distanteye.ep_utils.wrappers.AccessWrapper;
import com.github.distanteye.ep_utils.wrappers.MappedComponent;
import com.github.distanteye.ep_utils.wrappers.MappedComponent.DataFlow;

		
		DataFlow df; // for later
		
		if (editState == EditState.FIXED)
		{
			parentUIForTextChangeListener = null; // sanity check to prevent odd behavior
			df = DataFlow.PULL;
		}
		else
		{
			df = DataFlow.PUSH;
		}
		
		// however if accessWrapper is null, df becomes static as a fallback
		if (accessWrapper == null)
		{
			df = DataFlow.STATIC;
		}
		
		// no label if no orientation
		if (o != null)
		{
			addLabel(x,y,labelText);
		}
		JTextField temp = addTextF(newX,newY,value,cols,parentUIForTextChangeListener);
		
		if (editState == EditState.FIXED)
		{
			temp.setEditable(false);
		}

// Path: EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/wrappers/AccessWrapper.java
// public abstract class AccessWrapper<T> {
// 	abstract public T getValue();
// 	abstract public void setValue(T item);
// 	
// 	/**
// 	 * Reflects whether the underlying value is an Integer or not
// 	 * 
// 	 * This provides an accessibility/performance bonus to some contexts
// 	 * 
// 	 * @return True/False as appropriate 
// 	 */
// 	abstract public boolean isInt();
// 	
// }
// 
// Path: EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/wrappers/MappedComponent.java
// public class MappedComponent {
// 	private DataFlow df;
// 	private AccessWrapper<String> linkedData;
// 	private JComponent comp;
// 		
// 	
// 	/**
// 	 * @param df Valid enum for what direction data flows between comp and linkedData
// 	 * 				Use DataFlow.STATIC for non-updating components
// 	 * @param linkedData AccessWrapper for interacting with the backend/character-data. This can be null if df==STATIC
// 	 * @param comp the JComponent being wrapped. If df is not STATIC, JComponent must extend JTextComponent
// 	 */
// 	public MappedComponent(DataFlow df, AccessWrapper<String> linkedData, JComponent comp) {
// 		super();
// 		this.df = df;		
// 		this.comp = comp;
// 		
// 		if (df!=DataFlow.STATIC && !(comp instanceof JTextComponent || comp instanceof JButton))
// 		{
// 			throw new IllegalArgumentException("Non-static DataFlow components must be JTextComponents or JButtons for MappedComponent");
// 		}
// 		
// 		this.linkedData = linkedData;
// 	}
// 
// 	public JComponent getComp() {
// 		return comp;
// 	}
// 
// 	/**
// 	 * Cause any attached JTextComponents to refresh their displayed text via pulling from linkedData
// 	 */
// 	public void refresh()
// 	{
// 		// STATIC Components don't update or refresh
// 		if (df==DataFlow.STATIC)
// 		{
// 			return;
// 		}
// 		else
// 		{	
// 			setCompText(linkedData.getValue());
// 		}
// 	}
// 
// 	public void update()
// 	{
// 		// STATIC Components don't update
// 		if (df==DataFlow.STATIC)
// 		{
// 			return;
// 		}
// 		
// 		if (df == DataFlow.PULL)
// 		{
// 			setCompText(linkedData.getValue());
// 		}
// 		else
// 		{
// 			// PUSH
// 			linkedData.setValue(getCompText());
// 		}
// 	}
// 	
// 	/**
// 	 * Resolves whether comp is JTextComponent or JButton and calls setText accordingly
// 	 * @param val Valid string to set on comp
// 	 */
// 	private void setCompText(String val)
// 	{
// 		if (comp instanceof JTextComponent)
// 		{
// 			((JTextComponent)comp).setText(val);
// 		}
// 		else if (comp instanceof JButton)
// 		{
// 			((JButton)comp).setText(val);
// 		}
// 		else
// 		{
// 			throw new IllegalStateException("Could not recognize what subclass JComponent comp is");
// 		}
// 	}
// 	
// 	/**
// 	 * Resolves whether comp is JTextComponent or JButton and calls getText accordingly
// 	 * @return Text contents of comp
// 	 */
// 	private String getCompText()
// 	{
// 		if (comp instanceof JTextComponent)
// 		{
// 			return ((JTextComponent)comp).getText();
// 		}
// 		else if (comp instanceof JButton)
// 		{
// 			return ((JButton)comp).getText();
// 		}
// 		else
// 		{
// 			throw new IllegalStateException("Could not recognize what subclass JComponent comp is");
// 		}
// 	}
// 	
// 	/**
// 	 * The nature of the DataFlow between comp and linkedData
// 	 * If STATIC, no behavior during updates
// 	 * If PULL, comp is setText to the result of linkedData.getValue()
// 	 * If PUSH, linkedData is set to comp.getText()
// 	 * @author Vigilant
// 	 *
// 	 */
// 	public enum DataFlow
// 	{
// 		PULL,PUSH,STATIC
// 	}
// }
// 
// Path: EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/wrappers/MappedComponent.java
// public enum DataFlow
// {
// 	PULL,PUSH,STATIC
// }


// Path: EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/ui/GBagPanel.java
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.UIManager;
import com.github.distanteye.ep_utils.wrappers.AccessWrapper;
import com.github.distanteye.ep_utils.wrappers.MappedComponent;
import com.github.distanteye.ep_utils.wrappers.MappedComponent.DataFlow;

		
		DataFlow df; // for later
		
		if (editState == EditState.FIXED)
		{
			parentUIForTextChangeListener = null; // sanity check to prevent odd behavior
			df = DataFlow.PULL;
		}
		else
		{
			df = DataFlow.PUSH;
		}
		
		// however if accessWrapper is null, df becomes static as a fallback
		if (accessWrapper == null)
		{
			df = DataFlow.STATIC;
		}
		
		// no label if no orientation
		if (o != null)
		{
			addLabel(x,y,labelText);
		}
		JTextField temp = addTextF(newX,newY,value,cols,parentUIForTextChangeListener);
		
		if (editState == EditState.FIXED)
		{
			temp.setEditable(false);
		}

		this.putMapped(mapName, new MappedComponent(df,accessWrapper,temp)); // TODO fix this later
