本文整理汇总了Java中com.jgoodies.forms.layout.Sizes.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java Sizes.DEFAULT属性的具体用法?Java Sizes.DEFAULT怎么用?Java Sizes.DEFAULT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.jgoodies.forms.layout.Sizes
的用法示例。
在下文中一共展示了Sizes.DEFAULT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTitledDialogContentPane
@Override
protected JComponent createTitledDialogContentPane() {
messageArea = new JTextArea();
messageArea.setEditable(false);
Reporter reporter = getReporter();
Assert.notNull(reporter);
reporter.setMessageArea(messageArea);
JPanel panel = new JPanel(new FormLayout(new ColumnSpec[] {
new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW),
FormFactory.UNRELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) },
new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), }));
CellConstraints cc = new CellConstraints();
panel.add(reporter.getControl(), cc.xy(1, 1));
AbstractCommand[] reporterCommands = reporter.getReporterCommands();
AbstractCommand[] commandStack = new AbstractCommand[reporterCommands.length + 1];
System.arraycopy(reporterCommands, 0, commandStack, 0, reporterCommands.length);
commandStack[reporterCommands.length] = getClearTextAreaCommand();
CommandGroup commandGroup = CommandGroup.createCommandGroup(commandStack);
panel.add(commandGroup.createButtonStack(), cc.xy(3, 1));
JScrollPane scrollPane = new JScrollPane(messageArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panel, scrollPane);
scrollPane.setPreferredSize(new Dimension(200, 100));
return splitPane;
}
示例2: 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;
}
示例3: createTitledDialogContentPane
@Override
protected JComponent createTitledDialogContentPane() {
JPanel panel = new JPanel(new FormLayout(new ColumnSpec[] {
new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, ColumnSpec.DEFAULT_GROW),
FormFactory.RELATED_GAP_COLSPEC,
new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, ColumnSpec.DEFAULT_GROW) }, new RowSpec[] {
FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC }));
// create all columns, needed to add/remove them
TableColumn column;
for (int i = 0; i < headers.size(); ++i) {
column = new TableColumn(i, -1, new DefaultTableCellRenderer(), null);
column.setHeaderValue(headers.get(i));
tableColumns.add(column);
}
columnModel = new DefaultTableColumnModel();
// create the sortable model by wrapping our simple custom model
sortedModel = new ShuttleSortableTableModel(new CustomerTableModel());
table = new JTable(sortedModel, columnModel);
table.setAutoCreateColumnsFromModel(false);
TableSortIndicator sortIndicator = new TableSortIndicator(table);
new SortTableCommand(table, sortIndicator.getColumnSortList());
JScrollPane scrollPane = new JScrollPane(table);
CellConstraints cc = new CellConstraints();
panel.add(scrollPane, cc.xyw(1, 1, 3));
panel.add(createAddCommand().createButton(), cc.xy(1, 3));
panel.add(createRemoveCommand().createButton(), cc.xy(3, 3));
return panel;
}
示例4: 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;
}