/** * Called by objects to which this object has * registered as a listener. * * @param event A change event pointing to the source of the change */ @Override public void stateChanged(IChemObjectChangeEvent event) { notifyChanged(event); }
/** * Called by objects to which this object has * registered as a listener. * * @param event A change event pointing to the source of the change */ @Override public void stateChanged(IChemObjectChangeEvent event) { notifyChanged(event); }
/** * Sets the coefficient of a AtomContainer to a given value. * * @param position The position of the AtomContainer for which the multiplier is * set in [0,..] * @param multiplier The new multiplier for the AtomContatiner at * <code>position</code> * @see #getMultiplier(int) */ @Override public void setMultiplier(int position, Double multiplier) { multipliers[position] = multiplier; notifyChanged(); }
/** * Sets the coefficient of a AtomContainer to a given value. * * @param position The position of the AtomContainer for which the multiplier is * set in [0,..] * @param multiplier The new multiplier for the AtomContatiner at * <code>position</code> * @see #getMultiplier(int) */ @Override public void setMultiplier(int position, Double multiplier) { multipliers[position] = multiplier; notifyChanged(); }
/** * Sets the coefficient of a AtomContainer to a given value. * * @param container The AtomContainer for which the multiplier is set * @param multiplier The new multiplier for the AtomContatiner * @return true if multiplier has been set * @see #getMultiplier(IAtomContainer) */ @Override public boolean setMultiplier(IAtomContainer container, Double multiplier) { for (int i = 0; i < atomContainers.length; i++) { if (atomContainers[i] == container) { multipliers[i] = multiplier; notifyChanged(); return true; } } return false; }
/** * Sets the coefficient of a AtomContainer to a given value. * * @param container The AtomContainer for which the multiplier is set * @param multiplier The new multiplier for the AtomContatiner * @return true if multiplier has been set * @see #getMultiplier(IAtomContainer) */ @Override public boolean setMultiplier(IAtomContainer container, Double multiplier) { for (int i = 0; i < atomContainers.length; i++) { if (atomContainers[i] == container) { multipliers[i] = multiplier; notifyChanged(); return true; } } return false; }
/** * Sets the multipliers of the AtomContainers. * * @param newMultipliers The new multipliers for the AtomContainers in this set * @return true if multipliers have been set. * @see #getMultipliers */ @Override public boolean setMultipliers(Double[] newMultipliers) { if (newMultipliers.length == atomContainerCount) { if (multipliers == null) { multipliers = new Double[atomContainerCount]; } System.arraycopy(newMultipliers, 0, multipliers, 0, atomContainerCount); notifyChanged(); return true; } return false; }
/** * Sets the multipliers of the AtomContainers. * * @param newMultipliers The new multipliers for the AtomContainers in this set * @return true if multipliers have been set. * @see #getMultipliers */ @Override public boolean setMultipliers(Double[] newMultipliers) { if (newMultipliers.length == atomContainerCount) { if (multipliers == null) { multipliers = new Double[atomContainerCount]; } System.arraycopy(newMultipliers, 0, multipliers, 0, atomContainerCount); notifyChanged(); return true; } return false; }
/** {@inheritDoc} */ @Override public void notifyChanged(IChemObjectChangeEvent evt) { logger.debug("Notifying changed event: ", evt); super.notifyChanged(evt); }
/** {@inheritDoc} */ @Override public void notifyChanged() { logger.debug("Notifying changed"); super.notifyChanged(); }
/** {@inheritDoc} */ @Override public void notifyChanged() { logger.debug("Notifying changed"); super.notifyChanged(); }
/** {@inheritDoc} */ @Override public void notifyChanged(IChemObjectChangeEvent evt) { logger.debug("Notifying changed event: ", evt); super.notifyChanged(evt); }
/** * Removes all AtomContainer from this container. */ @Override public void removeAllAtomContainers() { for (int pos = atomContainerCount - 1; pos >= 0; pos--) { atomContainers[pos].removeListener(this); multipliers[pos] = 0.0; atomContainers[pos] = null; } atomContainerCount = 0; notifyChanged(); }
/** * Removes all AtomContainer from this container. */ @Override public void removeAllAtomContainers() { for (int pos = atomContainerCount - 1; pos >= 0; pos--) { atomContainers[pos].removeListener(this); multipliers[pos] = 0.0; atomContainers[pos] = null; } atomContainerCount = 0; notifyChanged(); }
/** * Removes an AtomContainer from this container. * * @param pos The position of the AtomContainer to be removed from this container */ @Override public void removeAtomContainer(int pos) { atomContainers[pos].removeListener(this); for (int i = pos; i < atomContainerCount - 1; i++) { atomContainers[i] = atomContainers[i + 1]; multipliers[i] = multipliers[i + 1]; } atomContainers[atomContainerCount - 1] = null; atomContainerCount--; notifyChanged(); }
/** * Removes an AtomContainer from this container. * * @param pos The position of the AtomContainer to be removed from this container */ @Override public void removeAtomContainer(int pos) { atomContainers[pos].removeListener(this); for (int i = pos; i < atomContainerCount - 1; i++) { atomContainers[i] = atomContainers[i + 1]; multipliers[i] = multipliers[i + 1]; } atomContainers[atomContainerCount - 1] = null; atomContainerCount--; notifyChanged(); }
/** * Replace the AtomContainer at a specific position (array has to be large enough). * * @param position position in array for AtomContainer * @param container the replacement AtomContainer */ @Override public void replaceAtomContainer(int position, IAtomContainer container) { IAtomContainer old = atomContainers[position]; old.removeListener(this); atomContainers[position] = container; container.addListener(this); notifyChanged(); }
/** * Replace the AtomContainer at a specific position (array has to be large enough). * * @param position position in array for AtomContainer * @param container the replacement AtomContainer */ @Override public void replaceAtomContainer(int position, IAtomContainer container) { IAtomContainer old = atomContainers[position]; old.removeListener(this); atomContainers[position] = container; container.addListener(this); notifyChanged(); }
/** * Adds an atomContainer to this container with the given * multiplier. * * @param atomContainer The atomContainer to be added to this container * @param multiplier The multiplier of this atomContainer */ @Override public void addAtomContainer(IAtomContainer atomContainer, double multiplier) { if (atomContainerCount + 1 >= atomContainers.length) { growAtomContainerArray(); } atomContainer.addListener(this); atomContainers[atomContainerCount] = atomContainer; multipliers[atomContainerCount] = multiplier; atomContainerCount++; notifyChanged(); }
/** * Adds an atomContainer to this container with the given * multiplier. * * @param atomContainer The atomContainer to be added to this container * @param multiplier The multiplier of this atomContainer */ @Override public void addAtomContainer(IAtomContainer atomContainer, double multiplier) { if (atomContainerCount + 1 >= atomContainers.length) { growAtomContainerArray(); } atomContainer.addListener(this); atomContainers[atomContainerCount] = atomContainer; multipliers[atomContainerCount] = multiplier; atomContainerCount++; notifyChanged(); }