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

import java.awt.geom.GeneralPath;
import java.lang.ref.WeakReference;

public class Glyph {
    private int charCode;
    private int gid;
    private double xPos;
    private double yPos;
    private WeakReference<GeneralPath> savedGlyphOutline;
    protected int id;

    protected Glyph() {
    }

    public Glyph(int charCode, int gid, double xPos, double yPos, int id) {
        this.setCharCode(charCode);
        this.setGID(gid);
        this.setXPos(xPos);
        this.setYPos(yPos);
        this.id = id;
    }

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

    public int getCharCode() {
        return this.charCode;
    }

    public void setCharCode(int charCode) {
        this.charCode = charCode;
    }

    public int getGID() {
        return this.gid;
    }

    public void setGID(int gid) {
        this.gid = gid;
    }

    public double getXPos() {
        return this.xPos;
    }

    public void setXPos(double xPos) {
        this.xPos = xPos;
    }

    public double getYPos() {
        return this.yPos;
    }

    public void setYPos(double yPos) {
        this.yPos = yPos;
    }

    public GeneralPath getGlyphOutline() {
        if (this.savedGlyphOutline != null) {
            return this.savedGlyphOutline.get();
        }
        return null;
    }

    public void setGlyphOutline(GeneralPath savedGlyphOutline) {
        this.savedGlyphOutline = new WeakReference<GeneralPath>(savedGlyphOutline);
    }
}