Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Image


    protected void addRow(Peer object) {
      super.addRow(object);
     
      if (!CountryLocator.getInstance().isServiceDown()) {
       
        Image image = SWTImageRepository.getFlagByAddress(object.getIP(),FlagSize.S25x15);
       
        CountryFlagPainter painter = new CountryFlagPainter(image);
        TableItemCountryFlag table_item_painter = new TableItemCountryFlag(SWTPreferences.getDefaultColumnOrder(SWTConstants.DOWNLOAD_PEER_LIST_FLAG_COLUMN_ID),painter);
        addCustumControl(getItemCount()-1, table_item_painter);
    }
View Full Code Here


          setForegroundColor(object, color_green);
        

        setRowText(object, SWTConstants.SEARCH_FILENAME_COLUMN_ID,
            object.getFileName());
        Image file_icon = SWTImageRepository.getIconByExtension(object
            .getFileName());
        setRowImage(object, SWTPreferences.SEARCH_FILENAME_COLUMN_ID,
            file_icon);

        Image file_quality_img = SWTImageRepository.getImage(object
            .getFileQuality());
        setRowImage(object,
            SWTPreferences.SEARCH_FILEQUALITY_COLUMN_ID,
            file_quality_img);
View Full Code Here

   
    return 0;
  }

  public void updateRow(UploadSession object) {
    Image image = SWTImageRepository.getIconByExtension(object.getSharingName());
    setRowImage(object, SWTConstants.UPLOAD_LIST_FILE_NAME_COLUMN_ID, image);
    setRowText(object,  SWTConstants.UPLOAD_LIST_FILE_NAME_COLUMN_ID, object.getSharingName());
    setRowText(object,  SWTConstants.UPLOAD_LIST_FILE_SIZE_COLUMN_ID, FileFormatter.formatFileSize(object.getFileSize()));
    setRowText(object,  SWTConstants.UPLOAD_LIST_UPLOAD_SPEED_COLUMN_ID, SpeedFormatter.formatSpeed(object.getSpeed()));
    setRowText(object, SWTConstants.UPLOAD_LIST_PEERS_COLUMN_ID, object
View Full Code Here

        SharedFile hashing_file = sharing_manager.getCurrentHashingFile();
        if (hashing_file != null)
          if (object.getFile().equals(hashing_file.getFile()))
            status = HASHING;

        Image icon = SWTImageRepository.getIconByExtension(object.getSharingName());
        setRowImage(object, SWTConstants.SHARED_LIST_FILE_NAME_COLUMN_ID, icon);
       
        String text = object.getSharingName();
       
        setRowText(object,  SWTConstants.SHARED_LIST_FILE_NAME_COLUMN_ID, text);
View Full Code Here

    }
   
    public void addRow(Peer object) {
      super.addRow(object);
      if (!CountryLocator.getInstance().isServiceDown()) {
        Image image = SWTImageRepository.getFlagByAddress(object.getIP(),FlagSize.S25x15);
       
        CountryFlagPainter painter = new CountryFlagPainter(image);
        TableItemCountryFlag table_item_painter = new TableItemCountryFlag(SWTPreferences.getDefaultColumnOrder(SWTConstants.UPLOAD_PEER_LIST_FLAG_COLUMN_ID),painter);
        addCustumControl(getItemCount()-1, table_item_painter);
      }
View Full Code Here

    return 0;
  }

  public void updateRow(DownloadSession session) {
    String file_name = session.getSharingName();
    Image image = SWTImageRepository.getIconByExtension(file_name);
    setRowImage(session, SWTConstants.DOWNLOAD_LIST_FILE_NAME_COLUMN_ID, image);
    setRowText(session,  SWTConstants.DOWNLOAD_LIST_FILE_NAME_COLUMN_ID, file_name);
    setRowText(session,  SWTConstants.DOWNLOAD_LIST_SIZE_COLUMN_ID, FileFormatter.formatFileSize(session.getFileSize()));
    setRowText(session,  SWTConstants.DOWNLOAD_LIST_TRANSFERRED_COLUMN_ID, FileFormatter.formatFileSize(session.getTransferredBytes()));
   
View Full Code Here

        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;
View Full Code Here

  public void setRowImage(T object,int columnID,Image image) {
    int line_id = getObjectID(object);
    if (line_id==-1) return;
    int column = getColumnOrder(columnID);
    BufferedTableRow row = line_list.get(line_id);
    Image old_image = row.getImage(column);
    if (old_image != null) {
      old_image.dispose();
    }
    row.setImage(column, image);
  }
View Full Code Here

    layout.verticalSpacing = 0;
    layout.marginHeight = 0;
    setLayout(layout);

    img_label = new Label(this,SWT.NONE);
    Image img = SWTImageRepository.getImage("toolbar_disconnected.png");
    img_label.setImage(img);
   
    connection_status_label = new Label(this,SWT.NONE);
    connection_status_label.setFont(skin.getLabelFont());
    connection_status_label.setText(Localizer._("mainwindow.statusbar.label.disconnected"));
View Full Code Here

  }
 

  public void setStatusDisconnected() {
    connection_status_label.setText(Localizer._("mainwindow.statusbar.label.disconnected"));
    Image img = SWTImageRepository.getImage("toolbar_disconnected.png");
    img_label.setImage(img);
    client_id_label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLACK));
    client_id_label.setText("");
    client_id_label.setToolTipText("");
    layout();
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Image

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.