Examples of SWTSkin


Examples of com.aelitis.azureus.ui.swt.skin.SWTSkin

    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        VuzeMessageBox box = new VuzeMessageBox("Title", "Text", new String[] { "Ok", "Cancel" }, 0);
        box.setListener(new VuzeMessageBoxListener() {
          public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
            SWTSkin skin = soExtra.getSkin();
            skin.createSkinObject("dlg.generic.test", "dlg.generic.test", soExtra);
            skin.layout(soExtra);
            shell.layout(true, true);
          }
        });
        box.open(null);
      }
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkin

    mainShell = UIFunctionsManagerSWT.getUIFunctionsSWT().getMainShell();
    shell = ShellFactory.createShell(mainShell, style);

    Utils.setShellIcon(shell);

    SWTSkin skin = SWTSkinFactory.getNonPersistentInstance(
        SkinnedDialog.class.getClassLoader(), "com/aelitis/azureus/ui/skin/",
        skinFile + ".properties");
   
    setSkin(skin);

    skin.initialize(shell, shellSkinObjectID);

    shell.addTraverseListener(new TraverseListener() {
      public void keyTraversed(TraverseEvent e) {
        if (e.detail == SWT.TRAVERSE_ESCAPE) {
          shell.close();
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkin

      buildNotifications();
    } catch (Exception e) {
      Debug.out(e);
    }
   
    final SWTSkin skin = SWTSkinFactory.getInstance();
    if (skin != null) {
      SWTSkinObject soHeader = skin.getSkinObject("plus-header");
      if (soHeader != null) {
        soHeader.setVisible(hasFullLicence);
      }
      Utils.execSWTThread(new AERunnable() {
        public void runSupport() {
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkin

    box.setIconResource(isTrial ? "image.burn.dlg.header" : "image.vp");

    box.setListener(new VuzeMessageBoxListener() {

      public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
        SWTSkin skin = soExtra.getSkin();
        skin.createSkinObject("dlg.register.install", "dlg.register.install",
            soExtra);

        SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
        if (soProgressBar != null) {
          progressBar = new ProgressBar(soProgressBar.getComposite(),
              SWT.HORIZONTAL);
          progressBar.setMinimum(0);
          progressBar.setMaximum(100);
          progressBar.setLayoutData(Utils.getFilledFormData());
        }
       
        soInstallPct = (SWTSkinObjectText) skin.getSkinObject("install-pct");

        soProgressText = (SWTSkinObjectText) skin.getSkinObject("progress-text");
        if (soProgressText != null && progressText != null) {
          soProgressText.setText(progressText);
        }
      }
    });
View Full Code Here

Examples of com.aelitis.azureus.ui.swt.skin.SWTSkin

          listener.MfChooserClosed(chosenMF);
        }
      }
    });
   
    SWTSkin skin = skinnedDialog.getSkin();
    SWTSkinObject so= skin.getSkinObject("list");
    if (so instanceof SWTSkinObjectContainer) {
      SWTSkinObjectContainer soList = (SWTSkinObjectContainer) so;
     
      Composite parent = soList.getComposite();
     
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

  public void getCoreComponents() {
   
  }

  public void initUIComponents() {
    SWTSkin skin = null;
    try {
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) { }
   
    display = SWTThread.getDisplay();
   
    final Shell shell1=new Shell(display,SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
   
    MouseAdapter link_listener = new MouseAdapter() {
      public void mouseDoubleClick(MouseEvent arg0) {
        String path = (String) ((CLabel) arg0.widget).getData();
        if (!Utils.launchProgram(path))
          Utils.showWarningMessage(shell, _._("aboutwindow.error_open_url.title")
              , Localizer._("aboutwindow.error_open_url",path));
      }
      public void mouseDown(MouseEvent arg0) {
        String path = (String) ((CLabel) arg0.widget).getData();
        if (!Utils.launchProgram(path))
          Utils.showWarningMessage(shell, _._("aboutwindow.error_open_url.title")
              , Localizer._("aboutwindow.error_open_url",path));
      }
    };
   
    GridData layout_data;
    GridLayout layout;
    Composite content;
   
    layout = new GridLayout(1,false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
   
    shell.setLayout(layout);
   
    // Top gradient
    final Canvas window_top = new Canvas(shell,SWT.NONE);
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.heightHint = TOP_GRADIENT_HEIGHT;
    window_top.setLayoutData(layout_data);
    window_top.addPaintListener(new PaintListener() {
      public void paintControl(PaintEvent arg0) {
        Rectangle rect = shell.getClientArea ();
        GC gc = arg0.gc;
        gc.setForeground (GRADIENT_COLOR_2);
        gc.setBackground (GRADIENT_COLOR_1);
        gc.fillGradientRectangle (rect.x, rect.y, rect.width, rect.height, false);
        Image image = SWTImageRepository.getImage(logo_image);
        gc.drawImage(image, rect.width - image.getImageData().width - 10, 5);
       
        gc.setForeground(new Color(SWTThread.getDisplay(),0,0,0));
        Font font = new Font(display,"Arial",14,SWT.NONE );
        gc.setFont(font);
        gc.drawText(JMConstants.JMULE_NAME, 20, TOP_GRADIENT_HEIGHT / 2 - 15,true);
       
        gc.setForeground(new Color(SWTThread.getDisplay(),0,0,0));
        font = new Font(display,"Arial",10,SWT.NONE );
        gc.setFont(font);
        gc.drawText("Version : " + JMConstants.JMULE_VERSION, 17, TOP_GRADIENT_HEIGHT / 2 + 5,true);
      }
    });
   
    Composite window_content = new Composite(shell,SWT.NONE);
    window_content.setLayoutData(new GridData(GridData.FILL_BOTH));
   
    FillLayout fill_layout = new FillLayout();
    fill_layout.marginHeight = 0;
    fill_layout.marginWidth = 0;
    window_content.setLayout(fill_layout);
   
    CTabFolder tab_list = new CTabFolder(window_content, SWT.BORDER);
    tab_list.setLayout(new FillLayout());
    tab_list.setSimple(false);
    tab_list.setUnselectedImageVisible(false);
    tab_list.setUnselectedCloseVisible(false);
   
    CTabItem general_tab = new CTabItem(tab_list,SWT.NONE);
    content = new Composite(tab_list,SWT.NONE);
    general_tab.setControl(content);
    general_tab.setText(_._("aboutwindow.tab.general"));
    layout = new GridLayout(1,false);
    layout.marginTop +=10;
    content.setLayout(layout);

    Composite container1 = new Composite(content,SWT.NONE);
    container1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout = new GridLayout(1,false);
    layout.marginWidth = 15;
    container1.setLayout(layout);
   
    Label jmule_version = new Label(container1,SWT.LEFT);
    FontData data = skin.getLabelFont().getFontData()[0];
   
    Font bold_font = new Font(display,data.getName(),data.getHeight(),SWT.BOLD);
    jmule_version.setText(JMConstants.JMULE_FULL_NAME);
    jmule_version.setFont(bold_font);
   
    Label copyright = new Label(container1,SWT.LEFT);
    copyright.setText("Copyright (C) 2007-2010 JMule Team");
    copyright.setFont(bold_font);
   
    new Label(container1,SWT.NONE);
   
    StyledText about_text = new StyledText(container1,SWT.LEFT | SWT.READ_ONLY);
    about_text.setText(_._("aboutwindow.tab.general.label.about"));
    about_text.setWordWrap(true);
    about_text.setBackground(shell.getBackground());
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    about_text.setLayoutData(layout_data);
   
    Composite links_container = new Composite(content,SWT.NONE);
    links_container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout = new GridLayout(2,false);
    layout.marginWidth = 15;
    links_container.setLayout(layout);
   
    FontData link_font_data = skin.getLabelFont().getFontData()[0];
    Font link_font = new Font(SWTThread.getDisplay(),link_font_data.getName(), link_font_data.getHeight(), SWT.UNDERLINE_SINGLE);
   
    CLabel link;
   
    link = new CLabel(links_container,SWT.NONE);
    link.setText(_._("aboutwindow.tab.general.label.home_page") + " : ");
    link = new CLabel(links_container,SWT.NONE);
    link.setFont(link_font);
    link.setText(JMConstants.JMULE_WEB_SITE);
    link.setData(JMConstants.JMULE_WEB_SITE);
    link.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    link.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    link.addMouseListener(link_listener);

    link = new CLabel(links_container,SWT.NONE);
    link.setText(_._("aboutwindow.tab.general.label.forum") + " : ");
   
    link = new CLabel(links_container,SWT.NONE);
    link.setFont(link_font);
    link.setText(JMConstants.JMULE_FORUMS);
    link.setData(JMConstants.JMULE_FORUMS);
    link.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    link.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    link.addMouseListener(link_listener);
   
    if (JMConstants.IS_NIGHTLY_BUILD) {
      CTabItem nightly_build = new CTabItem(tab_list,SWT.NONE);
      content = new Composite(tab_list,SWT.NONE);
      nightly_build.setControl(content);
      nightly_build.setText(_._("aboutwindow.tab.nightly_build"));
      layout = new GridLayout(1,false);
      layout.marginHeight = 10;
      layout.marginWidth  = 10;
      content.setLayout(layout);
     
      final Label image = new Label(content,SWT.NONE);
      image.setImage(SWTImageRepository.getImage("bomb.png"));
      layout_data = new GridData();
      layout_data.grabExcessHorizontalSpace = true;
      layout_data.horizontalAlignment = GridData.CENTER;
      image.setLayoutData(layout_data);
     
      Label nightly_build_label = new Label(content,SWT.NONE);
      nightly_build_label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_RED));
      layout_data = new GridData(GridData.FILL_HORIZONTAL);
      layout_data.horizontalAlignment = GridData.CENTER;
      nightly_build_label.setLayoutData(layout_data);
      nightly_build_label.setText(_._("aboutwindow.tab.nightly_build.label.nightly_buld_str1"));
     
      Label nightly_build_label2 = new Label(content,SWT.NONE);
      nightly_build_label2.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_RED));
      layout_data = new GridData(GridData.FILL_HORIZONTAL );
      layout_data.horizontalAlignment = GridData.CENTER;
      nightly_build_label2.setLayoutData(layout_data);
      nightly_build_label2.setText(_._("aboutwindow.tab.nightly_build.label.nightly_buld_str2")+" "+_._("aboutwindow.tab.general.label.forum"));
     
      CLabel forum_link = new CLabel(content,SWT.NONE);
      layout_data = new GridData(GridData.FILL_HORIZONTAL );
      layout_data.horizontalAlignment = GridData.CENTER;
      forum_link.setLayoutData(layout_data);
      forum_link.setFont(link_font);
      forum_link.setText(JMConstants.JMULE_FORUMS);
      forum_link.setData(JMConstants.JMULE_FORUMS);
      forum_link.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
      forum_link.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
      forum_link.addMouseListener(link_listener);
    }
   
    CTabItem environment_tab = new CTabItem(tab_list,SWT.NONE);
    content = new Composite(tab_list,SWT.NONE);
    environment_tab.setControl(content);
    environment_tab.setText(_._("aboutwindow.tab.environment"));
    content.setLayout(new FillLayout());
   
    JMTable<String> table = new JMTable<String>(content,SWT.NONE) {
      protected int compareObjects(String object1, String object2,
          int columnID, boolean order) {
        return 0;
      }

      protected Menu getPopUpMenu() {
        return null;
      }

      public void updateRow(String object) {
        setRowText(object, 1, object);
        if (object.equals("line.separator"))
          setRowText(object,2,"\\n");
        else {
          String data = System.getProperty(object);
          setRowText(object,2,data);
        }
      }
      protected void saveColumnSettings() {}
    };
    table.setLayout(new FillLayout());
    table.setLinesVisible(true);
    table.setAlternateBackgroundColor(false);
    table.setSorting(false);
    table.addColumn(SWT.LEFT, 1, _._("aboutwindow.tab.environment.table.column.key"), "", 200);
    table.addColumn(SWT.LEFT, 2, _._("aboutwindow.tab.environment.table.column.value"), "", 500);
   
    Set<Object> keys = System.getProperties().keySet();
   
    for(Object key : keys) {
      String value = (String) key;
      table.addRow(value);
    }
    CTabItem license_tab = new CTabItem(tab_list,SWT.NONE);
    content = new Composite(tab_list,SWT.NONE);
    license_tab.setControl(content);
    license_tab.setText(_._("aboutwindow.tab.license"));
   
    content.setLayout(new FillLayout());
   
    Text license_text = new Text(content,SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.READ_ONLY);
    Font font_license = new Font(SWTThread.getDisplay(),"Courier",10,SWT.NONE );
    license_text.setFont(font_license);
      license_text.setText(UIConstants.GNU_LICENSE);
      license_text.setBackground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_WHITE));
     
    tab_list.setSelection(general_tab);
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    layout = new GridLayout(1,false);
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    button_bar.setLayout(layout);
   
    Button button_ok = new Button(button_bar,SWT.NONE);
    button_ok.setFont(skin.getButtonFont());
    button_ok.setText(_._("aboutwindow.button.ok"));
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

 
  public void initUIComponents() {
    GridLayout layout;
    GridData layout_data;
    Label label;
    SWTSkin skin = null;
    try {
     
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
   
    }catch(Throwable t) {}
   
    Display display = SWTThread.getDisplay();
   
    final Shell shell1=new Shell(display,SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
   
    shell.setText(_._("advancedsearchwindow.title"));
   
    shell.setSize(500,300);

    layout = new GridLayout(1,false);
    layout.marginWidth = 10;
    layout.marginHeight = 10;
    shell.setLayout(layout);
   
    Composite file_size_options = new Composite(shell,SWT.NONE);
    layout = new GridLayout(7,false);
    layout.marginHeight=0;
    layout.marginWidth=0;
    file_size_options.setLayout(layout);
   
    layout_data = new GridData();
    layout_data.grabExcessHorizontalSpace = true;
    layout_data.horizontalAlignment = GridData.FILL;
    file_size_options.setLayoutData(layout_data);
   
    label = new Label(file_size_options,SWT.NONE);
    label.setText(_._("advancedsearchwindow.label.min_size") + " : ");
   
    min_file_size = new Text(file_size_options,SWT.BORDER);
    min_file_size.addVerifyListener(new VerifyListener() {     
      public void verifyText(VerifyEvent e) {
        try {
          String str = min_file_size.getText().substring(0, e.start)+e.text+min_file_size.getText().substring(e.end);
          double value = Double.parseDouble(str);
          double x = (100 * value) / 1024D;
          if (x>100) {
            e.doit = false;
            return ;
          }
          long min_unit = (Long)min_file_size_units.getData(min_file_size_units.getText());
          long max_unit = (Long)max_file_size_units.getData(max_file_size_units.getText());
          double min = formatSize(x, min_unit);
          double max = formatSize(file_size_slider.getUpValue(), max_unit);
          if (min>max) { e.doit = false; return ;}
          e.doit = true;
          file_size_slider.setDownValue(x);       
        }catch(Exception t) {
          e.doit = false;
        }
      }
    });
   
    min_file_size_units = new Combo(file_size_options,SWT.READ_ONLY);
   
    min_file_size_units.add("Bytes");
    min_file_size_units.add("KB");
    min_file_size_units.add("MB");
    min_file_size_units.add("GB");
   
    min_file_size_units.setData("Bytes", 1024L);
    min_file_size_units.setData("KB", 1024 * 1024L);
    min_file_size_units.setData("MB", 1024 * 1024 * 1024L);
    min_file_size_units.setData("GB", 1024 * 1024 * 1024 * 1024L);
    min_file_size_units.select(0);
   
    min_file_size_units.addSelectionListener(new SelectionAdapter() {

      public void widgetSelected(SelectionEvent arg0) {
        updated_file_size = true;
      }
     
    });
   
    layout_data = new GridData();
    layout_data.grabExcessHorizontalSpace = true;
    layout_data.horizontalAlignment = GridData.FILL;
    new Label(file_size_options,SWT.NONE).setLayoutData(layout_data);
   
    label = new Label(file_size_options,SWT.NONE);
    label.setText(_._("advancedsearchwindow.label.max_size") + " : ");
   
    max_file_size = new Text(file_size_options,SWT.BORDER);
   
    max_file_size.addVerifyListener(new VerifyListener() {     
      public void verifyText(VerifyEvent e) {
        try {
          String str = max_file_size.getText().substring(0, e.start)+e.text+max_file_size.getText().substring(e.end);
          double value = Double.parseDouble(str);
          double x = (100 * value) / 1024D;
         
          if (x>100) {
            e.doit = false;
            return ;
          }
         
          long min_unit = (Long)min_file_size_units.getData(min_file_size_units.getText());
          long max_unit = (Long)max_file_size_units.getData(max_file_size_units.getText());
          double min = formatSize(file_size_slider.getDownValue(), min_unit);
          double max = formatSize(x, max_unit);
          if (min>max) { e.doit = false; return ;}
          e.doit = true;
          file_size_slider.setUpValue(x);       
        }catch(Exception t) {
          e.doit = false;
        }
      }
    });
   
    max_file_size_units = new Combo(file_size_options,SWT.READ_ONLY);
    max_file_size_units.add("Bytes");
    max_file_size_units.add("KB");
    max_file_size_units.add("MB");
    max_file_size_units.add("GB");
   
    max_file_size_units.setData("Bytes", 1024L);
    max_file_size_units.setData("KB", 1024 * 1024L);
    max_file_size_units.setData("MB", 1024 * 1024 * 1024L);
    max_file_size_units.setData("GB", 1024 * 1024 * 1024 * 1024L);
    max_file_size_units.select(0);
   
    max_file_size_units.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        updated_file_size = true;
      }
    });
   
    Composite slider_composite = new Composite(shell,SWT.NONE);
    layout_data = new GridData();
    layout_data.grabExcessHorizontalSpace = true;
    layout_data.horizontalAlignment = GridData.FILL;
    slider_composite.setLayoutData(layout_data);
    slider_composite.setLayout(new GridLayout(1,true));
    file_size_slider = new ExSlider(slider_composite){
      public boolean validate(double upValue, double downValue) {
        long min_unit = (Long)min_file_size_units.getData(min_file_size_units.getText());
        long max_unit = (Long)max_file_size_units.getData(max_file_size_units.getText());
        double min = formatSize(downValue, min_unit);
        double max = formatSize(upValue, max_unit);
       
        return max>min;
      }
    };
   
    file_size_slider.setBarBackgroundColor(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    file_size_slider.setBarUsedSegmentColor(SWTThread.getDisplay().getSystemColor(SWT.COLOR_RED));
    file_size_slider.setPointerColor(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLACK));
   
    file_size_slider.setUpValue(0);
    file_size_slider.setUpValue(100);
   
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.heightHint = 30;
    file_size_slider.setLayoutData(layout_data);
   
    file_size_slider.addModifyListener(new ExSliderModifyListener() {

      public void downValueChanged(double downValue) {
        updated_file_size = true;
        DecimalFormat formatter = new DecimalFormat("0.00");
       
        downValue = Math.round(downValue);
        double u = 1024 / 100D;
       
        min_file_size.setText(formatter.format(u * downValue));
       
      }

      public void upValueChanged(double upValue) {
        updated_file_size = true;
        DecimalFormat formatter = new DecimalFormat("0.00");
       
        upValue = Math.round(upValue);
        double u = 1024 / 100D;
       
        max_file_size.setText(formatter.format(u * upValue));
      }
    });
       
    Composite options_composite = new Composite(shell,SWT.NONE);
    layout_data = new GridData();
    layout_data.grabExcessHorizontalSpace = true;
    layout_data.horizontalAlignment = GridData.FILL;
    options_composite.setLayoutData(layout_data);
    options_composite.setLayout(new GridLayout(4,false));
   
    label = new Label(options_composite,SWT.NONE);
    label.setText("File type : ");
    layout_data = new GridData();
    layout_data.horizontalAlignment = SWT.RIGHT;
    label.setLayoutData(layout_data);
   
    file_type = new Combo(options_composite,SWT.READ_ONLY);
    // must be same order as filetypes
    file_type.add(_._("advancedsearchwindow.file_type.any"));
    file_type.add(_._("advancedsearchwindow.file_type.archive"));
    file_type.add(_._("advancedsearchwindow.file_type.audio"));
    file_type.add(_._("advancedsearchwindow.file_type.cd_image"));
    file_type.add(_._("advancedsearchwindow.file_type.document"));
    file_type.add(_._("advancedsearchwindow.file_type.pictures"));
    file_type.add(_._("advancedsearchwindow.file_type.program"));
    file_type.add(_._("advancedsearchwindow.file_type.video"));
   
    file_type.select(0);
    file_type.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout_data = new GridData();
    file_type.setLayoutData(layout_data);
       
    label = new Label(options_composite,SWT.NONE);
    label.setText(_._("advancedsearchwindow.label.extension") + " : ");
    layout_data = new GridData();
    layout_data.horizontalAlignment = SWT.RIGHT;
    label.setLayoutData(layout_data);
   
    file_extension = new Text(options_composite,SWT.BORDER);
   
    label = new Label(options_composite,SWT.NONE);
    label.setText(_._("advancedsearchwindow.label.availability") + " : ");
    layout_data = new GridData();
    layout_data.horizontalAlignment = SWT.RIGHT;
    label.setLayoutData(layout_data);
   
    av_spinner = new Spinner(options_composite,SWT.BORDER);
    av_spinner.setMaximum(1000);
   
    label = new Label(options_composite,SWT.NONE);
    label.setText(_._("advancedsearchwindow.label.complete_sources") + " : ");
    layout_data = new GridData();
    layout_data.horizontalAlignment = SWT.RIGHT;
    label.setLayoutData(layout_data);
    cmp_src_spinner = new Spinner(options_composite,SWT.BORDER);
    cmp_src_spinner.setMaximum(1000);
   
   
    Composite button_composite = new Composite(shell,SWT.BORDER);
    layout_data = new GridData();
    layout_data.verticalAlignment = GridData.END;
    layout_data.horizontalAlignment = GridData.FILL;
    layout_data.grabExcessHorizontalSpace = true;
    layout_data.grabExcessVerticalSpace=true;
    button_composite.setLayoutData(layout_data);
   
    layout = new GridLayout(3,false);
    button_composite.setLayout(layout);
   
    Button button_clear = new Button(button_composite,SWT.NONE);
    button_clear.setText(_._("advancedsearchwindow.button.clear"));
    button_clear.setImage(SWTImageRepository.getImage("remove_all.png"));
    button_clear.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        min_file_size.setText("0.0");
        min_file_size_units.select(0);
       
        max_file_size.setText("1024.00");
        max_file_size_units.select(0);
       
        file_extension.setText("");
        file_type.select(0);
       
        av_spinner.setSelection(0);
        cmp_src_spinner.setSelection(0);
       
        updated_file_size = false;
      }
    });
   
    Button button_ok = new Button(button_composite,SWT.NONE);
    button_ok.setText(_._("advancedsearchwindow.button.ok"));
    button_ok.setImage(skin.getButtonImage(Skin.OK_BUTTON_IMAGE));
   
    layout_data = new GridData();
    layout_data.grabExcessHorizontalSpace=true;
    layout_data.horizontalAlignment = SWT.RIGHT;
    button_ok.setLayoutData(layout_data);
   
    button_ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        long min_unit = (Long)min_file_size_units.getData(min_file_size_units.getText());
        long max_unit = (Long)max_file_size_units.getData(max_file_size_units.getText());
        double min = formatSize(file_size_slider.getDownValue(), min_unit);
        double max = formatSize(file_size_slider.getUpValue(), max_unit);
        if (updated_file_size)
          save((long)min, (long)max, file_types[file_type.getSelectionIndex()],file_extension.getText(), av_spinner.getSelection(), cmp_src_spinner.getSelection());
        else
          save((long)0, (long)0, file_types[file_type.getSelectionIndex()],file_extension.getText(), av_spinner.getSelection(), cmp_src_spinner.getSelection());
        shell.close();
      }
    });
   
    Button button_cancel = new Button(button_composite,SWT.NONE);
    button_cancel.setText(_._("advancedsearchwindow.button.cancel"));
    button_cancel.setImage(skin.getButtonImage(Skin.CANCEL_BUTTON_IMAGE));
    button_cancel.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        shell.close();
      }
    });
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

  public UploadGeneralTab(CTabFolder tabFolder, UploadSession session) {
    super(tabFolder, SWT.NONE);
    upload_session = session;
    setText(Localizer._("uploadinfowindow.tab.general.title"));
   
    SWTSkin skin = null;
    try {
        skin = (SWTSkin)JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {
    }
    Composite content = new Composite(tabFolder,SWT.NONE);
    setControl(content);
    content.setLayout(new GridLayout(1,false));
    Label label;
   
    Group general = new Group(content,SWT.NONE);
    GridLayout layout = new GridLayout(2,false);
    layout.marginWidth = 10;
    general.setLayout(layout);
    general.setText(Localizer._("uploadinfowindow.tab.general.title"));
    general.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    label = new Label(general,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.general.label.filename")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general,SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(upload_session.getSharingName());
    label.setToolTipText(upload_session.getSharingName());
   
    label = new Label(general,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.general.label.filehash")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general,SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(upload_session.getFileHash().getAsString());
    label.setToolTipText(upload_session.getFileHash().getAsString());
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
   
    label = new Label(general,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.general.label.filesize")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(general,SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(FileFormatter.formatFileSize(upload_session.getFileSize()));
    label.setToolTipText(FileFormatter.formatFileSize(upload_session.getFileSize()));
   
    label = new Label(general,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("uploadinfowindow.tab.general.label.ed2k_link") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    label = new Label(general,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(upload_session.getED2KLink().getAsString());
    label.setToolTipText(_._("uploadinfowindow.tab.general.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    label.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    label.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        Utils.setClipBoardText(upload_session.getED2KLink().getAsString());
      }
    });
   
    Group transfer = new Group(content,SWT.NONE);
    GridLayout transfer_layout = new GridLayout(2,false);
    transfer_layout.marginWidth = 10;
    transfer.setLayout(transfer_layout);
    transfer.setText(Localizer._("uploadinfowindow.tab.general.group.transfer"));
    transfer.setLayoutData(new GridData(GridData.FILL_BOTH));
   
    label = new Label(transfer,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.transfer.label.uploadspeed")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    upload_speed = new Label(transfer,SWT.NONE);
    upload_speed.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    upload_speed.setText(SpeedFormatter.formatSpeed(upload_session.getSpeed()));

    label = new Label(transfer,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.transfer.label.transferred")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    total_uploaded = new Label(transfer,SWT.NONE);
    total_uploaded.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    total_uploaded.setText(FileFormatter.formatFileSize(upload_session.getTransferredBytes()));
   
    label = new Label(transfer,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.transfer.label.eta")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    eta = new Label(transfer,SWT.NONE);
    eta.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    eta.setText(TimeFormatter.format(upload_session.getETA()));

    label = new Label(transfer,SWT.NONE);
    label.setText(Localizer._("uploadinfowindow.tab.transfer.label.peers")+" : ");
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    peers = new Label(transfer,SWT.NONE);
    peers.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    peers.setText(upload_session.getPeerCount() + "");   
  }
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

  public SharedFilePropertiesWindow(SharedFile sharedFile) {
    shared_file = sharedFile; 
  }
 
  public void getCoreComponents() {
    SWTSkin skin = null;
    try {
        skin = (SWTSkin) JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {
    }
   
    final Shell shell1=new Shell(SWTThread.getDisplay(),SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
   
    shell.setText(_._("sharedfilepropertieswindow.title"));
    shell.setImage(SWTImageRepository.getImage("info.png"));
   
    shell.setSize(500, 310);
   
    Utils.centreWindow(shell);
   
    shell.setLayout(new GridLayout(1,false));
    Composite shared_file_fields = new Composite(shell,SWT.BORDER);
    shared_file_fields.setLayout(new GridLayout(2,false));
    shared_file_fields.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_BOTH));

    Label label;
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("sharedfilepropertieswindow.label.filename")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(shared_file.getSharingName());
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("sharedfilepropertieswindow.label.filesize")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(FileFormatter.formatFileSize(shared_file.length()));
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("sharedfilepropertieswindow.label.filepath")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(shared_file.getAbsolutePath());
    label.setToolTipText(shared_file.getAbsolutePath());
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("sharedfilepropertieswindow.label.filestype")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(FileFormatter.formatMimeType(shared_file.getMimeType()));
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("sharedfilepropertieswindow.label.file_hash")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(shared_file.getFileHash().getAsString());
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("sharedfilepropertieswindow.label.completed")+" : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
       
    completed = new Label(shared_file_fields,SWT.NONE);
    completed.setFont(skin.getLabelFont());
    completed.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (shared_file instanceof PartialFile) {
      refresher = new Refreshable(){

        public void refresh() {
          PartialFile p_file = (PartialFile) shared_file;
          completed.setText(FileFormatter.formatProgress(p_file.getPercentCompleted()));
        }
       
      };
      GUIUpdater.getInstance().addRefreshable(refresher);
    }else
      completed.setText("100%");
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(Localizer._("sharedfilepropertieswindow.label.ed2k_link") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));

    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    label.setText(shared_file.getED2KLink().getAsString());
    label.setToolTipText(_._("sharedfilepropertieswindow.label.ed2k_link.tooltip"));
    label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLUE));
    label.setCursor(new Cursor(SWTThread.getDisplay(),SWT.CURSOR_HAND));
    label.addListener(SWT.MouseUp, new Listener() {
      public void handleEvent(Event arg0) {
        Utils.setClipBoardText(shared_file.getED2KLink().getAsString());
      }
    });
   
    label = new Label(shared_file_fields,SWT.NONE);
    label.setFont(skin.getLabelFont());
    label.setText(_._("sharedfilepropertieswindow.label.file_quality") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
   
    file_quality_combo = new Combo(shared_file_fields,SWT.READ_ONLY);
   
    if (!shared_file.isCompleted())
      file_quality_combo.setEnabled(false);
    file_quality_combo.setFont(skin.getDefaultFont());
    file_quality_combo.add(_._("sharedfilepropertieswindow.label.fq_not_rated"));
    file_quality_combo.setData(_._("sharedfilepropertieswindow.label.fq_not_rated"), FileQuality.NOTRATED);
   
    file_quality_combo.add(_._("sharedfilepropertieswindow.label.fq_fake"));
    file_quality_combo.setData(_._("sharedfilepropertieswindow.label.fq_fake"), FileQuality.FAKE);
   
    file_quality_combo.add(_._("sharedfilepropertieswindow.label.fq_poor"));
    file_quality_combo.setData(_._("sharedfilepropertieswindow.label.fq_poor"), FileQuality.POOR);
   
    file_quality_combo.add(_._("sharedfilepropertieswindow.label.fq_fair"));
    file_quality_combo.setData(_._("sharedfilepropertieswindow.label.fq_fair"), FileQuality.FAIR);
   
    file_quality_combo.add(_._("sharedfilepropertieswindow.label.fq_good"));
    file_quality_combo.setData(_._("sharedfilepropertieswindow.label.fq_good"), FileQuality.GOOD);
   
    file_quality_combo.add(_._("sharedfilepropertieswindow.label.fq_excellent"));
    file_quality_combo.setData(_._("sharedfilepropertieswindow.label.fq_excellent"), FileQuality.EXCELLENT);
   
    switch(shared_file.getFileQuality()) {
      case FAKE : file_quality_combo.select(1); break;
      case POOR : file_quality_combo.select(2); break;
      case FAIR : file_quality_combo.select(3); break;
      case GOOD : file_quality_combo.select(4); break;
      case EXCELLENT : file_quality_combo.select(5); break;
      default :   file_quality_combo.select(0); break;
    }
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    GridLayout layout = new GridLayout(2,false);
    button_bar.setLayout(layout);

    Button button_ok = new Button(button_bar,SWT.NONE);
    button_ok.setFont(skin.getButtonFont());
    button_ok.setText(_._("sharedfilepropertieswindow.button.ok"));
    button_ok.setImage(skin.getButtonImage(SWTSkin.OK_BUTTON_IMAGE));
   
    Button button_cancel = new Button(button_bar,SWT.NONE);
    button_cancel.setFont(skin.getButtonFont());
    button_cancel.setText(_._("sharedfilepropertieswindow.button.cancel"));
    button_cancel.setImage(skin.getButtonImage(SWTSkin.CANCEL_BUTTON_IMAGE));
   
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
View Full Code Here

Examples of org.jmule.ui.swt.skin.SWTSkin

  public void getCoreComponents() {
   
  }

  public void initUIComponents() {
    SWTSkin skin = null;
    try {
        skin = (SWTSkin) JMuleUIManager.getJMuleUI().getSkin();
    }catch(Throwable t) {}
   
   
    Display display = SWTThread.getDisplay();
    final Shell shell1=new Shell(display,SWT.ON_TOP);
    shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
   
    shell.setText(Localizer._("downloadinfowindow.title"));
    shell.setImage(SWTImageRepository.getImage("info.png"));
       
    shell.setLayout(new FillLayout());
   
    Composite content = new Composite(shell,SWT.BORDER);
    content.setLayout(new GridLayout(1,true));
    CTabFolder tab_folder = new CTabFolder(content,SWT.BORDER);
    tab_folder.setLayoutData(new GridData(GridData.FILL_BOTH));
    tab_folder.setSimple(false);

    DownloadGeneralTab general_tab = new DownloadGeneralTab(tab_folder,download_session);
    tab_folder.setSelection(general_tab);
    tabs.add(general_tab);
   
    DownloadPeerListTab peer_list_tab = new DownloadPeerListTab(tab_folder,download_session);
    tabs.add(peer_list_tab);
   
    for(Refreshable refreshable : tabs)
      GUIUpdater.getInstance().addRefreshable(refreshable);
   
    Composite buttons_composite = new Composite(content,SWT.NONE);
    buttons_composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    buttons_composite.setLayout(new GridLayout(1,false));
    Button button_close = new Button(buttons_composite,SWT.NONE);
    GridData grid_data = new GridData();
    grid_data.widthHint = 70;
    grid_data.horizontalAlignment = GridData.END;
    grid_data.grabExcessHorizontalSpace = true;
    button_close.setLayoutData(grid_data);
   
    button_close.setFont(skin.getButtonFont());
    button_close.setText(Localizer._("downloadinfowindow.button.close"));
   
    button_close.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        for(Refreshable refreshable : tabs) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.