/** Constructs a new graphics export canvas. */
  public mxGraphicsCanvas2D(Graphics2D g) {
    setGraphics(g);
    state.g = g;

    // Initializes the cell renderer pane for drawing HTML markup
    try {
      rendererPane = new CellRendererPane();
    } catch (Exception e) {
      // ignore
    }
  }
 /** Saves the current canvas state. */
 public void save() {
   stack.push(state);
   state = cloneState(state);
   state.g = (Graphics2D) state.g.create();
 }