本文整理汇总了Java中javax.swing.GroupLayout.SequentialGroup方法的典型用法代码示例。如果您正苦于以下问题:Java GroupLayout.SequentialGroup方法的具体用法?Java GroupLayout.SequentialGroup怎么用?Java GroupLayout.SequentialGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.GroupLayout
的用法示例。
在下文中一共展示了GroupLayout.SequentialGroup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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);
}
}
示例3: 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);
}
示例4: setLayoutGroups
import javax.swing.GroupLayout; //导入方法依赖的package包/类
void setLayoutGroups(GroupLayout.ParallelGroup horizontalGroup,
GroupLayout.SequentialGroup verticalGroup) {
this.horizontalGroup = horizontalGroup;
this.verticalGroup = verticalGroup;
}
示例5: 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);
}