/** * Set the field that owns this listener. * @owner The field that this listener is being added to (if null, this listener is being removed). */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_fldTarget != null) if (m_fldTarget.getRecord() != this.getOwner().getRecord()) m_fldTarget.addListener(new FieldRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! if (this.getFieldTarget() != null) if (!(this.getFieldTarget().isVirtual()) && (!(this.getFieldTarget().getRecord() instanceof ScreenRecord))) if (this.respondsToMode(DBConstants.READ_MOVE) == true) if (this.respondsToMode(DBConstants.INIT_MOVE) == true) { // This is a performance issue if the field I'm updating is connected to a file this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to recompute on screen change this.setRespondsToMode(DBConstants.INIT_MOVE, false); // Usually, you only want to recompute on screen change } } } /**
/** * Set the field that owns this listener. * @owner The field that this listener is being added to (if null, this listener is being removed). */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_fldTarget != null) if (m_fldTarget.getRecord() != this.getOwner().getRecord()) m_fldTarget.addListener(new FieldRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! if (this.getFieldTarget() != null) if (!(this.getFieldTarget().isVirtual()) && (!(this.getFieldTarget().getRecord() instanceof ScreenRecord))) if (this.respondsToMode(DBConstants.READ_MOVE) == true) if (this.respondsToMode(DBConstants.INIT_MOVE) == true) { // This is a performance issue if the field I'm updating is connected to a file this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to recompute on screen change this.setRespondsToMode(DBConstants.INIT_MOVE, false); // Usually, you only want to recompute on screen change } } } /**
/** * Set the field that owns this listener. * @owner The field that this listener is being added to (if null, this listener is being removed). */ public void setOwner(ListenerOwner owner) { super.setOwner(owner); if (owner != null) { if (m_fldTarget != null) if (m_fldTarget.getRecord() != this.getOwner().getRecord()) m_fldTarget.addListener(new FieldRemoveBOnCloseHandler(this)); // Not same file, if target file closes, remove this listener! if (this.getFieldTarget() != null) if (!(this.getFieldTarget().isVirtual()) && (!(this.getFieldTarget().getRecord() instanceof ScreenRecord))) if (this.respondsToMode(DBConstants.READ_MOVE) == true) if (this.respondsToMode(DBConstants.INIT_MOVE) == true) { // This is a performance issue if the field I'm updating is connected to a file this.setRespondsToMode(DBConstants.READ_MOVE, false); // Usually, you only want to recompute on screen change this.setRespondsToMode(DBConstants.INIT_MOVE, false); // Usually, you only want to recompute on screen change } } } /**
/** * The Field has Changed. * Get the value of this listener's owner, pass it to the computeValue method and * set the returned value to the target field. * @param bDisplayOption If true, display the change. * @param iMoveMode The type of move being done (init/read/screen). * @return The error code (or NORMAL_RETURN if okay). * Field changed, re-compute the value in this field. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { double srcValue = ((NumberField)this.getOwner()).getValue(); BaseField fldTarget = this.getFieldTarget(); if (this.getOwner().isNull()) // If null, set the target to null return fldTarget.moveFieldToThis(this.getOwner(), bDisplayOption, iMoveMode); // zero out the field boolean[] rgbListeners = null; if (m_bDisableTarget) rgbListeners = fldTarget.setEnableListeners(false); int iErrorCode = fldTarget.setValue(this.computeValue(srcValue), bDisplayOption, iMoveMode); if (m_bDisableTarget) fldTarget.setEnableListeners(rgbListeners); return iErrorCode; } /**
/** * The Field has Changed. * Get the value of this listener's owner, pass it to the computeValue method and * set the returned value to the target field. * @param bDisplayOption If true, display the change. * @param iMoveMode The type of move being done (init/read/screen). * @return The error code (or NORMAL_RETURN if okay). * Field changed, re-compute the value in this field. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { double srcValue = ((NumberField)this.getOwner()).getValue(); BaseField fldTarget = this.getFieldTarget(); if (this.getOwner().isNull()) // If null, set the target to null return fldTarget.moveFieldToThis(this.getOwner(), bDisplayOption, iMoveMode); // zero out the field boolean[] rgbListeners = null; if (m_bDisableTarget) rgbListeners = fldTarget.setEnableListeners(false); int iErrorCode = fldTarget.setValue(this.computeValue(srcValue), bDisplayOption, iMoveMode); if (m_bDisableTarget) fldTarget.setEnableListeners(rgbListeners); return iErrorCode; } /**
/** * The Field has Changed. * Get the value of this listener's owner, pass it to the computeValue method and * set the returned value to the target field. * @param bDisplayOption If true, display the change. * @param iMoveMode The type of move being done (init/read/screen). * @return The error code (or NORMAL_RETURN if okay). * Field changed, re-compute the value in this field. */ public int fieldChanged(boolean bDisplayOption, int iMoveMode) { double srcValue = ((NumberField)this.getOwner()).getValue(); BaseField fldTarget = this.getFieldTarget(); if (this.getOwner().isNull()) // If null, set the target to null return fldTarget.moveFieldToThis(this.getOwner(), bDisplayOption, iMoveMode); // zero out the field boolean[] rgbListeners = null; if (m_bDisableTarget) rgbListeners = fldTarget.setEnableListeners(false); int iErrorCode = fldTarget.setValue(this.computeValue(srcValue), bDisplayOption, iMoveMode); if (m_bDisableTarget) fldTarget.setEnableListeners(rgbListeners); return iErrorCode; } /**