本文整理汇总了Java中javax.swing.Box.Filler方法的典型用法代码示例。如果您正苦于以下问题:Java Box.Filler方法的具体用法?Java Box.Filler怎么用?Java Box.Filler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.Box
的用法示例。
在下文中一共展示了Box.Filler方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: minimumLayoutSize
import javax.swing.Box; //导入方法依赖的package包/类
public Dimension minimumLayoutSize(final Container parent) {
final Insets insets = parent.getInsets();
final Dimension d = new Dimension(insets.left + insets.right,
insets.top + insets.bottom);
int maxWidth = 0;
int visibleCount = 0;
for (Component comp : parent.getComponents()) {
if (comp.isVisible() && !(comp instanceof Box.Filler)) {
final Dimension size = comp.getPreferredSize();
maxWidth = Math.max(maxWidth, size.width);
d.height += size.height;
visibleCount++;
}
}
d.height += (visibleCount - 1) * vGap;
d.width += maxWidth;
return d;
}
示例2: addFiller
import javax.swing.Box; //导入方法依赖的package包/类
public void addFiller() {
Dimension minDim = new Dimension(0, 0);
Dimension maxDim = new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
final boolean customFiller = customFiller();
Box.Filler filler = new Box.Filler(minDim, minDim, maxDim) {
public Dimension getPreferredSize() {
if (customFiller) {
int currentWidth = TransparentToolBar.this.getSize().width;
int minimumWidth = TransparentToolBar.this.getMinimumSize().width;
int extraWidth = currentWidth - minimumWidth;
return new Dimension(Math.max(extraWidth, 0), 0);
} else {
return super.getPreferredSize();
}
}
protected void paintComponent(Graphics g) {}
};
addItem(filler);
}
示例3: minimumLayoutSize
import javax.swing.Box; //导入方法依赖的package包/类
public Dimension minimumLayoutSize(final Container parent) {
final Insets insets = parent.getInsets();
final Dimension d = new Dimension(insets.left + insets.right,
insets.top + insets.bottom);
int maxHeight = 0;
int visibleCount = 0;
for (Component comp : parent.getComponents()) {
if (comp.isVisible() && !(comp instanceof Box.Filler)) {
final Dimension size = comp.getPreferredSize();
maxHeight = Math.max(maxHeight, size.height);
d.width += size.width;
visibleCount++;
}
}
d.width += (visibleCount - 1) * hGap;
d.height += maxHeight;
return d;
}
示例4: correctInstance
import javax.swing.Box; //导入方法依赖的package包/类
protected boolean correctInstance (Object obj) {
if (obj instanceof javax.swing.Action) {
return true;
}
if (obj instanceof org.openide.util.actions.Presenter.Menu) {
return true;
}
if (obj instanceof javax.swing.JSeparator) {
return true;
}
if (obj instanceof javax.swing.JMenuItem) {
return true;
}
if (obj instanceof Box.Filler) {
return true;
}
return false;
}
示例5: simpleFiller
import javax.swing.Box; //导入方法依赖的package包/类
private Box.Filler simpleFiller() {
Box.Filler filler = new Box.Filler(
new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 0),
new java.awt.Dimension(10, 32767));
filler.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent me) {
setGlassPane(docker);
SwingUtilities.invokeLater(() -> {
getGlassPane().setVisible(true);
});
}
});
return filler;
}
示例6: makeFlexibleHorizontalStrut
import javax.swing.Box; //导入方法依赖的package包/类
private static Component makeFlexibleHorizontalStrut(int minWidth,
int prefWidth,
int maxWidth) {
return new Box.Filler(new Dimension(minWidth, 0),
new Dimension(prefWidth, 0),
new Dimension(maxWidth, 0));
}
示例7: isFocusableComponent
import javax.swing.Box; //导入方法依赖的package包/类
protected boolean isFocusableComponent(Component component) {
if (!component.isVisible()) return false;
// if (!component.isEnabled()) return false;
if (component instanceof JLabel) return false;
if (component instanceof JPanel) return false;
if (component instanceof JSeparator) return false;
if (component instanceof JToolBar) return false;
if (component instanceof Box.Filler) return false;
return true;
}
示例8: makeFlexibleHorizontalStrut
import javax.swing.Box; //导入方法依赖的package包/类
private Component makeFlexibleHorizontalStrut(int minWidth,
int prefWidth,
int maxWidth) {
return new Box.Filler(new Dimension(minWidth, 0),
new Dimension(prefWidth, 0),
new Dimension(maxWidth, 0));
}
示例9: isGlue
import javax.swing.Box; //导入方法依赖的package包/类
private boolean isGlue(Component c) {
if (c.isVisible() && c instanceof Box.Filler) {
Box.Filler f = (Box.Filler)c;
Dimension min = f.getMinimumSize();
Dimension pref = f.getPreferredSize();
return min.width == 0 && min.height == 0 &&
pref.width == 0 && pref.height == 0;
}
return false;
}
示例10: createInstanceImpl
import javax.swing.Box; //导入方法依赖的package包/类
protected Box.Filler createInstanceImpl() {
return new Box.Filler(null, null, null);
}
示例11: focusable
import javax.swing.Box; //导入方法依赖的package包/类
private static boolean focusable(Component c) {
if (c instanceof JLabel || c instanceof Box.Filler) return false;
return c.isVisible() && c.isEnabled() && c.isFocusable();
}