本文整理汇总了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 );
}
}
}
示例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);
}
}
示例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);
}
示例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();
}
}
}
示例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();
}
}
}
示例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));
}
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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 + "]" );
}