package j3deditor.bin.hierarchy.util;


/**
 * Event generated by a component that has manipulated the scene hierarchy.
 *
 * @author Risto Seene
 * 
 * @see HierarchyEventListener
 */
public class HierarchyEvent{


	/** new hierarchy node has been added. */
	public static final int OBJECT_ADDITION = 0;

	/** a hierarchy node has been selected. */
	public static final int OBJECT_SELECTION = 1;

	/** a hierarchy node has been removed from scene. */
	public static final int OBJECT_REMOVAL = 2;

	/** an object has been transformed. */
	public static final int OBJECT_TRANSFORMATION = 3;

	/** the camera has been transformed. */
	public static final int CAMERA_TRANSFORMATION = 4;

	/** the <code>BranchGroup</code> object has been detached from a virtual universe. */
	public static final int BRANCHGROUP_DETACH = 5;
	
	/** the object has been altered. */
	public static final int OBJECT_ALTERATION = 6;


	/** source of this event */
	private Object source;

	/** the type of this event */
	private int type;


	/**
	 * Creates an instance of <code>EditorEvent</code>
	 * with the given source and type.
	 *
	 * @param source
	 *	source of this event
	 * @param type
	 *	the type of this event
	 */
	public HierarchyEvent(Object source, int type){
		this.source = source;
		this.type = type;
	}


	/**
	 * Returns the sender of this event.
	 *
	 * @return Returns the sender of this event
	 */
	public Object getSource(){
		return source;
	}


	/**
	 * Returns the type of this event.
	 *
	 * @return Returns the type of this event
	 */
	public int getEventType(){
		return type;
	}

}
