当前位置: 首页>>代码示例>>Java>>正文


Java Box.Filler方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:VerticalLayout.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:TransparentToolBar.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:HorizontalLayout.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:ValidateLayerMenuTest.java

示例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;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:20,代码来源:AppMainFrame.java

示例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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:VCSCommitPanel.java

示例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;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:GenericToolbar.java

示例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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:CommitPanel.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SynthToolBarUI.java

示例10: createInstanceImpl

import javax.swing.Box; //导入方法依赖的package包/类
protected Box.Filler createInstanceImpl() {
    return new Box.Filler(null, null, null);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:JComponentBuilders.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ProfilerPopup.java


注:本文中的javax.swing.Box.Filler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。