public void paintControl( PaintEvent pe ) { pe.gc.setFont( fixedFont ); Rectangle max = wFFont.getBounds(); String name = fixedFontData.getName() + " - " + fixedFontData.getHeight(); Point size = pe.gc.textExtent( name ); pe.gc.drawText( name, ( max.width - size.x ) / 2, ( max.height - size.y ) / 2, true ); } } );
public void paintControl( PaintEvent pe ) { pe.gc.setFont( graphFont ); Rectangle max = wGFont.getBounds(); String name = graphFontData.getName() + " - " + graphFontData.getHeight(); Point size = pe.gc.textExtent( name ); pe.gc.drawText( name, ( max.width - size.x ) / 2, ( max.height - size.y ) / 2, true ); } } );
public void paintControl( PaintEvent pe ) { pe.gc.setFont( noteFont ); Rectangle max = wNFont.getBounds(); String name = noteFontData.getName() + " - " + noteFontData.getHeight(); Point size = pe.gc.textExtent( name ); pe.gc.drawText( name, ( max.width - size.x ) / 2, ( max.height - size.y ) / 2, true ); } } );
Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return;
private void updateCanvas() { Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return;
private void updateCanvas() { Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return;
Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return;
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 ); } } } );
/** * @return The bounds of the border's control. */ public Rectangle getBounds() { return border.getBounds(); } }
@Override public void getLocation(AccessibleControlEvent e) { Rectangle rect = parent.header.getBounds(); rect.x = getX(); Point pt = parent.toDisplay(rect.x, rect.y); e.x = pt.x; e.y = pt.y; e.width = width; e.height = rect.height; } @Override
protected void computeInformation() { if (fSelection != null) { Rectangle subjectArea= fSelection.canvas.getBounds(); Annotation annotation= fSelection.fAnnotation; String msg; if (annotation != null) msg= annotation.getText(); else msg= null; setInformation(msg, subjectArea); } }
@Override protected void computeInformation() { if (fSelection != null) { Rectangle subjectArea= fSelection.canvas.getBounds(); Annotation annotation= fSelection.fAnnotation; String msg; if (annotation != null) msg= annotation.getText(); else msg= null; setInformation(msg, subjectArea); } }
@Override protected void computeInformation() { if (fSelection != null) { Rectangle subjectArea= fSelection.canvas.getBounds(); Annotation annotation= fSelection.fAnnotation; String msg; if (annotation != null) msg= annotation.getText(); else msg= null; setInformation(msg, subjectArea); } }
@Override public void paint(GC gc, int width, int height) { Device device = gc.getDevice(); Image image = GraphicsExample.loadImage(device, GraphicsExample.class, "houses.png"); Rectangle bounds = image.getBounds(); Rectangle canvasBounds = example.canvas.getBounds(); gc.drawImage(image, 0, 0, bounds.width, bounds.height, 0, 0, canvasBounds.width, canvasBounds.height); image.dispose(); } }
GC gc = ev.gc; Rectangle bounds = cell.getBounds();
Rectangle headerBounds= fHeader.getBounds(); boolean isOnTop= headerBounds.y + headerBounds.height <= fCanvas.getLocation().y; boolean isTall= s.y > s.x + 2*ANNOTATION_HEIGHT;
Rectangle bb = border.getBounds(); Rectangle cr = clientControl.getClientArea(); Geometry.moveInside(bb,cr);
gc.setAntialias(SWT.ON); Rectangle bounds = share_area.getBounds();
public void refresh(List<VivaldiPosition> vivaldiPositions) { if(canvas.isDisposed()) return; Rectangle size = canvas.getBounds();