private void drawShape(Shape shape, BasicGraphicalElement element, Color backupColor) {
		GraphicAttributes attributes = element.getGraphicAttributes();
		Color fillColor = null;
		if (element.isClosed() && attributes instanceof FillAttributes) {
			fillColor = ((FillAttributes) attributes).getFillColor();
		}
		if (fillColor != null) {
			_graphics.setColor(fillColor);
			_graphics.fill(shape);
		}
		Color lineColor = _defaultColor;
		if (attributes instanceof LineAttributes) {
			LineAttributes la = (LineAttributes) attributes;
			BasicStroke stroke = new BasicStroke((float) la.getLineThickness());
			double[] linePattern = la.getLinePattern();
			if (linePattern != null) {
				float[] dash = new float[linePattern.length];
				for (int i = 0; i < dash.length; i++) {
					dash[i] = (float) la.getLinePattern()[i];
				}
				stroke = new BasicStroke(stroke.getLineWidth(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10f,
						dash, 0f);
			}
			_graphics.setStroke(stroke);
			if (la.getLineColor() != null || fillColor != null) {
				lineColor = la.getLineColor();
			}
		}
		if (lineColor != null) {
			_graphics.setColor(lineColor);
			_graphics.draw(shape);
		}
		_graphics.setColor(backupColor);
	}