public void drawText( String text, int x, int y ) { gc.drawText( text, x, y ); }
public void drawText( String text, int x, int y, boolean transparent ) { gc.drawText( text, x, y, SWT.DRAW_DELIMITER | SWT.DRAW_TAB | SWT.DRAW_TRANSPARENT ); }
public void drawText( String text, int x, int y ) { gc.drawText( text, x, y ); }
public void drawText( String text, int x, int y, boolean transparent ) { gc.drawText( text, x, y, SWT.DRAW_DELIMITER | SWT.DRAW_TAB | SWT.DRAW_TRANSPARENT ); }
public void drawMessage( GC gc ) { gc.setForeground( blue ); gc.drawText( getMessageString(), size_up.x + size_up.width + offsetx + 40, size_up.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); // widget.setToolTipText(getMessageString()); }
private void repaint( GC gc, int width, int height ) { ImageData imd = image.getImageData(); double sizeOnPaperX = imd.width * factorx; double sizeOnPaperY = imd.height * factory; double actualSizeX = sizeOnPaperX * scale / 100; double actualSizeY = sizeOnPaperY * scale / 100; // What % of the screen is filled? // The canvas is nrcols * nrrows nr of pages large. double percentScreenX = actualSizeX / ( page.x * nrcols ); double percentScreenY = actualSizeY / ( page.y * nrrows ); gc.drawImage( image, 0, 0, imd.width, imd.height, 0, 0, (int) ( width * percentScreenX ), (int) ( height * percentScreenY ) ); StringBuilder text = new StringBuilder(); text.append( nrcols ).append( "x" ).append( nrrows ).append( " @ " ).append( scale ).append( "%" ); gc.drawText( text.toString(), 0, 0 ); for ( int c = 1; c < nrcols; c++ ) { gc.drawLine( c * ( width / nrcols ), 0, c * ( width / nrcols ), height ); } for ( int r = 1; r < nrrows; r++ ) { gc.drawLine( 0, r * ( height / nrrows ), width, r * ( height / nrrows ) ); } }
public void drawUp( GC gc ) { if ( hover_up ) { gc.setBackground( gray ); gc.fillRectangle( size_up ); } gc.drawRectangle( size_up ); gc.drawText( STRING_UP, size_up.x + 1 + offsetx, size_up.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); }
private void drawNegated( GC gc, int x, int y, Condition condition ) { Color color = gc.getForeground(); if ( hover_not ) { gc.setBackground( gray ); } gc.fillRectangle( Real2Screen( size_not ) ); gc.drawRectangle( Real2Screen( size_not ) ); if ( condition.isNegated() ) { if ( hover_not ) { gc.setForeground( green ); } gc.drawText( STRING_NOT, size_not.x + 5 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT ); gc.drawText( STRING_NOT, size_not.x + 6 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT ); if ( hover_not ) { gc.setForeground( color ); } } else { if ( hover_not ) { gc.setForeground( red ); gc.drawText( STRING_NOT, size_not.x + 5 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT ); gc.drawText( STRING_NOT, size_not.x + 6 + offsetx, size_not.y + 2 + offsety, SWT.DRAW_TRANSPARENT ); gc.setForeground( color ); } } if ( hover_not ) { gc.setBackground( bg ); } }
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 ); } } );
private void drawVersionWarning( GC gc, Display display ) { gc.setBackground( versionWarningBackgroundColor ); gc.setForeground( new Color( display, 65, 65, 65 ) ); // gc.fillRectangle(290, 231, 367, 49); // gc.drawRectangle(290, 231, 367, 49); gc.drawImage( exclamation_image, 304, 243 ); gc.setFont( devWarningFont ); gc.drawText( BaseMessages.getString( PKG, "SplashDialog.DevelopmentWarning" ), 335, 241, true ); }
gc.drawText( left, size_left.x + 1 + offsetx, size_left.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); } else { gc.setForeground( gray ); gc.drawText( "<field>", size_left.x + 1 + offsetx, size_left.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); gc.setForeground( black ); gc.drawText( fn, size_fn.x + 1 + offsetx, size_fn.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); gc.drawText( rightval, size_rightval.x + 1 + offsetx, size_rightval.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); } else { String nothing = rightex == null ? "<field>" : ""; gc.setForeground( gray ); gc.drawText( nothing, size_rightval.x + 1 + offsetx, size_rightval.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); if ( condition.getRightValuename() == null ) { gc.setForeground( black ); gc.drawText( re, size_rightex.x + 1 + offsetx, size_rightex.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); } else { String nothing = condition.getRightValuename() == null ? "<value>" : ""; gc.setForeground( gray ); gc.drawText( nothing, size_rightex.x + 1 + offsetx, size_rightex.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); gc.setForeground( black ); gc.drawText( stype, size_rightex.x + 1 + size_rightex.width + 10 + offsetx, size_rightex.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); } else { gc.drawText( "-", size_rightval.x + 1 + offsetx, size_rightval.y + 1 + offsety, SWT.DRAW_TRANSPARENT ); gc.drawText( "-", size_rightex.x + 1 + offsetx, size_rightex.y + 1 + offsety, SWT.DRAW_TRANSPARENT );
String str = rows.get( i ); for ( int p = fromx; p < str.length() && p < tox; p++ ) { gc.drawText( "" + str.charAt( p ), LEFT + MARGIN + p * fontwidth + offset.x, TOP + i * ( fontheight + 2 ) + offset.y, true ); gc.drawText( "" + i, LEFT + MARGIN + i * fontwidth - numsize / 2 + offset.x, linepos - 10 - fontheight, true ); String number = "" + ( i + 1 ); int numsize = number.length() * fontwidth; gc.drawText( number, LEFT - 5 - numsize, TOP + i * ( fontheight + 2 ) + offset.y, true ); gc.drawLine( LEFT, TOP + ( i + 1 ) * ( fontheight + 2 ) + offset.y, LEFT - 5, TOP + ( i + 1 ) * ( fontheight + 2 ) + offset.y );
String str = rows.get( i ); for ( int p = fromx; p < str.length() && p < tox; p++ ) { gc.drawText( "" + str.charAt( p ), LEFT + MARGIN + p * fontwidth + offset.x, TOP + i * ( fontheight + 2 ) + offset.y, true ); gc.drawText( "" + i, LEFT + MARGIN + i * fontwidth - numsize / 2 + offset.x, linepos - 10 - fontheight, true ); String number = "" + ( i + 1 ); int numsize = number.length() * fontwidth; gc.drawText( number, LEFT - 5 - numsize, TOP + i * ( fontheight + 2 ) + offset.y, true ); gc.drawLine( LEFT, TOP + ( i + 1 ) * ( fontheight + 2 ) + offset.y, LEFT - 5, TOP + ( i + 1 ) * ( fontheight + 2 ) + offset.y );
gc.setBackground( bg ); gc.drawText( operator, size_oper[nr].x + 2 + offsetx, size_oper[nr].y + 2 + offsety, SWT.DRAW_TRANSPARENT ); gc.setBackground( bg ); gc.drawText( str, size_cond[nr].x + 2 + offsetx, size_cond[nr].y + 5 + offsety, SWT.DRAW_DELIMITER | SWT.DRAW_TRANSPARENT | SWT.DRAW_TAB | SWT.DRAW_MNEMONIC );
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 ); } } } );
public void drawString(OutputDevice outputDevice, String string, float x, float y) { GC gc = ((SWTOutputDevice) outputDevice).getGC(); FontMetrics metrics = gc.getFontMetrics(); y -= (metrics.getAscent() + metrics.getLeading()); gc.drawText(string, (int) x, (int) y, SWT.DRAW_TRANSPARENT); }