/*
  * (non-Javadoc)
  *
  * @see com.jaspersoft.studio.model.ANode#propertyChange(java.beans.PropertyChangeEvent)
  */
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   // PropertyChangeEvent newEvent = evt;
   if (evt.getPropertyName().equals(PROPERTY_PARAMETERS) && evt.getSource() == getValue()) {
     if (evt.getOldValue() == null && evt.getNewValue() != null) {
       int newIndex = -1;
       if (evt instanceof CollectionElementAddedEvent) {
         newIndex = ((CollectionElementAddedEvent) evt).getAddedIndex();
       }
       // add the node to this parent
       ReportFactory.createNode(this, evt.getNewValue(), newIndex);
     } else if (evt.getOldValue() != null && evt.getNewValue() == null) {
       // delete
       for (INode n : getChildren()) {
         if (n.getValue() == evt.getOldValue()) {
           removeChild((ANode) n);
           break;
         }
       }
     } else {
       // changed
       for (INode n : getChildren()) {
         if (n.getValue() == evt.getOldValue()) n.setValue(evt.getNewValue());
       }
     }
   }
   super.propertyChange(evt);
   // getPropertyChangeSupport().firePropertyChange(newEvent);
 }
 /**
  * The value changed, notifier listeners that the display string and icon have (probably) changed.
  */
 protected void valueChanged(PropertyChangeEvent e) {
   this.firePropertyChanged(
       DISPLAY_STRING_PROPERTY,
       this.displayString(e.getOldValue()),
       this.displayString(e.getNewValue()));
   this.firePropertyChanged(ICON_PROPERTY, this.icon(e.getOldValue()), this.icon(e.getNewValue()));
 }
 @Override
 public void updateListener(Object modelElement, PropertyChangeEvent pce) {
   Object obj = pce.getSource();
   if ((obj == modelElement)
       && ("stereotype".equals(pce.getPropertyName())
           || "taggedValue".equals(pce.getPropertyName()))) {
     if (pce instanceof AddAssociationEvent
         && Model.getFacade().isAStereotype(pce.getNewValue())) {
       // new stereotype
       addElementListener(pce.getNewValue(), new String[] {"name", "remove"});
     }
     if (pce instanceof RemoveAssociationEvent
         && Model.getFacade().isAStereotype(pce.getOldValue())) {
       // removed stereotype
       removeElementListener(pce.getOldValue());
     }
     if (pce instanceof AddAssociationEvent
         && Model.getFacade().isATaggedValue(pce.getNewValue())) {
       addElementListener(pce.getNewValue());
     }
     if (pce instanceof RemoveAssociationEvent
         && Model.getFacade().isATaggedValue(pce.getOldValue())) {
       removeElementListener(pce.getOldValue());
     }
   }
 }
Ejemplo n.º 4
0
  public void propertyChange(PropertyChangeEvent e) {
    if (e.getSource() instanceof JComponent && "name".equals(e.getPropertyName())) {
      // Note - most components do NOT fire a property change on
      // setName(), but it is possible for this to be done intentionally
      if (e.getOldValue() instanceof String) {
        if (logger.isLoggable(Level.FINE)) {
          logger.fine(
              "Name of component changed from "
                  + e.getOldValue()
                  + // NOI18N
                  " to "
                  + e.getNewValue()
                  + ".  Removing any values for "
                  + // NOI18N
                  e.getOldValue()
                  + " from the wizard data map"); // NOI18N
        }
        wizardPage.removeFromMap(e.getOldValue());
      }

      if (logger.isLoggable(Level.FINE)) {
        logger.fine(
            "Possibly update map for renamed component "
                + // NOI18N
                e.getSource());
      }

    } else if (e.getSource() instanceof JFormattedTextField
        && "value".equals(e.getPropertyName())) {
      fire(e);
      wizardPage.maybeUpdateMap((JComponent) e.getSource());
    }
  }
Ejemplo n.º 5
0
  @Override
  public void componentLayoutChanged(int index, PropertyChangeEvent ev)
      throws PropertyVetoException {
    RADVisualComponent<?> radComp = radContainer.getSubComponent(index);

    if (ev != null && ev.getPropertyName() != null) {
      layoutDelegate.acceptComponentLayoutChange(index, ev);

      FormModel formModel = radContainer.getFormModel();
      formModel.fireComponentLayoutChanged(
          radComp, ev.getPropertyName(), ev.getOldValue(), ev.getNewValue());

      if (radComp.getNodeReference() != null) // propagate the change to node
      {
        radComp
            .getNodeReference()
            .firePropertyChangeHelper(ev.getPropertyName(), ev.getOldValue(), ev.getNewValue());
      }
    } else {
      if (radComp.getNodeReference() != null) // propagate the change to node
      {
        radComp.getNodeReference().fireComponentPropertySetsChange();
      }
      radComp.resetConstraintsProperties();
    }
  }
Ejemplo n.º 6
0
  @Override
  public void propertyChange(PropertyChangeEvent evt) {
    // super.propertyChange(evt);

    RefObject source = (RefObject) evt.getSource();
    if (evt.getPropertyName().equals("remove")) this.removedElement(source);
    // Se houve mudanca no nome da classe

    if (evt.getPropertyName().equals("name")
        && (evt.getNewValue() instanceof String && !evt.getNewValue().equals("newAttr"))) {
      // Fazer o tratamento especial para classes
      // Se esta declaracao estiver antes do if anterior, vai dar erro
      MofClass metaClass = (MofClass) source.refMetaObject();
      String designIdeaText = (String) metaClass.refGetValue("name");

      if (!evt.getNewValue().equals("")) {

        this.nameChanged(
            (String) evt.getNewValue(),
            (String) evt.getOldValue(),
            designIdeaText,
            "_" + KuabaSubsystem.resolver.resolveXmiId(source));
      }
    }

    if (evt.getPropertyName().equals("owner"))
      this.referenceModified(
          (RefObject) evt.getNewValue(),
          (RefObject) evt.getOldValue(),
          (RefObject) source,
          evt.getPropertyName());

    // CONFERIR SE PEGA A IDEIA DE DOMINIO :O

  }
Ejemplo n.º 7
0
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getOldValue() instanceof ListModel) {
     ((ListModel) evt.getOldValue()).removeListDataListener(this);
   }
   if (evt.getNewValue() instanceof ListModel) {
     _list.getCheckBoxListSelectionModel().setModel((ListModel) evt.getNewValue());
     ((ListModel) evt.getNewValue()).addListDataListener(this);
   }
 }
Ejemplo n.º 8
0
 /**
  * Listens to property fired by the <code>StatusLabel</code>.
  *
  * @see PropertyChangeListener#propertyChange(PropertyChangeEvent)
  */
 public void propertyChange(PropertyChangeEvent evt) {
   String name = evt.getPropertyName();
   if (StatusLabel.FILES_SET_PROPERTY.equals(name)) {
     if (isCancelled()) {
       statusLabel.setText(CANCEL_TEXT);
       busyLabel.setBusy(false);
       busyLabel.setVisible(false);
       return;
     }
     Map<File, StatusLabel> files = (Map<File, StatusLabel>) evt.getNewValue();
     insertFiles((Map<File, StatusLabel>) evt.getNewValue());
     firePropertyChange(IMPORT_FILES_NUMBER_PROPERTY, null, files.size());
   } else if (StatusLabel.FILE_IMPORT_STARTED_PROPERTY.equals(name)) {
     StatusLabel sl = (StatusLabel) evt.getNewValue();
     if (sl == statusLabel && busyLabel != null) {
       busyLabel.setBusy(true);
       busyLabel.setVisible(true);
       cancelButton.setVisible(sl.isCancellable());
     }
   } else if (StatusLabel.CANCELLABLE_IMPORT_PROPERTY.equals(name)) {
     StatusLabel sl = (StatusLabel) evt.getNewValue();
     cancelButton.setVisible(sl.isCancellable());
   } else if (StatusLabel.FILE_IMPORTED_PROPERTY.equals(name)) {
     Object[] results = (Object[]) evt.getNewValue();
     File f = (File) results[0];
     if (f.getAbsolutePath().equals(file.getAbsolutePath())) {
       setStatus(false, results[1]);
       if (f.isFile()) {
         if (hasImportFailed()) firePropertyChange(IMPORT_STATUS_CHANGE_PROPERTY, null, FAILURE);
         else if (isCancelled()) firePropertyChange(IMPORT_STATUS_CHANGE_PROPERTY, null, PARTIAL);
         else firePropertyChange(IMPORT_STATUS_CHANGE_PROPERTY, null, SUCCESS);
       }
     }
   } else if (StatusLabel.FILE_RESET_PROPERTY.equals(name)) {
     file = (File) evt.getNewValue();
     fileNameLabel.setText(file.getName());
   } else if (ThumbnailLabel.BROWSE_PLATE_PROPERTY.equals(name)) {
     firePropertyChange(BROWSE_PROPERTY, evt.getOldValue(), evt.getNewValue());
   } else if (StatusLabel.CONTAINER_FROM_FOLDER_PROPERTY.equals(name)) {
     containerFromFolder = (DataObject) evt.getNewValue();
     if (containerFromFolder instanceof DatasetData) {
       containerLabel.setText(TEXT_IMPORTED);
       browseButton.setText(((DatasetData) containerFromFolder).getName());
       containerObject = containerFromFolder;
     } else if (containerFromFolder instanceof ScreenData) {
       containerLabel.setText(TEXT_IMPORTED);
       browseButton.setText(((ScreenData) containerFromFolder).getName());
       containerObject = containerFromFolder;
     }
   } else if (StatusLabel.NO_CONTAINER_PROPERTY.equals(name)) {
     containerLabel.setText("");
     noContainer = true;
   } else if (StatusLabel.DEBUG_TEXT_PROPERTY.equals(name)) {
     firePropertyChange(name, evt.getOldValue(), evt.getNewValue());
   }
 }
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getSource() == group) {
     updateKeys();
     if (evt.getNewValue() != null) {
       refreshKey(evt.getNewValue());
     } else if (evt.getOldValue() != null) {
       refreshKey(evt.getOldValue());
     }
   }
 }
Ejemplo n.º 10
0
    /**
     * This method gets called when a bound property is changed.
     *
     * @param e A <code>PropertyChangeEvent</code> object describing the event source and the
     *     property that has changed. Must not be null.
     * @throws NullPointerException if the parameter is null.
     * @since 1.5
     */
    public void propertyChange(PropertyChangeEvent e) {
      String propertyName = e.getPropertyName();
      if (propertyName == "visible") {
        if (e.getOldValue() == Boolean.FALSE && e.getNewValue() == Boolean.TRUE) {
          handlePopupIsVisibleEvent(true);

        } else if (e.getOldValue() == Boolean.TRUE && e.getNewValue() == Boolean.FALSE) {
          handlePopupIsVisibleEvent(false);
        }
      }
    }
 /**
  * The observed property has been changed. Adds the event to the list of stored events.
  *
  * @param evt the property change event to be handled
  */
 public void propertyChange(PropertyChangeEvent evt) {
   addEvent(evt);
   if (isLogActive()) {
     boolean same = evt.getOldValue() == evt.getNewValue();
     System.out.println();
     System.out.println("Source:" + evt.getSource());
     System.out.println("Property:" + evt.getPropertyName());
     System.out.println("Old value:" + evt.getOldValue());
     System.out.println("New value:" + evt.getNewValue());
     System.out.println("Old==new: " + same);
   }
 }
    /** @see PropertyChangeListener#propertyChange(PropertyChangeEvent) */
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      // Detach from previous editor
      if (evt.getOldValue() != null) {
        detach(evt.getOldValue());
      }

      // Attach to new editor if possible
      if (evt.getNewValue() != null) {
        attach(evt.getNewValue());
      }
    }
Ejemplo n.º 13
0
 public void propertyChange(PropertyChangeEvent event) {
   if (event.getSource() instanceof TaxiwayParkingModel) {
     if (event.getPropertyName().equals("name"))
       updateJetwayNames((String) event.getOldValue(), (String) event.getNewValue());
     else if (event.getPropertyName().equals("number"))
       updateJetwayNumbers(
           (String) event.getOldValue(), ((Integer) event.getNewValue()).intValue());
   } else if ((event.getSource() instanceof RunwayModel)
       && event.getPropertyName().equals("ilsRunway")) {
     removeILSModel((ILSModel) event.getOldValue());
     addILSModelToRunway((ILSModel) event.getOldValue(), (String) event.getNewValue());
   }
 }
Ejemplo n.º 14
0
    @Override
    public boolean matches(Object argument) {
      PropertyChangeEvent actual = (PropertyChangeEvent) argument;
      if (m_expected == actual) return true;

      if (m_expected == null) {
        return actual == null;
      }

      return (m_expected.getSource() == actual.getSource()
          && m_expected.getPropertyName().equals(actual.getPropertyName())
          && nullSafeEquals(m_expected.getOldValue(), actual.getOldValue())
          && nullSafeEquals(m_expected.getNewValue(), actual.getNewValue()));
    }
  /**
   * INTERNAL: This method marks the object as changed. This method is only called by EclipseLink
   */
  public void internalPropertyChange(PropertyChangeEvent evt) {
    if (evt.getNewValue() == evt.getOldValue()) {
      return;
    }

    DatabaseMapping mapping =
        descriptor.getObjectBuilder().getMappingForAttributeName(evt.getPropertyName());
    // Bug#4127952 Throw an exception indicating there is no mapping for the property name.
    if (mapping == null) {
      throw ValidationException.wrongPropertyNameInChangeEvent(
          owner.getClass(), evt.getPropertyName());
    }
    if (mapping instanceof AbstractDirectMapping
        || mapping instanceof AbstractTransformationMapping) {
      // If both newValue and oldValue are null, or newValue is not null and newValue equals
      // oldValue, don't build ChangeRecord
      if (((evt.getNewValue() == null) && (evt.getOldValue() == null))
          || ((evt.getNewValue() != null) && (evt.getNewValue()).equals(evt.getOldValue()))) {
        return;
      }
    }

    super.internalPropertyChange(evt);

    if (uow.getUnitOfWorkChangeSet() == null) {
      uow.setUnitOfWorkChangeSet(new UnitOfWorkChangeSet(uow));
    }
    if (objectChangeSet == null) { // only null if new or if in a new UOW
      // add to tracker list to prevent GC of clone if using weak references
      // put it in here so that it only occurs on the 1st change for a particular UOW
      uow.addToChangeTrackedHardList(owner);
      objectChangeSet =
          getDescriptor()
              .getObjectBuilder()
              .createObjectChangeSet(
                  owner, (UnitOfWorkChangeSet) uow.getUnitOfWorkChangeSet(), false, uow);
    }

    if (evt.getClass().equals(ClassConstants.PropertyChangeEvent_Class)) {
      mapping.updateChangeRecord(
          evt.getSource(), evt.getNewValue(), evt.getOldValue(), objectChangeSet, getUnitOfWork());
    } else if (evt.getClass().equals(ClassConstants.CollectionChangeEvent_Class)
        || (evt.getClass().equals(ClassConstants.MapChangeEvent_Class))) {
      mapping.updateCollectionChangeRecord(
          (CollectionChangeEvent) evt, objectChangeSet, getUnitOfWork());
    } else {
      throw ValidationException.wrongChangeEvent(evt.getClass());
    }
  }
Ejemplo n.º 16
0
 /**
  * Update location, width & height of every sublayout, based on DPI.
  *
  * @param evt
  */
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   String type = evt.getPropertyName();
   switch (type) {
     case LayoutDocument.DPI_PROP:
       int oldDPI = (int) evt.getOldValue();
       int newDPI = (int) evt.getNewValue();
       for (Object o : getObjects()) {
         if (o instanceof SubLayoutLayer) {
           SubLayoutLayer sll = (SubLayoutLayer) o;
           sll.setLength(newDPI * sll.getLength() / oldDPI);
           sll.setWidth(newDPI * sll.getWidth() / oldDPI);
           Point p = sll.getLocation();
           sll.setLocation(new Point(p.x * newDPI / oldDPI, p.y * newDPI / oldDPI));
         }
       }
       break;
     case LayoutDocument.WIDTH_PROP:
     case LayoutDocument.HEIGHT_PROP:
       Point2D newMidPoint =
           new Point2D.Double(paperWidget.getWidth() / 2, paperWidget.getHeight() / 2);
       Point2D oldMidPoint =
           new Point2D.Double(paperWidget.getWidth() / 2, paperWidget.getHeight() / 2);
       Amount<Length> oldValue = (Amount<Length>) evt.getOldValue();
       // convert to pixel
       double oldDoubleValue =
           DocumentPaper.getLengthInPixel(oldValue, getlSystem().getDocument().getDPI());
       switch (evt.getPropertyName()) {
         case LayoutDocument.HEIGHT_PROP:
           oldMidPoint = new Point2D.Double(paperWidget.getWidth() / 2, oldDoubleValue / 2);
           break;
         case LayoutDocument.WIDTH_PROP:
           oldMidPoint = new Point2D.Double(oldDoubleValue / 2, paperWidget.getHeight() / 2);
           break;
       }
       int x_translate = (int) (newMidPoint.getX() - oldMidPoint.getX());
       int y_translate = (int) (newMidPoint.getY() - oldMidPoint.getY());
       Point oldWidgetLoc;
       for (Object o : getObjects()) {
         if (o instanceof SubLayoutLayer) {
           SubLayoutLayer sll = (SubLayoutLayer) o;
           oldWidgetLoc = sll.getLocation();
           oldWidgetLoc.translate(x_translate, y_translate);
           sll.setLocation(oldWidgetLoc);
         }
       }
       addSavable();
   }
 }
 public void propertyChange(PropertyChangeEvent e) {
   if (Control.showProperty)
     log.debug(
         "Property change {} old: {} new: {}",
         e.getPropertyName(),
         e.getOldValue(),
         e.getNewValue());
   if (e.getPropertyName().equals(TrainScheduleManager.LISTLENGTH_CHANGED_PROPERTY)
       || e.getPropertyName().equals(TrainSchedule.NAME_CHANGED_PROPERTY)) {
     updateControlPanel();
   }
   if (e.getPropertyName().equals(TrainManager.PRINTPREVIEW_CHANGED_PROPERTY)) {
     setPrintButtonText();
     setSwitchListButtonText();
   }
   if (e.getPropertyName().equals(TrainManager.TRAINS_BUILT_CHANGED_PROPERTY)) {
     switchListsButton.setEnabled(true);
   }
   if (e.getPropertyName().equals(Setup.REAL_TIME_PROPERTY_CHANGE)) {
     setSwitchListButtonText();
   }
   if (e.getPropertyName().equals(Location.STATUS_CHANGED_PROPERTY)
       || e.getPropertyName().equals(Location.SWITCHLIST_CHANGED_PROPERTY)) {
     updateSwitchListButton();
   }
 }
  public void propertyChange(PropertyChangeEvent evt) {
    String prop = evt.getPropertyName();
    Object newValue = evt.getNewValue();
    Object oldValue = evt.getOldValue();

    if ("focusOwner".equals(prop) && oldValue instanceof JTextArea) {
      JTextArea freeText = (JTextArea) oldValue;
      if (freeText.equals(freeTextPane)) {
        freeText.setEditable(false);
        if (contentTextChange) {
          contentTextChange = false;
          resetAppearanceShapes();
        }
        if (freeText instanceof FreeTextArea) {
          ((FreeTextArea) freeText).setActive(false);
        }
      }
    } else if ("focusOwner".equals(prop) && newValue instanceof JTextArea) {
      JTextArea freeText = (JTextArea) newValue;
      if (freeText.equals(freeTextPane) && !annotation.getFlagReadOnly()) {
        freeText.setEditable(true);
        if (freeText instanceof FreeTextArea) {
          ((FreeTextArea) freeText).setActive(true);
        }
      }
    }
  }
Ejemplo n.º 19
0
 public void propertyChange(java.beans.PropertyChangeEvent e) {
   if (Control.showProperty) {
     log.debug(
         "Property change ({}) old: ({}) new: ({})",
         e.getPropertyName(),
         e.getOldValue(),
         e.getNewValue()); // NOI18N
   }
   if (e.getPropertyName().equals(Location.TYPES_CHANGED_PROPERTY)
       || e.getPropertyName().equals(CarTypes.CARTYPES_CHANGED_PROPERTY)
       || e.getPropertyName().equals(Track.TYPES_CHANGED_PROPERTY)) {
     updateTypeComboBoxes();
   }
   if (e.getPropertyName().equals(CarLoads.LOAD_NAME_CHANGED_PROPERTY)
       || e.getPropertyName().equals(CarLoads.LOAD_CHANGED_PROPERTY)) {
     updateLoadComboBoxes();
     updateLoadNames();
     updateShipLoadNames();
   }
   if (e.getPropertyName().equals(Track.LOADS_CHANGED_PROPERTY)) {
     updateLoadNames();
     updateShipLoadNames();
   }
   if (e.getPropertyName().equals(Track.LOAD_OPTIONS_CHANGED_PROPERTY)) {
     if (_track != null) {
       updateButtons(true);
     }
   }
 }
Ejemplo n.º 20
0
  /**
   * <Some description here>
   *
   * @param evt
   * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
   */
  public void propertyChange(PropertyChangeEvent evt) {

    if (evt.getPropertyName().equals("enabled")) {

      Action tmp = this.delegate;

      if (evt.getNewValue().equals(Boolean.FALSE)) {
        for (int i = 0; i < this.delegates.length; i++) {
          if (this.delegates[i].isEnabled()) {
            this.delegate = this.delegates[i];
            break;
          }
        }
      } else {
        this.delegate = (Action) evt.getSource();
      }

      if (tmp != this.delegate) {
        this.firePropertyChange(NAME, tmp.getValue(NAME), this.delegate.getValue(NAME));
        this.firePropertyChange(
            SMALL_ICON, tmp.getValue(SMALL_ICON), this.delegate.getValue(SMALL_ICON));
        this.firePropertyChange(
            SHORT_DESCRIPTION,
            tmp.getValue(SHORT_DESCRIPTION),
            this.delegate.getValue(SHORT_DESCRIPTION));
      }
    }

    this.firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
  }
Ejemplo n.º 21
0
 @Override
 public void propertyChange(java.beans.PropertyChangeEvent e) {
   if (Control.SHOW_PROPERTY) {
     log.debug(
         "Property change ({}) for: ({}) old: {}, new: {}",
         e.getPropertyName(),
         e.getSource().toString(),
         e.getOldValue(),
         e.getNewValue());
   }
   if (e.getPropertyName().equals(Train.TRAIN_MOVE_COMPLETE_CHANGED_PROPERTY)
       || e.getPropertyName().equals(Train.BUILT_CHANGED_PROPERTY)
       || e.getPropertyName().equals(Train.TRAIN_MODIFIED_CHANGED_PROPERTY)) {
     clearAndUpdate();
   }
   if ((e.getPropertyName().equals(RollingStock.ROUTE_LOCATION_CHANGED_PROPERTY)
           && e.getNewValue() == null)
       || (e.getPropertyName().equals(RollingStock.ROUTE_DESTINATION_CHANGED_PROPERTY)
           && e.getNewValue() == null)
       || e.getPropertyName().equals(RollingStock.TRAIN_CHANGED_PROPERTY)) {
     // remove car from list
     if (e.getSource().getClass().equals(Car.class)) {
       Car car = (Car) e.getSource();
       checkBoxes.remove("p" + car.getId());
       checkBoxes.remove("s" + car.getId());
       checkBoxes.remove("m" + car.getId());
       log.debug("Car ({}) removed from list", car.toString());
     }
     update();
   }
 }
  /**
   * Notifies this instance that there was a change in the value of a property of an
   * <tt>Endpoint</tt> participating in this multipoint conference.
   *
   * @param endpoint the <tt>Endpoint</tt> which is the source of the event/notification and is
   *     participating in this multipoint conference
   * @param ev a <tt>PropertyChangeEvent</tt> which specifies the source of the event/notification,
   *     the name of the property and the old and new values of that property
   */
  private void endpointPropertyChange(Endpoint endpoint, PropertyChangeEvent ev) {
    String propertyName = ev.getPropertyName();
    boolean maybeRemoveEndpoint;

    if (Endpoint.SCTP_CONNECTION_PROPERTY_NAME.equals(propertyName)) {
      // The SctpConnection of/associated with an Endpoint has changed. We
      // may want to fire initial events over that SctpConnection (as soon
      // as it is ready).
      SctpConnection oldValue = (SctpConnection) ev.getOldValue();
      SctpConnection newValue = (SctpConnection) ev.getNewValue();

      endpointSctpConnectionChanged(endpoint, oldValue, newValue);

      // The SctpConnection may have expired.
      maybeRemoveEndpoint = (newValue == null);
    } else if (Endpoint.CHANNELS_PROPERTY_NAME.equals(propertyName)) {
      // An RtpChannel may have expired.
      maybeRemoveEndpoint = true;
    } else {
      maybeRemoveEndpoint = false;
    }
    if (maybeRemoveEndpoint) {
      // It looks like there is a chance that the Endpoint may have
      // expired. Endpoints are held by this Conference via WeakReferences
      // but WeakReferences are unpredictable. We have functionality
      // though which could benefit from discovering that an Endpoint has
      // expired as quickly as possible (e.g. ConferenceSpeechActivity).
      // Consequently, try to expedite the removal of expired Endpoints.
      if (endpoint.getSctpConnection() == null && endpoint.getChannelCount(null) == 0) {
        removeEndpoint(endpoint);
      }
    }
  }
Ejemplo n.º 23
0
 public void propertyChange(PropertyChangeEvent evt) {
   if (Debug.EVENT) {
     System.out.println("ColorMap: " + evt);
     System.out.println("          " + evt.getPropertyName());
   }
   firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
 }
Ejemplo n.º 24
0
    private void handleEditor(PropertyChangeEvent evt) {
      if (evt.getNewValue() instanceof AutoCompleteComboBoxEditor) {
        return;
      }

      AutoCompleteComboBoxEditor acEditor = (AutoCompleteComboBoxEditor) evt.getOldValue();
      boolean strictMatching = false;

      if (acEditor.getEditorComponent() != null) {
        JTextComponent textComponent = (JTextComponent) acEditor.getEditorComponent();
        strictMatching = ((AutoCompleteDocument) textComponent.getDocument()).strictMatching;

        undecorate(textComponent);

        for (KeyListener l : textComponent.getKeyListeners()) {
          if (l instanceof KeyAdapter) {
            textComponent.removeKeyListener(l);
            break;
          }
        }
      }

      JTextComponent editorComponent = (JTextComponent) comboBox.getEditor().getEditorComponent();
      AbstractAutoCompleteAdaptor adaptor = new ComboBoxAdaptor(comboBox);
      AutoCompleteDocument document =
          createAutoCompleteDocument(
              adaptor, strictMatching, acEditor.stringConverter, editorComponent.getDocument());
      decorate(editorComponent, document, adaptor);

      editorComponent.addKeyListener(new AutoComplete.KeyAdapter(comboBox));

      // set before adding the listener for the editor
      comboBox.setEditor(
          new AutoCompleteComboBoxEditor(comboBox.getEditor(), document.stringConverter));
    }
 public void propertyChange(final PropertyChangeEvent e) {
   if (myAlarm.getActiveRequestCount() == 0) {
     myInitialFocusedWindow = (Window) e.getOldValue();
     final MenuElement[] selectedPath = MenuSelectionManager.defaultManager().getSelectedPath();
     if (selectedPath.length == 0) { // there is no visible popup
       return;
     }
     Component firstComponent = null;
     for (final MenuElement menuElement : selectedPath) {
       final Component component = menuElement.getComponent();
       if (component instanceof JMenuBar) {
         firstComponent = component;
         break;
       } else if (component instanceof JPopupMenu) {
         firstComponent = ((JPopupMenu) component).getInvoker();
         break;
       }
     }
     if (firstComponent == null) {
       return;
     }
     final Window window = SwingUtilities.getWindowAncestor(firstComponent);
     if (window != myInitialFocusedWindow) { // focused window doesn't have popup
       return;
     }
   }
   myLastFocusedWindow = (Window) e.getNewValue();
   myAlarm.cancelAllRequests();
   myAlarm.addRequest(myClearSelectedPathRunnable, 150);
 }
 protected void doPropertyChange(PropertyChangeEvent evt) {
   if ("name".equals(evt.getPropertyName())) {
     setAttribute("name", (String) evt.getNewValue());
   } else if ("assignment".equals(evt.getPropertyName())) {
     setElement(
         "assignment", (SemanticElement) evt.getOldValue(), (SemanticElement) evt.getNewValue());
   }
 }
Ejemplo n.º 27
0
 @Override
 public void propertyChange(PropertyChangeEvent ev) {
   if (ev.getPropertyName().equals(NamedObject.PROPERTY_NAME)) {
     if (!ev.getNewValue().equals(ev.getOldValue())) {
       modelManager.setSaved(false);
     }
   }
 }
Ejemplo n.º 28
0
 @Override
 public void propertyChange(java.beans.PropertyChangeEvent e) {
   log.debug(
       "ScheduleManager sees property change: ({}) old: ({}) new ({})",
       e.getPropertyName(),
       e.getOldValue(),
       e.getNewValue());
 }
Ejemplo n.º 29
0
    /*
     * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
     */
    public void propertyChange(PropertyChangeEvent evt) {

      TableModel old = (TableModel) evt.getOldValue();
      TableModel knew = (TableModel) evt.getNewValue();

      if (old != null) old.removeTableModelListener(autoTailTracker_);

      if (knew != null) knew.addTableModelListener(autoTailTracker_);
    }
 /**
  * This method creates the object change set if necessary. It also creates/updates the change
  * record based on the new value. Object should check the if newValue and oldValue are identical.
  * If they are identical, do not create PropertyChangeEvent and call this method.
  */
 public void internalPropertyChange(PropertyChangeEvent evt) {
   super.internalPropertyChange(evt);
   // Also need to raise the event in the parent, to create a change set for it.
   // Only raise the event in parent if something actually changed.
   if (this.objectChangeSet != null && this.parentListener != null) {
     if (evt.getSource() == owner) {
       this.parentListener.internalPropertyChange(
           new PropertyChangeEvent(
               evt.getSource(), parentAttributeName, evt.getOldValue(), evt.getNewValue()));
     } else {
       // the event's source is not the owner of this change tracking policy - this is a nested
       // aggregate change.
       this.parentListener.internalPropertyChange(
           new PropertyChangeEvent(
               owner, parentAttributeName, evt.getOldValue(), evt.getNewValue()));
     }
   }
 }