public void addEvents( ){

		paint_panel.addMouseListener(paint_panel);
		paint_panel.addMouseMotionListener(paint_panel);
		shapechooser.addItemListener(new ItemListener() {

			@Override
			public void itemStateChanged(ItemEvent e) {
				String temp=shapechooser.getSelectedItem().toString(); //get shape type
				model.setShape_type(temp); //tell model to set current shape so that model will know
			}
		});

		colorchooser.addItemListener(new ItemListener() {

			@Override
			public void itemStateChanged(ItemEvent e) {
				String temp=colorchooser.getSelectedItem().toString(); //get color from combo box
				model.getColor(temp); //tell model to set  current color 
			}
		});

		chckbxFill.addItemListener(new ItemListener() {

			@Override
			public void itemStateChanged(ItemEvent e) {
				model.setFill(chckbxFill.isSelected()); //get information about whether user wants to
				//have filled object or not 

			}
		});

		unDoButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {

				//it means there is nothing to undo 
				//warn user in case of user wants to make undo operation
				if(model.getObjects().size()==0 || model.getDraw_index()==0){
					JOptionPane.showMessageDialog(null,"You can't do undo operation");
				}
				else{ //tell controller to start undo operation
					paint_panel.clear();  //clear current graph
					control.unDoShape(paint_panel.getG2());					
				}
			}
		});

		reDoButton.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {

				//it means there is nothing to reDo  
				//warn user in case of user wants to make undo operation
				if(model.getObjects().size()==0 || model.getDraw_index()==model.getObjects().size()){
					JOptionPane.showMessageDialog(null,"You can't do redo operation");
				}
				else{//tell controller to start reDo operation
					paint_panel.clear(); //clear current graph
					control.reDoShape(paint_panel.getG2());
				}
			}
		});

		btnSaveImage.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				saveDialog(); // open file saver 
				if(file==null) //if user did not enter any file name warn him
					JOptionPane.showMessageDialog(null,"You need to write file name");
				else
					control.saveImage(paint_panel.getBuf_image(),file);	 //tell controller to save
				    //file 
			}
		});

		btnLoadImage.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				loadDialog(); //open file loader 
				if(file==null)//if user did not enter any file name warn him
					JOptionPane.showMessageDialog(null,"You need to write file name");
				else{
					paint_panel.setBuf_image(control.loadImage(file));
					paint_panel.repaint();  //refresh canvas 
				}
			}
		});

	} //add events