@Override
		public void paintComponent(Graphics g)
		{
			super.paintComponent(g);

			// Draws the background
			paintBackground(g);

			// Creates or destroys the triple buffer as needed
			if (tripleBuffered)
			{
				checkTripleBuffer();
			}
			else if (tripleBuffer != null)
			{
				destroyTripleBuffer();
			}

			// Paints the buffer in the canvas onto the dirty region
			if (tripleBuffer != null)
			{
				mxUtils.drawImageClip(g, tripleBuffer, this);
			}

			// Paints the graph directly onto the graphics
			else
			{
				Graphics2D g2 = (Graphics2D) g;
				RenderingHints tmp = g2.getRenderingHints();

				// Sets the graphics in the canvas
				try
				{
					mxUtils.setAntiAlias(g2, antiAlias, textAntiAlias);
					drawGraph(g2, true);
				}
				finally
				{
					// Restores the graphics state
					g2.setRenderingHints(tmp);
				}
			}

			eventSource.fireEvent(new mxEventObject(mxEvent.PAINT, "g", g));
		}