Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.awt.image.*;

public class Main {
    /**
     * Decodes the bits of a java.awt.image.ImageObserver infoflag into a human
     * readable string.
     * 
     * @param infoflag
     *            the flag to decode
     * @return a string describing the flag
     */
    public static String imageObserverInfoflagToString(int infoflag) {
        String out = "";
        if ((infoflag & ImageObserver.ABORT) == ImageObserver.ABORT)
            out += "ABORT ";
        if ((infoflag & ImageObserver.ALLBITS) == ImageObserver.ALLBITS)
            out += "ALLBITS ";
        if ((infoflag & ImageObserver.ERROR) == ImageObserver.ERROR)
            out += "ERROR ";
        if ((infoflag & ImageObserver.FRAMEBITS) == ImageObserver.FRAMEBITS)
            out += "FRAMEBITS ";
        if ((infoflag & ImageObserver.HEIGHT) == ImageObserver.HEIGHT)
            out += "HEIGHT ";
        if ((infoflag & ImageObserver.PROPERTIES) == ImageObserver.PROPERTIES)
            out += "PROPERTIES ";
        if ((infoflag & ImageObserver.SOMEBITS) == ImageObserver.SOMEBITS)
            out += "SOMEBITS ";
        if ((infoflag & ImageObserver.WIDTH) == ImageObserver.WIDTH)
            out += "WIDTH ";
        return out;
    }
}