Package org.gudy.azureus2.core3.util

Examples of org.gudy.azureus2.core3.util.LightHashMap$HashIterator


      while (torrent.hasNext()) {
               
        DownloadManager dm = (DownloadManager) torrent.next();
               
        DownloadManagerStats stats = dm.getStats();

        boolean bDownloadCompleted = stats.getDownloadCompleted(false) == 1000;
        boolean bCanShow = ((bShowOnlyComplete == bShowOnlyIncomplete) || (bDownloadCompleted && bShowOnlyComplete) || (!bDownloadCompleted && bShowOnlyIncomplete));

        if (bCanShow && bShowOnlyActive) {
          int dmstate = dm.getState();
          bCanShow = (dmstate == DownloadManager.STATE_SEEDING) || (dmstate == DownloadManager.STATE_DOWNLOADING) || (dmstate == DownloadManager.STATE_CHECKING) || (dmstate == DownloadManager.STATE_INITIALIZING) || (dmstate == DownloadManager.STATE_ALLOCATING);
View Full Code Here


          AzureusCore          core,
          AzureusCoreComponent    comp )
          {
            if ( comp instanceof GlobalManager ){
             
              GlobalManager  gm  = (GlobalManager)comp;
             
              gm.addListener( PluginInitializer.this );
            }
          }
      });
   
    core_operation   = _core_operation;
View Full Code Here

  public static void invokeSlider(AzureusCore core, boolean isUpSpeed) {
    final String prefix = MessageText.getString(isUpSpeed
        ? "GeneralView.label.maxuploadspeed"
        : "GeneralView.label.maxdownloadspeed");

    GlobalManager gm = core.getGlobalManager();

    final String configAutoKey = TransferSpeedValidator.getActiveAutoUploadParameter(gm);
    boolean auto = COConfigurationManager.getBooleanParameter(configAutoKey);

    final String configKey = isUpSpeed
        ? TransferSpeedValidator.getActiveUploadParameter(gm)
        : "Max Download Speed KBs";
    int maxBandwidth = COConfigurationManager.getIntParameter(configKey);
    final boolean unlim = (maxBandwidth == 0);
    if (unlim && !isUpSpeed) {
      GlobalManagerStats stats = gm.getStats();
      int dataReceive = stats.getDataReceiveRate();
      if (dataReceive >= 1024) {
        maxBandwidth = dataReceive / 1024;
      }
    }
View Full Code Here

    DownloadManager dm = (DownloadManager) ci.torrents.get(number - 1);
    String name = dm.getDisplayName();
    if (name == null)
      name = "?";
   
    GlobalManager  gm = dm.getGlobalManager();

    if (moveto) {
      gm.moveTo(dm, nmoveto - 1);
      gm.fixUpDownloadManagerPositions();
      ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to #" + Integer.toString(nmoveto) + ".");
    } else if (ncommand > 0) {
      if (gm.isMoveableUp(dm)) {
        while (gm.isMoveableUp(dm))
          gm.moveUp(dm);
        gm.fixUpDownloadManagerPositions();
        ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to top.");
      } else {
        ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") already at top.");
      }
    } else {
      if (gm.isMoveableDown(dm)) {
        while (gm.isMoveableDown(dm))
          gm.moveDown(dm);
        gm.fixUpDownloadManagerPositions();
        ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") moved to bottom.");
      } else {
        ci.out.println("> Torrent #" + Integer.toString(number) + " (" + name + ") already at bottom.");
      }
    }
View Full Code Here

      }
     
      ci.torrents.clear();
      ci.torrents.addAll( shown_torrents );
     
      GlobalManager  gm = ci.getGlobalManager();
     
      ci.out.println("Total Speed (down/up): " + DisplayFormatters.formatByteCountToKiBEtcPerSec(gm.getStats().getDataReceiveRate() + gm.getStats().getProtocolReceiveRate() ) + " / " + DisplayFormatters.formatByteCountToKiBEtcPerSec(gm.getStats().getDataSendRate() + gm.getStats().getProtocolSendRate() ));

      ci.out.println("Transferred Volume (down/up/discarded): " + DisplayFormatters.formatByteCountToKiBEtc(totalReceived) + " / " + DisplayFormatters.formatByteCountToKiBEtc(totalSent) + " / " + DisplayFormatters.formatByteCountToKiBEtc(totalDiscarded));
      ci.out.println("Total Connected Peers (seeds/peers): " + Integer.toString(connectedSeeds) + " / " + Integer.toString(connectedPeers));
      ci.out.println("> -----");
    } else if (subCommand.equalsIgnoreCase("dht") || subCommand.equalsIgnoreCase("d")) {
View Full Code Here

        public void handleEvent(Event e) {
          if (!AzureusCoreFactory.isCoreRunning()) {
            return;
          }
          AzureusCore core = AzureusCoreFactory.getSingleton();
          GlobalManager globalManager = core.getGlobalManager();
         
          SelectableSpeedMenu.generateMenuItems(menuUpSpeed, core,
              globalManager, true);
        }
      });
      statusUp.setMenu(menuUpSpeed);
    } else {

      statusUp.addMouseListener(new MouseAdapter() {
        public void mouseDown(MouseEvent e) {
          if (!(e.button == 3 || (e.button == 1 && e.stateMask == SWT.CONTROL))) {
            return;
          }
          Event event = new Event();
          event.type = SWT.MouseUp;
          event.widget = e.widget;
          event.stateMask = e.stateMask;
          event.button = e.button;
          e.widget.getDisplay().post(event);

          CoreWaiterSWT.waitForCoreRunning(new AzureusCoreRunningListener() {
            public void azureusCoreRunning(AzureusCore core) {
              SelectableSpeedMenu.invokeSlider(core, true);
            }
          });
        }
      });
    }

    if (bSpeedMenu) {
      final Menu menuDownSpeed = new Menu(statusBar.getShell(), SWT.POP_UP);
      menuDownSpeed.addListener(SWT.Show, new Listener() {
        public void handleEvent(Event e) {
          if (!AzureusCoreFactory.isCoreRunning()) {
            return;
          }
          AzureusCore core = AzureusCoreFactory.getSingleton();
          GlobalManager globalManager = core.getGlobalManager();

          SelectableSpeedMenu.generateMenuItems(menuDownSpeed, core,
              globalManager, false);
        }
      });
View Full Code Here


    // UL/DL Status Sections
    if (AzureusCoreFactory.isCoreRunning()) {
      AzureusCore core = AzureusCoreFactory.getSingleton();
      GlobalManager gm = core.getGlobalManager();
      GlobalManagerStats stats = gm.getStats();

      int dl_limit = NetworkManager.getMaxDownloadRateBPS() / 1024;
      long rec_data = stats.getDataReceiveRate();
      long rec_prot = stats.getProtocolReceiveRate();
     
View Full Code Here

   */
  private static int adjustMaxBandWidth(int maxBandwidth,
      GlobalManager globalManager, boolean up_menu) {
    if(maxBandwidth == 0 && !up_menu )
    {
      GlobalManagerStats stats = globalManager.getStats();
      int dataReceive = stats.getDataReceiveRate();
      if (dataReceive < 1024) {
        maxBandwidth = 275;
      } else {
        maxBandwidth = dataReceive / 1024;           
      }
View Full Code Here

        ? TransferSpeedValidator.getActiveUploadParameter(gm)
        : "Max Download Speed KBs";
    int maxBandwidth = COConfigurationManager.getIntParameter(configKey);
    final boolean unlim = (maxBandwidth == 0);
    if (unlim && !isUpSpeed) {
      GlobalManagerStats stats = gm.getStats();
      int dataReceive = stats.getDataReceiveRate();
      if (dataReceive >= 1024) {
        maxBandwidth = dataReceive / 1024;
      }
    }
View Full Code Here

    // UL/DL Status Sections
    if (AzureusCoreFactory.isCoreRunning()) {
      AzureusCore core = AzureusCoreFactory.getSingleton();
      GlobalManager gm = core.getGlobalManager();
      GlobalManagerStats stats = gm.getStats();

      int dl_limit = NetworkManager.getMaxDownloadRateBPS() / 1024;
      long rec_data = stats.getDataReceiveRate();
      long rec_prot = stats.getProtocolReceiveRate();
     
      if (last_dl_limit != dl_limit || last_rec_data != rec_data || last_rec_prot != rec_prot) {
        last_dl_limit = dl_limit;
        last_rec_data = rec_data;
        last_rec_prot = rec_prot;

        statusDown.setText((dl_limit == 0 ? "" : "[" + dl_limit + "K] ")
            + DisplayFormatters.formatDataProtByteCountToKiBEtcPerSec(rec_data, rec_prot));
      }
     
      boolean auto_up = TransferSpeedValidator.isAutoSpeedActive(gm)
          && TransferSpeedValidator.isAutoUploadAvailable(core);

      int ul_limit_norm = NetworkManager.getMaxUploadRateBPSNormal() / 1024;

      String seeding_only;
      if (NetworkManager.isSeedingOnlyUploadRate()) {
        int ul_limit_seed = NetworkManager.getMaxUploadRateBPSSeedingOnly() / 1024;
        if (ul_limit_seed == 0) {
          seeding_only = "+" + Constants.INFINITY_STRING + "K";
        } else {
          int diff = ul_limit_seed - ul_limit_norm;
          seeding_only = (diff >= 0 ? "+" : "") + diff + "K";
        }
      } else {
        seeding_only = "";
      }

      int sent_data = stats.getDataSendRate();
      if (imgRec != null && !imgRec.isDisposed()) {
        updateGraph(statusDown, imgRec, rec_data, max_rec);
        updateGraph(statusUp, imgSent, sent_data, max_sent);
      }


      statusUp.setText((ul_limit_norm == 0 ? "" : "[" + ul_limit_norm + "K"
          + seeding_only + "]")
          + (auto_up ? "* " : " ")
          + DisplayFormatters.formatDataProtByteCountToKiBEtcPerSec(
              sent_data, stats.getProtocolSendRate()));
    }
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.util.LightHashMap$HashIterator

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.