All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.actelion.research.gui.generic.GenericEventHandler Maven / Gradle / Ivy

There is a newer version: 2024.11.2
Show newest version
package com.actelion.research.gui.generic;

import java.util.ArrayList;

public abstract class GenericEventHandler {
	private ArrayList> mListeners;
	private Object mSource;

	public GenericEventHandler(Object source) {
		mSource = source;
		mListeners = new ArrayList<>();
	}

	public Object getSource() {
		return mSource;
	}

	public void addListener(GenericEventListener e) {
		mListeners.add(e);
	}

	public void removeListener(GenericEventListener e) {
		mListeners.remove(e);
	}

	public void fireEvent(T e) {
		for (GenericEventListener gel:mListeners)
			gel.eventHappened(e);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy