org.eclipse.swt.graphics.GC.fillRectangle()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(192)

本文整理了Java中org.eclipse.swt.graphics.GC.fillRectangle()方法的一些代码示例,展示了GC.fillRectangle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GC.fillRectangle()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.GC
类名称:GC
方法名:fillRectangle

GC.fillRectangle介绍

[英]Fills the interior of the rectangle specified by the arguments, using the receiver's background color.
[中]

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public void fillRectangle( int x, int y, int width, int height ) {
 gc.fillRectangle( x, y, width, height );
}

代码示例来源:origin: pentaho/pentaho-kettle

public void fillRectangle( int x, int y, int width, int height ) {
 gc.fillRectangle( x, y, width, height );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
 public void paintControl( PaintEvent paintEvent ) {
  paintEvent.gc.setBackground( gui.getColorBackground() );
  paintEvent.gc.fillRectangle( 2, 0, control.getBounds().width - 8, control.getBounds().height - 20 );
 }
} );

代码示例来源:origin: caoxinyu/RedisClient

/**
 * @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;
}
/**

代码示例来源:origin: pentaho/pentaho-kettle

gc.fillRectangle( LEFT, TOP, area.x, area.y );
gc.fillRectangle( LEFT + MARGIN, 0, area.x, linepos + 1 );
gc.setBackground( bg );
gc.fillRectangle( 0, TOP, LEFT, area.y );

代码示例来源:origin: pentaho/pentaho-kettle

gc.fillRectangle( LEFT, TOP, area.x, area.y );
gc.fillRectangle( LEFT + MARGIN, 0, area.x, linepos + 1 );
gc.setBackground( bg );
gc.fillRectangle( 0, TOP, LEFT, area.y );

代码示例来源:origin: pentaho/pentaho-kettle

if ( nr == hover_operator ) {
 gc.setBackground( gray );
 gc.fillRectangle( Real2Screen( size_oper[nr] ) );
 gc.drawRectangle( Real2Screen( size_oper[nr] ) );
 gc.setBackground( bg );
gc.fillRectangle( Real2Screen( size_cond[nr] ) );
gc.drawRectangle( Real2Screen( size_cond[nr] ) );
gc.setBackground( bg );

代码示例来源:origin: pentaho/pentaho-kettle

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 );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

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 );
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

gc.setBackground( gray );
gc.fillRectangle( Real2Screen( size_left ) );
gc.drawRectangle( Real2Screen( size_left ) );
gc.setBackground( bg );
 gc.setBackground( gray );
gc.fillRectangle( Real2Screen( size_fn ) );
gc.drawRectangle( Real2Screen( size_fn ) );
gc.setBackground( bg );
 gc.setBackground( gray );
gc.fillRectangle( Real2Screen( size_rightval ) );
gc.drawRectangle( Real2Screen( size_rightval ) );
gc.setBackground( bg );
 gc.setBackground( gray );
gc.fillRectangle( Real2Screen( size_rightex ) );
gc.drawRectangle( Real2Screen( size_rightex ) );
gc.setBackground( bg );

代码示例来源:origin: pentaho/pentaho-kettle

gc.fillRectangle( 0, 0, width, height );

代码示例来源:origin: pentaho/pentaho-kettle

gc.fillRectangle( canvas.getClientArea() );
return;
gc.fillRectangle( canvas.getClientArea() );
gc.setBackgroundPattern( null );
return;

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

@Override
  public void drawAdornment(GC gc) {
    gc.fillRectangle(outerRect);
  }
}

代码示例来源:origin: org.jfree/swtgraphics2d

/**
 * Fill a rectangle area on the SWT graphic composite.
 * The {@code fillRectangle} method of the {@code GC}
 * class uses the background color so we must switch colors.
 * @see java.awt.Graphics#fillRect(int, int, int, int)
 */
@Override
public void fillRect(int x, int y, int width, int height) {
  this.switchColors();
  this.gc.fillRectangle(x, y, width, height);
  this.switchColors();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

@Override
public void draw(FigureDrawContext fdc) {
  Rectangle r = fdc.toClientRectangle(x1, y1, x2, y2);
  fdc.gc.setBackground(color);
  fdc.gc.fillRectangle(r.x, r.y, r.width, r.height);
}
@Override

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void paintControl(PaintEvent e) {
    assert e != null;
    Control c = (Control) e.widget;
    Point size = c.getSize();
    e.gc.setBackground(ColorCache.getColor(e.display, "#23a7df"));
    int breakX = size.x * waitProgress / 100;
    e.gc.fillRectangle(0, 0, breakX, size.y);
    e.gc.setBackground(ColorCache.getColor(e.display, "#cccccc"));
    e.gc.fillRectangle(breakX, 0, size.x - breakX, size.y);
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
  public void handleEvent (Event event) {
    if (currentOffset != -1) {
      StyledText text = (StyledText) getControl();
      Point position = text.getLocationAtOffset(currentOffset);
      int height = text.getLineHeight(currentOffset);
      event.gc.setBackground(event.display.getSystemColor (SWT.COLOR_BLACK));
      event.gc.fillRectangle(position.x, position.y, CARET_WIDTH, height);
    }
  }
};

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

public void setBackground (Color color) {
  super.setBackground(color);
  table.setBackground(color);
  if (sizeImage != null) {
    GC gc = new GC (sizeImage);
    gc.setBackground(getBackground());
    Rectangle size = sizeImage.getBounds();
    gc.fillRectangle(size);
    gc.dispose();
  }
}
public void setEnabled (boolean enabled) {

相关文章

GC类方法