Creates a graphics context for the specified graphics rectangle.
First computes a scale factor from the dimensions of this panel
and those of the specified graphics rectangle. Then
(1) sets the clip rectangle using the specified graphics rectangle,
(2) translates the coordinate system by the specified (x,y),
(3) sets the line width, and
(4) sets the font to be a scaled version of this panel's font.
Classes that extend this base class typically call this method in
their implementation of
#paintToRect(java.awt.Graphics2D,int,int,int,int).
When painting to a high-resolution image, this method makes lines
and text appear as they would on screen, neither too thin nor too
small.
When the returned graphics context is no longer needed, it should
be disposed.