AbstractContentItem.java 1.09 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.internal.pdftoolkit.graphicsDOM;

import com.adobe.internal.pdftoolkit.graphicsDOM.ContentItem;
import com.adobe.internal.pdftoolkit.graphicsDOM.DocumentContext;
import com.adobe.internal.pdftoolkit.graphicsDOM.GraphicsState;

/*
 * This class specifies class file version 49.0 but uses Java 6 signatures.  Assumed Java 6.
 */
public abstract class AbstractContentItem<G extends GraphicsState>
implements ContentItem<G> {
    private G graphicsState;
    private int id = 0;

    public AbstractContentItem(G graphicsState, int id) {
        this.setGState(graphicsState);
        this.id = id;
    }

    public G getGState() {
        return this.graphicsState;
    }

    public void setGState(G gState) {
        this.graphicsState = gState;
    }

    @Override
    public int getID() {
        return this.id;
    }

    public void writeToDisplayArea(DocumentContext holder) {
        if (this.getGState() != null) {
            holder.graphicsStateChanged();
            this.getGState().writeToDisplayArea((DocumentContext)holder);
        }
    }
}