@Override
	public void paintObject(Graphics g) {

		Lane l = this.getCurrentLane();
		Street s = l.getStreet();

		g.setColor(carColor);
		
		Point brakeLight = null;

		Double convertedPos =  ( (double) this.getCurrentPosOnLane() / (double) s.getPositionsOnStreet() * (double) s.getLenght());


		if (s.isHorizontal()) {

			// Car is on a horizontal Street
			if (currentLane.isLeftToRight()) {

				// Drive from left to right
				this.setOrigin(new Point(l.getOrigin().x + convertedPos.intValue(), l.getOrigin().y + 5));
				
				if (this.brakeStatus) {
					brakeLight = new Point(l.getOrigin().x + convertedPos.intValue(), l.getOrigin().y + 5);
				}
				
			} else {
				// Drive from right to left
				this.setOrigin(new Point(l.getOrigin().x + l.getDimension().width- convertedPos.intValue() , l.getOrigin().y + 5));
				
				if (this.brakeStatus) {
					brakeLight = new Point(l.getOrigin().x + l.getDimension().width + dimension.width  - 2 - convertedPos.intValue(), l.getOrigin().y + 5);
				}
			}

			g.fillRect(origin.x, origin.y, dimension.width, dimension.height);
			
			if (brakeLight != null) {
				g.setColor(Color.RED);
				g.fillRect(brakeLight.x, brakeLight.y, 2, dimension.height);
			}


		} else {
			// Car is on a vertical Street
			if (currentLane.isTopToBottom()) {
				// Drive from left to right
				this.setOrigin(new Point(l.getOrigin().x + 5, l.getOrigin().y + convertedPos.intValue()));
				
				if (this.brakeStatus) {
					brakeLight = new Point(l.getOrigin().x + 5, l.getOrigin().y + convertedPos.intValue());
				}
				
				
			} else {
				// Drive from bottom to up
				this.setOrigin(new Point(l.getOrigin().x + 5, l.getOrigin().y + l.getDimension().height- convertedPos.intValue()));
				
				if (this.brakeStatus) {
					brakeLight = new Point(l.getOrigin().x + 5, l.getOrigin().y + l.getDimension().height + dimension.width - 2 - convertedPos.intValue());
				}
			}

			g.fillRect(origin.x, origin.y, dimension.height, dimension.width);
			
			if (brakeLight != null) {
				g.setColor(Color.RED);
				g.fillRect(brakeLight.x, brakeLight.y, dimension.height, 2);
			}
		}

	}