本文整理了Java中java.awt.FlowLayout.getVgap()
方法的一些代码示例,展示了FlowLayout.getVgap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FlowLayout.getVgap()
方法的具体详情如下:
包路径:java.awt.FlowLayout
类名称:FlowLayout
方法名:getVgap
[英]Gets the vertical gap between components.
[中]获取组件之间的垂直间距。
代码示例来源:origin: stackoverflow.com
synchronized (target.getTreeLock()) {
int hgap = getHgap();
int vgap = getVgap();
int w = target.getWidth();
代码示例来源:origin: RPTools/maptool
@Override
public Dimension getPreferredSize() {
Dimension size = getParent().getSize();
FlowLayout layout = (FlowLayout) getLayout();
Insets insets = getInsets();
// This isn't exact, but hopefully it's close enough
int panelWidth = size.width - insets.left - insets.right;
int panelHeight = size.height - insets.top - insets.bottom;
int height = insets.top + insets.bottom + layout.getVgap();
for (Component c : getComponents()) {
Dimension cSize = c.getPreferredSize();
height += cSize.height + layout.getVgap();
}
height = Math.max(height, panelHeight); // fill the panel if it wouldn't already
Dimension prefSize = new Dimension(panelWidth, height);
return prefSize;
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = VGAP_JSDOC)
public int getVgap() {
return ((FlowLayout) super.getLayout()).getVgap();
}
代码示例来源:origin: uk.org.ponder.rsf/rsf-core-ponderutilcore
public LayoutManager getLayout() {
LayoutManager togo = null;
if (exemplar instanceof FlowLayout) {
FlowLayout exflow = (FlowLayout)exemplar;
togo = new FlowLayout(exflow.getAlignment(), exflow.getHgap(),
exflow.getVgap());
}
else {
throw new AssertionException("Unrecognised layout manager " + exemplar);
}
return togo;
}
public int getHeight() {
代码示例来源:origin: stackoverflow.com
synchronized (target.getTreeLock()) {
int hgap = getHgap();
int vgap = getVgap();
int w = target.getWidth();
代码示例来源:origin: RPTools/maptool
@Override
public Dimension getPreferredSize() {
Dimension size = getParent().getSize();
FlowLayout layout = (FlowLayout) getLayout();
Insets insets = getInsets();
// This isn't exact, but hopefully it's close enough
int x = layout.getHgap() + insets.left;
int y = layout.getVgap();
int rowHeight = 0;
for (Component c : getComponents()) {
Dimension cSize = c.getPreferredSize();
if (x + cSize.width + layout.getHgap() > size.width - insets.right && x > 0) {
x = 0;
y += rowHeight + layout.getVgap();
rowHeight = 0;
}
x += cSize.width + layout.getHgap();
rowHeight = Math.max(cSize.height, rowHeight);
}
y += rowHeight + layout.getVgap();
y += getInsets().top;
y += getInsets().bottom;
Dimension prefSize = new Dimension(size.width, y);
return prefSize;
}
代码示例来源:origin: RPTools/maptool
@Override
public Dimension getPreferredSize() {
FlowLayout layout = (FlowLayout) getLayout();
Insets insets = getInsets();
// This isn't exact, but hopefully it's close enough
int availableWidth = getPanel().getAvailableWidth() - insets.left - insets.right;
int height = insets.top + insets.bottom + layout.getVgap();
int rowHeight = 0;
int rowWidth = insets.left + layout.getHgap() + insets.right;
for (Component c : getComponents()) {
Dimension cSize = c.getPreferredSize();
if (rowWidth + cSize.width + layout.getHgap() - 5 > availableWidth && rowWidth > 0) {
height += rowHeight + layout.getVgap();
rowHeight = 0;
rowWidth = insets.left + layout.getHgap() + insets.right;
}
rowWidth += cSize.width + layout.getHgap();
rowHeight = Math.max(cSize.height, rowHeight);
}
height += rowHeight;
Dimension prefSize = new Dimension(availableWidth, height);
return prefSize;
}
代码示例来源:origin: RPTools/maptool
private int getPreferredHeight() {
int rv = 0;
for (int k = 0, count = getComponentCount(); k < count; k++) {
Component comp = getComponent(k);
Rectangle r = comp.getBounds();
int height = r.y + r.height;
if (height > rv)
rv = height;
}
rv += ((FlowLayout) getLayout()).getVgap();
return rv;
}
}
代码示例来源:origin: stackoverflow.com
int lineStart = getVgap();
int lineHeight = lineStart + c.getSize().height;
lineStart = lineHeight + getVgap();
p.y = lineStart;
lineHeight = lineStart + d.height;
代码示例来源:origin: RPTools/maptool
@Override
public Dimension getPreferredSize() {
FlowLayout layout = (FlowLayout) getLayout();
Insets insets = getInsets();
// This isn't exact, but hopefully it's close enough
int availableWidth = getPanel().getAvailableWidth() - insets.left - insets.right - 10;
int height = insets.top + insets.bottom + layout.getVgap();
int rowHeight = 0;
int rowWidth = insets.left + layout.getHgap() + insets.right;
for (Component c : getComponents()) {
Dimension cSize = c.getPreferredSize();
if (rowWidth + cSize.width + layout.getHgap() - 5 > availableWidth && rowWidth > 0) {
height += rowHeight + layout.getVgap();
rowHeight = 0;
rowWidth = insets.left + layout.getHgap() + insets.right;
}
rowWidth += cSize.width + layout.getHgap();
rowHeight = Math.max(cSize.height, rowHeight);
}
height += rowHeight;
Dimension prefSize = new Dimension(availableWidth, height);
return prefSize;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-vmd-game
private int getPreferredHeight() {
int rv = 0;
for (int k = 0, count = getComponentCount(); k < count; k++) {
Component comp = getComponent(k);
Rectangle r = comp.getBounds();
int height = r.y + r.height;
if (height > rv) {
rv = height;
}
}
rv += ((FlowLayout) getLayout()).getVgap();
return rv;
}
}
代码示例来源:origin: stackoverflow.com
private final FlowLayout layout = new FlowLayout();
private final int hGap = layout.getHgap();
private final int vGap = layout.getVgap();
private final Dimension size;
代码示例来源:origin: stackoverflow.com
int vgap = getVgap();
Insets insets = target.getInsets();
int horizontalInsetsAndGap = insets.left + insets.right + (hgap * 2);
dim.height += getVgap();
代码示例来源:origin: stackoverflow.com
int vgap = getVgap();
Insets insets = target.getInsets();
int horizontalInsetsAndGap = insets.left + insets.right + (hgap * 2);
dim.height += getVgap();
代码示例来源:origin: stackoverflow.com
int vgap = getVgap();
Insets insets = target.getInsets();
int horizontalInsetsAndGap = insets.left + insets.right + (hgap * 2);
dim.height += getVgap();
代码示例来源:origin: stackoverflow.com
int vgap = getVgap();
Insets insets = target.getInsets();
int horizontalInsetsAndGap = insets.left + insets.right + hgap * 2;
dim.height += getVgap();
代码示例来源:origin: stackoverflow.com
int vgap = getVgap();
Insets insets = target.getInsets();
int horizontalInsetsAndGap = insets.left + insets.right + hgap * 2;
dim.height += getVgap();
内容来源于网络,如有侵权,请联系作者删除!