Class GraphicsResetHelper


  • public class GraphicsResetHelper
    extends java.lang.Object
    A utility class that holds a Graphics2D object and is able to reset it back to its original configuration, as this is often more efficient than creating a new graphics instance. This class does not track what parameters have been modified, nor does it reset all configuration parameters. Which parameters are reset should be expanded as needed.
    • Constructor Summary

      Constructors 
      Constructor Description
      GraphicsResetHelper​(java.awt.Graphics2D graphics)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Graphics2D graphics()  
      void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • graphics

        private final java.awt.Graphics2D graphics
      • originalComposite

        private final java.awt.Composite originalComposite
      • originalPaint

        private final java.awt.Paint originalPaint
      • originalStroke

        private final java.awt.Stroke originalStroke
      • originalTransform

        private final java.awt.geom.AffineTransform originalTransform
    • Constructor Detail

      • GraphicsResetHelper

        public GraphicsResetHelper​(java.awt.Graphics2D graphics)
    • Method Detail

      • graphics

        public java.awt.Graphics2D graphics()
      • reset

        public void reset()