code: public static Object activateAntiAliasing (Graphics2D gfx)
      {
          RenderingHints ohints = gfx.getRenderingHints(), nhints = new RenderingHints(null);
          nhints.add(ohints);
          nhints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
          nhints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
          gfx.setRenderingHints(nhints);
          return ohints;
      }
docs: Activates anti-aliasing in the supplied graphics context on both text and 2D drawing
  primitives.
  
  @return an object that should be passed to {@link #restoreAntiAliasing} to restore the
  graphics context to its original settings.