public override void dispose() { myState = null; if (pen != null) pen.Dispose(); if (brush != null) brush.Dispose(); disposed = true; if (!isBase) { // only dispose the underlying Graphics if this is the base PrintGraphics! return; } base.dispose(); }
protected void init(Graphics graphics) { NetGraphicsState state = new NetGraphicsState(); state.saveGraphics(this); g = graphics; state.restoreGraphics(this); }
public override java.awt.Graphics create() { checkState(); myState = new NetGraphicsState(); myState.saveGraphics(this); PrintGraphics newGraphics = (PrintGraphics)MemberwiseClone(); newGraphics.myState = null; newGraphics.isBase = false; newGraphics.baseContext = baseContext; baseContext.Current = newGraphics; // since it is very likely that the next op will be on that graphics // this is similar to init myState.restoreGraphics(newGraphics); return newGraphics; }