org.eclipse.swt.widgets.Label.getImage()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.eclipse.swt.widgets.Label.getImage()方法的一些代码示例,展示了Label.getImage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.getImage()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Label
类名称:Label
方法名:getImage

Label.getImage介绍

[英]Returns the receiver's image if it has one, or null if it does not.
[中]如果有接收器的图像,则返回该图像;如果没有,则返回null。

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 *
 */
protected Image getMessageImage() {
  if (imageLabel != null) {
    imageLabel.getImage();
  }
  return null;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

@Override
Image doGetImageValue(Object source) {
  return ((Label) source).getImage();
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

public void mouseEnter(MouseEvent e) {
  if (labelButton.getImage() != activeImage) {
    labelButton.setImage(activeImage);
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Sets the image to the given image.
 *
 * @param image the image to use
 */
public void setImage(Image image) {
  if (image != fElementImage.getImage()) {
    fElementImage.setImage(image);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

/**
 * Sets the image to the given image.
 *
 * @param image the image to use
 */
public void setImage(Image image) {
  if (image != fElementImage.getImage()) {
    fElementImage.setImage(image);
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Sets the image to the given image.
 *
 * @param image the image to use
 */
public void setImage(Image image) {
  if (image != fElementImage.getImage()) {
    fElementImage.setImage(image);
  }
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

public void mouseExit(MouseEvent e) {
  if (labelButton.getImage() != inactiveImage) {
    labelButton.setImage(inactiveImage);
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

/**
 * Returns the width of this element.
 *
 * @return current width of this element
 */
public int getWidth() {
  int result= 2;
  if (fElementImage.getImage() != null)
    result+= fElementImage.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
  if (fTextVisible && fElementText.getText().length() > 0)
    result+= fElementText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
  return result;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Returns the width of this element.
 *
 * @return current width of this element
 */
public int getWidth() {
  int result= 2;
  if (fElementImage.getImage() != null)
    result+= fElementImage.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
  if (fTextVisible && fElementText.getText().length() > 0)
    result+= fElementText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
  return result;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

/**
 * Returns the width of this element.
 *
 * @return current width of this element
 */
public int getWidth() {
  int result= 2;
  if (fElementImage.getImage() != null) {
    result+= fElementImage.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
  }
  if (fTextVisible && fElementText.getText().length() > 0) {
    result+= fElementText.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
  }
  return result;
}

代码示例来源:origin: BiglySoftware/BiglyBT

public void
setIconImage(
  Image        image )
{
  if ( 	icon_label != null &&
      image != icon_label.getImage()){
    icon_label.setImage( image );
    icon_label.pack();
    icon_label.redraw();
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void runSupport() {
    synchronized (PieceInfoView.this) {
      if (!alreadyFilling) {
        return;
      }
    }
    try {
      if (imageLabel == null || imageLabel.isDisposed()) {
        return;
      }
      if (imageLabel.getImage() != null) {
        Image image = imageLabel.getImage();
        imageLabel.setImage(null);
        image.dispose();
      }
      refreshInfoCanvas();
    } finally {
      synchronized (PieceInfoView.this) {
        alreadyFilling = false;
      }
    }
  }
});

代码示例来源:origin: openaudible/openaudible

private void clearCoverArt() {
  Image i = imageLabel.getImage();
  if (i != null && i != cover) {
    imageLabel.setImage(null);
    i.dispose();
  }
  
  imageLabel.setImage(cover);
  
}

代码示例来源:origin: BiglySoftware/BiglyBT

private void delete() {
  if (imageLabel != null && !imageLabel.isDisposed()
      && imageLabel.getImage() != null) {
    Image image = imageLabel.getImage();
    imageLabel.setImage(null);
    image.dispose();
  }
  if (img != null && !img.isDisposed()) {
    img.dispose();
    img = null;
  }
  if (font != null && !font.isDisposed()) {
    font.dispose();
    font = null;
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

private static void writeImage( final Label label ) throws IOException {
 Image image = label.getImage();
 if( WidgetLCAUtil.hasChanged( label, Props.IMAGE, image, null ) )
 {
  JSWriter writer = JSWriter.getWriterFor( label );
  String imagePath;
  if( image == null ) {
   imagePath = null;
  } else {
   // TODO passing image bounds to qooxdoo can speed up rendering
   imagePath = ImageFactory.getImagePath( image );
  }
  Object[] args = new Object[]{ label, imagePath };
  writer.callStatic( JS_FUNC_LABEL_UTIL_SET_IMAGE, args );
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
void preserveValues( Label label ) {
 preserveProperty( label, PROP_TEXT, label.getText() );
 preserveProperty( label, PROP_IMAGE, label.getImage() );
 preserveProperty( label, PROP_ALIGNMENT, getAlignment( label ) );
}

代码示例来源:origin: BiglySoftware/BiglyBT

private void delete() {
  if (imageLabel != null && !imageLabel.isDisposed()
      && imageLabel.getImage() != null) {
    Image image = imageLabel.getImage();
    imageLabel.setImage(null);
    image.dispose();
  }
  if (img != null && !img.isDisposed()) {
    img.dispose();
    img = null;
  }
  if (font != null && !font.isDisposed()) {
    font.dispose();
    font = null;
  }
  synchronized( this ){
    if ( dlm != null){
      dlm.removePieceListener(this);
      dlm = null;
    }
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

void preserveValues( final Label label ) {
 ControlLCAUtil.preserveValues( label );
 IWidgetAdapter adapter = WidgetUtil.getAdapter( label );
 adapter.preserve( PROP_TEXT, label.getText() );
 adapter.preserve( PROP_IMAGE, label.getImage() );
 adapter.preserve( PROP_ALIGNMENT, new Integer( label.getAlignment() ) );
 WidgetLCAUtil.preserveCustomVariant( label );
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
void renderChanges( Label label ) throws IOException {
 ControlLCAUtil.renderChanges( label );
 WidgetLCAUtil.renderCustomVariant( label );
 renderText( label );
 renderClientListeners( label );
 renderMnemonicIndex( label );
 renderProperty( label, PROP_IMAGE, label.getImage(), null );
 renderProperty( label, PROP_ALIGNMENT, getAlignment( label ), DEFAULT_ALIGNMENT );
}

代码示例来源:origin: BiglySoftware/BiglyBT

if ( existing == null || notification_icon.getImage() == null || !existing.equals( icon_id )){

相关文章