當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。