class PDShadingPattern extends PDAbstractPattern
{
    private PDExtendedGraphicsState extendedGraphicsState;
    private PDShading shading;

    /**
     * Creates a new shading pattern.
     */
    public PDShadingPattern()
    {
        getCOSObject().setInt(COSName.PATTERN_TYPE, PDAbstractPattern.TYPE_SHADING_PATTERN);
    }

    /**
     * Creates a new shading pattern from the given COS dictionary.
     * @param resourceDictionary The COSDictionary for this pattern resource.
     */
    public PDShadingPattern(COSDictionary resourceDictionary)
    {
        super(resourceDictionary);
    }

    @Override
    public int getPatternType()
    {
        return PDAbstractPattern.TYPE_SHADING_PATTERN;
    }

    /**
     * This will get the external graphics state for this pattern.
     * @return The extended graphics state for this pattern.
     */
    public PDExtendedGraphicsState getExtendedGraphicsState()
    {<FILL_FUNCTION_BODY>}

    /**
     * This will set the external graphics state for this pattern.
     * @param extendedGraphicsState The new extended graphics state for this pattern.
     */
    public void setExtendedGraphicsState(PDExtendedGraphicsState extendedGraphicsState)
    {
        this.extendedGraphicsState = extendedGraphicsState;
        getCOSObject().setItem(COSName.EXT_G_STATE, extendedGraphicsState);
    }

    /**
     * This will get the shading resources for this pattern.
     * @return The shading resources for this pattern.
     * @throws IOException if something went wrong
     */
    public PDShading getShading() throws IOException
    {
        if (shading == null)
        {
            COSDictionary base = getCOSObject().getCOSDictionary(COSName.SHADING);
            if (base != null)
            {
                shading = PDShading.create(base);
            }
        }
        return shading;
    }

    /**
     * This will set the shading resources for this pattern.
     * @param shadingResources The new shading resources for this pattern.
     */
    public void setShading( PDShading shadingResources )
    {
        shading = shadingResources;
        getCOSObject().setItem(COSName.SHADING, shadingResources);
    }
}

        if (extendedGraphicsState == null)
        {
            COSDictionary base = getCOSObject().getCOSDictionary(COSName.EXT_G_STATE);
            if (base != null)
            {
                extendedGraphicsState = new PDExtendedGraphicsState(base);
            }
        }
        return extendedGraphicsState;
    
<methods>public void <init>() ,public void <init>(org.apache.pdfbox.cos.COSDictionary) ,public static org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern create(org.apache.pdfbox.cos.COSDictionary, org.apache.pdfbox.pdmodel.ResourceCache) throws java.io.IOException,public org.apache.pdfbox.cos.COSDictionary getCOSObject() ,public org.apache.pdfbox.util.Matrix getMatrix() ,public abstract int getPatternType() ,public java.lang.String getType() ,public void setMatrix(java.awt.geom.AffineTransform) ,public void setPaintType(int) ,public void setPatternType(int) <variables>public static final int TYPE_SHADING_PATTERN,public static final int TYPE_TILING_PATTERN,private final non-sealed org.apache.pdfbox.cos.COSDictionary patternDictionary