State to store/restore the state of a NetGraphics/Graphics object
Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 protected void init(Graphics graphics)
 {
     NetGraphicsState state = new NetGraphicsState();
     state.saveGraphics(this);
     g = graphics;
     state.restoreGraphics(this);            
 }
Exemplo n.º 3
0
 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;
 }