@Override
	public void mouseClicked(MouseEvent event) {
		int clickedX = event.getX();//offsetX;
		int clickedY = event.getY();//offsetY;
		if (!drawings.isInsideCricle(clickedX, clickedY)){
			if (selectedShape != null && selectedShape.isSelected()) {
				if (SwingUtilities.isRightMouseButton(event)){// double click
					history.addHistory(drawings);
					drawings.getShapes().remove(selectedShape);
					history.setRedo(drawings);
					selectedShape = new CustomShape();
					repaint();
					return;
				}
			}
			selectCloestPoint(clickedX,clickedY);

			
			if (selectedShape != null && selectedShape.isSelected()) {
					strokeLabel.setText("Thickness: "+selectedShape.getStrokeThicknessFactor());
					strokeThicknessSlider.setValue(selectedShape.getStrokeThicknessFactor());
				
			} else {
				strokeLabel.setText("Thickness: "+strokeThicknessFactor);
				strokeThicknessSlider.setValue(strokeThicknessFactor);
			}
		}else {
			if (event.getClickCount() == 2){// double click
				history.addHistory(drawings);
				drawings.clear();
				history.setRedo(drawings);
			}
			else {
				history.addHistory(drawings);
				drawings.switchColor();
				strokeLabel.setBackground(drawings.getNextColor());
				history.setRedo(drawings);
				if (selectedShape != null) {
					selectedShape.setSelected(false);
					selectedShape=null;
				}
				
			}

		}
		repaint();	
	}