public ImagePanel() {
		super();
		addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent e) {
				if (image != null) {
					paintNewFrame = true;
					startX = e.getX();
					startY = e.getY();
				}
			}

			@Override
			public void mouseReleased(MouseEvent e) {
				if (image != null) {
					paintNewFrame = false;
					endX = e.getX();
					endY = e.getY();
					if(!inImage(startX, startY) || !inImage(endX, endY)){
						repaint();
						return;
					}
					try {
						AddFrameEvent addFrameEvent = new AddFrameEvent(fsc.buildFrameRec(
								Math.min(startX, endX), Math.min(startY, endY),
								Math.abs(startX - endX), Math.abs(startY - endY),
								scaledInstance.getWidth(null), scaledInstance.getHeight(null)), selectedScreen);
						App.EVENT_BUS.post(addFrameEvent);
					} finally {
						repaint();
					}
				}
			}

		});
		addMouseMotionListener(new MouseMotionAdapter() {
			@Override
			public void mouseDragged(MouseEvent e) {
				if (image != null && paintNewFrame) {
					currentX = e.getX();
					currentY = e.getY();
					repaint();
				}
			}
		});
	}