/** * 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)); }
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); }
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); }
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()); }
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(); }
private void InitTaskListTable() { // 任务列表Table this.taskListTable = new TaskListTable(); JScrollPane scrollPane = new JScrollPane(taskListTable, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); // scrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(40, 0)); this.wrapperPanel.add(scrollPane, new GridConstraints(1, 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.taskListTable.setAutoCreateColumnsFromModel(true); // Data Rows taskListTable.setModel(new DefaultTableModel(null, taskListTable.getColumns())); // Actions new TaskActionsColumn(taskListTable, taskListTable.getColumns().length - 1, (ActionEvent e, int row, int column, TaskAction action) -> { logger.info("row {} col {} action {}", row, column, action); }); // 注册Observer this.taskListModel = TaskListModel.getInstance(); this.taskListModel.RegisterObserver(this.taskListTable); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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); }
@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; }
/** * 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)); }
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)); } } }); }
/** * 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); }
@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(); }
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); }
public Result[] convert() { ArrayList results = new ArrayList(); for(int i=0; i<myComponents.size(); i++) { results.add(convert((JComponent) myComponents.get(i), (GridConstraints) myConstraints.get(i))); } //addFillerPanels(results); final Result[] resultArray = (Result[])results.toArray(new Result[results.size()]); if (myHGap > 0 || myVGap > 0) { applyGaps(resultArray); } if (mySameSizeHorz) { makeSameSizes(resultArray, true); } if (mySameSizeVert) { makeSameSizes(resultArray, false); } return resultArray; }
public static void constraintsToGridBag(final GridConstraints constraints, final GridBagConstraints result) { result.gridx = constraints.getColumn(); result.gridy = constraints.getRow(); result.gridwidth = constraints.getColSpan(); result.gridheight = constraints.getRowSpan(); switch(constraints.getFill()) { case GridConstraints.FILL_HORIZONTAL: result.fill = GridBagConstraints.HORIZONTAL; break; case GridConstraints.FILL_VERTICAL: result.fill = GridBagConstraints.VERTICAL; break; case GridConstraints.FILL_BOTH: result.fill = GridBagConstraints.BOTH; break; default: result.fill = GridBagConstraints.NONE; break; } switch(constraints.getAnchor()) { case GridConstraints.ANCHOR_NORTHWEST: result.anchor = GridBagConstraints.NORTHWEST; break; case GridConstraints.ANCHOR_NORTH: result.anchor = GridBagConstraints.NORTH; break; case GridConstraints.ANCHOR_NORTHEAST: result.anchor = GridBagConstraints.NORTHEAST; break; case GridConstraints.ANCHOR_EAST: result.anchor = GridBagConstraints.EAST; break; case GridConstraints.ANCHOR_SOUTHEAST: result.anchor = GridBagConstraints.SOUTHEAST; break; case GridConstraints.ANCHOR_SOUTH: result.anchor = GridBagConstraints.SOUTH; break; case GridConstraints.ANCHOR_SOUTHWEST: result.anchor = GridBagConstraints.SOUTHWEST; break; case GridConstraints.ANCHOR_WEST: result.anchor = GridBagConstraints.WEST; break; } }
protected static void writeGridConstraints(final XmlWriter writer, final RadComponent child) { // Constraints in Grid layout writer.startElement("grid"); try { final GridConstraints constraints = child.getConstraints(); writer.addAttribute("row",constraints.getRow()); writer.addAttribute("column",constraints.getColumn()); writer.addAttribute("row-span",constraints.getRowSpan()); writer.addAttribute("col-span",constraints.getColSpan()); writer.addAttribute("vsize-policy",constraints.getVSizePolicy()); writer.addAttribute("hsize-policy",constraints.getHSizePolicy()); writer.addAttribute("anchor",constraints.getAnchor()); writer.addAttribute("fill",constraints.getFill()); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_INDENT, constraints.getIndent()); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_USE_PARENT_LAYOUT, constraints.isUseParentLayout()); // preferred size writer.writeDimension(constraints.myMinimumSize,"minimum-size"); writer.writeDimension(constraints.myPreferredSize,"preferred-size"); writer.writeDimension(constraints.myMaximumSize,"maximum-size"); } finally { writer.endElement(); // grid } }
public void showProperties(RadContainer container, boolean isRow, int[] selectedIndices) { myContainer = container; myRow = isRow; if (selectedIndices.length != 1) { myTitleLabel.setText(selectedIndices.length + (isRow ? " rows selected" : " columns selected")); myWantGrowCheckBox.setEnabled(false); } else { mySelectedIndex = selectedIndices [0]; myTitleLabel.setText((isRow ? "Row " : "Column ") + selectedIndices [0]); myWantGrowCheckBox.setEnabled(true); GridLayoutManager layout = (GridLayoutManager) container.getLayout(); int sizePolicy = layout.getCellSizePolicy(isRow, selectedIndices [0]); myWantGrowCheckBox.setSelected((sizePolicy & GridConstraints.SIZEPOLICY_WANT_GROW) != 0); } }
@Override public void addSnapshotComponent(final JComponent parent, final JComponent child, final RadContainer container, final RadComponent component) { GridLayoutManager grid = (GridLayoutManager) container.getLayout(); component.getConstraints().setRow(myLastRow); component.getConstraints().setColumn(myLastColumn); component.getConstraints().setFill(GridConstraints.FILL_BOTH); if (myLastColumn == grid.getColumnCount()-1) { myLastRow++; myLastColumn = 0; } else { myLastColumn++; } container.addComponent(component); }
private static int addComponent(JComponent parent, JComponent component, int row, int column, boolean isLast) { GridConstraints gridConstraints = new GridConstraints(); gridConstraints.setRow(row); gridConstraints.setColumn(column); boolean isGreedyComponent = component instanceof JTextField || component instanceof Spacer || component instanceof LabelWithEditLink || component instanceof TextAccessor || component instanceof EditorComboBox; int columnSpan = (isLast && isGreedyComponent) ? COLUMN_COUNT - column : 1; gridConstraints.setColSpan(columnSpan); gridConstraints.setAnchor(GridConstraints.ALIGN_LEFT); gridConstraints.setHSizePolicy(isGreedyComponent ? GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW : GridConstraints.SIZEPOLICY_CAN_SHRINK); gridConstraints.setVSizePolicy(component instanceof Spacer ? GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW : GridConstraints.SIZEPOLICY_FIXED); gridConstraints.setFill(GridConstraints.FILL_HORIZONTAL); parent.add(component, gridConstraints); if (isLast && !isGreedyComponent && column < COLUMN_COUNT - 1) { addComponent(parent, new Spacer(), row, column + 1, true); } return columnSpan; }
/** * @param cellIndex column or row index, depending on isRow parameter; must be in the range 0..grid.get{Row|Column}Count()-1 * @param isRow if true, row inserted, otherwise column * @param isBefore if true, row/column will be inserted before row/column with given index, otherwise after */ public static void insertRowOrColumn(final RadContainer grid, final int cellIndex, final boolean isRow, final boolean isBefore) { check(grid, isRow, cellIndex); final RadAbstractGridLayoutManager oldLayout = grid.getGridLayoutManager(); int beforeIndex = cellIndex; if (!isBefore) { // beforeIndex can actually be equal to get{Row|Column}Count an case we add row after the last row/column beforeIndex++; } final LayoutManager newLayout = oldLayout.copyLayout(grid.getLayout(), isRow ? 1 : 0, isRow ? 0 : 1); GridConstraints[] oldConstraints = copyConstraints(grid); for (int i=grid.getComponentCount() - 1; i >= 0; i--){ final GridConstraints constraints = grid.getComponent(i).getConstraints(); adjustConstraintsOnInsert(constraints, isRow, beforeIndex, 1); } grid.setLayout(newLayout); fireAllConstraintsChanged(grid, oldConstraints); }
/** * @param cellIndex column or row index, depending on isRow parameter; must be in the range 0..grid.get{Row|Column}Count()-1 * @param isRow if true, row is splitted, otherwise column */ public static void splitCell(final RadContainer grid, final int cellIndex, final boolean isRow) { check(grid, isRow, cellIndex); int insertedCells = grid.getGridLayoutManager().insertGridCells(grid, cellIndex, isRow, false, false); for (int i=grid.getComponentCount() - 1; i >= 0; i--){ final RadComponent component = grid.getComponent(i); final GridConstraints constraints = component.getConstraints(); if (constraints.getCell(isRow) + constraints.getSpan(isRow) - 1 == cellIndex) { // component belongs to the cell being resized - increment component's span GridConstraints oldConstraints = (GridConstraints)constraints.clone(); constraints.setSpan(isRow, constraints.getSpan(isRow) + insertedCells); component.fireConstraintsChanged(oldConstraints); } } }
public static void moveCell(final RadContainer container, final boolean isRow, final int sourceCell, int targetCell) { if (targetCell == sourceCell || targetCell == sourceCell+1) return; // if column moved to left - components inbetween move to right, and vice versa int delta = (sourceCell > targetCell) ? 1 : -1; int startCell = Math.min(sourceCell, targetCell); int endCell = Math.max(sourceCell, targetCell); if (sourceCell < targetCell) targetCell--; for(RadComponent c: container.getComponents()) { GridConstraints constraints = c.getConstraints(); GridConstraints oldConstraints = (GridConstraints) constraints.clone(); final int aCell = constraints.getCell(isRow); if (aCell == sourceCell) { constraints.setCell(isRow, targetCell); } else if (aCell >= startCell && aCell < endCell) { constraints.setCell(isRow, aCell + delta); } c.fireConstraintsChanged(oldConstraints); } }
public ComponentItem( @NotNull Project project, @NotNull final String className, @Nullable final String iconPath, @Nullable final String toolTipText, @NotNull final GridConstraints defaultConstraints, @NotNull final HashMap<String, StringDescriptor> propertyName2initialValue, final boolean removable, final boolean autoCreateBinding, final boolean canAttachLabel ){ myAutoCreateBinding = autoCreateBinding; myCanAttachLabel = canAttachLabel; myProject = project; setClassName(className); setIconPath(iconPath); myToolTipText = toolTipText; myDefaultConstraints = defaultConstraints; myPropertyName2initialValue = propertyName2initialValue; myRemovable = removable; }
private static int convertAnchor(final GridBagConstraints gbc) { switch (gbc.anchor) { case GridBagConstraints.NORTHWEST: return GridConstraints.ANCHOR_NORTHWEST; case GridBagConstraints.NORTH: return GridConstraints.ANCHOR_NORTH; case GridBagConstraints.NORTHEAST: return GridConstraints.ANCHOR_NORTHEAST; case GridBagConstraints.EAST: return GridConstraints.ANCHOR_EAST; case GridBagConstraints.SOUTHEAST: return GridConstraints.ANCHOR_SOUTHEAST; case GridBagConstraints.SOUTH: return GridConstraints.ANCHOR_SOUTH; case GridBagConstraints.SOUTHWEST: return GridConstraints.ANCHOR_SOUTHWEST; default: return GridConstraints.ANCHOR_WEST; } }
private static void addNewGridConstraints(final FormSourceCodeGenerator generator, final LwComponent component) { final GridConstraints constraints = component.getConstraints(); generator.startConstructor(GridConstraints.class.getName()); generator.push(constraints.getRow()); generator.push(constraints.getColumn()); generator.push(constraints.getRowSpan()); generator.push(constraints.getColSpan()); generator.push(constraints.getAnchor(), myAnchors); generator.push(constraints.getFill(), myFills); pushSizePolicy(generator, constraints.getHSizePolicy()); pushSizePolicy(generator, constraints.getVSizePolicy()); generator.newDimensionOrNull(constraints.myMinimumSize); generator.newDimensionOrNull(constraints.myPreferredSize); generator.newDimensionOrNull(constraints.myMaximumSize); generator.push(constraints.getIndent()); generator.push(constraints.isUseParentLayout()); generator.endConstructor(); }
protected void setValueImpl(final RadComponent component, final Integer value) throws Exception { int anchorMask = myHorizontal ? 0x0C : 3; int fillMask = myHorizontal ? 1 : 2; int anchor = 0; int fill = 0; switch(value.intValue()) { case GridConstraints.ALIGN_FILL: fill = myHorizontal ? GridConstraints.FILL_HORIZONTAL : GridConstraints.FILL_VERTICAL; break; case GridConstraints.ALIGN_LEFT: anchor = myHorizontal ? GridConstraints.ANCHOR_WEST : GridConstraints.ANCHOR_NORTH; break; case GridConstraints.ALIGN_RIGHT: anchor = myHorizontal ? GridConstraints.ANCHOR_EAST : GridConstraints.ANCHOR_SOUTH; break; } GridConstraints gc = component.getConstraints(); GridConstraints oldGC = (GridConstraints) gc.clone(); gc.setAnchor((gc.getAnchor() & ~anchorMask) | anchor); gc.setFill((gc.getFill() & ~fillMask) | fill); AlignPropertyProvider provider = getAlignPropertyProvider(component); if (provider != null) { provider.setAlignment(component, myHorizontal, value.intValue()); } component.fireConstraintsChanged(oldGC); }
protected void customize(@NotNull final Integer value) { final int policy=value.intValue(); myBuffer.setLength(0); if((policy & GridConstraints.SIZEPOLICY_CAN_SHRINK) != 0){ myBuffer.append(UIDesignerBundle.message("property.can.shrink")); } if((policy & GridConstraints.SIZEPOLICY_CAN_GROW) != 0){ if(myBuffer.length()>0){ myBuffer.append(", "); } myBuffer.append(UIDesignerBundle.message("property.can.grow")); } if((policy & GridConstraints.SIZEPOLICY_WANT_GROW) != 0){ if(myBuffer.length()>0){ myBuffer.append(", "); } myBuffer.append(UIDesignerBundle.message("property.want.grow")); } if(policy==GridConstraints.SIZEPOLICY_FIXED){ myBuffer.append(UIDesignerBundle.message("property.fixed")); } setText(myBuffer.substring(0, myBuffer.length())); // [jeka] important! do not use toString() on the StringBuffer that is reused }
@Override public void processDrop(final GuiEditor editor, final RadComponent[] components, final GridConstraints[] constraintsToAdjust, final ComponentDragObject dragObject) { RadAbstractGridLayoutManager gridLayout = myContainer.getGridLayoutManager(); if (myContainer.getGridRowCount() == 0) { gridLayout.insertGridCells(myContainer, 0, true, true, true); } if (myContainer.getGridColumnCount() == 0) { gridLayout.insertGridCells(myContainer, 0, false, true, true); } dropIntoGrid(myContainer, components, myRow, myColumn, dragObject); FormLayout formLayout = (FormLayout) myContainer.getDelegee().getLayout(); if (myXPart == 0) { formLayout.setColumnSpec(1, new ColumnSpec("d")); } else if (myXPart == 2) { gridLayout.insertGridCells(myContainer, 0, false, true, true); } if (myYPart == 0) { formLayout.setRowSpec(1, new RowSpec("d")); } else if (myYPart == 2) { gridLayout.insertGridCells(myContainer, 0, true, true, true); } }
private void adjustDeletedCellOrigins(final RadContainer grid, final int cellIndex, final boolean isRow) { int gapCellDelta = isGapCell(grid, isRow, cellIndex+1) ? 2 : 1; for(RadComponent component: grid.getComponents()) { // ensure that we don't have component origins in the deleted cells final GridConstraints gc = component.getConstraints(); if (gc.getCell(isRow) == cellIndex) { final int span = gc.getSpan(isRow); if (span > gapCellDelta) { gc.setCell(isRow, cellIndex+gapCellDelta); gc.setSpan(isRow, span -gapCellDelta); updateConstraints(component); } else { throw new IllegalArgumentException("Attempt to delete grid row/column which contains origins of 1-span components"); } } } }
private static void selectComponentsInRange(final RadComponent component, final RadComponent anchor) { final GridConstraints c1 = component.getConstraints(); final GridConstraints c2 = anchor.getConstraints(); int startRow = Math.min(c1.getRow(), c2.getRow()); int startCol = Math.min(c1.getColumn(), c2.getColumn()); int endRow = Math.max(c1.getRow() + c1.getRowSpan(), c2.getRow() + c2.getRowSpan()); int endCol = Math.max(c1.getColumn() + c1.getColSpan(), c2.getColumn() + c2.getColSpan()); for(int row=startRow; row<endRow; row++) { for(int col=startCol; col<endCol; col++) { RadComponent c = anchor.getParent().getComponentAtGrid(row, col); if (c != null) { c.setSelected(true); } } } }
private void addVmEditor(String template) { EditorFactory factory = EditorFactory.getInstance(); Document velocityTemplate = factory.createDocument(template); editor = factory.createEditor(velocityTemplate, null, FileTypeManager.getInstance() .getFileTypeByExtension("vm"), false); 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); editorPane.add(editor.getComponent(), constraints); }
private void InitViews() { setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1)); taskDetailPane = new TaskDetailPane(runTasksModel); add(taskDetailPane, new GridConstraints(0, 0, 1, 1, 0, 3, 1|2, 1|2, null, null, null, 0, false)); InitOrderListTable(); }
/** * 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, 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(6, 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)); titleField = new JTextField(); panel3.add(titleField, 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)); defaultExpressionField = new JTextField(); panel3.add(defaultExpressionField, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JLabel label1 = new JLabel(); label1.setText("Наименование параметра"); panel3.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)); final JLabel label2 = new JLabel(); label2.setText("Тип параметра"); panel3.add(label2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label3 = new JLabel(); label3.setText("Значение параметра по умолчанию"); panel3.add(label3, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel3.add(typeBox, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); }
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL */ private void $$$setupUI$$$() { loadForm = new JPanel(); loadForm.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); loadReportButton = new JButton(); loadReportButton.setText("Загрузить отчет"); loadForm.add(loadReportButton, new GridConstraints(1, 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)); createReportButton = new JButton(); createReportButton.setText("Создать новый отчет"); loadForm.add(createReportButton, 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)); }
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL */ private void $$$setupUI$$$() { autoReplyConfigFormJPanel = new JPanel(); autoReplyConfigFormJPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); final JLabel label1 = new JLabel(); label1.setText("此窗体暂未实现"); autoReplyConfigFormJPanel.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)); }
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL */ private void $$$setupUI$$$() { loginFormJPanel = new JPanel(); loginFormJPanel.setLayout(new GridLayoutManager(4, 4, new Insets(5, 5, 5, 5), -1, -1)); final JLabel label1 = new JLabel(); label1.setText("Cookies:"); loginFormJPanel.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)); final JLabel label2 = new JLabel(); label2.setText("PS2: Only support login by cookies yet."); loginFormJPanel.add(label2, new GridConstraints(2, 1, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label3 = new JLabel(); label3.setText("PS1: Cookies must include 'DedeUserID', 'DedeUserID__ckMd5', 'SESSDATA'."); loginFormJPanel.add(label3, new GridConstraints(1, 1, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); OKButton = new JButton(); OKButton.setText("OK"); loginFormJPanel.add(OKButton, new GridConstraints(3, 3, 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 JScrollPane scrollPane1 = new JScrollPane(); loginFormJPanel.add(scrollPane1, new GridConstraints(0, 1, 1, 3, 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(-1, 100), null, 0, false)); cookiesTextArea = new JTextArea(); cookiesTextArea.setLineWrap(true); scrollPane1.setViewportView(cookiesTextArea); testButton = new JButton(); testButton.setText("Test"); loginFormJPanel.add(testButton, new GridConstraints(3, 2, 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 Spacer spacer1 = new Spacer(); loginFormJPanel.add(spacer1, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); }
/** * 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, 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(4, 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 JLabel label1 = new JLabel(); label1.setFont(new Font(label1.getFont().getName(), label1.getFont().getStyle(), 36)); label1.setText("Bilibili DanMuJi"); panel3.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)); authorJLabel = new JLabel(); authorJLabel.setText("<html>Author: <a href=''>czp</a></html>"); panel3.add(authorJLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); licenseJLabel = new JLabel(); licenseJLabel.setText("<html>License: <a href=''>GNU GENERAL PUBLIC LICENSE Version 3</a></html>"); panel3.add(licenseJLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); githubJLabel.setText("<html>Github: <a href=''>https://github.com/czp3009/danmuji</a></html>"); panel3.add(githubJLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); }