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


Java GroupLayout.ParallelGroup方法代码示例

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


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

示例1: getVerticalGroup

import javax.swing.GroupLayout; //导入方法依赖的package包/类
private GroupLayout.ParallelGroup getVerticalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (/* XXX huh? GroupLayout.PREFERRED_SIZE*/);
    GroupLayout.SequentialGroup seq = layout.createSequentialGroup ();
    if (hasPrimary) {
        seq.addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 40, 40)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addComponent (tpPrimaryPlugins, GroupLayout.PREFERRED_SIZE, tpPrimaryPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
            .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
            .addGap (0, 30, 30);
    }
    if (hasRequired) {
        seq.addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 80, 80)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED)
                .addComponent (tpDependingPlugins, GroupLayout.PREFERRED_SIZE, tpDependingPlugins.getPreferredSize ().height, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap (LayoutStyle.ComponentPlacement.RELATED);
    }
    res.addGroup (seq);
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:OperationDescriptionPanel.java

示例2: getHorizontalGroup

import javax.swing.GroupLayout; //导入方法依赖的package包/类
private GroupLayout.ParallelGroup getHorizontalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) {
    GroupLayout.ParallelGroup res = layout.createParallelGroup (Alignment.LEADING);
    if (hasPrimary) {
        res.addGroup (Alignment.TRAILING, layout.createSequentialGroup ()
                .addGroup (layout.createParallelGroup (Alignment.TRAILING)
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addGap (49, 49, 49)
                .addComponent (tpPrimaryPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addContainerGap ()
                .addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)))
                .addContainerGap ());
    }
    if (hasRequired) {
        res.addGroup (Alignment.TRAILING, layout.createSequentialGroup ()
                .addGroup (layout.createParallelGroup (Alignment.TRAILING)
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addGap (49, 49, 49)
                .addComponent (tpDependingPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE))
                .addGroup (Alignment.LEADING, layout.createSequentialGroup ()
                .addContainerGap ()
                .addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)))
                .addContainerGap ());
    }
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:OperationDescriptionPanel.java

示例3: init

import javax.swing.GroupLayout; //导入方法依赖的package包/类
private void init() {
    errorLabel.setText(" "); // NOI18N
    GroupLayout containerPanelLayout = new GroupLayout(containerPanel);
    containerPanel.setLayout(containerPanelLayout);
    GroupLayout.ParallelGroup horizontalGroup = containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    GroupLayout.SequentialGroup verticalGroup = containerPanelLayout.createSequentialGroup();
    containerPanelLayout.setHorizontalGroup(horizontalGroup);
    containerPanelLayout.setVerticalGroup(
        containerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(verticalGroup)
    );
    for (CssPreprocessorUIImplementation.Options options : allOptions) {
        JComponent component = options.getComponent();
        Parameters.notNull("component", component); // NOI18N
        horizontalGroup.addComponent(component, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
        verticalGroup.addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CssPrepOptionsPanel.java

示例4: layoutHeaderPanel

import javax.swing.GroupLayout; //导入方法依赖的package包/类
private void layoutHeaderPanel(JPanel headerPanel, JLabel iconLabel, JLabel leftLabel, JLabel commentLabel, JLabel rightLabel, LinkButton replyButton, LinkButton mailtoButton, JLabel stateLabel) {
    GroupLayout layout = new GroupLayout(headerPanel);
    headerPanel.setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup()
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(stateLabel);
    }
    hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(commentLabel,0, 0, Short.MAX_VALUE)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(rightLabel)
          .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(mailtoButton);
    }
    layout.setHorizontalGroup(hGroup);
    
    GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        .addComponent(iconLabel)
        .addComponent(leftLabel);
    if (stateLabel != null) {
        vGroup.addComponent(stateLabel);
    }
    vGroup.addComponent(commentLabel)
          .addComponent(rightLabel)
          .addComponent(replyButton);
    if (mailtoButton != null) {
        vGroup.addComponent(mailtoButton);
    }
    layout.setVerticalGroup(vGroup);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:CommentsPanel.java

示例5: setLayoutGroups

import javax.swing.GroupLayout; //导入方法依赖的package包/类
void setLayoutGroups(GroupLayout.ParallelGroup horizontalGroup,
        GroupLayout.SequentialGroup verticalGroup) {
    this.horizontalGroup = horizontalGroup;
    this.verticalGroup = verticalGroup;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:AttachmentsPanel.java

示例6: setIssue

import javax.swing.GroupLayout; //导入方法依赖的package包/类
void setIssue(BugzillaIssue issue,
              List<BugzillaIssue.Attachment> attachments) {
    removeAll();
    this.issue = issue;
    initCollapsedComments();
    this.attachments = attachments;
    this.attachmentIds = getAttachmentIds(attachments);
    BugzillaIssue.Comment[] comments = issue.getComments();
    this.sections = new ArrayList<>(comments.length + 1);
    GroupLayout layout = new GroupLayout(this);
    GroupLayout.ParallelGroup horizontalGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
    layout.setHorizontalGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(horizontalGroup)
        .addContainerGap());
    GroupLayout.SequentialGroup verticalGroup = layout.createSequentialGroup();
    verticalGroup.addContainerGap();
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(verticalGroup));
    DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.SHORT);
    String creationTxt = issue.getFieldValue(IssueField.CREATION);
    try {
        if (!creationTxt.isEmpty()) {
            Date creation = dateTimeFormat.parse(creationTxt);
            creationTxt = format.format(creation);
        }
    } catch (ParseException pex) {
        Bugzilla.LOG.log(Level.INFO, null, pex);
    }
    sections.add(addSection(layout,
        new Long(0),    
        issue.getFieldValue(IssueField.DESCRIPTION),
        issue.getFieldValue(IssueField.REPORTER),
        issue.getFieldValue(IssueField.REPORTER_NAME),
        creationTxt, horizontalGroup, verticalGroup, true));
    for (BugzillaIssue.Comment comment : comments) {
        String when = format.format(comment.getWhen());
        sections.add(addSection(layout, comment.getNumber(), comment.getText(), comment.getAuthor(), comment.getAuthorName(), when, horizontalGroup, verticalGroup, false));
    }
    verticalGroup.addContainerGap();
    setLayout(layout);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:CommentsPanel.java


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