本文整理汇总了Java中javax.swing.GroupLayout.SequentialGroup.addGroup方法的典型用法代码示例。如果您正苦于以下问题:Java SequentialGroup.addGroup方法的具体用法?Java SequentialGroup.addGroup怎么用?Java SequentialGroup.addGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.GroupLayout.SequentialGroup
的用法示例。
在下文中一共展示了SequentialGroup.addGroup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: add
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private void add(GroupLayout layout, ParallelGroup horizontalGroup, SequentialGroup verticalGroup) {
//Layout
horizontalGroup
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel, 75, 75, 75)
.addComponent(jBrowse)
.addComponent(jReset)
.addComponent(jPlay)
);
verticalGroup
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
.addComponent(jLabel)
.addComponent(jBrowse)
.addComponent(jReset)
.addComponent(jPlay)
);
}
示例2: buildSpecV
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private Group buildSpecV(GroupLayout layout) {
SequentialGroup specSectionV = layout.createSequentialGroup();
specSectionV.addGap(5, 10, 15);
for (int i = 0; i < cboSpecialty.length; i++) {
specSectionV.addGroup(parallelPair(layout, cboSpecialty[i],
txtSpecialty[i]));
if (i == cboSpecialty.length - 1) {
specSectionV.addGap(5, 10, Short.MAX_VALUE);
} else {
specSectionV.addGap(5, 10, 15);
}
}
return specSectionV;
}
示例3: buildMeritsV
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private Group buildMeritsV(GroupLayout layout) {
SequentialGroup contractsSectionV = layout.createSequentialGroup();
contractsSectionV.addGap(5, 10, 15);
for (int i = 0; i < cboMerits.length; i++) {
contractsSectionV.addGroup(parallelPair(layout, cboMerits[i],
parallelRadioArray(layout, rdoMerits[i])));
if (i == rdoContracts.length - 1) {
contractsSectionV.addGap(5, 10, Short.MAX_VALUE);
} else {
contractsSectionV.addGap(5, 10, 15);
}
}
return contractsSectionV;
}
示例4: buildGoblinContractsV
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private Group buildGoblinContractsV(GroupLayout layout) {
SequentialGroup contractsSectionV = layout.createSequentialGroup();
contractsSectionV.addGap(5, 10, 15);
for (int i = 0; i < cboContracts.length; i++) {
contractsSectionV.addGroup(parallelPair(layout, lblGoblin[i],
txtGoblin[i]));
if (i == rdoContracts.length - 1) {
contractsSectionV.addGap(5, 10, Short.MAX_VALUE);
} else {
contractsSectionV.addGap(5, 10, 15);
}
}
return contractsSectionV;
}
示例5: buildContractsV
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private Group buildContractsV(GroupLayout layout) {
SequentialGroup contractsSectionV = layout.createSequentialGroup();
contractsSectionV.addGap(5, 10, 15);
for (int i = 0; i < cboContracts.length; i++) {
contractsSectionV.addGroup(parallelPair(layout, cboContracts[i],
parallelRadioArray(layout, rdoContracts[i])));
if (i == rdoContracts.length - 1) {
contractsSectionV.addGap(5, 10, Short.MAX_VALUE);
} else {
contractsSectionV.addGap(5, 10, 15);
}
}
return contractsSectionV;
}
示例6: makeVerticalGroup
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private SequentialGroup makeVerticalGroup( GroupLayout layout ) {
SequentialGroup verticalGroup = layout.createSequentialGroup();
verticalGroup.addGroup( layout.createParallelGroup( GroupLayout.Alignment.BASELINE )
.addComponent( subjectJLabel )
.addComponent( relationJLabel )
.addComponent( objectJLabel )
);
for ( int i = 0; i < Constants.MAX_EXPORTS; i++ ) {
verticalGroup.addGroup( layout.createParallelGroup( GroupLayout.Alignment.BASELINE )
.addComponent( removeRowButtons.get( i ) )
.addComponent( subjectComboBoxes.get( i ) )
.addComponent( relationComboBoxes.get( i ) )
.addComponent( objectComboBoxes.get( i ) )
);
}
verticalGroup.addComponent( maxExportLimitLabel );
verticalGroup.addGroup( layout.createParallelGroup( GroupLayout.Alignment.BASELINE )
.addComponent( addRelationshipButton )
.addComponent( togrid )
.addComponent( exportButton )
);
return verticalGroup;
}
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:28,代码来源:ExportSpecificRelationshipsToLoadingSheetAction.java
示例7: getInputPanel
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private JPanel getInputPanel(){
if(panelInput == null){
panelInput = new JPanel();
panelInput.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
GroupLayout layout = new GroupLayout(panelInput);
panelInput.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
SequentialGroup horizGroup = layout.createSequentialGroup();
JLabel inputFileLabel = new JLabel("Input file:");
inputFileLabel.setPreferredSize(new Dimension(100,30));
inputFileLabel.setHorizontalAlignment(SwingConstants.TRAILING);
JLabel inputFormatLabel = new JLabel("Input format:");
inputFormatLabel.setPreferredSize(new Dimension(100,30));
inputFormatLabel.setHorizontalAlignment(SwingConstants.TRAILING);
horizGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(inputFileLabel).addComponent(inputFormatLabel));
horizGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(getPNPathField()).addComponent(getFormatBox()));
horizGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(getBrowseButton()));
layout.setHorizontalGroup(horizGroup);
SequentialGroup verticalGroup = layout.createSequentialGroup();
verticalGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(inputFileLabel).addComponent(getPNPathField()).addComponent(getBrowseButton()));
verticalGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(inputFormatLabel).addComponent(getFormatBox()));
layout.setVerticalGroup(verticalGroup);
}
return panelInput;
}
示例8: makeTweaksLayout
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private GroupLayout makeTweaksLayout(List<JCheckBox> tweaks) {
GroupLayout gl = new GroupLayout(miscTweaksPanel);
int numTweaks = tweaks.size();
// Handle columns
SequentialGroup columnsGroup = gl.createSequentialGroup().addContainerGap();
int numCols = Math.min(TWEAK_COLS, numTweaks);
ParallelGroup[] colGroups = new ParallelGroup[numCols];
for (int col = 0; col < numCols; col++) {
if (col > 0) {
columnsGroup.addGap(18, 18, 18);
}
colGroups[col] = gl.createParallelGroup(GroupLayout.Alignment.LEADING);
columnsGroup.addGroup(colGroups[col]);
}
for (int tweak = 0; tweak < numTweaks; tweak++) {
colGroups[tweak % numCols].addComponent(tweaks.get(tweak));
}
columnsGroup.addContainerGap();
gl.setHorizontalGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(columnsGroup));
// And rows
SequentialGroup rowsGroup = gl.createSequentialGroup().addContainerGap();
int numRows = (numTweaks - 1) / numCols + 1;
ParallelGroup[] rowGroups = new ParallelGroup[numRows];
for (int row = 0; row < numRows; row++) {
if (row > 0) {
rowsGroup.addPreferredGap(ComponentPlacement.UNRELATED);
}
rowGroups[row] = gl.createParallelGroup(GroupLayout.Alignment.BASELINE);
rowsGroup.addGroup(rowGroups[row]);
}
for (int tweak = 0; tweak < numTweaks; tweak++) {
rowGroups[tweak / numCols].addComponent(tweaks.get(tweak));
}
rowsGroup.addContainerGap();
gl.setVerticalGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(rowsGroup));
return gl;
}
示例9: buildAttributesH
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private Group buildAttributesH(GroupLayout layout) {
SequentialGroup statsSectionH = layout.createSequentialGroup();
statsSectionH.addGap(10, 75, Short.MAX_VALUE);
statsSectionH.addGroup(layout.createParallelGroup().addGroup(sequentialPair(
layout, lblIntelligence,
sequentialRadioArray(layout, rdoIntelligence))).addGroup(sequentialPair(
layout, lblWits,
sequentialRadioArray(layout, rdoWits))).addGroup(sequentialPair(
layout, lblResolve,
sequentialRadioArray(layout, rdoResolve))));
statsSectionH.addGap(10, 15, 50);
statsSectionH.addGroup(layout.createParallelGroup().addGroup(sequentialPair(
layout, lblStrength,
sequentialRadioArray(layout, rdoStrength))).addGroup(sequentialPair(
layout, lblDexterity,
sequentialRadioArray(layout, rdoDexterity))).addGroup(sequentialPair(
layout, lblStamina,
sequentialRadioArray(layout, rdoStamina))));
statsSectionH.addGap(10, 15, 50);
statsSectionH.addGroup(layout.createParallelGroup().addGroup(sequentialPair(
layout, lblPresence,
sequentialRadioArray(layout, rdoPresence))).addGroup(sequentialPair(
layout, lblManipulation,
sequentialRadioArray(layout, rdoManipulation))).addGroup(sequentialPair(
layout, lblComposure,
sequentialRadioArray(layout, rdoComposure))));
statsSectionH.addGap(10, 75, Short.MAX_VALUE);
return statsSectionH;
}
示例10: buildDetailsH
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private Group buildDetailsH(GroupLayout layout) {
SequentialGroup skillsSectionH = layout.createSequentialGroup();
skillsSectionH.addGap(5, 15, Short.MAX_VALUE);
skillsSectionH.addGroup(
layout.createParallelGroup(GroupLayout.Alignment.CENTER)
.addGroup(
sequentialPair(layout,
sequentialPair(layout, lblBackgroud, scrBackground),
sequentialPair(layout, lblDescription, scrDescription)))
.addGap(5, 15, Short.MAX_VALUE)
.addGroup(
sequentialPair(layout,
sequentialPair(layout, lblAge, spnAge),
sequentialPair(layout, lblHeight, txtHeight)))
.addGap(5, 15, Short.MAX_VALUE)
.addGroup(
sequentialPair(layout,
sequentialPair(layout, lblApparent, spnApparent),
sequentialPair(layout, lblWeight, txtWeight)))
.addGap(5, 15, Short.MAX_VALUE)
.addGroup(
sequentialPair(layout,
sequentialPair(layout, lblHair, txtHair),
sequentialPair(layout, lblRace, txtRace)))
.addGap(5, 15, Short.MAX_VALUE)
.addGroup(
sequentialPair(layout,
sequentialPair(layout, lblEyes, txtEyes),
sequentialPair(layout, lblSex, txtSex))));
skillsSectionH.addGap(5, 15, Short.MAX_VALUE);
return skillsSectionH;
}
示例11: getTableCellRendererComponent
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
@Override
public Component getTableCellRendererComponent(JTable table,
Object value, boolean isSelected, boolean hasFocus, int row,
int column) {
JPanel panel = new JPanel();
if (value instanceof String[]) {
String[] valueArray = (String[]) value;
if (valueArray.length == 0)
return panel;
GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
SequentialGroup cols = layout.createSequentialGroup();
layout.setHorizontalGroup(cols);
ParallelGroup col1 = layout
.createParallelGroup(GroupLayout.Alignment.LEADING);
ParallelGroup col2 = layout
.createParallelGroup(GroupLayout.Alignment.TRAILING);
cols.addGroup(col1)
.addPreferredGap(
LayoutStyle.ComponentPlacement.RELATED,
GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(col2);
SequentialGroup rows = layout.createSequentialGroup();
layout.setVerticalGroup(rows);
for (int i = 0; i < valueArray.length; i++) {
// the value array has null elements for
// IdResource/Demand
if (valueArray[i] != null) {
/* TODO: Fix ArrayIndexOutofBounds Exception here
* Update: Problem is actually above. Probably linked to resources without setters. */
//System.out.println("ValueArray: " + valueArray[i]);
//for (int j = 0; j < resParamNames.size(); j++) { System.out.println("resParamNames: " + resParamNames.get(j)); }
JLabel label = new JLabel();
if (resParamNames.get(row).length == 0)
label.setText("max. param");
else
label.setText("max. " + resParamNames.get(row)[i]);
JTextField tf = new JTextField(3);
tf.setText(valueArray[i]);
col1.addComponent(label);
col2.addComponent(tf, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE);
rows.addGroup(layout
.createParallelGroup(
GroupLayout.Alignment.CENTER)
.addComponent(label).addComponent(tf));
}
}
}
table.setRowHeight(row, Math.max(table.getRowHeight(row),
(int) panel.getPreferredSize().getHeight()));
TableColumn cm = table.getColumnModel().getColumn(column);
cm.setMinWidth(Math.max(cm.getMinWidth(), (int) panel
.getPreferredSize().getWidth()));
return panel;
}
示例12: getTableCellEditorComponent
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
@Override
public Component getTableCellEditorComponent(JTable table,
Object value, boolean isSelected, int row, int column) {
panel = new JPanel();
if (value instanceof String[]) {
String[] valueArray = (String[]) value;
if (valueArray.length == 0)
return panel;
GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
SequentialGroup cols = layout.createSequentialGroup();
layout.setHorizontalGroup(cols);
ParallelGroup col1 = layout
.createParallelGroup(GroupLayout.Alignment.LEADING);
ParallelGroup col2 = layout
.createParallelGroup(GroupLayout.Alignment.TRAILING);
cols.addGroup(col1)
.addPreferredGap(
LayoutStyle.ComponentPlacement.RELATED,
GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(col2);
SequentialGroup rows = layout.createSequentialGroup();
layout.setVerticalGroup(rows);
for (int i = 0; i < valueArray.length; i++) {
// create the label. use the resource param name for both
// resource and demand params as it should be the same. TODO
JLabel label = new JLabel();
if (resParamNames.get(row).length == 0)
label.setText("max. param");
else
label.setText("max. " + resParamNames.get(row)[i]);
JTextField tf = new JTextField(3);
tf.setText(valueArray[i]);
tf.setEditable(true);
col1.addComponent(label);
col2.addComponent(tf, GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE);
rows.addGroup(layout
.createParallelGroup(GroupLayout.Alignment.CENTER)
.addComponent(label).addComponent(tf));
}
}
table.setRowHeight(row, Math.max(table.getRowHeight(row),
(int) panel.getPreferredSize().getHeight()));
TableColumn cm = table.getColumnModel().getColumn(column);
cm.setMinWidth(Math.max(cm.getMinWidth(), (int) panel
.getPreferredSize().getWidth()));
return panel;
}
示例13: displayDecisionVariables
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
private void displayDecisionVariables() {
Panel dvPanel = new Panel();
ScrollPane scrollPane = new ScrollPane();
GroupLayout dvlayout = new GroupLayout(dvPanel);
dvlayout.setAutoCreateGaps(true);
dvlayout.setAutoCreateContainerGaps(true);
ParallelGroup groupForElementsInLine = dvlayout.createParallelGroup(Alignment.LEADING);
SequentialGroup groupForElementsInColumns = dvlayout.createSequentialGroup();
for (Displayable displayable : decisionVariables) {
List<InfoGUI> infos = displayable.getInfo();
for (InfoGUI infoGUI : infos) {
DecisionVariableGUI dvGui1 = new DecisionVariableGUI(infoGUI);
groupForElementsInLine.addGroup((dvlayout.createSequentialGroup().addComponent(dvGui1.getLabel())
.addComponent(dvGui1.getComponent())));
groupForElementsInColumns.addGroup((dvlayout.createParallelGroup(Alignment.CENTER)
.addComponent(dvGui1.getLabel()).addComponent(dvGui1.getComponent())));
mapWithControls.add(dvGui1);
}
}
dvlayout.setHorizontalGroup(groupForElementsInLine);
dvlayout.setVerticalGroup(groupForElementsInColumns);
dvPanel.setLayout(dvlayout);
dvPanel.setBackground(Color.lightGray);
Collections.sort(mapWithControls);
Dimension scrollPaneDimension = new Dimension(dvPanel.getPreferredSize().width + 30,
dvPanel.getPreferredSize().height + 35);
scrollPane.setPreferredSize(new Dimension(250, 700));
if (scrollPaneDimension.height < scrollPane.getPreferredSize().height) {
scrollPane.setPreferredSize(scrollPaneDimension);
}
scrollPane.add(dvPanel);
controlPanel.add(scrollPane);
}
示例14: updateDetails
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
/**
* Update the controls of the detail panel.
*/
void updateDetails() {
bottomPanel.removeAll();
GroupLayout gl = (GroupLayout)bottomPanel.getLayout();
ParallelGroup c1 = gl.createParallelGroup();
ParallelGroup c2 = gl.createParallelGroup();
SequentialGroup r1 = gl.createSequentialGroup();
c1.addComponent(keyLabel);
c2.addComponent(keyField);
r1.addGroup(
gl.createParallelGroup(Alignment.BASELINE)
.addComponent(keyLabel)
.addComponent(keyField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
);
textAreas.clear();
for (final String lang : context.dataManager().languages()) {
JLabel lbl = new JLabel(lang);
JTextArea ta = new JTextArea();
final CEValueBox<JTextArea> vta = CEValueBox.of("", ta);
vta.validator = new Action1<JTextArea>() {
@Override
public void invoke(JTextArea value) {
validateLabelField(vta);
}
};
textAreas.put(lang, vta);
c1.addComponent(lbl);
c2.addComponent(vta);
r1.addGroup(
gl.createParallelGroup(Alignment.BASELINE)
.addComponent(lbl)
.addComponent(vta, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
);
}
gl.setHorizontalGroup(
gl.createSequentialGroup()
.addGroup(c1)
.addGroup(c2)
);
gl.setVerticalGroup(
r1
);
}
示例15: createReferencesPanel
import javax.swing.GroupLayout.SequentialGroup; //导入方法依赖的package包/类
/** @return The referenced main data files panel. */
JPanel createReferencesPanel() {
JPanel p = new JPanel();
GroupLayout gl = new GroupLayout(p);
p.setLayout(gl);
gl.setAutoCreateContainerGaps(true);
gl.setAutoCreateGaps(true);
SequentialGroup rows = gl.createSequentialGroup();
ParallelGroup col1 = gl.createParallelGroup();
ParallelGroup col2 = gl.createParallelGroup();
ParallelGroup col3 = gl.createParallelGroup();
for (String a : ELEMENT_NAMES) {
JLabel indicator = new JLabel();
JLabel caption = new JLabel(get("definition.ref_" + a));
JTextField textField = new JTextField();
indicators.put(a, indicator);
fields.put(a, textField);
ParallelGroup pg = gl.createParallelGroup(Alignment.BASELINE);
col1.addComponent(caption);
col2.addComponent(textField);
col3.addComponent(indicator, 20, 20, 20);
pg.addComponent(caption);
pg.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE);
pg.addComponent(indicator, 20, 20, 20);
rows.addGroup(pg);
}
gl.setHorizontalGroup(
gl.createSequentialGroup()
.addGroup(col1)
.addGroup(col2)
.addGroup(col3)
);
gl.setVerticalGroup(rows);
return p;
}