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


Java BoxLayout.PAGE_AXIS属性代码示例

本文整理汇总了Java中javax.swing.BoxLayout.PAGE_AXIS属性的典型用法代码示例。如果您正苦于以下问题:Java BoxLayout.PAGE_AXIS属性的具体用法?Java BoxLayout.PAGE_AXIS怎么用?Java BoxLayout.PAGE_AXIS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.BoxLayout的用法示例。


在下文中一共展示了BoxLayout.PAGE_AXIS属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tweak

private void tweak() {
    if (UIUtils.isGTKLookAndFeel() || UIUtils.isNimbusLookAndFeel()) {
        int axis = getOrientation() == VERTICAL ? BoxLayout.PAGE_AXIS :
                                                  BoxLayout.LINE_AXIS;
        setLayout(new BoxLayout(this, axis));
    }
    
    if (UIUtils.isNimbusLookAndFeel())
        setBorder(BorderFactory.createEmptyBorder(-2, 0, -2, 0));
    else if (UIUtils.isAquaLookAndFeel())
        setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1));
    
    if (UIUtils.isWindowsClassicLookAndFeel()) setRollover(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:GenericToolbar.java

示例2: getProperties

/** Since BoxLayout is not a bean, we must specify its properties
     * explicitly. This method is called from getPropertySets() implementation
     * to obtain the default property set for the layout (assuming there's only
     * one property set). So it woul be also possible to override (more
     * generally) getPropertySets() instead.
     * @return array of properties of the layout manager
     */
    @Override
    protected FormProperty[] getProperties() {
        if (properties == null) {
            // we cannot use RADProperty because "axis" is not a real
            // bean property - we must create a special FormProperty
            properties = new FormProperty[1];

            properties[0] = new FormProperty(
                                PROP_AXIS,
                                Integer.TYPE,
                                getBundle().getString("PROP_axis"), // NOI18N
                                getBundle().getString("HINT_axis")) // NOI18N
            {
                @Override
                public Object getTargetValue() {
                    return new Integer(axis);
                }

                @Override
                public void setTargetValue(Object value) {
                    int ax = ((Integer)value).intValue();
                    if (ax == BoxLayout.X_AXIS || ax == BoxLayout.Y_AXIS
                            || ax == BoxLayout.LINE_AXIS || ax == BoxLayout.PAGE_AXIS) {
                        axis = ax;
                    }
                }

                @Override
                public boolean supportsDefaultValue() {
                    return true;
                }

                @Override
                public Object getDefaultValue() {
                    return new Integer(BoxLayout.LINE_AXIS);
                }

                @Override
                public PropertyEditor getExpliciteEditor() {
                    return new BoxAxisEditor();
                }
            };
            // [!!]
//            properties[0].setPropertyContext(
//                new FormPropertyContext.DefaultImpl(getContainer().getFormModel()));
        }

        return properties;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:56,代码来源:BoxLayoutSupport.java

示例3: ConnectionErrorDlg

private ConnectionErrorDlg(Segment[] segments) {
    super(BoxLayout.PAGE_AXIS);
    initComponents(segments);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ConnectionErrorDlg.java

示例4: selectIssue

public static Issue selectIssue(String message, Repository repository, JPanel caller, HelpCtx helpCtx) {
    QuickSearchComboBar bar = new QuickSearchComboBar(caller);
    bar.setRepository(repository);
    bar.setAlignmentX(0f);
    bar.setMaximumSize(new Dimension(Short.MAX_VALUE, bar.getPreferredSize().height));
    JPanel panel = new JPanel();
    BoxLayout layout = new BoxLayout(panel, BoxLayout.PAGE_AXIS);
    panel.setLayout(layout);
    JLabel label = new JLabel();
    Mnemonics.setLocalizedText(label, message);
    panel.add(label);
    label.setLabelFor(bar.getIssueComponent());
    LayoutStyle layoutStyle = LayoutStyle.getInstance();
    int gap = layoutStyle.getPreferredGap(label, bar, LayoutStyle.ComponentPlacement.RELATED, SwingConstants.SOUTH, panel);
    panel.add(Box.createVerticalStrut(gap));
    panel.add(bar);
    panel.add(Box.createVerticalStrut(gap));
    ResourceBundle bundle = NbBundle.getBundle(QuickSearchComboBar.class);
    JLabel hintLabel = new JLabel(bundle.getString("MSG_SelectIssueHint")); // NOI18N
    hintLabel.setEnabled(false);
    panel.add(hintLabel);
    panel.add(Box.createVerticalStrut(80));
    panel.setBorder(BorderFactory.createEmptyBorder(
            layoutStyle.getContainerGap(panel, SwingConstants.NORTH, null),
            layoutStyle.getContainerGap(panel, SwingConstants.WEST, null),
            0,
            layoutStyle.getContainerGap(panel, SwingConstants.EAST, null)));
    panel.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_IssueSelector"));
    Issue issue = null;
    JButton ok = new JButton(bundle.getString("LBL_Select")); // NOI18N
    ok.getAccessibleContext().setAccessibleDescription(ok.getText());
    JButton cancel = new JButton(bundle.getString("LBL_Cancel")); // NOI18N
    cancel.getAccessibleContext().setAccessibleDescription(cancel.getText());
    DialogDescriptor descriptor = new DialogDescriptor(
            panel,
            bundle.getString("LBL_Issues"), // NOI18N
            true,
            NotifyDescriptor.OK_CANCEL_OPTION,
            ok,
            null);
    descriptor.setOptions(new Object [] {ok, cancel});
    descriptor.setHelpCtx(helpCtx);
    DialogDisplayer.getDefault().createDialog(descriptor).setVisible(true);
    if (descriptor.getValue() == ok) {
        issue = bar.getIssue();
    }
    return issue;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:QuickSearchComboBar.java


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