Package com.github.weisj.jsvg.util
Class GraphicsResetHelper
java.lang.Object
com.github.weisj.jsvg.util.GraphicsResetHelper
- All Implemented Interfaces:
Output.SafeState
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Graphics2D
private final Composite
private final Paint
private final Stroke
private final AffineTransform
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
graphics
-
originalComposite
-
originalPaint
-
originalStroke
-
originalTransform
-
-
Constructor Details
-
GraphicsResetHelper
-
-
Method Details
-
graphics
-
restore
public void restore()- Specified by:
restore
in interfaceOutput.SafeState
-