public DialogObjectWizard() {
		setIconImage(((ImageIcon)IconUtils.getIcon("item_create_object")).getImage());
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		setModal(true);
		setTitle("Create Object");
		setResizable(false);
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.NORTH);
		
		JLabel lblLabel = new JLabel("Label:");
		lblLabel.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		txtLabel = new JTextField();
		txtLabel.setColumns(10);
		JLabel lblType = new JLabel("Type:");
		lblType.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>();
		
		cbType = new JComboBox<String>(model);
		
		for (String s : RoomObjects.getTypes()) {
			model.addElement(s);
		}
		
		JLabel lblIcon = new JLabel("Icon:");
		lblIcon.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		cbIcon = new JIconComboBox();
		
		JLabel lblColor = new JLabel("Color:");
		lblColor.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		cbColor = new JColorComboBox();
		
		JLabel lblHci = new JLabel("HCI:");
		lblHci.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		DefaultComboBoxModel<String> model1 = new DefaultComboBoxModel<String>();
		
		for (int i = 0; i < HCInterface.TOTAL_HCINTERFACES; i++) {
			model1.addElement("HCI" + (i + 1));
		}
		
		cbHci = new JComboBox<String>(model1);
		
		spNode = new JSpinner();
		spNode.setModel(new SpinnerNumberModel(1, 1, HCInterface.MAX_NODES, 1));
		
		JLabel lblNode = new JLabel("Node:");
		lblNode.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblManualOn = new JLabel("Manual On:");
		lblManualOn.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		JLabel lblManualOff = new JLabel("Manual Off:");
		lblManualOff.setFont(new Font("Tahoma", Font.BOLD, 11));
		
		txtManualOn = new JTextField();
		txtManualOn.setColumns(10);
		
		txtManualOff = new JTextField();
		txtManualOff.setColumns(10);
		
		GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
		gl_contentPanel.setHorizontalGroup(
			gl_contentPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPanel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING, false)
						.addComponent(cbType, Alignment.LEADING, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(lblLabel, Alignment.LEADING)
						.addComponent(lblType, Alignment.LEADING)
						.addComponent(lblIcon, Alignment.LEADING)
						.addComponent(lblColor, Alignment.LEADING)
						.addComponent(cbIcon, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(cbColor, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 116, Short.MAX_VALUE)
						.addComponent(txtLabel, Alignment.LEADING))
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_contentPanel.createSequentialGroup()
							.addGap(20)
							.addComponent(lblHci))
						.addGroup(gl_contentPanel.createSequentialGroup()
							.addGap(18)
							.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING, false)
								.addComponent(lblManualOn, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
								.addComponent(cbHci, 0, 116, Short.MAX_VALUE)
								.addComponent(lblManualOff, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtManualOn, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtManualOff, GroupLayout.PREFERRED_SIZE, 116, GroupLayout.PREFERRED_SIZE))))
					.addGap(8)
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING, false)
						.addComponent(lblNode, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(spNode, GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE))
					.addContainerGap(116, Short.MAX_VALUE))
		);
		gl_contentPanel.setVerticalGroup(
			gl_contentPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPanel.createSequentialGroup()
					.addGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_contentPanel.createSequentialGroup()
							.addContainerGap()
							.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblLabel)
								.addComponent(lblHci)
								.addComponent(lblNode))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(txtLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(cbHci, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblType)
								.addComponent(lblManualOn))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(cbType, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtManualOn, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGap(11)
							.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(lblIcon)
								.addComponent(lblManualOff))
							.addPreferredGap(ComponentPlacement.RELATED)
							.addGroup(gl_contentPanel.createParallelGroup(Alignment.BASELINE)
								.addComponent(cbIcon, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtManualOff, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(lblColor)
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(cbColor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGroup(gl_contentPanel.createSequentialGroup()
							.addGap(31)
							.addComponent(spNode, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap(23, Short.MAX_VALUE))
		);
		contentPanel.setLayout(gl_contentPanel);
		{
			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) {
						try {
							room.getObjects().remove(obj);
							
							List<RoomJob> list = null;
							
							if (obj != null) {
								list = obj.getJobs();
							}

							obj = null;
							
							if (obj == null) {
								Logger.log("Creating new object of type " + cbType.getSelectedItem().toString() + "...");
								RoomObject object = RoomObjects.newInstance(cbType.getSelectedItem().toString(), txtLabel.getText().trim(), cbHci.getSelectedIndex(), (Integer) spNode.getValue(), cbIcon.getSelectedItem().toString(), cbColor.getSelectedItem().toString(), Integer.parseInt(txtManualOn.getText()), Integer.parseInt(txtManualOff.getText()));
								room.getObjects().add(object);
								if (list != null) {
									object.setJobs(list);
								}
								FrameMain.instance.reloadTree();
							} else {
								obj.setLabel(txtLabel.getText().trim());
								obj.setStringIcon(cbIcon.getSelectedItem().toString());
								obj.setIcon(IconUtils.getIcon("icon_" + cbIcon.getSelectedItem().toString()));
								obj.setColor(cbColor.getColor());
								obj.setHcinode((Integer) spNode.getValue());
								obj.setHci(cbHci.getSelectedIndex());
								obj.setManualOff(Integer.parseInt(txtManualOff.getText().trim()));
								obj.setManualOn(Integer.parseInt(txtManualOn.getText().trim()));

								FrameMain.instance.reloadTree();
							}
														
							dispose();
							setVisible(false);
						} catch (Exception e1) {
							e1.printStackTrace();
						}
					}
				});
				okButton.setActionCommand("OK");
				buttonPane.add(okButton);
				getRootPane().setDefaultButton(okButton);
			}
			{
				JButton cancelButton = new JButton("Cancel");
				cancelButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						dispose();
						setVisible(false);
					}
				});
				cancelButton.setActionCommand("Cancel");
				buttonPane.add(cancelButton);
			}
		}
	}