Package java.util

Examples of java.util.Observer


      public synchronized void deleteObserver(Observer o)
      {
         for (WeakReference<Observer> w : observer)
         {
            Observer tmp = w.get();
            if (tmp.equals(o))
            {
               observer.remove(o);
               break;
            }
View Full Code Here


      {
         if (hasChanged())
         {
            for (WeakReference<Observer> w : observer)
            {
               Observer tmp = w.get();
               tmp.update(this, arg);

            }
         }
      }
View Full Code Here

      try {
        logger.trace("Waiting for client connection");
        Socket sourceSocket = serverSocket.accept();
        logger.debug("Accepted client connection");
        TunnelHandler handler = new TunnelHandler(sourceSocket, tunnelFactory, taskExecutor);
        handler.addObserver(new Observer() {
          public void update(Observable observable, Object o) {
            if (logger.isDebugEnabled()) {
              logger.debug("Notified that " + observable + " is now " + o);
            }
            handlers.remove(observable);
View Full Code Here

      public synchronized void deleteObserver(Observer o)
      {
         clearCollected();
         for (WeakReference<Observer> w : observer)
         {
            Observer tmp = w.get();
            if (tmp != null && tmp.equals(o))
            {
               observer.remove(o);
               break;
            }
View Full Code Here

         clearCollected();
         if (hasChanged())
         {
            for (WeakReference<Observer> w : observer)
            {
               Observer tmp = w.get();
               if (tmp != null)
               {
                  tmp.update(this, arg);
               }
            }
         }
      }
View Full Code Here

      public synchronized void deleteObserver(Observer o)
      {
         for(WeakReference<Observer> w : observer)
         {
            Observer tmp = w.get();
            if(tmp.equals(o))
            {
               observer.remove(o);
               break;
            }
View Full Code Here

      {
         if(hasChanged())
         {
            for(WeakReference<Observer> w : observer)
            {
               Observer tmp = w.get();
               tmp.update(this, arg);

            }
         }
      }
View Full Code Here

  public JPanel getInterfaceVisualizer() {
    JPanel panel = new JPanel();
    final JLabel ipLabel = new JLabel();

    Observer observer;
    this.addObserver(observer = new Observer() {
      public void update(Observable obs, Object obj) {
        if (isVersion4()) {
          ipLabel.setText("IPv4 address: " + getIPString());
        } else if (isVersion6()) {
          ipLabel.setText((ipv6IsGlobal?"Global":"Local") +
              " IPv6 address(#" + ipv6AddressIndex + "): " + getIPString());
        } else {
          ipLabel.setText("Unknown IP");
        }
      }
    });
    observer.update(null, null);

    panel.add(ipLabel);
    panel.putClientProperty("intf_obs", observer);

    return panel;
View Full Code Here

    return panel;
  }

  public void releaseInterfaceVisualizer(JPanel panel) {
    Observer observer = (Observer) panel.getClientProperty("intf_obs");
    if (observer == null) {
      logger.fatal("Error when releasing panel, observer is null");
      return;
    }
    this.deleteObserver(observer);
View Full Code Here

   
    WITH_CAPTURE_EFFECT = currentChannelModel.getParameterBooleanValue(ChannelModel.Parameter.captureEffect);
    CAPTURE_EFFECT_THRESHOLD = currentChannelModel.getParameterDoubleValue(ChannelModel.Parameter.captureEffectSignalTreshold);
    CAPTURE_EFFECT_PREAMBLE_DURATION = currentChannelModel.getParameterDoubleValue(ChannelModel.Parameter.captureEffectPreambleDuration);
  
    currentChannelModel.addSettingsObserver(channelModelObserver = new Observer() {
      public void update(Observable o, Object arg) {
        WITH_CAPTURE_EFFECT = currentChannelModel.getParameterBooleanValue(ChannelModel.Parameter.captureEffect);
        CAPTURE_EFFECT_THRESHOLD = currentChannelModel.getParameterDoubleValue(ChannelModel.Parameter.captureEffectSignalTreshold);
        CAPTURE_EFFECT_PREAMBLE_DURATION = currentChannelModel.getParameterDoubleValue(ChannelModel.Parameter.captureEffectPreambleDuration);
      }
View Full Code Here

TOP

Related Classes of java.util.Observer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.