private JPanel createDescriptorAndVariablesAndPreprocessingPanel() { JPanel descriptorAndVariablesPanel = new JPanel(new SpringLayout()); descriptorAndVariablesPanel.add(createDescriptorPanel()); descriptorAndVariablesPanel.add(createVariablesPanel()); descriptorAndVariablesPanel.add(createPreProcessingPanel()); SpringUtilities.makeCompactGrid(descriptorAndVariablesPanel, 3, 1, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); return descriptorAndVariablesPanel; }
for (int r = 0; r < rows; r++) { width = Spring.max(width, getConstraintsForCell(r, c, parent, cols). getWidth()); getConstraintsForCell(r, c, parent, cols); constraints.setX(x); constraints.setWidth(width); for (int c = 0; c < cols; c++) { height = Spring.max(height, getConstraintsForCell(r, c, parent, cols). getHeight()); getConstraintsForCell(r, c, parent, cols); constraints.setY(y); constraints.setHeight(height);
private JPanel createPreProcessingTab() { JPanel preprocessAndPatternsPanel = new JPanel(new SpringLayout()); preprocessAndPatternsPanel.add(createPreProcessingPanel()); SpringUtilities.makeCompactGrid(preprocessAndPatternsPanel, 1, 1, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); preprocessAndPatternsPanel.setMaximumSize(preprocessAndPatternsPanel.getSize()); return preprocessAndPatternsPanel; }
private JPanel createDescriptorTab() { JPanel jPanel = new JPanel(new SpringLayout()); jPanel.add(createDescriptorPanel()); SpringUtilities.makeCompactGrid(jPanel, 1, 1, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); jPanel.setMaximumSize(jPanel.getSize()); return jPanel; }
private JPanel createContentPanel() { JPanel panel = new JPanel(new BorderLayout(DEFAULT_PADDING, DEFAULT_PADDING)); int panelHeight = 0; JTable propertiesPanel = createPropertiesPanel(); panelHeight += propertiesPanel.getPreferredSize().getHeight(); panel.add(propertiesPanel, BorderLayout.PAGE_START); panelHeight += 10; SpringLayout springLayout = new SpringLayout(); JPanel adaptersAndButtonsPanel = new JPanel(springLayout); JScrollPane scrollPane = new JScrollPane(createAdaptersPanel()); panelHeight += scrollPane.getPreferredSize().getHeight(); adaptersAndButtonsPanel.add(scrollPane); panelHeight += 10; JPanel buttonsPanel = createButtonsPanel(); panelHeight += buttonsPanel.getPreferredSize().getHeight(); adaptersAndButtonsPanel.add(buttonsPanel); springLayout.putConstraint(SpringLayout.NORTH, adaptersAndButtonsPanel, DEFAULT_PADDING, SpringLayout.NORTH, scrollPane); springLayout.putConstraint(SpringLayout.WEST, adaptersAndButtonsPanel, DEFAULT_PADDING, SpringLayout.WEST, scrollPane); springLayout.putConstraint(SpringLayout.EAST, adaptersAndButtonsPanel, DEFAULT_PADDING, SpringLayout.EAST, scrollPane); springLayout.putConstraint(SpringLayout.SOUTH, scrollPane, DEFAULT_PADDING, SpringLayout.NORTH, buttonsPanel); springLayout.putConstraint(SpringLayout.EAST, adaptersAndButtonsPanel, DEFAULT_PADDING, SpringLayout.EAST, buttonsPanel); springLayout.putConstraint(SpringLayout.WEST, adaptersAndButtonsPanel, DEFAULT_PADDING, SpringLayout.WEST, buttonsPanel); springLayout.putConstraint(SpringLayout.SOUTH, adaptersAndButtonsPanel, DEFAULT_PADDING, SpringLayout.SOUTH, buttonsPanel); makeCompactGrid(adaptersAndButtonsPanel, 2, 1, 0, 0, DEFAULT_PADDING, DEFAULT_PADDING); panel.add(adaptersAndButtonsPanel, BorderLayout.CENTER); JPanel sideButtonsPanel = createSideButtonsPanel(); panel.add(sideButtonsPanel, BorderLayout.LINE_END); panel.setPreferredSize(new Dimension(CHECK_COLUMN_WIDTH + LABEL_COLUMN_WIDTH + COLUMN_WIDTH - 32, panelHeight + DEFAULT_PADDING)); return panel; }
subPanel.setMaximumSize(new Dimension(subPanel.getWidth(), (int) (2.5 * controlHeight))); makeCompactGrid(subPanel, 2, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING);
@Override protected JPanel createPreProcessingPanel() { final JPanel preProcessingPanel = new JPanel(new SpringLayout()); PropertyDescriptor propertyDescriptor = propertyContainer.getDescriptor("preprocessorExternalTool"); PropertyEditor editor = PropertyEditorRegistry.getInstance().findPropertyEditor(propertyDescriptor); JComponent editorComponent = editor.createEditorComponent(propertyDescriptor, bindingContext); editorComponent.setMaximumSize(new Dimension(editorComponent.getMaximumSize().width, controlHeight)); editorComponent.setPreferredSize(new Dimension(editorComponent.getPreferredSize().width, controlHeight)); preProcessingPanel.add(createCheckboxComponent("preprocessTool", editorComponent, newOperatorDescriptor.getPreprocessTool())); preProcessingPanel.add(new JLabel(Bundle.CTL_Label_PreprocessingTool_Text())); preProcessingPanel.add(editorComponent); propertyDescriptor = propertyContainer.getDescriptor("processingWriter"); editor = PropertyEditorRegistry.getInstance().findPropertyEditor(propertyDescriptor); editorComponent = editor.createEditorComponent(propertyDescriptor, bindingContext); editorComponent.setMaximumSize(new Dimension(editorComponent.getMaximumSize().width, controlHeight)); editorComponent.setPreferredSize(new Dimension(editorComponent.getPreferredSize().width, controlHeight)); JComponent writeComponent = createCheckboxComponent("writeForProcessing", editorComponent, newOperatorDescriptor.shouldWriteBeforeProcessing()); preProcessingPanel.add(writeComponent); preProcessingPanel.add(new JLabel(Bundle.CTL_Label_WriteBefore_Text())); preProcessingPanel.add(editorComponent); TitledBorder title = BorderFactory.createTitledBorder(Bundle.CTL_Panel_PreProcessing_Border_TitleText()); preProcessingPanel.setBorder(title); SpringUtilities.makeCompactGrid(preProcessingPanel, 2, 3, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); return preProcessingPanel; }
panelToolFiles.add(editorComponent); SpringUtilities.makeCompactGrid(panelToolFiles, 2, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); checkPanel.add(new JLabel("Tool produces the name of the output product")); SpringUtilities.makeCompactGrid(checkPanel, 1, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); configPanel.add(scrollPane); SpringUtilities.makeCompactGrid(configPanel, 4, 1, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); SpringUtilities.makeCompactGrid(container, 2, 1, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING);
}); rows++; SpringUtilities.makeCompactGrid(bundlePanel, rows, 1, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); return bundlePanel;
buttonsPannel.add(addFileBtn); buttonsPannel.add(removeFileBtn); SpringUtilities.makeCompactGrid(buttonsPannel, 2, 1, 0, 0, 0, 0); SpringUtilities.makeCompactGrid(panel, 1, 2, 0, 0, 0, 0);
@Override protected JPanel createPatternsPanel() { JPanel patternsPanel = new JPanel(new SpringLayout()); patternsPanel.setBorder(BorderFactory.createTitledBorder(Bundle.CTL_Panel_OutputPattern_Border_TitleText())); TextFieldEditor textEditor = new TextFieldEditor(); addTextField(patternsPanel, textEditor, Bundle.CTL_Label_ProgressPattern(), ToolAdapterConstants.PROGRESS_PATTERN, false, null); propertyContainer.getDescriptor(ToolAdapterConstants.PROGRESS_PATTERN).setValidator(new RegexFieldValidator()); addTextField(patternsPanel, textEditor, Bundle.CTL_Label_ErrorPattern(), ToolAdapterConstants.ERROR_PATTERN, false, null); propertyContainer.getDescriptor(ToolAdapterConstants.ERROR_PATTERN).setValidator(new RegexFieldValidator()); SpringUtilities.makeCompactGrid(patternsPanel, 2, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); return patternsPanel; }
SpringUtilities.makeCompactGrid(panelToolFiles, 2, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); checkPanel.add(new JLabel("Tool produces the name of the output product")); SpringUtilities.makeCompactGrid(checkPanel, 1, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); SpringUtilities.makeCompactGrid(configPanel, 5, 1, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING);
buttonsPannel.add(addVariableButton); buttonsPannel.add(addDependentVariableButton); SpringUtilities.makeCompactGrid(buttonsPannel, 1, 2, 0, 0, 0, 0); buttonsPannel.setAlignmentX(Component.LEFT_ALIGNMENT); variablesBorderPanel.add(buttonsPannel);
preProcessingPanel.add(secondEditorComponent); SpringUtilities.makeCompactGrid(preProcessingPanel, 2, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING);
buttonsPannel.add(addVariableButton); buttonsPannel.add(addDependentVariableButton); SpringUtilities.makeCompactGrid(buttonsPannel, 1, 2, 0, 0, 0, 0); buttonsPannel.setAlignmentX(Component.LEFT_ALIGNMENT); variablesBorderPanel.add(buttonsPannel);
setPreferredSize(new Dimension((int)(screen.getWidth() / 3), (int)(screen.getHeight() / 2.5))); setMinimumSize(new Dimension(200, 200)); SpringUtilities.makeCompactGrid(processingParamPanel, 2, 1, 2, 2, 2, 2); addTab("Processing Parameters", processingParamPanel); updateTargetProductFields();
@Override protected JPanel createDescriptorPanel() { final JPanel descriptorPanel = new JPanel(new SpringLayout()); TextFieldEditor textEditor = new TextFieldEditor(); addValidatedTextField(descriptorPanel, textEditor, Bundle.CTL_Label_Alias_Text(), ToolAdapterConstants.ALIAS, "[^\\\\\\?%\\*:\\|\"<>\\./]*"); addTextField(descriptorPanel, textEditor, Bundle.CTL_Label_UniqueName_Text(), ToolAdapterConstants.NAME, true, null); addTextField(descriptorPanel, textEditor, Bundle.CTL_Label_Label_Text(), ToolAdapterConstants.LABEL, true, null); addTextField(descriptorPanel, textEditor, Bundle.CTL_Label_Version_Text(), ToolAdapterConstants.VERSION, true, null); addTextField(descriptorPanel, textEditor, Bundle.CTL_Label_Copyright_Text(), ToolAdapterConstants.COPYRIGHT, false, null); addTextField(descriptorPanel, textEditor, Bundle.CTL_Label_Authors_Text(), ToolAdapterConstants.AUTHORS, false, null); addTextField(descriptorPanel, textEditor, Bundle.CTL_Label_Description_Text(), ToolAdapterConstants.DESCRIPTION, false, null); java.util.List<String> menus = getAvailableMenuOptions(null); addComboField(descriptorPanel, Bundle.CTL_Label_MenuLocation_Text(), ToolAdapterConstants.MENU_LOCATION, menus); TitledBorder title = BorderFactory.createTitledBorder(Bundle.CTL_Panel_OperatorDescriptor_Text()); descriptorPanel.setBorder(title); SpringUtilities.makeCompactGrid(descriptorPanel, 8, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); return descriptorPanel; }
@Override protected JPanel createPatternsPanel() { JPanel patternsPanel = new JPanel(new SpringLayout()); TitledBorder titledBorder = BorderFactory.createTitledBorder(Bundle.CTL_Panel_OutputPattern_Border_TitleText()); titledBorder.setTitleJustification(TitledBorder.CENTER); patternsPanel.setBorder(titledBorder); TextFieldEditor textEditor = new TextFieldEditor(); addTextField(patternsPanel, textEditor, Bundle.CTL_Label_ProgressPattern(), ToolAdapterConstants.PROGRESS_PATTERN, false, null); propertyContainer.getDescriptor(ToolAdapterConstants.PROGRESS_PATTERN) .setValidator(new RegexFieldValidator()); addTextField(patternsPanel, textEditor, Bundle.CTL_Label_StepPattern(), ToolAdapterConstants.STEP_PATTERN, false, null); propertyContainer.getDescriptor(ToolAdapterConstants.STEP_PATTERN) .setValidator(new RegexFieldValidator()); addTextField(patternsPanel, textEditor, Bundle.CTL_Label_ErrorPattern(), ToolAdapterConstants.ERROR_PATTERN, false, null); propertyContainer.getDescriptor(ToolAdapterConstants.ERROR_PATTERN) .setValidator(new RegexFieldValidator()); SpringUtilities.makeCompactGrid(patternsPanel, 3, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); return patternsPanel; }
SpringUtilities.makeCompactGrid(descriptorPanel, 9, 2, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING, DEFAULT_PADDING); return descriptorPanel;
makeCompactGrid(panel, 4, 1, 0, 0, DEFAULT_PADDING, DEFAULT_PADDING); return panel;