本文整理匯總了Java中com.jgoodies.forms.layout.ColumnSpec.LEFT屬性的典型用法代碼示例。如果您正苦於以下問題:Java ColumnSpec.LEFT屬性的具體用法?Java ColumnSpec.LEFT怎麽用?Java ColumnSpec.LEFT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.jgoodies.forms.layout.ColumnSpec
的用法示例。
在下文中一共展示了ColumnSpec.LEFT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDialogContentPane
@Override
protected JComponent createDialogContentPane() {
JPanel panel = new JPanel(new FormLayout(new ColumnSpec[] { new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT,
ColumnSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
FormFactory.DEFAULT_ROWSPEC }));
CommandManager commandManager = Application.instance().getActiveWindow().getCommandManager();
List<Object> members = new ArrayList<Object>();
for (int i = 0; i < commandIds.length; i++) {
members.add(commandManager.getCommand(commandIds[i]));
}
CellConstraints cc = new CellConstraints();
CommandGroupFactoryBean commandGroupFactory = new CommandGroupFactoryBean("toolbar", members.toArray());
panel.add(commandGroupFactory.getCommandGroup().createToolBar(), cc.xy(1, 1));
JTextField toolbarTextField = new JTextField(20);
toolbarTextField.setText("input");
members.add(toolbarTextField);
commandGroupFactory = new CommandGroupFactoryBean("toolbar2", members.toArray());
panel.add(commandGroupFactory.getCommandGroup().createToolBar(), cc.xy(1, 3));
return panel;
}
示例2: flipped
/**
* Flips the default alignment of the given column specification and returns
* a new column specification object with the flipped alignment and the same
* size and growing behavior as the original.
*
* @param spec
* the original column specification
* @return the column specification with flipped default alignment
*/
private static ColumnSpec flipped(ColumnSpec spec) {
DefaultAlignment alignment = spec.getDefaultAlignment();
if (alignment == ColumnSpec.LEFT) {
alignment = ColumnSpec.RIGHT;
} else {
if (alignment == ColumnSpec.RIGHT) {
alignment = ColumnSpec.LEFT;
}
}
return new ColumnSpec(alignment, spec.getSize(), spec.getResizeWeight());
}
示例3: createDialogContentPane
@Override
protected JComponent createDialogContentPane() {
JPanel panel = new JPanel(new FormLayout(new ColumnSpec[] {FormFactory.DEFAULT_COLSPEC , FormFactory.RELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT,
ColumnSpec.DEFAULT_GROW)}, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
FormFactory.DEFAULT_ROWSPEC }));
CommandManager commandManager = Application.instance().getActiveWindow().getCommandManager();
List<Object> members = new ArrayList<Object>();
for (int i = 0; i < commandIds.length; i++) {
members.add(commandManager.getCommand(commandIds[i]));
}
CellConstraints cc = new CellConstraints();
CommandGroupFactoryBean commandGroupFactory = new CommandGroupFactoryBean("buttonBar", members.toArray());
panel.add(new JLabel(getMessage("buttonBar.label")), cc.xy(1, 1));
panel.add(commandGroupFactory.getCommandGroup().createButtonBar(), cc.xyw(1, 3, 3));
JTextField toolbarTextField = new JTextField(20);
toolbarTextField.setText("input");
members.add(toolbarTextField);
commandGroupFactory = new CommandGroupFactoryBean("buttonStack", members.toArray());
panel.add(new JLabel(getMessage("buttonStack.label")), cc.xy(1, 5));
panel.add(commandGroupFactory.getCommandGroup().createButtonStack(), cc.xy(3, 5));
return panel;
}