本文整理匯總了Java中com.intellij.uiDesigner.core.GridConstraints類的典型用法代碼示例。如果您正苦於以下問題:Java GridConstraints類的具體用法?Java GridConstraints怎麽用?Java GridConstraints使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GridConstraints類屬於com.intellij.uiDesigner.core包,在下文中一共展示了GridConstraints類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: JPanel
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
mainPanel = new JPanel();
mainPanel.setLayout(new GridLayoutManager(4, 5, new Insets(10, 10, 10, 10), -1, -1));
mainPanel.putClientProperty("html.disable", Boolean.FALSE);
mainPanel.setBorder(BorderFactory.createTitledBorder("9"));
final JLabel label1 = new JLabel();
label1.setText("Table Prefix");
mainPanel.add(label1, new GridConstraints(2, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
mainPanel.add(spacer1, new GridConstraints(3, 2, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
tablePrefixTextbox = new JTextField();
mainPanel.add(tablePrefixTextbox, new GridConstraints(2, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
final JLabel label2 = new JLabel();
label2.setFont(new Font(label2.getFont().getName(), Font.BOLD, 18));
label2.setText("Table Prefix Support");
mainPanel.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
insertTableNamesWithCheckBox = new JCheckBox();
insertTableNamesWithCheckBox.setText("Insert table names with prefix");
insertTableNamesWithCheckBox.setToolTipText("Insert {{%tableName}}");
mainPanel.add(insertTableNamesWithCheckBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
示例2: CodeMakerConfiguration
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
public CodeMakerConfiguration(CodeMakerSettings settings) {
tabbedPane = new JBTabbedPane();
editPaneMap = new HashMap<>();
addTemplateButton.addActionListener(e -> {
TemplateEditPane editPane = new TemplateEditPane(settings, "", this);
String title = "Untitled";
tabbedPane.addTab(title, editPane.getTemplateEdit());
tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
editPaneMap.put(title, editPane);
});
resetTabPane(settings);
GridConstraints constraints = new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(300, 300), null, 0, true);
mainPane.add(tabbedPane, constraints);
}
示例3: InitOrderListTable
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
private void InitOrderListTable() {
// 訂單列表Table
this.orderListTable = new OrderListTable();
JScrollPane scrollPane = new JScrollPane(orderListTable, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
taskDetailPane.getBotWrapperPanel().add(scrollPane, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(600, 50), null, 0, false));
this.orderListTable.setAutoCreateColumnsFromModel(true);
// Data Rows
orderListTable.setModel(new DefaultTableModel(null, orderListTable.getColumns()));
// Actions
new OrderActionsColumn(orderListTable, orderListTable.getColumns().length - 1, (ActionEvent e, int row, int column, OrderAction action) -> {
logger.info("row {} col {} action {}", row, column, action);
});
// 注冊Observer
runTasksModel.RegisterObserver(orderListTable);
}
示例4: InitView
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
private void InitView() {
mainPanel = new JPanel();
mainPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 0, 0, 0), -1, -1));
tabbedPane = new JTabbedPane();
mainPanel.add(tabbedPane, new GridConstraints(0, 0, 1, 1, 0, 3, 1|2, 1|2, null, new Dimension(200, 200), null, 0, false));
// Add Tabs
final JPanel configTaskPanel = new ConfigTaskController();
final JPanel taskStatusPanel = new TaskDetailController();
final JPanel settingPanel = new SettingController();
final JPanel aboutPanel = new AboutController();
tabbedPane.addTab("配置任務", configTaskPanel);
tabbedPane.addTab("任務詳細", taskStatusPanel);
tabbedPane.addTab("設置", settingPanel);
tabbedPane.addTab("關於", aboutPanel);
tabbedPane.setSelectedIndex(Settings.getInstance().getCurrentTab().ordinal());
}
示例5: InitViews
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
private void InitViews() {
// Layout設置要盡可能早
this.setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1));
this.wrapperPanel = new JPanel();
this.wrapperPanel.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), 0, 0));
this.add(wrapperPanel, new GridConstraints(0, 0, 1, 1, 0, 3, 1|2, 1|2, null, null, null, 0, false));
// Border
EtchedBorder line = new EtchedBorder();
Border border = BorderFactory.createTitledBorder(line, "任務編輯列表");
this.wrapperPanel.setBorder(border);
this.InitAddForm();
this.InitTaskListTable();
}
示例6: JPanel
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1, true, false));
panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
buttonOK = new JButton();
buttonOK.setText("OK");
panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
buttonCancel = new JButton();
buttonCancel.setText("Cancel");
panel2.add(buttonCancel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
}
示例7: JPanel
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
testFormJPanel = new JPanel();
testFormJPanel.setLayout(new GridLayoutManager(4, 2, new Insets(5, 5, 5, 5), -1, -1));
final JLabel label1 = new JLabel();
label1.setText("這是一個測試窗口");
testFormJPanel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
button1 = new JButton();
button1.setText("Button");
testFormJPanel.add(button1, new GridConstraints(3, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
checkBox1 = new JCheckBox();
checkBox1.setText("CheckBox");
testFormJPanel.add(checkBox1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
textField1 = new JTextField();
testFormJPanel.add(textField1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
passwordField1 = new JPasswordField();
testFormJPanel.add(passwordField1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
list1 = new JList();
testFormJPanel.add(list1, new GridConstraints(1, 1, 2, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));
}
示例8: JPanel
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(3, 1, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
buttonOK = new JButton();
buttonOK.setText("OK");
panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JScrollPane scrollPane1 = new JScrollPane();
panel3.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(200, 100), null, 0, false));
list = new JList();
scrollPane1.setViewportView(list);
totalLabel = new JLabel();
totalLabel.setText("Total: X");
contentPane.add(totalLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
示例9: createUIComponents
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
createUIComponents();
rootPanel.setLayout(new BorderLayout(0, 0));
actionPanel = new JPanel();
actionPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
rootPanel.add(actionPanel, BorderLayout.SOUTH);
buttonOk = new JButton();
buttonOk.setText("OK");
actionPanel.add(buttonOk, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
buttonCancel = new JButton();
buttonCancel.setText("Cancel");
actionPanel.add(buttonCancel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
sqlPanel.setLayout(new BorderLayout(0, 0));
rootPanel.add(sqlPanel, BorderLayout.CENTER);
sqlPanel.add(sqlScrollPane, BorderLayout.CENTER);
}
示例10: addComponents
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
@Override
public int addComponents(JPanel panel, SearchableOptionsHelper helper, int rowi) {
for (JCheckBox contributedComponent : components) {
helper.registerLabelText(contributedComponent.getText(), true);
panel.add(
contributedComponent,
new GridConstraints(
rowi++,
0,
1,
2,
GridConstraints.ANCHOR_NORTHWEST,
GridConstraints.FILL_NONE,
GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
GridConstraints.SIZEPOLICY_FIXED,
null,
null,
null,
0,
false));
}
return rowi;
}
示例11: createUIComponents
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
createUIComponents();
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.setBackground(new Color(-1));
contentPane.add(imagePanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
contentPane.add(spacer1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 10, 5, 10), -1, -1));
panel1.setBackground(new Color(-1));
contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
openButton = new JButton();
this.$$$loadButtonText$$$(openButton, ResourceBundle.getBundle("translations/ShowQrDialogBundle").getString("openButton"));
panel1.add(openButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
示例12: GridLayoutColumnProperties
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
public GridLayoutColumnProperties() {
myWantGrowCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
for(RadComponent c: myContainer.getComponents()) {
if (c.getConstraints().getCell(myRow) == mySelectedIndex) {
Property<RadComponent, Integer> property = myRow
? VSizePolicyProperty.getInstance(c.getProject())
: HSizePolicyProperty.getInstance(c.getProject());
if (myWantGrowCheckBox.isSelected()) {
property.setValueEx(c, property.getValue(c).intValue() | GridConstraints.SIZEPOLICY_WANT_GROW);
break;
}
else {
if ((property.getValue(c).intValue() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) {
property.setValueEx(c, property.getValue(c).intValue() & ~GridConstraints.SIZEPOLICY_WANT_GROW);
break;
}
}
}
}
for(ChangeListener listener: myListeners) {
listener.stateChanged(new ChangeEvent(this));
}
}
});
}
示例13: JPanel
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
buttonOK = new JButton();
buttonOK.setText("OK");
panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final JScrollPane scrollPane1 = new JScrollPane();
panel3.add(scrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
textPane = new JTextPane();
textPane.setContentType("text/html");
textPane.setEditable(false);
scrollPane1.setViewportView(textPane);
}
示例14: compileSet
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
@Override
public void compileSet(Object table, List<ConfigurableAttribute<?>> attrs) {
if(!(table instanceof JPanel)) return;
JPanel configPane = (JPanel)table;
configPane.removeAll();
int rows = configPane.getHeight() / 30;
if (rows < attrs.size()) rows = attrs.size() + 1;
configPane.setLayout(new GridLayoutManager(rows, 3, new Insets(0, 0, 0, 0), -1, 0, false, true));
final int[] index = new int[]{0};
attrs.forEach(ca -> {
System.out.println(ca.displayName());
Object compObj = buildComponent(ca);
if (compObj instanceof Component) {
configPane.add(new JLabel(ca.displayName()), new GridConstraints(index[0], 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 24), null, 0, false));
configPane.add((Component) compObj, new GridConstraints(index[0], 1, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 24), null, 0, false));
index[0]++;
}
});
configPane.invalidate();
configPane.repaint();
}
示例15: getAlignment
import com.intellij.uiDesigner.core.GridConstraints; //導入依賴的package包/類
public int getAlignment(RadComponent component, boolean horizontal) {
CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints();
CellConstraints.Alignment al = horizontal ? cc.hAlign : cc.vAlign;
if (al == CellConstraints.DEFAULT) {
FormLayout formLayout = (FormLayout) component.getParent().getLayout();
FormSpec formSpec = horizontal
? formLayout.getColumnSpec(component.getConstraints().getColumn()+1)
: formLayout.getRowSpec(component.getConstraints().getRow()+1);
final FormSpec.DefaultAlignment defaultAlignment = formSpec.getDefaultAlignment();
if (defaultAlignment.equals(RowSpec.FILL)) {
return GridConstraints.ALIGN_FILL;
}
if (defaultAlignment.equals(RowSpec.TOP) || defaultAlignment.equals(ColumnSpec.LEFT)) {
return GridConstraints.ALIGN_LEFT;
}
if (defaultAlignment.equals(RowSpec.CENTER)) {
return GridConstraints.ALIGN_CENTER;
}
return GridConstraints.ALIGN_RIGHT;
}
return Utils.alignFromConstraints(component.getConstraints(), horizontal);
}