Esempio n. 1
0
  /**
   * 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 ErrorEventListener on an error in this gui by creating an ErrorEvent (with the
  * error message) and sending it using the errorOccured method to all the listeners.
  */
 public void notifyErrorListeners(String errorMessage) {
   ErrorEvent event = new ErrorEvent(this, errorMessage);
   for (int i = 0; i < errorEventListeners.size(); i++)
     ((ErrorEventListener) errorEventListeners.elementAt(i)).errorOccured(event);
 }
 /**
  * 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);
   }
 }