FileDocCategorySizeDatePackage
JavaSurface.javaAPI DocphoneME MR2 API (J2ME)3852Wed May 02 18:00:36 BST 2007com.sun.pisces

JavaSurface

public final class JavaSurface extends AbstractSurface

Fields Summary
private int[]
dataInt
private short[]
dataShort
private byte[]
dataByte
Constructors Summary
public JavaSurface(int[] data, int width, int height)

        this(data, TYPE_INT_ARGB, width, height);
    
public JavaSurface(int[] dataInt, int dataType, int width, int height)

        this.dataInt = dataInt;

        switch (dataType) {
            case TYPE_INT_RGB:
            case TYPE_INT_ARGB:
            case TYPE_INT_ARGB_PRE:
                break;
            case TYPE_USHORT_565_RGB:
            case TYPE_BYTE_GRAY:            
                throw new IllegalArgumentException("Use different constructor"
                        + " for " + JavaSurface.class.getName() + " to use this"
                        + " data type");
            default:
                throw new IllegalArgumentException("Data type not supported "
                        + " for " + JavaSurface.class.getName());
        }

        initialize(dataType, width, height);
    
public JavaSurface(short[] dataShort, int dataType, int width, int height)

        this.dataShort = dataShort;

        switch (dataType) {
            case TYPE_USHORT_565_RGB:
                break;
            case TYPE_INT_RGB:
            case TYPE_INT_ARGB:
            case TYPE_INT_ARGB_PRE:
            case TYPE_BYTE_GRAY:    
                throw new IllegalArgumentException("Use different constructor"
                        + " for " + JavaSurface.class.getName() + " to use this"
                        + " data type");
            default:
                throw new IllegalArgumentException("Data type not supported "
                        + " for " + JavaSurface.class.getName());
        }

        initialize(dataType, width, height);
    
public JavaSurface(byte[] dataByte, int dataType, int width, int height)

        this.dataByte = dataByte;

        switch (dataType) {
            case TYPE_BYTE_GRAY:
                break;
            case TYPE_INT_RGB:
            case TYPE_INT_ARGB:
            case TYPE_INT_ARGB_PRE:
            case TYPE_USHORT_565_RGB:
                throw new IllegalArgumentException("Use different constructor"
                        + " for " + JavaSurface.class.getName() + " to use this"
                        + " data type");
            default:
                throw new IllegalArgumentException("Data type not supported "
                        + " for " + JavaSurface.class.getName());
        }

        initialize(dataType, width, height);
    
Methods Summary
private native voidinitialize(int dataType, int width, int height)