当前位置: 首页>>代码示例>>Java>>正文


Java Image.isDisposed方法代码示例

本文整理汇总了Java中org.eclipse.swt.graphics.Image.isDisposed方法的典型用法代码示例。如果您正苦于以下问题:Java Image.isDisposed方法的具体用法?Java Image.isDisposed怎么用?Java Image.isDisposed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.graphics.Image的用法示例。


在下文中一共展示了Image.isDisposed方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispose

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void dispose(TableCell cell) {
	// only dispose of image here, this method is reused in other methods
	Graphic graphic = cell.getGraphic();
	if (graphic instanceof UISWTGraphic)
	{
		final Image img = ((UISWTGraphic) graphic).getImage();
		if (img != null && !img.isDisposed()){
			img.dispose();

				// see http://forum.vuze.com/thread.jspa?threadID=117243
				// could it be that it isn't being marked as disposed after disposal and
				// being double-disposed?
			((UISWTGraphic) graphic).setImage( null );
		}
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:18,代码来源:ProgressGraphItem.java

示例2: cellPaint

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void cellPaint(GC gc, TableCellSWT cell) {

	Object ds = cell.getDataSource();
	if (noIconForYou(ds, cell)) {
		return;
	}

	Comparable sortValue = cell.getSortValue();
	if (!(sortValue instanceof Number)) {
		return;
	}
	int sortVal = ((Number) sortValue).intValue();
	boolean canStream = (sortVal & 2) > 0;
	boolean canPlay = (sortVal & 1) > 0;
	// for now, always use green
	Image img = canStream ? imgBlue : canPlay ? imgGreen : imgDisabled;

	Rectangle cellBounds = cell.getBounds();

	if (img != null && !img.isDisposed()) {
		Utils.drawImageCenterScaleDown(gc, img, cellBounds);
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:25,代码来源:ColumnStream.java

示例3: dispose

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void dispose(TableCell cell) {
	// Named infoObj so code can be copied easily to the other PiecesItem
	DownloadManager infoObj = (DownloadManager) cell.getDataSource();
	if (infoObj == null)
		return;

	Image img = (Image) infoObj.getUserData("PiecesImage");
	if (img != null && !img.isDisposed())
		img.dispose();

	infoObj.setUserData("PiecesImageBuffer", null);
	infoObj.setUserData("PiecesImage", null);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:15,代码来源:PiecesItem.java

示例4: disposeCellIcon

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
private void disposeCellIcon(TableCell cell) {
	if (!(cell instanceof TableCellSWT)) {
		return;
	}
	final Image img = ((TableCellSWT) cell).getIcon();
	if (img != null) {
		((TableCellSWT) cell).setIcon(null);
		if (!img.isDisposed()) {
			img.dispose();
		}
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:13,代码来源:NameItem.java

示例5: disposeCellIcon

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
private void disposeCellIcon(TableCell cell) {
	final Image img = ((TableCellSWT) cell).getIcon();
	if (img != null) {
		((TableCellSWT) cell).setIcon(null);
		if (!img.isDisposed()) {
			img.dispose();
		}
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:10,代码来源:NameItem.java

示例6: cellPaint

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void cellPaint(GC gc, TableCellSWT cell) {
	SBC_SearchResult entry = (SBC_SearchResult) cell.getDataSource();

	Rectangle cellBounds = cell.getBounds();

	Image img = entry.getIcon();

	if (img != null && !img.isDisposed()) {
		Rectangle imgBounds = img.getBounds();
		if (cellBounds.width < imgBounds.width || cellBounds.height < imgBounds.height) {
			float dx = (float) cellBounds.width / imgBounds.width;
			float dy = (float) cellBounds.height / imgBounds.height;
			float d = Math.min(dx, dy);
			int newWidth = (int) (imgBounds.width * d);
			int newHeight = (int) (imgBounds.height * d);

			gc.drawImage(img, 0, 0, imgBounds.width, imgBounds.height,
					cellBounds.x + (cellBounds.width - newWidth) / 2,
					cellBounds.y + (cellBounds.height - newHeight) / 2, newWidth,
					newHeight);
		} else {
 			gc.drawImage(img, cellBounds.x
 					+ ((cellBounds.width - imgBounds.width) / 2), cellBounds.y
 					+ ((cellBounds.height - imgBounds.height) / 2));
		}
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:29,代码来源:ColumnSearchResultSite.java

示例7: cellPaint

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void cellPaint(GC gc, TableCellSWT cell) {
	SBC_SubscriptionResult entry = (SBC_SubscriptionResult) cell.getDataSource();

	Rectangle cellBounds = cell.getBounds();
	Image img = entry== null || entry.getRead() ? imgOld: imgNew;

	if (img != null && !img.isDisposed()) {
		Rectangle imgBounds = img.getBounds();
		gc.drawImage(img, cellBounds.x
				+ ((cellBounds.width - imgBounds.width) / 2), cellBounds.y
				+ ((cellBounds.height - imgBounds.height) / 2));
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:15,代码来源:ColumnSubResultNew.java

示例8: cellPaint

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void cellPaint(GC gc, TableCellSWT cell) {
	ActivitiesEntry entry = (ActivitiesEntry) cell.getDataSource();

	Rectangle cellBounds = cell.getBounds();
	Image img = entry.getReadOn() <= 0 ? imgNew : imgOld;

	if (img != null && !img.isDisposed()) {
		Rectangle imgBounds = img.getBounds();
		gc.drawImage(img, cellBounds.x
				+ ((cellBounds.width - imgBounds.width) / 2), cellBounds.y
				+ ((cellBounds.height - imgBounds.height) / 2));
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:15,代码来源:ColumnActivityNew.java

示例9: cellPaint

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
@Override
public void cellPaint(GC gc, TableCellSWT cell) {
	SearchSubsResultBase entry = (SearchSubsResultBase) cell.getDataSource();

	Rectangle cellBounds = cell.getBounds();
	Image img;
	if ( entry == null ){
		img = imgOther;
	}else{
		int ct = entry.getContentType();
		switch( ct ){
			case 0:{
				img = imgOther;
				break;
			}
			case 1:{
				img = imgVideo;
				break;
			}
			case 2:{
				img = imgAudio;
				break;
			}
			case 3:{
				img = imgGame;
				break;
			}
			default:{
				img = imgOther;
				break;
			}
		}
	}

	if (img != null && !img.isDisposed()) {
		Rectangle imgBounds = img.getBounds();
		gc.drawImage(img, cellBounds.x
				+ ((cellBounds.width - imgBounds.width) / 2), cellBounds.y
				+ ((cellBounds.height - imgBounds.height) / 2));
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:42,代码来源:ColumnSearchSubResultType.java

示例10: getString

import org.eclipse.swt.graphics.Image; //导入方法依赖的package包/类
protected String
getString()
{
	String img_str = "";

	for ( Image i: images ){

		String s;

		if ( i == null ){

			s = "null";

		}else{

			s = i.toString() + ", disp=" + i.isDisposed();
		}

		img_str += (img_str.length()==0?"":",") + s;
	}

	return( "rc=" + refcount + ", images=[" + img_str + "]" );
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:24,代码来源:ImageLoaderRefInfo.java


注:本文中的org.eclipse.swt.graphics.Image.isDisposed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。