canvas.setSize( bounds.width, bounds.height );
canvas.setSize( bounds.width, bounds.height );
public Canvas createCanvas(int width, int height) { Canvas canvas = new Canvas(this.shell, SWT.NONE); canvas.setSize(width, height); return canvas; }
void setHeaderImageHeight (int value) { headerImageHeight = value; Point headerSize = header.getSize (); int newHeaderHeight = Math.max (fontHeight, headerImageHeight) + 2 * getHeaderPadding (); if (headerSize.y != newHeaderHeight) { header.setSize (headerSize.x, newHeaderHeight); } } /**
public void setCanvasSize(int canvasWidth, int canvasHeight) { if(canvasWidth > width || this.canvasWidth <= 0) { this.canvasWidth = canvasWidth; } if(canvasHeight > height || this.canvasHeight <= 0) { this.canvasHeight = canvasHeight; } if(canvasHeight > 0 && canvasWidth > 0){ imageCanvas.setSize(this.canvasWidth, this.canvasHeight); scrollComposite.setMinSize(this.canvasWidth, this.canvasHeight); scrollComposite.layout(); } }
private void updateSize() { int width = ( getCount() * diameter ) + ( Math.max( 0, getCount() - 1 ) * spacing ); indicatorCanvas.setSize( width, diameter ); GridData gd = ( GridData )indicatorCanvas.getLayoutData(); gd.heightHint = diameter; gd.widthHint = width; }
end1.setSize(width, width); end2 = new Canvas (parent.getShell(), SWT.BORDER); end2.setSize(width, width); caretControl.setSize(trimRect.width-(2*hDelta), width); caretControl.setLocation(trimRect.x + hDelta, trimRect.y + trimRect.height + threshold); bb = caretControl.getBounds(); break; case SWT.BOTTOM: caretControl.setSize(trimRect.width-(2*hDelta), width); caretControl.setLocation(trimRect.x + hDelta, trimRect.y - threshold); bb = caretControl.getBounds(); break; case SWT.LEFT: caretControl.setSize(width, trimRect.height -(2*vDelta)); caretControl.setLocation(trimRect.x + trimRect.width + threshold, trimRect.y + vDelta); break; case SWT.RIGHT: caretControl.setSize(width, trimRect.height -(2*vDelta)); caretControl.setLocation(trimRect.x - threshold, trimRect.y + vDelta);
if (drawMode != DRAW_CENTER && drawMode != DRAW_HCENTER && drawMode != DRAW_STRETCH && drawMode != DRAW_SCALEDOWN_OR_CENTER) { canvas.setSize(imgBounds.width + hpadding, imgBounds.height); canvas.setData("oldSize", canvas.getSize());
: maxSize.x, maxSize.y); canvas.setLayoutData(layoutData); canvas.setSize(SWT.DEFAULT, maxSize.y); setControl(canvas);
barData.heightHint = 22; barCanvas.setLayoutData(barData); barCanvas.setSize(20, 20); barCanvas.addPaintListener(new PaintListener() { @Override
header.setSize (clientArea.width, headerHeight);
int newHeaderHeight = Math.max (fontHeight, headerImageHeight) + 2 * getHeaderPadding (); if (headerSize.y != newHeaderHeight) { header.setSize (headerSize.x, newHeaderHeight);
border.setSize(dragSize.x+2, dragSize.y+2);
pbWidth = width - OFFSET_LEFT - OFFSET_RIGHT; canvas.setSize(width, height); Font font = canvas.getFont(); FontData[] fdata = font.getFontData();