// Path: org/lateralgm/libmaker/backend/Action.java
// public class Action
// 	{
// 	//Enums
// 	public static enum Kind
// 		{
// 		NORMAL,BEGIN_GROUP,END_GROUP,ELSE,EXIT,REPEAT,VARIABLE,CODE,PLACEHOLDER,SEPARATOR,LABEL
// 		}
// 
// 	public static enum InterfaceKind
// 		{
// 		NORMAL,NONE,ARROWS,CODE,TEXT
// 		}
// 
// 	public static enum Execution
// 		{
// 		NOTHING,FUNCTION,CODE
// 		}
// 
// 	public static int MAX_ARGS = 6;
// 	private static final BufferedImage DEFAULT_TILE = Messages.getImageForKey("Action.DEFAULT_TILE"); //$NON-NLS-1$
// 
// 	public enum PAction
// 		{
// 		NAME,ID,IMAGE,HIDDEN,ADVANCED,REGISTERED,DESCRIPTION,LIST,HINT,KIND,EXEC_TYPE,EXEC_INFO,
// 		IFACE_KIND,QUESTION,APPLY,RELATIVE,ARG_NUM
// 		}
// 
// 	private static final EnumMap<PAction,Object> DEFS = PropertyMap.makeDefaultMap(PAction.class,
// 			null,null,DEFAULT_TILE,false,false,false,null,null,null,Kind.NORMAL,Execution.CODE,null,
// 			InterfaceKind.NORMAL,false,true,true,0);
// 
// 	public final PropertyMap<PAction> properties = new PropertyMap<PAction>(PAction.class,DEFS);
// 
// 	//Fields
// 	public Library parent;
// 	/** .length is always MAX_ARGS. Use argNum to determine actual used argument count. */
// 	public Argument arguments[] = new Argument[MAX_ARGS];
// 
// 	public Action()
// 		{
// 		int id = Library.lastActionId++;
// 		properties.put(PAction.ID,id);
// 		properties.put(PAction.NAME,"Action " + id);
// 
// 		for (int arg = 0; arg < MAX_ARGS; arg++)
// 			arguments[arg] = new Argument(arg);
// 		}
// 
// 	public void put(PAction key, Object value)
// 		{
// 		properties.put(key,value);
// 		}
// 
// 	public <V>V get(PAction key)
// 		{
// 		return properties.get(key);
// 		}
// 	}
// 
// Path: org/lateralgm/libmaker/backend/Action.java
// public enum PAction
// 	{
// 	NAME,ID,IMAGE,HIDDEN,ADVANCED,REGISTERED,DESCRIPTION,LIST,HINT,KIND,EXEC_TYPE,EXEC_INFO,
// 	IFACE_KIND,QUESTION,APPLY,RELATIVE,ARG_NUM
// 	}
// 
// Path: org/lateralgm/libmaker/backend/Argument.java
// public class Argument
// 	{
// 	public static enum Kind
// 		{
// 		EXPRESSION,STRING,BOTH,BOOLEAN,MENU,COLOR,FONT_STRING,SPRITE,SOUND,BACKGROUND,PATH,SCRIPT,
// 		OBJECT,ROOM,FONT,TIMELINE
// 		}
// 
// 	public enum PArgument
// 		{
// 		CAPTION,KIND,DEF_VALUE,MENU_OPTS
// 		}
// 
// 	private static final EnumMap<PArgument,Object> DEFS = PropertyMap.makeDefaultMap(PArgument.class,
// 			null,Kind.EXPRESSION,"0","item 1|item 2");
// 
// 	public final PropertyMap<PArgument> properties = new PropertyMap<PArgument>(PArgument.class,DEFS);
// 
// 	//Only available to Action
// 	/*package*/Argument(int id)
// 		{
// 		properties.put(PArgument.CAPTION,"Argument " + id + ":");
// 		}
// 
// 	public void put(PArgument key, Object value)
// 		{
// 		properties.put(key,value);
// 		}
// 
// 	public <V>V get(PArgument key)
// 		{
// 		return properties.get(key);
// 		}
// 	}
// 
// Path: org/lateralgm/libmaker/backend/Argument.java
// public enum PArgument
// 	{
// 	CAPTION,KIND,DEF_VALUE,MENU_OPTS
// 	}


import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import org.lateralgm.libmaker.backend.Action;
import org.lateralgm.libmaker.backend.Action.PAction;
import org.lateralgm.libmaker.backend.Argument;
import org.lateralgm.libmaker.backend.Argument.PArgument;
	private class ColorSelect extends JTextField
		{
		private static final long serialVersionUID = 1L;

		public ColorSelect(Color c)
			{
			super();
			setSelectedColor(c);
			}

		public void setSelectedColor(Color c)
			{
			setBackground(c);
			}
		}

	private class ArgumentComponent
		{
		private Argument arg;
		private Component editor;

		public ArgumentComponent(Argument arg)
			{
			this.arg = arg;
			editor = makeEditor();
			discard();
			}

		private JComponent makeEditor()
			{
// Path: org/lateralgm/libmaker/backend/Action.java
// public class Action
// 	{
// 	//Enums
// 	public static enum Kind
// 		{
// 		NORMAL,BEGIN_GROUP,END_GROUP,ELSE,EXIT,REPEAT,VARIABLE,CODE,PLACEHOLDER,SEPARATOR,LABEL
// 		}
// 
// 	public static enum InterfaceKind
// 		{
// 		NORMAL,NONE,ARROWS,CODE,TEXT
// 		}
// 
// 	public static enum Execution
// 		{
// 		NOTHING,FUNCTION,CODE
// 		}
// 
// 	public static int MAX_ARGS = 6;
// 	private static final BufferedImage DEFAULT_TILE = Messages.getImageForKey("Action.DEFAULT_TILE"); //$NON-NLS-1$
// 
// 	public enum PAction
// 		{
// 		NAME,ID,IMAGE,HIDDEN,ADVANCED,REGISTERED,DESCRIPTION,LIST,HINT,KIND,EXEC_TYPE,EXEC_INFO,
// 		IFACE_KIND,QUESTION,APPLY,RELATIVE,ARG_NUM
// 		}
// 
// 	private static final EnumMap<PAction,Object> DEFS = PropertyMap.makeDefaultMap(PAction.class,
// 			null,null,DEFAULT_TILE,false,false,false,null,null,null,Kind.NORMAL,Execution.CODE,null,
// 			InterfaceKind.NORMAL,false,true,true,0);
// 
// 	public final PropertyMap<PAction> properties = new PropertyMap<PAction>(PAction.class,DEFS);
// 
// 	//Fields
// 	public Library parent;
// 	/** .length is always MAX_ARGS. Use argNum to determine actual used argument count. */
// 	public Argument arguments[] = new Argument[MAX_ARGS];
// 
// 	public Action()
// 		{
// 		int id = Library.lastActionId++;
// 		properties.put(PAction.ID,id);
// 		properties.put(PAction.NAME,"Action " + id);
// 
// 		for (int arg = 0; arg < MAX_ARGS; arg++)
// 			arguments[arg] = new Argument(arg);
// 		}
// 
// 	public void put(PAction key, Object value)
// 		{
// 		properties.put(key,value);
// 		}
// 
// 	public <V>V get(PAction key)
// 		{
// 		return properties.get(key);
// 		}
// 	}
// 
// Path: org/lateralgm/libmaker/backend/Action.java
// public enum PAction
// 	{
// 	NAME,ID,IMAGE,HIDDEN,ADVANCED,REGISTERED,DESCRIPTION,LIST,HINT,KIND,EXEC_TYPE,EXEC_INFO,
// 	IFACE_KIND,QUESTION,APPLY,RELATIVE,ARG_NUM
// 	}
// 
// Path: org/lateralgm/libmaker/backend/Argument.java
// public class Argument
// 	{
// 	public static enum Kind
// 		{
// 		EXPRESSION,STRING,BOTH,BOOLEAN,MENU,COLOR,FONT_STRING,SPRITE,SOUND,BACKGROUND,PATH,SCRIPT,
// 		OBJECT,ROOM,FONT,TIMELINE
// 		}
// 
// 	public enum PArgument
// 		{
// 		CAPTION,KIND,DEF_VALUE,MENU_OPTS
// 		}
// 
// 	private static final EnumMap<PArgument,Object> DEFS = PropertyMap.makeDefaultMap(PArgument.class,
// 			null,Kind.EXPRESSION,"0","item 1|item 2");
// 
// 	public final PropertyMap<PArgument> properties = new PropertyMap<PArgument>(PArgument.class,DEFS);
// 
// 	//Only available to Action
// 	/*package*/Argument(int id)
// 		{
// 		properties.put(PArgument.CAPTION,"Argument " + id + ":");
// 		}
// 
// 	public void put(PArgument key, Object value)
// 		{
// 		properties.put(key,value);
// 		}
// 
// 	public <V>V get(PArgument key)
// 		{
// 		return properties.get(key);
// 		}
// 	}
// 
// Path: org/lateralgm/libmaker/backend/Argument.java
// public enum PArgument
// 	{
// 	CAPTION,KIND,DEF_VALUE,MENU_OPTS
// 	}


// Path: org/lateralgm/libmaker/ActionPreview.java
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import org.lateralgm.libmaker.backend.Action;
import org.lateralgm.libmaker.backend.Action.PAction;
import org.lateralgm.libmaker.backend.Argument;
import org.lateralgm.libmaker.backend.Argument.PArgument;

	private class ColorSelect extends JTextField
		{
		private static final long serialVersionUID = 1L;

		public ColorSelect(Color c)
			{
			super();
			setSelectedColor(c);
			}

		public void setSelectedColor(Color c)
			{
			setBackground(c);
			}
		}

	private class ArgumentComponent
		{
		private Argument arg;
		private Component editor;

		public ArgumentComponent(Argument arg)
			{
			this.arg = arg;
			editor = makeEditor();
			discard();
			}

		private JComponent makeEditor()
			{
			switch ((Argument.Kind) arg.get(PArgument.KIND))