public void Run(Component comp, Graphics cg) { if (comp.Peer_Renamed is LightweightPeer) { comp.PrintHeavyweightComponents(cg); } else { comp.PrintAll(cg); } }
/// <summary> /// Prints the component in this scroll pane. </summary> /// <param name="g"> the specified Graphics window </param> /// <seealso cref= Component#print </seealso> /// <seealso cref= Component#printAll </seealso> public override void PrintComponents(Graphics g) { if (ComponentCount == 0) { return; } Component c = GetComponent(0); Point p = c.Location; Dimension vs = ViewportSize; Insets i = Insets; Graphics cg = g.Create(); try { cg.ClipRect(i.Left, i.Top, vs.Width_Renamed, vs.Height_Renamed); cg.Translate(p.x, p.y); c.PrintAll(cg); } finally { cg.Dispose(); } }
public void Run(Component comp, Graphics cg) { comp.PrintAll(cg); }