Package org.jmule.ui.swt.common

Examples of org.jmule.ui.swt.common.SpeedScaleShell


  protected void checkSubclass() {
    }
 
  private void showDownSpeedLimitScaleWindow() {
    SpeedScaleShell speedScaleWidget = new SpeedScaleShell(_._("mainwindow.statusbar.speed_scale.download") + " :");
    long down_limit = 0;
    try {
      down_limit = config_manager.getDownloadLimit() / 1024;
    } catch (ConfigurationManagerException e) {
      e.printStackTrace();
    }
    speedScaleWidget.setMaxValue(down_limit+500);
    speedScaleWidget.setMaxTextValue(down_limit+500);
    speedScaleWidget.addOption(_._("mainwindow.statusbar.speed_scale.no_limit"), 0);
   
    List<Long> sets = getDefaultSpeedValues(down_limit);
   
    for(Long v : sets) {
      speedScaleWidget.addOption(SpeedFormatter.formatByteCountToKiBEtcPerSec(v * 1024,true), v);
    }
   
    boolean result = speedScaleWidget.open(down_limit, JMConstants.isWindows);
    if (result) {
      long value = speedScaleWidget.getValue();
      value*=1024;
      try {
        config_manager.setDownloadLimit(value);
      } catch (ConfigurationManagerException e) {
        e.printStackTrace();
View Full Code Here


      }
    }
  }
 
  private void showUpSpeedLimitScaleWindow() {
    SpeedScaleShell speedScaleWidget = new SpeedScaleShell(_._("mainwindow.statusbar.speed_scale.upload") + " :");
    long up_limit = 0;
    try {
      up_limit = config_manager.getUploadLimit() / 1024;
    } catch (ConfigurationManagerException e) {
   
      e.printStackTrace();
    }
    speedScaleWidget.setMaxValue(up_limit+500);
    speedScaleWidget.setMaxTextValue(up_limit+500);
    speedScaleWidget.addOption(_._("mainwindow.statusbar.speed_scale.no_limit"), 0);
   
    List<Long> sets = getDefaultSpeedValues(up_limit);
   
    for(Long v : sets) {
      speedScaleWidget.addOption(SpeedFormatter.formatByteCountToKiBEtcPerSec(v * 1024,true), v);
    }
   
    boolean result = speedScaleWidget.open(up_limit, JMConstants.isWindows);
    if (result) {
      long value = speedScaleWidget.getValue();
      value*=1024;
      try {
        config_manager.setUploadLimit(value);
      } catch (ConfigurationManagerException e) {
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.jmule.ui.swt.common.SpeedScaleShell

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.