ControlEvent.java :  » Game » sf-library » com » studiofortress » sf » graphics » display » Java Open Source

Java Open Source » Game » sf library 
sf library » com » studiofortress » sf » graphics » display » ControlEvent.java

package com.studiofortress.sf.graphics.display;

/**
 * This is a marker class for events. It doesn't do anything other then provide
 * a superclass which is lower then Object (which obviously could mean anything).
 * 
 * It also defines a handled flag for stating if the event has been used or not.
 * Once the flag is set then it will be ignored by the SF framework internally.
 *
 * After you have used the event you should call setHandled() so it's flagged to
 * be ignored.
 * 
 * @author Joseph Lenton - JosephLenton@StudioFortress.com
 */
public abstract class ControlEvent
{
    private boolean isHandled;

    /**
     * Trivial constructor.
     */
    ControlEvent()
    {
        isHandled = false;
    }
    
    /**
     * Flags this as being handled and so shouldn't be used anymore.
     */
    public void setHandled()
    {
        isHandled = true;
    }
    
    /**
     * States if this ControlEvent has been handled or not.
     * @return True if this has been handled and should no longer be used, otherwise false.
     */
    public boolean isHandled()
    {
        return isHandled;
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.