Package com.aelitis.azureus.ui.swt.imageloader

Examples of com.aelitis.azureus.ui.swt.imageloader.ImageLoader


  public void configSectionSave() {
  }

  public void configSectionDelete() {
    ImageLoader imageLoader = ImageLoader.getInstance();
    imageLoader.releaseImage("openFolderButton");
  }
View Full Code Here


  }

 

  public Composite configSectionCreate(final Composite parent) {
    ImageLoader imageLoader = ImageLoader.getInstance();
    Image imgOpenFolder = imageLoader.getImage("openFolderButton");     

    GridData gridData;
    GridLayout layout;

    Composite gStats = new Composite(parent, SWT.NULL);
View Full Code Here

   */
  public static void setMenuItemImage(final MenuItem item, final String repoKey) {
    if (Constants.isOSX || repoKey == null) {
      return;
    }
    ImageLoader imageLoader = ImageLoader.getInstance();
    item.setImage(imageLoader.getImage(repoKey));
    item.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        ImageLoader imageLoader = ImageLoader.getInstance();
        imageLoader.releaseImage(repoKey);
      }
    });
  }
View Full Code Here

    if (Constants.isOSX) {
      if (true) {
        return;
      }
      if (icon128 == null) {
        ImageLoader imageLoader = ImageLoader.getInstance();
        icon128 = imageLoader.getImage("azureus128");
        if (Constants.isCVSVersion()) {
          final int border = 9;
          Image image = Utils.createAlphaImage(shell.getDisplay(),
              128 + (border * 2), 128 + (border * 2));
          image = blitImage(shell.getDisplay(), icon128, null, image, new Point(border,
              border + 1));
          imageLoader.releaseImage("azureus128");
          icon128 = image;
//          GC gc = new GC(icon128);
//          gc.setTextAntialias(SWT.ON);
//          gc.setForeground(shell.getDisplay().getSystemColor(SWT.COLOR_YELLOW));
//          Font font = getFontWithHeight(gc.getFont(), gc, 20, SWT.BOLD);
//          gc.setFont(font);
//          GCStringPrinter.printString(gc, Constants.AZUREUS_VERSION,
//              new Rectangle(0, 0, 128, 128), false, false, SWT.CENTER
//                  | SWT.BOTTOM);
//          gc.dispose();
//          font.dispose();
        }
      }
       shell.setImage(icon128);
      return;
    }

    try {
      if (shellIcons == null) {

        ArrayList<Image> listShellIcons = new ArrayList<Image>(
            shellIconNames.length);

        ImageLoader imageLoader = ImageLoader.getInstance();
        for (int i = 0; i < shellIconNames.length; i++) {
          // never release images since they are always used and stored
          // in an array
          Image image = imageLoader.getImage(shellIconNames[i]);
          if (ImageLoader.isRealImage(image)) {
            listShellIcons.add(image);
          }
        }
        shellIcons = (Image[]) listShellIcons.toArray(new Image[listShellIcons.size()]);
View Full Code Here

    display = SWTThread.getInstance().getDisplay();

    tray = display.getSystemTray();
    trayItem = new TrayItem(tray, SWT.NULL);
   
    ImageLoader imageLoader = ImageLoader.getInstance();
    if (Constants.isOSX) {
      imgAzureusGray = imageLoader.getImage("azureus_grey");
      imgAzureusWhite = imageLoader.getImage("azureus_white");
      trayItem.setImage(imgAzureusGray);
    } else {
      imgAzureus = imageLoader.getImage("azureus");
      trayItem.setImage(imgAzureus);
    }

    trayItem.setVisible(true);
View Full Code Here

      public void runSupport() {
        if (trayItem != null && !trayItem.isDisposed()) {
          trayItem.dispose();
        }

        ImageLoader imageLoader = ImageLoader.getInstance();
        if (Constants.isOSX) {
          imageLoader.releaseImage("azureus_grey");
          imageLoader.releaseImage("azureus_white");
        } else {
          imageLoader.releaseImage("azureus");
        }
      }
    });
  }
View Full Code Here

          }
        });

    Utils.execSWTThread(new AERunnable() {
      public void runSupport() {
        ImageLoader imageLoader = ImageLoader.getInstance();

        iconNLI = imageLoader.getImage( "bbb_nli" );
        iconIDLE = imageLoader.getImage( "bbb_idle" );
        iconIN = imageLoader.getImage( "bbb_in" );
        iconOUT = imageLoader.getImage( "bbb_out" );
      }
    });
  }
View Full Code Here

    gridData = new GridData();
    gridData.horizontalIndent = 15;
    gridData.horizontalSpan = 2;
    cMaxActiveOptionsArea.setLayoutData(gridData);

    ImageLoader imageLoader = ImageLoader.getInstance();
    label = new Label(cMaxActiveOptionsArea, SWT.NULL);
    imageLoader.setLabelImage(label, "subitem");
    gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    label.setLayoutData(gridData);

    gridData = new GridData();
    BooleanParameter maxActiveWhenSeedingEnabled = new BooleanParameter(
        cMaxActiveOptionsArea,
        "StartStopManager_bMaxActiveTorrentsWhenSeedingEnabled",
        "ConfigView.label.queue.maxactivetorrentswhenseeding");
    maxActiveWhenSeedingEnabled.setLayoutData(gridData);

    gridData = new GridData();

    final IntParameter maxActivWhenSeeding = new IntParameter(
        cMaxActiveOptionsArea, "StartStopManager_iMaxActiveTorrentsWhenSeeding");
    maxActivWhenSeeding.setLayoutData(gridData);

    // row

    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, "ConfigView.label.mindownloads");
    gridData = new GridData();
    final IntParameter minDLs = new IntParameter(cSection, "min downloads");
    minDLs.setLayoutData(gridData);
    minDLs.setMaximumValue(maxDLs.getValue() / 2);
   
    // change controllers for above items

    maxActiveWhenSeedingEnabled.setAdditionalActionPerformer(new ChangeSelectionActionPerformer(
        maxActivWhenSeeding));

    maxDLs.addChangeListener(new ParameterChangeAdapter() {
      public void parameterChanged(Parameter p, boolean caused_internally) {
        int iMaxDLs = maxDLs.getValue();
        minDLs.setMaximumValue(iMaxDLs / 2);

        int iMinDLs = minDLs.getValue();
        int iMaxActive = maxActiv.getValue();
       
        if ((iMaxDLs == 0 || iMaxDLs > iMaxActive) && iMaxActive != 0) {
          maxActiv.setValue(iMaxDLs);
        }
      }
    });

    maxActiv.addChangeListener(new ParameterChangeAdapter() {
      public void parameterChanged(Parameter p, boolean caused_internally) {
        int iMaxDLs = maxDLs.getValue();
        int iMaxActive = maxActiv.getValue();

        if ((iMaxDLs == 0 || iMaxDLs > iMaxActive) && iMaxActive != 0) {
          maxDLs.setValue(iMaxActive);
        }
      }
    });

   
    // row
   
    final ArrayList values = new ArrayList();
    int exp = 29;
    for(int val = 0; val <= 8*1024*1024;)
    {
      values.add(new Integer(val));
      if(val < 256)
        val+=64;
      else if(val < 1024)
        val+=256;
      else if(val < 16*1024)
        val+=1024;
      else
        val = (int)(Math.pow(2, exp++/2) + (exp % 2 == 0 ? Math.pow(2(exp-3)/2) : 0));
    }
    String[] activeDLLabels = new String[values.size()];
    int[] activeDLValues = new int[activeDLLabels.length];
   

    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, "ConfigView.label.minSpeedForActiveDL");
    for(int i=0;i<activeDLLabels.length;i++)
    {
      activeDLValues[i] = ((Integer)values.get(i)).intValue();
      activeDLLabels[i] = DisplayFormatters.formatByteCountToKiBEtcPerSec(
        activeDLValues[i], true);
     
    }
    new IntListParameter(cSection, "StartStopManager_iMinSpeedForActiveDL",
        activeDLLabels, activeDLValues);

    // row

    label = new Label(cSection, SWT.NULL);
    Messages.setLanguageText(label, "ConfigView.label.minSpeedForActiveSeeding");
    String[] activeSeedingLabels = new String[values.size()-4];
    int[] activeSeedingValues = new int[activeSeedingLabels.length];
    System.arraycopy(activeDLLabels, 0, activeSeedingLabels, 0, activeSeedingLabels.length);
    System.arraycopy(activeDLValues, 0, activeSeedingValues, 0, activeSeedingValues.length);

    new IntListParameter(cSection,
        "StartStopManager_iMinSpeedForActiveSeeding", activeSeedingLabels,
        activeSeedingValues);

    // subrow

    final Composite cMinSpeedActiveCDing = new Composite(cSection, SWT.NULL);
    layout = new GridLayout();
    layout.numColumns = 3;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    cMinSpeedActiveCDing.setLayout(layout);
    gridData = new GridData();
    gridData.horizontalIndent = 15;
    gridData.horizontalSpan = 2;
    cMinSpeedActiveCDing.setLayoutData(gridData);

    label = new Label(cMinSpeedActiveCDing, SWT.NULL);
    imageLoader.setLabelImage(label, "subitem");
    gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    label.setLayoutData(gridData);

    label = new Label(cMinSpeedActiveCDing, SWT.NULL);
    Messages.setLanguageText(label, "ConfigView.label.maxStalledSeeding");
View Full Code Here

    // <<<<<<< Buttons
   
    // >>>>>>> Chosen

    ImageLoader imageLoader = ImageLoader.getInstance();

    Button btnUp = new Button(cResultButtonArea, SWT.PUSH);
    imageLoader.setButtonImage(btnUp, "up");
    btnUp.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        moveChosenUp();
      }

      public void widgetDefaultSelected(SelectionEvent e) {
      }
    });

    Button btnDown = new Button(cResultButtonArea, SWT.PUSH);
    imageLoader.setButtonImage(btnDown, "down");
    btnDown.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        moveChosenDown();
      }

      public void widgetDefaultSelected(SelectionEvent e) {
      }
    });

    Button btnDel = new Button(cResultButtonArea, SWT.PUSH);
    imageLoader.setButtonImage(btnDel, "delete");
    btnDel.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        removeSelectedChosen();
      }
View Full Code Here

   *
   * @since 4.0.0.5
   */
  private void releaseOldImages() {
    if (imageIDstoDispose.size() > 0) {
      ImageLoader imageLoader = ImageLoader.getInstance();

      for (Iterator iter = imageIDstoDispose.iterator(); iter.hasNext();) {
        String id = (String) iter.next();
        imageLoader.releaseImage(id);
        iter.remove();
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.ui.swt.imageloader.ImageLoader

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.