本文整理匯總了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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例5: setLayoutGroups
import javax.swing.GroupLayout; //導入方法依賴的package包/類
void setLayoutGroups(GroupLayout.ParallelGroup horizontalGroup,
GroupLayout.SequentialGroup verticalGroup) {
this.horizontalGroup = horizontalGroup;
this.verticalGroup = verticalGroup;
}
示例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);
}