@Override
	public void paint(Graphics g) {
		locationImg = CreateGUI.returnInstance().createImageIcon("img/location.png", "Location");
		Graphics2D g2 = (Graphics2D) g;
		paintComponent(g2);
		if(dragging) {
			g2.setColor(Color.RED);
			if(rectWidth/rectHeight < preferredRatio) {
				rectWidth = rectHeight * preferredRatio;
			}
			else if(rectWidth/rectHeight > preferredRatio) {
				rectHeight = rectWidth / preferredRatio;
			}
			g2.draw(new Rectangle2D.Double(x2, y2, rectWidth, rectHeight));
		}
		if(dirFromNode != null) {
			int size = 32;
			Image locImg = locationImg.getImage();
			Image newImg = locImg.getScaledInstance(size, size, 0);
			locationImg = new ImageIcon(newImg);
			locationImg.paintIcon(this, g2, (int)((dirFromNode.getX() - upperLeftX) / (1000/factor))-size/2, (int)((upperLeftY - dirFromNode.getY()) / (1000/factor)-(size*0.875)));
		}
		if(dirToNode != null) {
			int size = 32;
			Image locImg = locationImg.getImage();
			Image newImg = locImg.getScaledInstance(size, size, 0);
			locationImg = new ImageIcon(newImg);
			locationImg.paintIcon(this, g2, (int)((dirToNode.getX() - upperLeftX) / (1000/factor))-size/2, (int)((upperLeftY - dirToNode.getY()) / (1000/factor)-(size*0.875)));
		}
		dragging = false;
	}