本文整理了Java中org.eclipse.swt.graphics.GC.drawRectangle()
方法的一些代码示例,展示了GC.drawRectangle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GC.drawRectangle()
方法的具体详情如下:
包路径:org.eclipse.swt.graphics.GC
类名称:GC
方法名:drawRectangle
[英]Draws the outline of the rectangle specified by the arguments, using the receiver's foreground color. The left and right edges of the rectangle are at x
and x + width
. The top and bottom edges are at y
and y + height
.
[中]使用接收器的前景色绘制由参数指定的矩形的轮廓。矩形的左边缘和右边缘分别位于x
和x + width
。顶部和底部边缘分别位于y
和y + height
。
代码示例来源:origin: pentaho/pentaho-kettle
public void drawRectangle( int x, int y, int width, int height ) {
gc.drawRectangle( x, y, width, height );
}
代码示例来源:origin: pentaho/pentaho-kettle
public void drawRectangle( int x, int y, int width, int height ) {
gc.drawRectangle( 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
/**
* Get the image for when all other fallbacks have failed. This is an image
* drawn on the canvas, a square with a red X.
*
* @param display the device to render the image to
* @return the missing image
*/
public static SwtUniversalImage getMissingImage( Display display ) {
Image img = new Image( display, ConstUI.ICON_SIZE, ConstUI.ICON_SIZE );
GC gc = new GC( img );
gc.setForeground( new Color( display, 0, 0, 0 ) );
gc.drawRectangle( 4, 4, ConstUI.ICON_SIZE - 8, ConstUI.ICON_SIZE - 8 );
gc.setForeground( new Color( display, 255, 0, 0 ) );
gc.drawLine( 4, 4, ConstUI.ICON_SIZE - 4, ConstUI.ICON_SIZE - 4 );
gc.drawLine( ConstUI.ICON_SIZE - 4, 4, 4, ConstUI.ICON_SIZE - 4 );
gc.dispose();
return new SwtUniversalImageBitmap( img );
}
代码示例来源:origin: pentaho/pentaho-kettle
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 );
代码示例来源: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
gc.drawRectangle( Real2Screen( size_left ) );
gc.setBackground( bg );
gc.drawRectangle( Real2Screen( size_fn ) );
gc.setBackground( bg );
gc.drawRectangle( Real2Screen( size_rightval ) );
gc.setBackground( bg );
gc.drawRectangle( Real2Screen( size_rightex ) );
gc.setBackground( bg );
代码示例来源:origin: de.dentrassi.eclipse.neoscada.chart/org.eclipse.scada.chart.swt
@Override
public void drawRectangle ( final int x, final int y, final int width, final int height )
{
this.gc.drawRectangle ( x, y, width, height );
}
代码示例来源:origin: de.dentrassi.eclipse.neoscada.chart/org.eclipse.scada.chart.swt
@Override
public void drawRectangle ( final Rectangle rect )
{
this.gc.drawRectangle ( rect );
}
代码示例来源:origin: org.eclipse.neoscada.chart/org.eclipse.scada.chart.swt
@Override
public void drawRectangle ( final int x, final int y, final int width, final int height )
{
this.gc.drawRectangle ( x, y, width, height );
}
代码示例来源:origin: org.eclipse.neoscada.chart/org.eclipse.scada.chart.swt
@Override
public void drawRectangle ( final Rectangle rect )
{
this.gc.drawRectangle ( rect );
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.navigator
public void handleEvent(Event e) {
Point textSize = textEditor.getSize();
Point parentSize = textEditorParent.getSize();
e.gc.drawRectangle(0, 0, Math.min(textSize.x + 4, parentSize.x - 1), parentSize.y - 1);
}
});
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
public void handleEvent(Event e) {
Point textSize = textEditor.getSize();
Point parentSize = textEditorParent.getSize();
e.gc.drawRectangle(0, 0, Math.min(textSize.x + 4,
parentSize.x - 1), parentSize.y - 1);
}
});
代码示例来源:origin: stefanhaustein/flowgrid
public void drawBuffer(GC gc, int x, int y) {
gc.setBackground(resourceManager.background);
gc.setForeground(resourceManager.foreground);
int radius = Math.round(cellSize / 6);
gc.fillRectangle(x - radius, y - radius, 2 * radius, 2 * radius);
gc.drawRectangle(x - radius, y - radius, 2 * radius, 2 * radius);
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event e) {
Rectangle clientArea = ((Canvas) e.widget).getClientArea();
e.gc.setForeground(Colors.getSystemColor(e.display, SWT.COLOR_WIDGET_NORMAL_SHADOW));
e.gc.drawRectangle(clientArea);
clientArea.y++;
e.gc.setForeground(Colors.getSystemColor(e.display, SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
e.gc.drawRectangle(clientArea);
}
});
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event e) {
Rectangle clientArea = ((Canvas) e.widget).getClientArea();
e.gc.setForeground(Colors.getSystemColor(e.display, SWT.COLOR_WIDGET_NORMAL_SHADOW));
e.gc.drawRectangle(clientArea);
clientArea.y++;
e.gc.setForeground(Colors.getSystemColor(e.display, SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
e.gc.drawRectangle(clientArea);
}
});
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void paintControl(PaintEvent e) {
GC gc = e.gc;
gc.setForeground( Colors.grey);
Point size = engine_comp.getSize();
gc.drawRectangle( new Rectangle( 0, 0, size.x-1, size.y-1 ));
}
});
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void
paintControl(PaintEvent e)
{
Rectangle client_area = tracker_webseed_comp.getClientArea();
Rectangle rect = new Rectangle(0,0, client_area.width-1, client_area.height-1);
e.gc.setAlpha(50);
e.gc.drawRectangle(rect);
}
});
代码示例来源:origin: org.xworker/xworker_swt
@ActionParams(names="canvas,gc,shape")
public static void draw(Canvas canvas, GC gc, SimpleShape shape, ActionContext actionContext) {
if(shape.getThing().getBoolean("fill")) {
gc.fillRectangle(0, 0, shape.getWidth(), shape.getHeight());
}else {
gc.drawRectangle(0, 0, shape.getWidth(), shape.getHeight());
}
}
}
代码示例来源:origin: openaudible/openaudible
public static void debugLayout(final Composite c, final int color) {
c.addPaintListener(e -> {
Color save = e.gc.getForeground();
e.gc.setForeground(Display.getCurrent().getSystemColor(color));
e.gc.drawRectangle(1, 1, c.getBounds().width - 1, c.getBounds().width - 1);
// e.gc.drawLine(1, 1, c.getBounds().width - 1, c.getBounds().height - 1);
e.gc.setForeground(save);
});
}
内容来源于网络,如有侵权,请联系作者删除!