protected void paintBackground(Graphics g)
	{
		if (graphComponent != null)
		{
			Graphics2D g2 = (Graphics2D) g;
			AffineTransform tx = g2.getTransform();

			try
			{
				// Draws the background of the outline if a graph exists 
				g.setColor(graphComponent.getPageBackgroundColor());
				mxUtils.fillClippedRect(g, 0, 0, getWidth(), getHeight());

				g2.translate(translate.x, translate.y);
				g2.scale(scale, scale);

				// Draws the scaled page background
				if (!graphComponent.isPageVisible())
				{
					Color bg = graphComponent.getBackground();

					if (graphComponent.getViewport().isOpaque())
					{
						bg = graphComponent.getViewport().getBackground();
					}

					g.setColor(bg);
					Dimension size = graphComponent.getGraphControl().getSize();

					// Paints the background of the drawing surface
					mxUtils.fillClippedRect(g, 0, 0, size.width, size.height);
					g.setColor(g.getColor().darker().darker());
					g.drawRect(0, 0, size.width, size.height);
				}
				else
				{
					// Paints the page background using the graphics scaling
					graphComponent.paintBackgroundPage(g);
				}
			}
			finally
			{
				g2.setTransform(tx);
			}
		}
		else
		{
			// Draws the background of the outline if no graph exists 
			g.setColor(getBackground());
			mxUtils.fillClippedRect(g, 0, 0, getWidth(), getHeight());
		}
	}