public void setBackground( int r, int g, int b ) { Color color = getColor( r, g, b ); gc.setBackground( color ); }
return; gc.setBackground( (Color) object ); gc.fillRectangle( canvas.getClientArea() ); return;
public void setBackground( int r, int g, int b ) { Color color = getColor( r, g, b ); gc.setBackground( color ); }
public void setBackground( EColor color ) { gc.setBackground( getColor( color ) ); }
public void setBackground( EColor color ) { gc.setBackground( getColor( color ) ); }
gc.setBackground( fore ); gc.fillPolygon( new int[] { mx, my, x3, y3, x4, y4 } ); gc.setBackground( back );
public void switchForegroundBackgroundColors() { Color fg = gc.getForeground(); Color bg = gc.getBackground(); gc.setForeground( bg ); gc.setBackground( fg ); }
public void switchForegroundBackgroundColors() { Color fg = gc.getForeground(); Color bg = gc.getBackground(); gc.setForeground( bg ); gc.setBackground( fg ); }
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 ); }
@Override public void paintControl( PaintEvent paintEvent ) { paintEvent.gc.setBackground( gui.getColorBackground() ); paintEvent.gc.fillRectangle( 2, 0, control.getBounds().width - 8, control.getBounds().height - 20 ); } } );
public void drawPentahoGradient( Display display, GC gc, Rectangle rect, boolean vertical ) { if ( !vertical ) { gc.setForeground( display.getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); gc.setBackground( GUIResource.getInstance().getColorPentaho() ); gc.fillGradientRectangle( rect.x, rect.y, 2 * rect.width / 3, rect.height, vertical ); gc.setForeground( GUIResource.getInstance().getColorPentaho() ); gc.setBackground( display.getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); gc.fillGradientRectangle( rect.x + 2 * rect.width / 3, rect.y, rect.width / 3 + 1, rect.height, vertical ); } else { gc.setForeground( display.getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); gc.setBackground( GUIResource.getInstance().getColorPentaho() ); gc.fillGradientRectangle( rect.x, rect.y, rect.width, 2 * rect.height / 3, vertical ); gc.setForeground( GUIResource.getInstance().getColorPentaho() ); gc.setBackground( display.getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ) ); gc.fillGradientRectangle( rect.x, rect.y + 2 * rect.height / 3, rect.width, rect.height / 3 + 1, vertical ); } }
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.setBackground( gray ); gc.fillRectangle( Real2Screen( size_oper[nr] ) ); gc.drawRectangle( Real2Screen( size_oper[nr] ) ); gc.setBackground( bg ); gc.setBackground( gray ); gc.fillRectangle( Real2Screen( size_cond[nr] ) ); gc.drawRectangle( Real2Screen( size_cond[nr] ) ); gc.setBackground( bg );
/** * @return the small {@link Image} that can be used as placeholder for missing image. */ private static Image getMissingImage() { Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); // GC gc = new GC(image); gc.setBackground(getColor(SWT.COLOR_RED)); gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); gc.dispose(); // return image; } /**
gc.setBackground( bg ); gc.fillRectangle( LEFT, TOP, area.x, area.y ); gc.setBackground( red ); int x_oval = LEFT + MARGIN + str.length() * fontwidth + offset.x; int y_oval = TOP + i * ( fontheight + 2 ) + offset.y; gc.fillOval( x_oval, y_oval, fontwidth, fontheight ); gc.setForeground( black ); gc.setBackground( bg ); gc.setBackground( lgray ); gc.fillRectangle( LEFT + MARGIN, 0, area.x, linepos + 1 ); gc.setBackground( bg ); gc.setBackground( lgray ); gc.fillRectangle( 0, TOP, LEFT, area.y ); gc.setBackground( red ); int position = 0; for ( FixedFileInputField field : fields ) { gc.setBackground( blue ); drawMarker( gc, potential_click, area.y );
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 e ) { Point area = getArea(); if ( area.x == 0 || area.y == 0 ) { return; // nothing to do! } Display disp = shell.getDisplay(); Image img = getJobImage( disp, area.x, area.y, magnification ); e.gc.drawImage( img, 0, 0 ); if ( jobMeta.nrJobEntries() == 0 ) { e.gc.setForeground( GUIResource.getInstance().getColorCrystalTextPentaho() ); e.gc.setBackground( GUIResource.getInstance().getColorBackground() ); e.gc.setFont( GUIResource.getInstance().getFontMedium() ); Image pentahoImage = GUIResource.getInstance().getImageJobCanvas(); int leftPosition = ( area.x - pentahoImage.getBounds().width ) / 2; int topPosition = ( area.y - pentahoImage.getBounds().height ) / 2; e.gc.drawImage( pentahoImage, leftPosition, topPosition ); } img.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 ); } } } );
gc.setBackground( white ); gc.setForeground( black ); gc.fillRectangle( 0, 0, width, height );