本文整理了Java中java.awt.Canvas.setBounds()
方法的一些代码示例,展示了Canvas.setBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.setBounds()
方法的具体详情如下:
包路径:java.awt.Canvas
类名称:Canvas
方法名:setBounds
暂无
代码示例来源:origin: org.processing/core
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);
}
代码示例来源:origin: google/sagetv
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());
}
};
代码示例来源:origin: google/sagetv
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());
}
};
代码示例来源:origin: org.junit/com.springsource.junit
public void setBounds(int x, int y, int w, int h) {
super.setBounds(x, y, w, h);
fProgressX= scale(fProgress);
}
代码示例来源:origin: com.github.steveash.mallet/mallet
/**
* 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;
}
代码示例来源:origin: de.julielab/jcore-mallet-2.0.9
/**
* 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;
}
代码示例来源:origin: net.imagej/ij
public void setBounds(int x, int y, int width, int height) {
super.setBounds(x, y, width, height);
tp.adjustVScroll();
tp.adjustHScroll();
iImage = null;
}
代码示例来源:origin: de.julielab/jcore-mallet-0.4
/**
* 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;
}
代码示例来源:origin: cc.mallet/mallet
/**
* 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;
}
代码示例来源:origin: imagej/ImageJA
public void setBounds(int x, int y, int width, int height) {
super.setBounds(x, y, width, height);
tp.adjustVScroll();
tp.adjustHScroll();
iImage = null;
}
代码示例来源:origin: stackoverflow.com
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");
代码示例来源:origin: org.processing/core
canvas.setBounds((screenRect.width - sketchWidth) / 2,
(screenRect.height - sketchHeight) / 2,
sketchWidth, sketchHeight);
代码示例来源:origin: stackoverflow.com
canvas.setBounds(0,0,image.getImageData().width, image.getImageData().height);
canvas.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
代码示例来源:origin: stackoverflow.com
case1.setBounds(84, 111, 136, 64);
代码示例来源:origin: org.processing/core
canvas.setBounds((contentW - sketchWidth)/2,
(contentH - sketchHeight)/2,
sketchWidth, sketchHeight);
代码示例来源:origin: uk.co.caprica/vlcj
c.setBounds(0, 0, 1000, 900);
o1.setBounds(100, 60, 200, 300);
o2.setBounds(400, 200, 150, 150);
o3.setBounds(50, 500, 200, 200);
内容来源于网络,如有侵权,请联系作者删除!