Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Image


    layout();
  }
 
  public void setStatusConnecting() {
    connection_status_label.setText(Localizer._("mainwindow.statusbar.label.connecting"));
    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("");
    layout();
  }
View Full Code Here


      client_id_label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_RED));
    else
      client_id_label.setForeground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_BLACK));
    long id = Convert.intToLong(client_id.hashCode());
    client_id_label.setToolTipText(id+"");
    Image img = SWTImageRepository.getImage("toolbar_connected.png");
    img_label.setImage(img);
    layout();
  }
View Full Code Here

   
    //System.out.println("PW: " + word);
    if (images != null && word.length() >= 2 && word.charAt(0) == '%') {
      int imgIdx = word.charAt(1) - '0';
      if (images.length > imgIdx && imgIdx >= 0 && images[imgIdx] != null) {
        Image img = images[imgIdx];
        Rectangle bounds = img.getBounds();
        if (imageScales != null && imageScales.length > imgIdx) {
          bounds.width = (int) (bounds.width * imageScales[imgIdx]);
          bounds.height = (int) (bounds.height * imageScales[imgIdx]);
        }
       
 
View Full Code Here

 
  public void addServer(final Server server) {
    addRow(server);
   
    if (!CountryLocator.getInstance().isServiceDown()) {
        Image image = SWTImageRepository.getFlagByAddress(server.getAddress(),default_flag_size);
       
        CountryFlagPainter painter = new CountryFlagPainter(image);
       
        TableItemCountryFlag table_item_painter = new TableItemCountryFlag(SWTPreferences.getDefaultColumnOrder(SWTConstants.SERVER_LIST_FLAG_COLUMN_ID),painter);
        addCustumControl(getItemCount()-1, table_item_painter);
View Full Code Here

    server_info.setLayout(server_info_layout);
 
    CountryLocator country_locator = CountryLocator.getInstance();
    if (!country_locator.isServiceDown()) {
      label = new Label(server_info,SWT.NONE);
      Image flag = SWTImageRepository.getFlagByAddress(server.getAddress(),FlagSize.S18x25);
      label.setImage(flag);
      String country_name = country_locator.getCountryName(server.getAddress());
      String country_code = country_locator.getCountryCode(server.getAddress());
     
      if (country_name.equals(CountryLocator.COUNTRY_NAME_NOT_AVAILABLE))
View Full Code Here

      System.arraycopy( image_values, 0, new_images, 0, image_values.length );
     
      image_values = new_images;
    }
   
    Image  image = image_values[index];
   
    if ( new_image == image ){
     
      return;
    }
View Full Code Here

      return false;
   
    if (!checkWidget(REQUIRE_TABLEITEM_INITIALIZED))
      return false;
   
    Image oldImage = item.getImage(0);
    if (oldImage != null) {
      Rectangle r = oldImage.getBounds();
      if (r.width == pt.x && r.height == pt.y)
        return false;
    }
   
    // set row height by setting image
    Image image = new Image(item.getDisplay(), pt.x, pt.y);
    item.setImage(0, image);
    item.setImage(0, null);
    image.dispose();
   
    return true;
  }
View Full Code Here

  public static Image getImage(String  name ) {
    InputStream input_stream = (SWTImageRepository.class.getClassLoader().getResourceAsStream("org/jmule/ui/resources/" + name));
    if ( input_stream == null )
      input_stream = (SWTImageRepository.class.getClassLoader().getResourceAsStream("org/jmule/ui/resources/image_not_found.png"));
    Image image = new Image(SWTThread.getDisplay(),input_stream);
    try {
      input_stream.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

   
    Program program = Program.findProgram(extension);
    if (program == null) {
     
      InputStream stream = UIConstants.getIconByExtension(extension);
      Image img = new Image(SWTThread.getDisplay(),stream);
     
      try {
        stream.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
      stream = null;
      return img;
    }
   
    ImageData image_data = program.getImageData();
    if (image_data == null) {
      return getImage("image_not_found.png");
    }
    image_data = image_data.scaledTo(16, 16);
    Image image = new Image(SWTThread.getDisplay(),image_data);
    return image;
  }
View Full Code Here

 
  public static Image getMenuImage(String name) {
    InputStream input_stream = (SWTImageRepository.class.getClassLoader().getResourceAsStream("org/jmule/ui/resources/menuicons/" + name));
    if ( input_stream == null )
      input_stream = (SWTImageRepository.class.getClassLoader().getResourceAsStream("org/jmule/ui/resources/image_not_found.png"));
    Image image = new Image(SWTThread.getDisplay(),input_stream);
    try {
      input_stream.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
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.