private void setCanvasSize() { // System.out.format("setting canvas size %d %d%n", sketchWidth, sketchHeight); // new Exception().printStackTrace(System.out); int contentW = Math.max(sketchWidth, MIN_WINDOW_WIDTH); int contentH = Math.max(sketchHeight, MIN_WINDOW_HEIGHT); canvas.setBounds((contentW - sketchWidth)/2, (contentH - sketchHeight)/2, sketchWidth, sketchHeight); }
public void layoutContainer(java.awt.Container parent) { c.setBounds(parent.getInsets().left, parent.getInsets().top, parent.getWidth() - parent.getInsets().left - parent.getInsets().right, parent.getHeight() - parent.getInsets().top - parent.getInsets().bottom); //System.out.println("LAYOUT frame bounds=" + f.getBounds() + " videoBounds=" + videoBounds + " parentBounds=" + parent.getBounds()); } };
public void layoutContainer(java.awt.Container parent) { c.setBounds(parent.getInsets().left, parent.getInsets().top, parent.getWidth() - parent.getInsets().left - parent.getInsets().right, parent.getHeight() - parent.getInsets().top - parent.getInsets().bottom); // videoCanvas.setBounds(parent.getInsets().left, parent.getInsets().top, // parent.getWidth() - parent.getInsets().left - parent.getInsets().right, // parent.getHeight() - parent.getInsets().top - parent.getInsets().bottom);//vf.setBounds(x, y, w, h); //System.out.println("LAYOUT frame bounds=" + f.getBounds() + " videoBounds=" + videoBounds + " parentBounds=" + parent.getBounds()); } };
public void setBounds(int x, int y, int w, int h) { super.setBounds(x, y, w, h); fProgressX= scale(fProgress); }
/** * Set bounds of canvas */ public void setBounds(int x, int y, int width, int height) { super.setBounds(x, y, width, height); fm = getFontMetrics(getFont()); titleHeight = fm.getHeight(); yLabelWidth = fm.stringWidth(yLabel); xLabelHeight = fm.getHeight(); labelWidth = Math.max(fm.stringWidth(new Integer(min).toString()), fm.stringWidth(new Integer(max).toString())) + 2; top = padding + titleHeight; bottom = getSize().height - padding - xLabelHeight - fm.getHeight(); left = padding + yLabelWidth; right = getSize().width - padding; }
/** * Set bounds of canvas */ public void setBounds(int x, int y, int width, int height) { super.setBounds(x, y, width, height); fm = getFontMetrics(getFont()); titleHeight = fm.getHeight(); yLabelWidth = fm.stringWidth(yLabel); xLabelHeight = fm.getHeight(); labelWidth = Math.max(fm.stringWidth(new Integer(min).toString()), fm.stringWidth(new Integer(max).toString())) + 2; top = padding + titleHeight; bottom = getSize().height - padding - xLabelHeight - fm.getHeight(); left = padding + yLabelWidth; right = getSize().width - padding; }
public void setBounds(int x, int y, int width, int height) { super.setBounds(x, y, width, height); tp.adjustVScroll(); tp.adjustHScroll(); iImage = null; }
/** * Set bounds of canvas */ public void setBounds(int x, int y, int width, int height) { super.setBounds(x, y, width, height); fm = getFontMetrics(getFont()); titleHeight = fm.getHeight(); yLabelWidth = fm.stringWidth(yLabel); xLabelHeight = fm.getHeight(); labelWidth = Math.max(fm.stringWidth(new Integer(min).toString()), fm.stringWidth(new Integer(max).toString())) + 2; top = padding + titleHeight; bottom = getSize().height - padding - xLabelHeight - fm.getHeight(); left = padding + yLabelWidth; right = getSize().width - padding; }
/** * Set bounds of canvas */ public void setBounds(int x, int y, int width, int height) { super.setBounds(x, y, width, height); fm = getFontMetrics(getFont()); titleHeight = fm.getHeight(); yLabelWidth = fm.stringWidth(yLabel); xLabelHeight = fm.getHeight(); labelWidth = Math.max(fm.stringWidth(new Integer(min).toString()), fm.stringWidth(new Integer(max).toString())) + 2; top = padding + titleHeight; bottom = getSize().height - padding - xLabelHeight - fm.getHeight(); left = padding + yLabelWidth; right = getSize().width - padding; }
public void setBounds(int x, int y, int width, int height) { super.setBounds(x, y, width, height); tp.adjustVScroll(); tp.adjustHScroll(); iImage = null; }
Region region = new Region(); region.add(new int[] {3, 3, 20, 20, 3, 20}); Canvas c = new Canvas(this, SWT.NONE); c.setBounds(35, 35, 60, 60); c.setRegion(region); Menu menu = new Menu(this); c.setMenu(menu); MenuItem mntmProperties = new MenuItem(menu, SWT.NONE); mntmProperties.setText("Properties"); MenuItem mntmDelete = new MenuItem(menu, SWT.NONE); mntmDelete.setText("Delete");
canvas.setBounds((screenRect.width - sketchWidth) / 2, (screenRect.height - sketchHeight) / 2, sketchWidth, sketchHeight);
canvas.setBounds(0,0,image.getImageData().width, image.getImageData().height); canvas.addPaintListener(new PaintListener() { public void paintControl(PaintEvent e) {
case1.setBounds(84, 111, 136, 64);
canvas.setBounds((contentW - sketchWidth)/2, (contentH - sketchHeight)/2, sketchWidth, sketchHeight);