Ejemplo n.º 1
0
    public void propertyChange(PropertyChangeEvent e) {
      if (_squelchChangeEvents) return;

      PropertyEditor editor = (PropertyEditor) e.getSource();
      PropertyDescriptor prop = (PropertyDescriptor) _editor2Prop.get(editor);
      Method writer = prop.getWriteMethod();
      if (writer != null) {
        try {
          Object[] params = {editor.getValue()};
          writer.invoke(_value, params);
          setObject(_value);
          firePropertyChange(_value, prop.getName(), null, editor.getValue());
        } catch (IllegalAccessException ex) {
          ex.printStackTrace();
        } catch (InvocationTargetException ex) {
          ex.getTargetException().printStackTrace();
        }
      }
    }
  /**
   * Notifies this instance that there was a change in the value of a property of an object in which
   * this instance is interested.
   *
   * @param ev a <tt>PropertyChangeEvent</tt> which specifies the object of interest, the name of
   *     the property and the old and new values of that property
   */
  @Override
  public void propertyChange(PropertyChangeEvent ev) {
    Object source = ev.getSource();

    if (isExpired()) {
      // An expired Conference is to be treated like a null Conference
      // i.e. it does not handle any PropertyChangeEvents. If possible,
      // make sure that no further PropertyChangeEvents will be delivered
      // to this Conference.
      if (source instanceof PropertyChangeNotifier) {
        ((PropertyChangeNotifier) source).removePropertyChangeListener(propertyChangeListener);
      }
    } else if (source == speechActivity) {
      speechActivityPropertyChange(ev);
    } else if (source instanceof Endpoint) {
      // We care about PropertyChangeEvents from Endpoint but only if the
      // Endpoint in question is still participating in this Conference.
      Endpoint endpoint = getEndpoint(((Endpoint) source).getID());

      if (endpoint != null) endpointPropertyChange(endpoint, ev);
    }
  }