public void drawRectangle( int x, int y, int width, int height ) { gc.drawRectangle( x, y, width, height ); }
public void drawRectangle( int x, int y, int width, int height ) { gc.drawRectangle( x, y, width, height ); }
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 ); }
/** * 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 ); }
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 );
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 ); } }
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 );
@Override public void drawRectangle ( final int x, final int y, final int width, final int height ) { this.gc.drawRectangle ( x, y, width, height ); }
@Override public void drawRectangle ( final Rectangle rect ) { this.gc.drawRectangle ( rect ); }
@Override public void drawRectangle ( final int x, final int y, final int width, final int height ) { this.gc.drawRectangle ( x, y, width, height ); }
@Override public void drawRectangle ( final Rectangle rect ) { this.gc.drawRectangle ( rect ); }
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); } });
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); } });
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); }
@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); } });
@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); } });
@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 )); } });
@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); } });
@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()); } } }
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); }); }