public SpellEditor(int ID) {
		this.ID = ID;
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		setTitle("Spell Editor");
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);
		{
			JLabel lblId = new JLabel("ID:");
			lblId.setBounds(12, 13, 46, 14);
			contentPanel.add(lblId);
		}
		{
			IDText = new JTextField(ID + "");
			IDText.setEditable(false);
			IDText.setBounds(70, 11, 86, 20);
			contentPanel.add(IDText);
			IDText.setColumns(10);
		}
		{
			JLabel lblName = new JLabel("Name:");
			lblName.setBounds(12, 40, 46, 14);
			contentPanel.add(lblName);
		}
		{
			nameText = new JTextField();
			nameText.setBounds(70, 38, 86, 20);
			contentPanel.add(nameText);
			nameText.setColumns(10);
		}
		{
			JLabel lblSpellType = new JLabel("Spell Type:");
			lblSpellType.setBounds(168, 14, 57, 14);
			contentPanel.add(lblSpellType);
		}
		{
			spellTypeCombo = new JComboBox<ProjectileType>();
			spellTypeCombo.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					toggleType();
				}
			});
			spellTypeCombo.setModel(new DefaultComboBoxModel<ProjectileType>(ProjectileType.values()));
			spellTypeCombo.setBounds(237, 9, 86, 22);
			contentPanel.add(spellTypeCombo);
		}
		{
			JLabel lblCost = new JLabel("Cost:");
			lblCost.setBounds(168, 41, 46, 14);
			contentPanel.add(lblCost);
		}
		{
			costSpinner = new JSpinner();
			costSpinner.setModel(new SpinnerNumberModel(new Float(0), null, null, new Float(1)));
			costSpinner.setBounds(237, 38, 57, 20);
			contentPanel.add(costSpinner);
		}
		{
			JSeparator separator = new JSeparator();
			separator.setBounds(12, 67, 410, 2);
			contentPanel.add(separator);
		}
		{
			JLabel lblSpeed = new JLabel("Speed:");
			lblSpeed.setBounds(12, 82, 46, 14);
			contentPanel.add(lblSpeed);
		}
		{
			speedSpinner = new JSpinner();
			speedSpinner.setModel(new SpinnerNumberModel(new Float(0), null, null, new Float(1)));
			speedSpinner.setBounds(70, 80, 57, 20);
			contentPanel.add(speedSpinner);
		}
		{
			piercingCheck = new JCheckBox("Piercing");
			piercingCheck.setBounds(12, 105, 97, 23);
			contentPanel.add(piercingCheck);
		}
		{
			JLabel lblDistance = new JLabel("Distance:");
			lblDistance.setBounds(12, 137, 57, 14);
			contentPanel.add(lblDistance);
		}
		{
			distanceSpinner = new JSpinner();
			distanceSpinner.setModel(new SpinnerNumberModel(new Float(0), null, null, new Float(1)));
			distanceSpinner.setBounds(70, 135, 57, 20);
			contentPanel.add(distanceSpinner);
		}
		{
			JLabel lblDamage = new JLabel("Damage:");
			lblDamage.setBounds(12, 164, 57, 14);
			contentPanel.add(lblDamage);
		}
		{
			damageSpinner = new JSpinner();
			damageSpinner.setModel(new SpinnerNumberModel(new Float(0), null, null, new Float(1)));
			damageSpinner.setBounds(70, 162, 57, 20);
			contentPanel.add(damageSpinner);
		}
		{
			JLabel lblRadius = new JLabel("Diameter:");
			lblRadius.setBounds(12, 191, 57, 14);
			contentPanel.add(lblRadius);
		}
		{
			diameterSpinner = new JSpinner();
			diameterSpinner.setModel(new SpinnerNumberModel(new Float(0), null, null, new Float(1)));
			diameterSpinner.setBounds(70, 189, 57, 20);
			contentPanel.add(diameterSpinner);
		}
		{
			multiCheck = new JCheckBox("Multi");
			multiCheck.setBounds(168, 78, 97, 23);
			contentPanel.add(multiCheck);
		}
		{
			movingCheck = new JCheckBox("Moving");
			movingCheck.setBounds(168, 106, 97, 23);
			contentPanel.add(movingCheck);
		}
		{
			JLabel lblDuration = new JLabel("Duration:");
			lblDuration.setBounds(168, 138, 57, 14);
			contentPanel.add(lblDuration);
		}
		{
			durationSpinner = new JSpinner();
			durationSpinner.setModel(new SpinnerNumberModel(new Float(0), null, null, new Float(1)));
			durationSpinner.setBounds(237, 135, 57, 20);
			contentPanel.add(durationSpinner);
		}
		{
			JLabel lblAreaTexture = new JLabel("Area Texture:");
			lblAreaTexture.setBounds(168, 165, 69, 14);
			contentPanel.add(lblAreaTexture);
		}
		{
			areaTextureText = new JTextField();
			areaTextureText.setBounds(237, 162, 86, 20);
			contentPanel.add(areaTextureText);
			areaTextureText.setColumns(10);
		}
		{
			JPanel buttonPane = new JPanel();
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				JButton okButton = new JButton("OK");
				okButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						save();
						
						dispose();
					}
				});
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
			{
				JButton cancelButton = new JButton("Cancel");
				cancelButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						dispose();
					}
				});
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
		
		if(ID != 0)
			load();
		else {
			updateID();
			toggleType();
		}
		setModalityType(ModalityType.APPLICATION_MODAL);
		setVisible(true);
	}