當前位置: 首頁>>代碼示例>>Java>>正文


Java ColumnSpec.LEFT屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:shevek,項目名稱:spring-rich-client,代碼行數:24,代碼來源:ToolbarSample.java

示例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());
}
 
開發者ID:DigitalMediaServer,項目名稱:DigitalMediaServer,代碼行數:22,代碼來源:FormLayoutUtil.java

示例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;
}
 
開發者ID:shevek,項目名稱:spring-rich-client,代碼行數:27,代碼來源:ButtonStackBarSample.java


注:本文中的com.jgoodies.forms.layout.ColumnSpec.LEFT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。