public void paintControl( PaintEvent event ) { if ( image != null && !image.isDisposed() ) { event.gc.drawImage( image, 0, 0 ); } } } );
public synchronized void dispose() { if ( cache == null ) { return; } for ( Image img : cache.values() ) { if ( !img.isDisposed() ) { img.dispose(); } } cache = null; }
private void disposeImage( Image image ) { if ( image != null && !image.isDisposed() ) { image.dispose(); } }
@Override public synchronized void dispose() { super.dispose(); if ( !bitmap.isDisposed() ) { bitmap.dispose(); } }
public void paintControl( final PaintEvent event ) { if ( transGraph.trans != null && transGraph.trans.isFinished() ) { refreshImage( event.gc ); if ( image != null && !image.isDisposed() ) { event.gc.drawImage( image, 0, 0 ); } } else { Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return; } event.gc.setForeground( GUIResource.getInstance().getColorWhite() ); event.gc.setBackground( GUIResource.getInstance().getColorWhite() ); event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) ); event.gc.setForeground( GUIResource.getInstance().getColorBlack() ); String metricsMessage = BaseMessages.getString( PKG, "TransMetricsDelegate.TransformationIsNotRunning.Message" ); org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage ); event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 ); } } } );
public void paintControl( PaintEvent event ) { if ( jobGraph.job != null && ( jobGraph.job.isFinished() || jobGraph.job.isStopped() ) ) { refreshImage( event.gc ); if ( image != null && !image.isDisposed() ) { event.gc.drawImage( image, 0, 0 ); } } else { Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return; } event.gc.setForeground( GUIResource.getInstance().getColorWhite() ); event.gc.setBackground( GUIResource.getInstance().getColorWhite() ); event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) ); event.gc.setForeground( GUIResource.getInstance().getColorBlack() ); String metricsMessage = BaseMessages.getString( PKG, "JobMetricsDelegate.JobIsNotRunning.Message" ); org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage ); event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 ); } } } );
if ( ( (Image) object ).isDisposed() ) { return;
private void delete() { if (img != null && !img.isDisposed()) { img.dispose(); img = null; } }
@Override public void runSupport() { for ( Image img: to_dispose ){ if ( !img.isDisposed()){ img.dispose(); } } } });
@Override public void widgetDisposed(DisposeEvent e) { if (fImage != null && !fImage.isDisposed()) { fImage.dispose(); fImage= null; } } });
protected void dispose() { if ( buffer_image != null && ! buffer_image.isDisposed()){ buffer_image.dispose(); } COConfigurationManager.removeParameterListener("Graphics Update",this); } }
@Override public void runSupport() { Image img = ((TableCellSWT) cell).getGraphicSWT(); if (img != null && !img.isDisposed()) { img.dispose(); } } });
@Override public void dispose() { if (fImage != null && !fImage.isDisposed()) fImage.dispose(); fImage= null; super.dispose(); }
@Override public void dispose() { super.dispose(); if(bufferScale != null && ! bufferScale.isDisposed()) bufferScale.dispose(); if ( scale != null ) { scale.dispose(); } }
public void swt_updateCanvasImage(boolean immediateRedraw) { if (canvasImage != null && !canvasImage.isDisposed()) { swt_updateCanvasImage(canvasImage.getBounds(), immediateRedraw); } else { cTable.redraw(); } }
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(); } } }
/** * {@inheritDoc} */ public void dispose() { if (fPackageImage != null && !fPackageImage.isDisposed()) fPackageImage.dispose(); if (fLabelProvider != null) fLabelProvider.dispose(); super.dispose(); }
private void disposeExisting(TableCell cell) { Graphic oldGraphic = cell.getGraphic(); //log(cell, oldGraphic); if (oldGraphic instanceof UISWTGraphic) { Image oldImage = ((UISWTGraphic) oldGraphic).getImage(); if (oldImage != null && !oldImage.isDisposed()) { //log(cell, "dispose"); cell.setGraphic(null); oldImage.dispose(); } } }
@Override public void setImage (Image image) { checkWidget(); if (image != null && image.isDisposed ()) { error (SWT.ERROR_INVALID_ARGUMENT); } super.setImage (image); if (parent.sortColumn != this || parent.sortDirection != SWT.NONE) { setImage (image, false, false); } }
@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); }