PDFWritingMode.java 1.45 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException
 */
package com.adobe.internal.pdftoolkit.pdf.graphics.font;

import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException;

/*
 * This class specifies class file version 49.0 but uses Java 6 signatures.  Assumed Java 6.
 */
public enum PDFWritingMode {
    HORIZONTAL(0),
    VERTICAL(1);
    
    private final int mode;

    private PDFWritingMode(int mode) {
        this.mode = mode;
    }

    public String toString() {
        String modeStr = null;
        switch (this.mode) {
            case 0: {
                modeStr = "horizontal writing mode";
                break;
            }
            case 1: {
                modeStr = "vertical writing mode";
            }
        }
        return modeStr;
    }

    int getValue() {
        return this.mode;
    }

    public static final PDFWritingMode getWritingModeForValue(int modeValue) throws PDFInvalidParameterException {
        PDFWritingMode mode = null;
        switch (modeValue) {
            case 0: {
                mode = HORIZONTAL;
                break;
            }
            case 1: {
                mode = VERTICAL;
                break;
            }
            default: {
                throw new PDFInvalidParameterException("illegal writing mode value");
            }
        }
        return mode;
    }
}