Ejemplo n.º 1
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.º 2
0
      public void propertyChange(PropertyChangeEvent e) {
        if (e.getPropertyName().equals("minimum") && startAtMin) {
          start = getMinimum();
        }

        if (e.getPropertyName().equals("minimum") || e.getPropertyName().equals("maximum")) {

          Enumeration keys = getLabelTable().keys();
          Hashtable<Object, Object> hashtable = new Hashtable<Object, Object>();

          // Save the labels that were added by the developer
          while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            Object value = labelTable.get(key);
            if (!(value instanceof LabelUIResource)) {
              hashtable.put(key, value);
            }
          }

          clear();
          createLabels();

          // Add the saved labels
          keys = hashtable.keys();
          while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            put(key, hashtable.get(key));
          }

          ((JSlider) e.getSource()).setLabelTable(this);
        }
      }
Ejemplo n.º 3
0
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
Ejemplo n.º 4
0
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     // System.out.println("Debug:TextViewer: ActionChangedListener enabled");
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
Ejemplo n.º 5
0
 /**
  * A property in the observed bean has changed. First checks, if this listener should handle the
  * event, because the event's property name is the one to be observed or the event indicates
  * that any property may have changed. In case the event provides no new value, it is read from
  * the source bean.
  *
  * @param evt the property change event to be handled
  */
 public void propertyChange(PropertyChangeEvent evt) {
   String sourcePropertyName = sourcePropertyDescriptor.getName();
   if ((evt.getPropertyName() == null) || (evt.getPropertyName().equals(sourcePropertyName))) {
     Object newValue = evt.getNewValue();
     if (newValue == null) {
       newValue = BeanUtils.getValue(sourceBean, sourcePropertyDescriptor);
     }
     setValueSilently(
         sourceBean, sourcePropertyDescriptor, targetBean, targetPropertyDescriptor, newValue);
   }
 }
  /**
   * 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.º 7
0
  //
  //  Implement the PropertyChangeListener
  //
  public void propertyChange(PropertyChangeEvent e) {
    //  Keep the row table in sync with the main table

    if ("selectionModel".equals(e.getPropertyName())) {
      setSelectionModel(main.getSelectionModel());
    }

    if ("rowHeight".equals(e.getPropertyName())) {
      repaint();
    }

    if ("model".equals(e.getPropertyName())) {
      main.getModel().addTableModelListener(this);
      revalidate();
    }
  }
Ejemplo n.º 8
0
  public void propertyChange(PropertyChangeEvent e) {
    String prop = e.getPropertyName();

    if (JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(prop)) fc.setSelectedFile(new File(name));
    else if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(prop)
        && !fc.getSelectedFile().isDirectory()) name = fc.getSelectedFile().getName();
  }
Ejemplo n.º 9
0
  public void propertyChange(PropertyChangeEvent e) {
    String prop = e.getPropertyName();

    if (isVisible()
        && (e.getSource() == optionPane)
        && (JOptionPane.VALUE_PROPERTY.equals(prop)
            || JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) {
      Object value = optionPane.getValue();

      if (value == JOptionPane.UNINITIALIZED_VALUE) return;
      optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE);

      if (button1.equals(value)) {
        try {
          double a = Double.parseDouble(left.getText());
          double b = Double.parseDouble(right.getText());
          double err = Double.parseDouble(error.getText());

          if (a > b) {
            JOptionPane.showMessageDialog(this, "A < B!!!", null, JOptionPane.ERROR_MESSAGE);
          } else {
            hideIt();
            graphic.startApplyingMethod(parentFrame.getSelectedMethod(), err, a, b);
          }
        } catch (Exception ex) {
          JOptionPane.showMessageDialog(
              this, "Trebuie sa fie numar real!", null, JOptionPane.ERROR_MESSAGE);
        }
      } else if (button2.equals(value)) {
        hideIt();
      }
    }
  }
    /**
     * Function called when an audio device is plugged or unplugged.
     *
     * @param event The property change event which may concern the audio device.
     */
    public void propertyChange(PropertyChangeEvent event) {
      if (DeviceConfiguration.PROP_AUDIO_SYSTEM_DEVICES.equals(event.getPropertyName())) {
        NotificationService notificationService = getNotificationService();

        if (notificationService != null) {
          // Registers only once to the  popup message notification
          // handler.
          if (!isRegisteredToPopupMessageListener) {
            isRegisteredToPopupMessageListener = true;
            managePopupMessageListenerRegistration(true);
          }

          // Fires the popup notification.
          ResourceManagementService resources = NeomediaActivator.getResources();
          Map<String, Object> extras = new HashMap<String, Object>();

          extras.put(NotificationData.POPUP_MESSAGE_HANDLER_TAG_EXTRA, this);
          notificationService.fireNotification(
              DEVICE_CONFIGURATION_HAS_CHANGED,
              resources.getI18NString("impl.media.configform" + ".AUDIO_DEVICE_CONFIG_CHANGED"),
              resources.getI18NString(
                  "impl.media.configform" + ".AUDIO_DEVICE_CONFIG_MANAGMENT_CLICK"),
              null,
              extras);
        }
      }
    }
  /**
   * 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.º 12
0
  /**
   * The animation changed. Handle the change.
   *
   * @param evt The event
   */
  private void handleAnimationPropertyChange(PropertyChangeEvent evt) {
    //        System.err.println ("Handlechange:" +evt.getPropertyName());
    if (evt.getPropertyName().equals(Animation.ANI_VALUE)) {
      debug("handleAnimationPropertyChange value :" + evt.getPropertyName());
      Real eventValue = (Real) evt.getNewValue();
      // if there's nothing to do, return;
      if ((eventValue == null) || eventValue.isMissing()) {
        return;
      }

      /** The Animation associated with this widget */
      DateTime time = null;
      try {
        time = new DateTime(eventValue);
      } catch (VisADException ve) {;
      }
      final DateTime theDateTime = time;
      final int theIndex = ((anime != null) ? anime.getCurrent() : -1);
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              boolean oldValue = ignoreTimesCbxEvents;
              try {
                ignoreTimesCbxEvents = true;
                //                        synchronized (timesCbxMutex) {
                xcnt++;

                timesCbx.setSelectedItem(theDateTime);
                //                        }
                if ((boxPanel != null) && (theIndex >= 0)) {
                  boxPanel.setOnIndex(theIndex);
                }
                timesCbx.repaint();
              } finally {
                ignoreTimesCbxEvents = oldValue;
              }
            }
          });
      shareValue();
    } else if (evt.getPropertyName().equals(Animation.ANI_SET)) {
      if (ignoreAnimationSetChange) {
        return;
      }
      updateIndicatorInner((Set) evt.getNewValue(), true);
    }
  }
  /**
   * This method gets called when a property we're interested in is about to change. In case we
   * don't like the new value we throw a PropertyVetoException to prevent the actual change from
   * happening.
   *
   * @param evt a <tt>PropertyChangeEvent</tt> object describing the event source and the property
   *     that will change.
   * @exception PropertyVetoException if we don't want the change to happen.
   */
  public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
    if (evt.getPropertyName().equals(PROP_STUN_SERVER_ADDRESS)) {
      // make sure that we have a valid fqdn or ip address.

      // null or empty port is ok since it implies turning STUN off.
      if (evt.getNewValue() == null) return;

      String host = evt.getNewValue().toString();
      if (host.trim().length() == 0) return;

      boolean ipv6Expected = false;
      if (host.charAt(0) == '[') {
        // This is supposed to be an IPv6 litteral
        if (host.length() > 2 && host.charAt(host.length() - 1) == ']') {
          host = host.substring(1, host.length() - 1);
          ipv6Expected = true;
        } else {
          // This was supposed to be a IPv6 address, but it's not!
          throw new PropertyVetoException("Invalid address string" + host, evt);
        }
      }

      for (int i = 0; i < host.length(); i++) {
        char c = host.charAt(i);
        if (Character.isLetterOrDigit(c)) continue;

        if ((c != '.' && c != ':') || (c == '.' && ipv6Expected) || (c == ':' && !ipv6Expected))
          throw new PropertyVetoException(host + " is not a valid address nor host name", evt);
      }

    } // is prop_stun_server_address
    else if (evt.getPropertyName().equals(PROP_STUN_SERVER_PORT)) {

      // null or empty port is ok since it implies turning STUN off.
      if (evt.getNewValue() == null) return;

      String port = evt.getNewValue().toString();
      if (port.trim().length() == 0) return;

      try {
        Integer.valueOf(evt.getNewValue().toString());
      } catch (NumberFormatException ex) {
        throw new PropertyVetoException(port + " is not a valid port! " + ex.getMessage(), evt);
      }
    }
  }
 public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException {
   try {
     eventProcessor.processExceptionableEvent(e.getPropertyName(), new Object[] {e});
   } catch (PropertyVetoException ex) {
     throw ex;
   } catch (Exception ex) {
   }
 }
Ejemplo n.º 15
0
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   String strPropertyName = evt.getPropertyName();
   if ("progress".equals(strPropertyName)) {
     progressBar.setIndeterminate(false);
     int progress = (Integer) evt.getNewValue();
     progressBar.setValue(progress);
   }
 }
 public void propertyChange(PropertyChangeEvent e) {
   String prop = e.getPropertyName();
   if (prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) {
     filters = (FileFilter[]) e.getNewValue();
     fireContentsChanged(this, -1, -1);
   } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) {
     fireContentsChanged(this, -1, -1);
   }
 }
Ejemplo n.º 17
0
 public void propertyChange(PropertyChangeEvent e) {
   String prop = e.getPropertyName();
   if (prop == JFileChooser.SELECTED_FILE_CHANGED_PROPERTY) {
     if (isShowing()) {
       loadImage((File) e.getNewValue());
       repaint();
     }
   }
 }
Ejemplo n.º 18
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);
        }
      }
    }
  /**
   * Notifies this instance that there was a change in the value of a property of {@link
   * #speechActivity}.
   *
   * @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 speechActivityPropertyChange(PropertyChangeEvent ev) {
    String propertyName = ev.getPropertyName();

    if (ConferenceSpeechActivity.DOMINANT_ENDPOINT_PROPERTY_NAME.equals(propertyName)) {
      // The dominant speaker in this Conference has changed. We will
      // likely want to notify the Endpoints participating in this
      // Conference.
      dominantSpeakerChanged();
    } else if (ConferenceSpeechActivity.ENDPOINTS_PROPERTY_NAME.equals(propertyName)) {
      speechActivityEndpointsChanged();
    }
  }
Ejemplo n.º 20
0
  @Override
  public void containerLayoutChanged(PropertyChangeEvent ev) throws PropertyVetoException {
    if (ev != null && ev.getPropertyName() != null) {
      layoutDelegate.acceptContainerLayoutChange(ev);

      FormModel formModel = radContainer.getFormModel();
      formModel.fireContainerLayoutChanged(
          radContainer, ev.getPropertyName(), ev.getOldValue(), ev.getNewValue());
    } else {
      propertySets = null;
    }

    LayoutNode node = radContainer.getLayoutNodeReference();
    if (node != null) {
      // propagate the change to node
      if (ev != null && ev.getPropertyName() != null) {
        node.fireLayoutPropertiesChange();
      } else {
        node.fireLayoutPropertySetsChange();
      }
    }
  }
  //
  //  Implement the PropertyChangeListener
  //
  public void propertyChange(PropertyChangeEvent e) {
    //  When the TableModel changes we need to update the listeners
    //  and column widths

    if ("model".equals(e.getPropertyName())) {
      TableModel model = (TableModel) e.getOldValue();
      model.removeTableModelListener(this);

      model = (TableModel) e.getNewValue();
      model.addTableModelListener(this);
      adjustColumns();
    }
  }
  /**
   * Listens for changes in notify device.
   *
   * @param ev the event that notify device has changed.
   */
  public void propertyChange(PropertyChangeEvent ev) {
    String propertyName = ev.getPropertyName();

    if (DeviceConfiguration.AUDIO_NOTIFY_DEVICE.equals(propertyName)
        || DeviceConfiguration.AUDIO_PLAYBACK_DEVICE.equals(propertyName)) {
      synchronized (audiosSyncRoot) {
        /*
         * Make sure that the currently referenced SCAudioClips will not
         * be reclaimed.
         */
        audios = null;
      }
    }
  }
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getPropertyName().equals(InstallOptionsModel.PROPERTY_INDEX)) {
     mDialog.moveChild(mCurrentWidget, ((Integer) evt.getNewValue()).intValue());
   } else if (evt.getPropertyName().equals(InstallOptionsModel.PROPERTY_CHILDREN)) {
     if (Common.objectsAreEqual(mCurrentWidget, evt.getOldValue())
         && evt.getNewValue() instanceof InstallOptionsWidget) {
       InstallOptionsWidget widget = (InstallOptionsWidget) evt.getNewValue();
       mCurrentWidget.removeModelCommandListener(InstallOptionsWidgetEditorDialog.this);
       mCurrentWidget.removePropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
       mCurrentWidget = widget;
       mSection = mCurrentWidget.getSection();
       mCurrentWidget.addModelCommandListener(InstallOptionsWidgetEditorDialog.this);
       mCurrentWidget.addPropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
       Display.getDefault()
           .asyncExec(
               new Runnable() {
                 public void run() {
                   mPage.selectionChanged(null, new StructuredSelection(mCurrentWidget));
                 }
               });
     }
   }
 }
Ejemplo n.º 24
0
    @Override
    public void vetoableChange(PropertyChangeEvent ev) throws PropertyVetoException {
      Object source = ev.getSource();
      String eventName = ev.getPropertyName();
      if (source instanceof FormProperty<?> && FormProperty.PROP_VALUE.equals(eventName)) {
        ev =
            new PropertyChangeEvent(
                layoutDelegate,
                ((FormProperty<?>) source).getName(),
                ev.getOldValue(),
                ev.getNewValue());

        containerLayoutChanged(ev);
      }
    }
Ejemplo n.º 25
0
  @Override
  public void propertyChange(final PropertyChangeEvent evt) {
    final String propertyName = evt.getPropertyName();

    if (AquaFocusHandler.FRAME_ACTIVE_PROPERTY.equals(propertyName)) {
      final JTextComponent comp = ((JTextComponent) evt.getSource());

      if (evt.getNewValue() == Boolean.TRUE) {
        setVisible(comp.hasFocus());
      } else {
        setVisible(false);
      }

      if (getDot() != getMark()) comp.getUI().damageRange(comp, getDot(), getMark());
    }
  }
Ejemplo n.º 26
0
  // Called on EDT
  public void propertyChange(PropertyChangeEvent ev) {
    String prop = ev.getPropertyName();

    if (prop == JConsoleContext.CONNECTION_STATE_PROPERTY) {
      ConnectionState newState = (ConnectionState) ev.getNewValue();

      switch (newState) {
        case DISCONNECTED:
          synchronized (this) {
            long time = System.currentTimeMillis();
            times.add(time);
            for (Sequence seq : seqs) {
              seq.add(Long.MIN_VALUE);
            }
          }
          break;
      }
    }
  }
Ejemplo n.º 27
0
    @Override
    public void propertyChange(PropertyChangeEvent ev) {
      Object source = ev.getSource();
      String eventName = ev.getPropertyName();
      if (source instanceof FormProperty<?> && FormProperty.PROP_VALUE.equals(eventName)) {
        ev =
            new PropertyChangeEvent(
                layoutDelegate,
                ((FormProperty<?>) source).getName(),
                ev.getOldValue(),
                ev.getNewValue());

        try {
          containerLayoutChanged(ev);
        } catch (PropertyVetoException ex) {
          // should not happen
        }
      }
    }
Ejemplo n.º 28
0
 public void propertyChange(PropertyChangeEvent e) {
   if (e.getSource() instanceof PanelThreadMonitor) {
     if (e.getPropertyName().equals("Status")) {
       PanelThreadMonitor mntTmp = (PanelThreadMonitor) e.getSource();
       int iMonitorIndex = pnlThread.indexOfComponent(mntTmp);
       if (iMonitorIndex >= 0) {
         if (e.getNewValue().equals("Started")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(COLOR_STARTED)) {
             pnlThread.setBackgroundAt(iMonitorIndex, COLOR_STARTED);
             pnlThread.setForegroundAt(iMonitorIndex, COLOR_STARTED_FG);
           }
         } else if (e.getNewValue().equals("Stopped")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(SystemColor.controlShadow)) {
             pnlThread.setBackgroundAt(iMonitorIndex, UIManager.getColor("TabbedPane.background"));
             pnlThread.setForegroundAt(iMonitorIndex, SystemColor.textText);
           }
         }
       }
     }
   }
 }
Ejemplo n.º 29
0
  /**
   * Called with a DjVuBean property has changed.
   *
   * @param e the PropertyChangeEvent.
   */
  public void propertyChange(final PropertyChangeEvent e) {
    try {
      final String name = e.getPropertyName();

      if ("page".equalsIgnoreCase(name)) {
        final Object object = e.getNewValue();

        if (object instanceof Number) {
          setCheckedPage(((Number) object).intValue() - 1);
        }
      } else if ("propertyName".equalsIgnoreCase(name)) {
        final String propertyName = (String) e.getNewValue();

        if ("navpane".equalsIgnoreCase(propertyName)) {
          setVisible("Outline".equalsIgnoreCase(djvuBean.properties.getProperty(propertyName)));
        }
      }
    } catch (final Throwable exp) {
      exp.printStackTrace(DjVuOptions.err);
      System.gc();
    }
  }
Ejemplo n.º 30
0
 @Override
 public void firePropertyChange(PropertyChangeEvent evt) {
   // do nothing if value not changed - the super method will check it anyway
   // but this way we don't have to log it
   if (ObjectUtils.equals(evt.getOldValue(), evt.getNewValue())) {
     return;
   }
   // improve log display for arrays
   Object newValue = evt.getNewValue();
   Object oldValue = evt.getOldValue();
   if (oldValue instanceof Object[]) {
     oldValue = Arrays.toString((Object[]) oldValue);
     newValue = Arrays.toString((Object[]) newValue);
   }
   // log change
   logger.log(
       Level.CONFIG,
       "Config changed - property: {0}, old: {1}, new: {2}",
       new Object[] {evt.getPropertyName(), oldValue, newValue});
   // fire change
   super.firePropertyChange(evt);
 }