Add the listeners according to the mask.
174964
protected void addListeners() {
    // Listen for result changes, including the one we monitor
    context.addResultListener(this);
    context.addVisualizationListener(this);
    // Listen for database events only when needed.
    if(task.has(UpdateFlag.ON_DATA)) {
      context.addDataStoreListener(this);
    }
  }
1048102
public void addListeners()
    {
        super.addListeners();
        
        this.addListener(new DateChangedHandler((DateTimeField)this.getField(Person.DATE_CHANGED)));
        this.addListener(new SetUserIDHandler(Person.CHANGED_ID, false));
        
        this.getField(Person.NAME).addListener(new CopyLastHandler(this.getField(Person.NAME_SORT)));    // Only if dest is null (ie., company name is null)
        this.getField(Person.NAME_SORT).addListener(new FieldToUpperHandler(null));
        
        this.getField(Person.POSTAL_CODE).addListener(new CopyFieldHandler(this.getField(Person.POSTAL_CODE_SORT)));
    }
71938
def add_listener(self, listener, question):
        """"""
        now = current_time_millis()
        self.listeners.append(listener)
        if question is not None:
            for record in self.cache.entries_with_name(question.name):
                if question.answered_by(record) and not record.is_expired(now):
                    listener.update_record(self, now, record)
        self.notify_all()
1086683
public void addListeners()
    {
        super.addListeners();
        Record record = this.getMainRecord();
        Record recClassInfo = this.getRecord(ClassInfo.CLASS_INFO_FILE);
        if (recClassInfo != null)
        {
            record.setKeyArea(ScreenIn.SCREEN_IN_PROG_NAME_KEY);
            SubFileFilter listener = new SubFileFilter(recClassInfo.getField(ClassInfo.CLASS_NAME), ScreenIn.SCREEN_IN_PROG_NAME, null, null, null, null, true);
            record.addListener(listener);
            recClassInfo.getField(ClassInfo.CLASS_NAME).addListener(new FieldReSelectHandler(this));
        }
    }
181695
public void addListeners()
    {
        super.addListeners();
        
        if (this.isContactDisplay())
        {
            ReferenceField field = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID);
            field.setValue(field.getReferenceRecord(this).getIDFromCode(MessageInfoType.REQUEST));
            field = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TYPE_ID);
            field.setValue(field.getReferenceRecord(this).getIDFromCode(MessageType.MESSAGE_OUT));
            field = (ReferenceField)this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_STATUS_ID);
            field.setValue(field.getReferenceRecord(this).getIDFromCode(MessageStatus.SENT));
        }
        
        this.getMainRecord().getKeyArea().setKeyOrder(DBConstants.DESCENDING);
        
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.REFERENCE_ID), this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.REFERENCE_TYPE), this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_TYPE), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.REFERENCE_TYPE).addListener(new FieldReSelectHandler(this));
        
        this.getScreenRecord().getField(MessageLogScreenRecord.CONTACT_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_INFO_TYPE_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TYPE_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TYPE_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TYPE_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_STATUS_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_STATUS_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_STATUS_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TRANSPORT_ID), this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TRANSPORT_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.MESSAGE_TRANSPORT_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.USER_ID), this.getScreenRecord().getField(MessageLogScreenRecord.USER_ID), DBConstants.EQUALS, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.USER_ID).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TIME), this.getScreenRecord().getField(MessageLogScreenRecord.START_DATE), CompareFileFilter.GREATER_THAN_EQUAL, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.START_DATE).addListener(new FieldReSelectHandler(this));
        this.getMainRecord().addListener(new CompareFileFilter(this.getMainRecord().getField(MessageLog.MESSAGE_TIME), this.getScreenRecord().getField(MessageLogScreenRecord.END_DATE), CompareFileFilter.LESS_THAN_EQUAL, null, true));
        this.getScreenRecord().getField(MessageLogScreenRecord.END_DATE).addListener(new FieldReSelectHandler(this));
        
        this.setEditing(false);
    }
371497
public void addListeners()
    {
        super.addListeners();
        Map<String,Object> map = Utility.arrayToMap(DESCRIPTIONS);
        ((PropertiesField)this.getField(MessageControl.PROPERTIES)).setMapKeyDescriptions(map);
    }
344921
public synchronized void addListener(String threadPrefix,
			EventListener listener) {
		if (threadPrefix.trim().equals("")) {
			globalListeners.addElement(listener);
		} else {
			keyedListeners.put(threadPrefix.trim(), listener);
		}
	}
429799
function applyMask(mask) {
    var x, y, r3x, r3y;

    switch (mask) {
      case 0:
        for (y = 0; y < width; y++) {
          for (x = 0; x < width; x++) {
            if (!((x + y) & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 1:
        for (y = 0; y < width; y++) {
          for (x = 0; x < width; x++) {
            if (!(y & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 2:
        for (y = 0; y < width; y++) {
          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!r3x && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 3:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = r3y, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!r3x && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 4:
        for (y = 0; y < width; y++) {
          for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++, r3x++) {
            if (r3x === 3) {
              r3x = 0;
              r3y = !r3y;
            }

            if (!r3y && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 5:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!((x & y & 1) + !(!r3x | !r3y)) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 6:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!(((x & y & 1) + (r3x && (r3x === r3y))) & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
      case 7:
        for (r3y = 0, y = 0; y < width; y++, r3y++) {
          if (r3y === 3) r3y = 0;

          for (r3x = 0, x = 0; x < width; x++, r3x++) {
            if (r3x === 3) r3x = 0;

            if (!(((r3x && (r3x === r3y)) + ((x + y) & 1)) & 1) && !isMasked(x, y)) {
              frameBuffer[x + y * width] ^= 1;
            }
          }
        }

        break;
    }
  }
241399
function addListener(event, callback, meta) {
  event.listeners.push(callback);
  event.meta.set(callback, meta);
}
300908
public void addListeners()
    {
        super.addListeners();
        this.getScreenRecord().getField(MessageInfoScreenRecord.MESSAGE_INFO_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.MESSAGE_INFO_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.MESSAGE_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.PROCESS_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.CONTACT_TYPE_ID).setEnabled(true);
        this.getScreenRecord().getField(MessageInfoScreenRecord.REQUEST_TYPE_ID).setEnabled(true);
    }
1350429
private void addListeners() {
	    this.min.xProperty().addListener((observable, oldValue, nValue) -> {
	        final double currentMin = nValue.doubleValue();
	        final double currentMax = getMaxX();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            maxXProperty().set(currentMin);
	        }
	    });
	    this.min.yProperty().addListener((observable, oValue, nValue) -> {
	        final double currentMin = nValue.doubleValue();
	        final double currentMax = getMaxY();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            maxYProperty().set(currentMin);
	        }
	    });
	    this.max.xProperty().addListener((observable, oValue, nValue) -> {
	        final double currentMax = nValue.doubleValue();
	        final double currentMin = getMinX();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            minXProperty().set(currentMax);
	        }
	    });
	    this.max.yProperty().addListener((observable, oValue, nValue) -> {
	        final double currentMax = nValue.doubleValue();
	        final double currentMin = getMinY();
	        if (currentMax < currentMin) {
	            // min-max constrain is broken
	            minYProperty().set(currentMax);
	        }
	    });
	}
441696
public void addMasterListeners()
    {
        super.addMasterListeners();
        
        this.addListener(new SetUserIDHandler(ProjectTask.ENTERED_BY_USER_ID, true));
        this.addListener(new SetUserIDHandler(ProjectTask.CHANGED_BY_USER_ID, true));
        this.addListener(new DateChangedHandler(ProjectTask.CHANGED_DATE));
        
        FieldListener listener = null;
        this.getField(ProjectTask.END_DATE_TIME).addListener(listener = new InitDateOffsetHandler(this.getField(ProjectTask.DURATION), (DateTimeField)this.getField(ProjectTask.START_DATE_TIME)));
        listener.setRespondsToMode(DBConstants.READ_MOVE, true);
        
        this.getField(ProjectTask.END_DATE_TIME).addListener(listener = new ReComputeTimeOffsetHandler(ProjectTask.DURATION, (DateTimeField)this.getField(ProjectTask.START_DATE_TIME)));
        
        this.getField(ProjectTask.START_DATE_TIME).addListener(listener = new ReComputeEndDateHandler(ProjectTask.END_DATE_TIME, (NumberField)this.getField(ProjectTask.DURATION)));
        
        this.getField(ProjectTask.DURATION).addListener(listener = new ChangeOnChangeHandler(this.getField(ProjectTask.START_DATE_TIME)));
        listener.setRespondsToMode(DBConstants.INIT_MOVE, false);
        
        
        this.getField(ProjectTask.START_DATE_TIME).addListener(new InitFieldHandler((BaseField)null)
        {
            public int fieldChanged(boolean bDisplayOption, int iMoveMode)
            {
                if (!getField(ProjectTask.PARENT_PROJECT_TASK_ID).isNull())
                {
                    Record recParent = ((ReferenceField)getField(ProjectTask.PARENT_PROJECT_TASK_ID)).getReference();
                    if (recParent != null)
                        if ((recParent.getEditMode() == DBConstants.EDIT_IN_PROGRESS) || (recParent.getEditMode() == DBConstants.EDIT_CURRENT))
                        {
                            if (recParent.getField(ProjectTask.HAS_CHILDREN).getState() == true)
                                return this.getOwner().moveFieldToThis(recParent.getField(ProjectTask.END_DATE_TIME), bDisplayOption, iMoveMode);
                            else
                                return this.getOwner().moveFieldToThis(recParent.getField(ProjectTask.START_DATE_TIME), bDisplayOption, iMoveMode);
                        }
                }
                return super.fieldChanged(bDisplayOption, iMoveMode);
            }
        });
        
        this.addListener(new UpdateChildrenHandler(null));
        this.addListener(new UpdateDependenciesHandler(null));
        this.addListener(new SurveyDatesHandler(null));
        
        
        // todo (don) Move these to the server environment
        this.addListener(new SubFileIntegrityHandler(ProjectTask.class.getName(), true));
        
        this.addListener(new SubFileIntegrityHandler(ProjectTaskPredecessor.class.getName(), true));
        
        this.addListener(new SubFileIntegrityHandler(ProjectTaskPredecessor.class.getName(), true)
        {
            public Record getSubRecord()
            {
                if (m_recDependent == null)
                    m_recDependent = this.createSubRecord();
                if (m_recDependent != null)
                {
                    if (m_recDependent.getListener(SubFileFilter.class.getName()) == null)
                    {
                        m_recDependent.addListener(new SubFileFilter(getField(ProjectTask.ID), ProjectTaskPredecessor.PROJECT_TASK_ID, null, null, null, null));
                        m_recDependent.setKeyArea(ProjectTaskPredecessor.PROJECT_TASK_ID_KEY);
                    }
                }
                return m_recDependent;
            }
        });
    }
788937
public void addComponentListeners() {
        // avoid duplicate registration
        removeListeners();

        for (final AbstractField<?> field : allComponents) {
            if (field instanceof TextChangeNotifier) {
                ((TextChangeNotifier) field).addTextChangeListener(new ChangeListener(field));
            }

            if (field instanceof Table) {
                ((Table) field).addItemSetChangeListener(new ChangeListener(field));
            }
            field.addValueChangeListener(new ChangeListener(field));
        }
    }
869459
def set_listener(self, name, listener):
        
        with self.__listeners_change_condition:
            self.listeners[name] = listener
617905
public void addMasterListeners()
    {
        super.addMasterListeners();
        this.addListener(new CalcTimeoutTimeHandler(null));
        this.addListener(new NotifyTimeoutProcessHandler(null));
        this.addListener(new NoDeleteModifyHandler(true, false));   // Can't delete these
    }
750707
function(mask) {
        var options = this.options,
            message;

        // Prepare mask
        mask.addClass('hide').appendTo(this.element);

        if (this.element.is('body')) {
            mask.css('position', 'fixed');
        }

        if (options.revealOnClick) {
            mask.click(this.hide.bind(this));
        }

        this.mask = mask;

        // Create message if it does not exist
        message = mask.find(this.ns('message'));

        if (!message.length && options.messageContent) {
            message = this.render(options.messageTemplate)
                .html(options.messageContent)
                .appendTo(mask);
        }

        this.message = message;
    }
33175
public void addListeners()
    {
        super.addListeners();
        this.getScreenRecord().getField(PackagesReportScreenRecord.JNLP_FILE_ID).addListener(new ReadSecondaryHandler(this.getRecord(JnlpFile.JNLP_FILE_FILE)));
    }