/** Clears all the ComputerPartErrorEventListeners from errors. */ public void clearErrorListeners() { ComputerPartErrorEvent event = new ComputerPartErrorEvent(this, null); for (int i = 0; i < errorListeners.size(); i++) ((ComputerPartErrorEventListener) errorListeners.elementAt(i)) .computerPartErrorOccured(event); }
/** * Notifies all the ComputerPartErrorEventListeners on an error that occured in the computer part * by creating a ComputerPartErrorEvent (with the error message) and sending it using the * computerPartErrorOccured method to all the listeners. */ public void notifyErrorListeners(String errorMessage) { ComputerPartErrorEvent event = new ComputerPartErrorEvent(this, errorMessage); for (int i = 0; i < errorListeners.size(); i++) ((ComputerPartErrorEventListener) errorListeners.elementAt(i)) .computerPartErrorOccured(event); }
/** * Notifies all the ProgramEventListeners on a change in the ROM's program by creating a * ProgramEvent (with the new event type and program's file name) and sending it using the * programChanged method to all the listeners. */ protected void notifyProgramListeners(byte eventType, String programFileName) { ProgramEvent event = new ProgramEvent(this, eventType, programFileName); for (int i = 0; i < listeners.size(); i++) { ((ProgramEventListener) listeners.elementAt(i)).programChanged(event); } }
public void notifyListeners() { ComputerPartEvent event = new ComputerPartEvent(this); for (int i = 0; i < listeners.size(); i++) { ((ComputerPartEventListener) listeners.elementAt(i)).guiGainedFocus(); } }
/** * Notifies all the ComputerPartEventListeners on a change in the memory by creating a MemoryEvent * (with the changed address and value) and sending it using the memoryChanged method to all the * listeners. */ public void notifyListeners(int address, short value) { ComputerPartEvent event = new ComputerPartEvent(this, address, value); for (int i = 0; i < listeners.size(); i++) { ((ComputerPartEventListener) listeners.elementAt(i)).valueChanged(event); } }