List of usage examples for javax.swing BorderFactory createLineBorder
public static Border createLineBorder(Color color)
From source file:Citas.FrameCita.java
private void dibujarPanelCita(Medico medico) { min = medico.getMinutosDeAtencionxPaciente(); int horaInicio; int minInicio; int horaActual; int minActual; GridBagConstraints gbc = new GridBagConstraints(); horaInicio = medico.getHoraInicio(); horaActual = medico.getHoraInicio(); minInicio = medico.getMinInicio();// ww w . j a v a2s. c o m minActual = medico.getMinInicio(); gbc.gridx = 0; gbc.gridwidth = 1; gbc.gridheight = 1; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.fill = GridBagConstraints.BOTH; for (int i = 0; i < medico.getCitasPorDia(); i++) { minActual += medico.getMinutosDeAtencionxPaciente(); if (minActual == 60) { horaActual += 1; minActual = 0; } gbc.gridy = i + 1; System.out.print(String.format("%02d", horaInicio)); citas[i] = new Citas( ("" + String.format("%02d", horaInicio) + ":" + String.format("%02d", minInicio) + " - " + String.format("%02d", horaActual) + ":" + String.format("%02d", minActual)), ("" + String.format("%02d", horaInicio) + ":" + String.format("%02d", minInicio) + ":" + String.format("%02d", 0))); citas[i].setBorder(BorderFactory.createLineBorder(Color.black)); citas[i].setOpaque(true); citas[i].addMouseListener(new MouseListener() { @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mouseClicked(MouseEvent e) { fechaJ.setText(jCalendar1.getDate().toString()); fechaJ.setEnabled(true); acciones(null); } }); PanelCita.add(citas[i], gbc); System.out.print(i); horaInicio = horaActual; minInicio = minActual; } }
From source file:ca.sqlpower.wabit.swingui.chart.ChartPanel.java
private void buildUI() { // First level in the panel has only 2 rows of 1 column panel.setLayout(new MigLayout("fill", "[grow, fill]", "[shrink]10[grow, fill]")); panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.GRAY), BorderFactory.createEmptyBorder(5, 5, 5, 5))); // Now we build the upper part. // The "data" section. JPanel topPanel = new JPanel(new MigLayout("fill", "[115]10[fill, grow]", "[]10[]10[400]")); JLabel dataCategoryLabel = new JLabel("Data"); dataCategoryLabel.setFont(dataCategoryLabel.getFont().deriveFont(Font.BOLD)); topPanel.add(dataCategoryLabel, "span, wrap"); topPanel.add(new JLabel("Data source"), "gapleft 15"); topPanel.add(queryComboBox, "wrap"); JScrollPane tableScrollPane = new JScrollPane(resultTable); topPanel.add(headerLegendContainer, "gapleft 15, aligny top"); topPanel.add(tableScrollPane);//from w ww .j av a 2 s. c o m panel.add(topPanel, "wrap"); // Now the lower part. It has two parts. The options scrolling pane and the preview. JPanel bottomPanel = new JPanel( new MigLayout("fill, hidemode 2", "[grow]10[fill, shrinkprio 101]", "[fill]")); JLabel optionsCategoryLabel = new JLabel("Options"); optionsCategoryLabel.setFont(optionsCategoryLabel.getFont().deriveFont(Font.BOLD)); bottomPanel.add(optionsCategoryLabel); JLabel previewCategoryLabel = new JLabel("Preview"); previewCategoryLabel.setFont(previewCategoryLabel.getFont().deriveFont(Font.BOLD)); bottomPanel.add(previewCategoryLabel, "wrap"); JScrollPane optionsScrollPane = new JScrollPane(buildChartPrefsPanel(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); optionsScrollPane.setBorder(null); bottomPanel.add(optionsScrollPane, "push, gapleft 15"); JPanel chartAndErrorPanel = new JPanel(new BorderLayout()); chartAndErrorPanel.add(chartError, BorderLayout.NORTH); chartAndErrorPanel.add(chartPanel, BorderLayout.CENTER); bottomPanel.add(chartAndErrorPanel, "width 100%, alignx left, gapleft 15"); panel.add(bottomPanel, "height 100%"); toolBarBuilder.add(refreshDataAction); toolBarBuilder.add(revertToDefaultsAction); //Since the first button on the tool bar will be displayed this size will be the //same as the font size of a displayed button. If the button wasn't being displayed //the font size ends up incorrect float fontSize = toolBarBuilder.getToolbar().getComponentAtIndex(0).getFont().getSize(); toolBarBuilder.addSeparator(); toolBarBuilder.add(makeChartTypeButton("Bar", ChartType.BAR, BAR_CHART_ICON, fontSize)); toolBarBuilder.add(makeChartTypeButton("Pie", ChartType.PIE, PIE_CHART_ICON, fontSize)); toolBarBuilder .add(makeChartTypeButton("Category Line", ChartType.CATEGORY_LINE, LINE_CHART_ICON, fontSize)); toolBarBuilder.addSeparator(); toolBarBuilder.add(makeChartTypeButton("Line", ChartType.LINE, LINE_CHART_ICON, fontSize)); toolBarBuilder.add(makeChartTypeButton("Scatter", ChartType.SCATTER, SCATTER_CHART_ICON, fontSize)); }
From source file:org.genedb.jogra.plugins.TermRationaliser.java
private Box createRationaliserPanel(final String name, final RationaliserJList rjlist) { int preferredHeight = 500; //change accordingly int preferredWidth = 500; Toolkit tk = Toolkit.getDefaultToolkit(); Dimension size = tk.getScreenSize(); int textboxHeight = 10; //change accordingly int textboxWidth = size.width; Box box = Box.createVerticalBox(); box.add(new JLabel(name)); JTextField searchField = new JTextField(20); //Search field on top /* We don't want this textfield's height to expand when * the Rationaliser is dragged to exapnd. So we set it's * height to what we want and the width to the width of * the screen //from ww w. j a va 2s. co m */ searchField.setMaximumSize(new Dimension(textboxWidth, textboxHeight)); rjlist.installJTextField(searchField); box.add(searchField); JScrollPane scrollPane = new JScrollPane(); //scroll pane scrollPane.setViewportView(rjlist); scrollPane.setPreferredSize(new Dimension(preferredWidth, preferredHeight)); box.add(scrollPane); TitledBorder sysidBorder = BorderFactory.createTitledBorder("Systematic IDs"); //systematic ID box sysidBorder.setTitleColor(Color.DARK_GRAY); final JTextArea idField = new JTextArea(1, 1); idField.setMaximumSize(new Dimension(textboxWidth, textboxHeight)); idField.setEditable(false); idField.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY)); idField.setForeground(Color.DARK_GRAY); JScrollPane scroll = new JScrollPane(idField); scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); Box sysidBox = Box.createVerticalBox(); sysidBox.add(scroll /*idField*/); sysidBox.setBorder(sysidBorder); box.add(sysidBox); rjlist.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { Term highlightedTerm = (Term) rjlist.getSelectedValue(); if (highlightedTerm != null) { /* For each list, call the relevant methods * to get the systematic IDs. Then for the * right list, add the term name in the * text box below */ if (name.equals(FROM_LIST_NAME)) { idField.setText(StringUtils.collectionToCommaDelimitedString( termService.getSystematicIDs(highlightedTerm, selectedTaxons))); } else if (name.equals(TO_LIST_NAME)) { idField.setText(StringUtils.collectionToCommaDelimitedString( termService.getSystematicIDs(highlightedTerm, null))); /* We allow the user to edit the term name */ textField.setText(highlightedTerm.getName()); } } } }); return box; }
From source file:app.RunApp.java
/** * Initializes the default configuration of the app *//*from w w w . j a v a 2 s .c om*/ private void initConfig() { /* * Preprocess */ buttonGroup1.add(radioRandomHoldout); radioRandomHoldout.setToolTipText("Split the dataset into random train and test files"); textRandomHoldout.setToolTipText("Percentage of train instances"); buttonGroup1.add(radioIterativeStratifiedHoldout); radioIterativeStratifiedHoldout .setToolTipText("Split the dataset into train and test files by Iterative stratified method"); textIterativeStratifiedHoldout.setToolTipText("Percentage of train instances"); buttonGroup1.add(radioLPStratifiedHoldout); radioLPStratifiedHoldout .setToolTipText("Split the dataset into train and test files by Label Powerset stratified method"); textLPStratifiedHoldout.setToolTipText("Percentage of train instances"); buttonGroup1.add(radioRandomCV); radioRandomCV.setToolTipText("Generates random cross-validation files for selected number of folds"); textRandomCV.setToolTipText("Number of folds for cross-validation"); buttonGroup1.add(radioIterativeStratifiedCV); radioIterativeStratifiedCV.setToolTipText( "Generates Iterative stratified cross-validation files for selected number of folds"); textIterativeStratifiedCV.setToolTipText("Number of folds for cross-validation"); buttonGroup1.add(radioLPStratifiedCV); radioLPStratifiedCV.setToolTipText( "Generates Label Powerset stratified cross-validation files for selected number of folds"); textLPStratifiedCV.setToolTipText("Number of folds for cross-validation"); buttonGroup1.add(radioNoSplit); radioNoSplit.setToolTipText("Not generate any partition of the dataset"); buttonGroup2.add(radioBRFS); radioBRFS.setToolTipText("Feature selection by Binary Relevance Feature Selection method"); textBRFS.setToolTipText("Number of features to select"); labelBRFSComb.setToolTipText("Combiantion approach mode"); jComboBoxBRFSComb.setToolTipText("<html>Combiantion approach mode: <br>" + "max: maximum <br>" + "avg: average <br>" + "min: minumum </html>"); labelBRFSNorm.setToolTipText("Normalization mode"); jComboBoxBRFSNorm.setToolTipText("<html>Normalization mode: <br>" + "dl: divide by length <br>" + "dm: divide by maximum <br>" + "none: no normalization </html>"); labelBRFSOut.setToolTipText("Scoring mode"); jComboBoxBRFSOut.setToolTipText( "<html>Scoring mode: <br>" + "eval: evaluation score <br>" + "rank: ranking score </html>"); buttonGroup2.add(radioRandomFS); radioRandomFS.setToolTipText("Random selection of the features"); textRandomFS.setToolTipText("Number of features to select"); buttonGroup2.add(radioNoFS); radioNoFS.setToolTipText("No feature selection is done"); jButtonStartPreprocess.setToolTipText("Start preprocessing"); jButtonSaveDatasets.setToolTipText("Save dataset files in a folder"); jComboBoxSaveFormat.setToolTipText("Select Mulan or Meka format to save datasets"); buttonGroup3.add(radioNoIS); radioNoIS.setToolTipText("No instance selection is done"); buttonGroup3.add(radioRandomIS); radioRandomIS.setToolTipText("Random selection of the instances"); textRandomIS.setToolTipText("Number of instances to select"); radioRandomHoldout.setSelected(true); radioNoFS.setSelected(true); radioNoIS.setSelected(true); textRandomHoldout.setEnabled(true); textRandomHoldout.setEnabled(true); textIterativeStratifiedHoldout.setEnabled(false); textRandomCV.setEnabled(false); textIterativeStratifiedCV.setEnabled(false); /* * Transformations */ radioBRTrans.setSelected(true); buttonGroup4.add(radioBRTrans); radioBRTrans.setToolTipText("Generates a binary dataset for each label"); buttonGroup4.add(radioLPTrans); radioLPTrans.setToolTipText( "Generates a multi-class dataset where each class is each one of the labelsets in the MLDataset"); buttonGroup4.add(radioIncludeLabelsTrans); radioIncludeLabelsTrans.setToolTipText( "<html>Generates a binary dataset, replicating the instance, where each one is augmented <br> with a label name and the class indicates if the label was associated or not</html>"); radioIncludeLabelsTrans.setToolTipText( "<html>Generates a binary dataset where each instance is replicated as many times as the number of labels.<br>" + "Each new instance is augmented with a label name and the class indicates if the label was associated or not.</html>"); buttonGroup4.add(radioRemoveLabelsTrans); radioRemoveLabelsTrans.setToolTipText("Remove all the labels of the dataset"); jButtonStartTrans.setToolTipText("Start transformation"); jButtonSaveDatasetsTrans.setToolTipText("Save dataset files in a folder"); /* * Dependences */ buttonShowCoOcurrence.setToolTipText("Show graph with labels selected in table"); buttonShowMostFrequent.setToolTipText("Show graph with n most frequent labels"); textMostFrequent.setToolTipText("Number of most frequent labels to show"); buttonShowMostRelated.setToolTipText("Show graph with n most related labels"); textMostRelated.setToolTipText("Number of most related labels to show"); buttonShowMostFrequentURelated .setToolTipText("Show graph with n most frequent union n most related labels"); textMostFrequentURelated.setToolTipText("Show graph with n most frequent union n most related labels"); buttonShowHeatMap.setToolTipText("Show heatmap with labels selected in table"); buttonShowMostFrequentHeatMap.setToolTipText("Show heatmap with n most frequent labels"); textMostFrequentHeatMap.setToolTipText("Number of most frequent labels to show"); buttonShowMostRelatedHeatMap.setToolTipText("Show heatmap with n most related labels"); textMostRelatedHeatMap.setToolTipText("Number of most related labels to show"); buttonShowMostFrequentURelatedHeatMap .setToolTipText("Show heatmap with n most frequent union n most related labels"); textMostFrequentURelatedHeatMap .setToolTipText("Show graph with n most frequent union n most related labels"); jTableChiPhi = setChiPhiTableHelp(jTableChiPhi); jTableCoocurrences = setCoocurrenceTableHelp(jTableCoocurrences); jTableHeatmap = setHeatmapTableHelp(jTableHeatmap); initChiPhiJTable(); //Config jTable Co-ocurrence values jTableCoocurrences.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); JScrollPane scrollPane = new JScrollPane(jTableCoocurrences, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setBounds(20, 20, 780, 390); jTableCoocurrences.setBorder(BorderFactory.createLineBorder(Color.black)); panelCoOcurrenceValues.add(scrollPane, BorderLayout.CENTER); //Config jTable heatmap values jTableHeatmap.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); scrollPane = new JScrollPane(jTableHeatmap, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setBounds(20, 20, 780, 390); jTableHeatmap.setBorder(BorderFactory.createLineBorder(Color.black)); panelHeatmapValues.add(scrollPane, BorderLayout.CENTER); createButtonExportDependencesTable(jTableChiPhi, fixedTableChiPhi, panelChiPhi, exportChiPhiTable, 710, 415, "ChiPhi"); // chiLabel and phiLabel values createButtonExportDependencesTable(jTableCoocurrences, fixedTableCoocurrences, panelCoOcurrenceValues, exportCoocurrenceTable, 710, 415, "Coocurrence");//graph values createButtonExportDependencesTable(jTableHeatmap, fixedTableHeatmap, panelHeatmapValues, exportHeatmapTable, 710, 415, "Heatmap");//heatmap values createButtonExportDependencesChart(panelCoOcurrence, exportCoocurrenceGraph, 720, 440); createButtonExportDependencesChart(panelHeatmapGraph, exportHeatmapGraph, 720, 440); Border border = BorderFactory.createLineBorder(Color.gray, 1); panelHeatmap.setBorder(border); jTableChiPhi.setBorder(border); jTableCoocurrences.setBorder(border); jTableHeatmap.setBorder(border); /* * Charts */ labelFrequencyChart = createJChart(panelExamplesPerLabel, "bar", "Frequency", "Labels", false, "Label frequency"); labelsetsFrequencyChart = createJChart(panelExamplesPerLabelset, "bar", "Frequency", "Labelsets", false, "Labelset frequency"); labelsHistogramChart = createJChart(panelLabelsPerExample, "bar", "Frequency", "Number of labels", false, "Labels histogram"); labelsBoxDiagram = createGraph(panelBoxDiagram); attributesBoxDiagram2 = createGraph(panelBoxDiagramAtt); IRInterClassChart = createJChart(panelIRperLabelInterClass, "bar", "IR inter-class", "Labels", false, "IR inter class"); IRIntraClassChart = createJChart(panelIRperLabelIntraClass, "bar", "IR intra-class", "Labels", false, "IR intra class"); IRLabelsetsChart = createJChart(panelIRperLabelset, "bar", "IR", "Labelsets", false, "IR per labelset"); jLabelIR.setVisible(false); /* * Metrics */ jTablePrincipal = setMetricsHelp(jTablePrincipal); createMetricsTable(jTablePrincipal, panelSummary, buttonAll, buttonNone, buttonInvert, buttonCalculate, buttonSave, buttonClear, 30, 190, 780, 280); //tab Database //35,155,500,355 jTableMulti = setMetricsHelp(jTableMulti); createMultiMetricsTable(jTableMulti, jPanelMulti, buttonAll, buttonNone, buttonInvert, buttonCalculate, buttonSave, 25, 15, 510, 420); //tab Multi jButtonSaveDatasets.setEnabled(false); jComboBoxSaveFormat.setEnabled(false); /* * Progress bar */ progressBar = new JProgressBar(0, 100); progressBar.setValue(0); progressFrame = new JFrame(); progressFrame.setBounds(this.getX() + this.getWidth() / 2 - 100, this.getY() + this.getHeight() / 2 - 15, 200, 30); progressFrame.setResizable(false); progressFrame.setUndecorated(true); progressFrame.add(progressBar); //Default tab TabPrincipal.setEnabledAt(1, false); TabPrincipal.setEnabledAt(2, false); TabPrincipal.setEnabledAt(3, false); TabPrincipal.setEnabledAt(4, false); TabPrincipal.setEnabledAt(5, false); TabPrincipal.setEnabledAt(6, true); //Multiple datasets table enabled TabPrincipal.setEnabledAt(7, false); }
From source file:org.datanucleus.ide.idea.ui.DNEConfigForm.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL//from ww w. j a va 2 s. c om */ private void $$$setupUI$$$() { createUIComponents(); parentPanel.setLayout(new GridLayoutManager(2, 1, new Insets(1, 0, 0, 0), -1, -1)); configTabbedPane = new JTabbedPane(); parentPanel.add(configTabbedPane, new GridConstraints(1, 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)); configPanel = new JPanel(); configPanel.setLayout(new GridLayoutManager(5, 3, new Insets(6, 2, 2, 2), -1, -1)); configTabbedPane.addTab("Enhancer", configPanel); indexNotReadyPanel = new JPanel(); indexNotReadyPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); configPanel.add(indexNotReadyPanel, new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); final JLabel label1 = new JLabel(); label1.setText("Please wait until indexing is finished"); indexNotReadyPanel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); contentPanel = new JPanel(); contentPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1)); configPanel.add(contentPanel, new GridConstraints(4, 0, 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, null, null, 0, false)); final JPanel panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.add(panel1, 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)); panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-3355444)), "Affected Modules")); final JScrollPane scrollPane1 = new JScrollPane(); panel1.add(scrollPane1, 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)); affectedModulesTable = new JTable(); affectedModulesTable.setEnabled(true); affectedModulesTable.setFillsViewportHeight(false); affectedModulesTable.setPreferredScrollableViewportSize(new Dimension(450, 30)); scrollPane1.setViewportView(affectedModulesTable); final JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.add(panel2, 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)); panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-3355444)), "Metadata and annotated classes for enhancement", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, new Color(-16777216))); infoPanel = new JPanel(); infoPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); panel2.add(infoPanel, 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 label2 = new JLabel(); label2.setText("Please click 'Make Project' to see affected files"); infoPanel.add(label2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); metaDataAndClassesScrollPane = new JScrollPane(); panel2.add(metaDataAndClassesScrollPane, 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)); metadataAndClassesTable = new JTable(); metadataAndClassesTable.setFillsViewportHeight(false); metadataAndClassesTable.setFont(new Font(metadataAndClassesTable.getFont().getName(), metadataAndClassesTable.getFont().getStyle(), metadataAndClassesTable.getFont().getSize())); metadataAndClassesTable.setPreferredScrollableViewportSize(new Dimension(450, 100)); metaDataAndClassesScrollPane.setViewportView(metadataAndClassesTable); modifiersPanel = new JPanel(); modifiersPanel.setLayout(new GridLayoutManager(2, 3, new Insets(0, 2, 0, 0), -1, -1)); configPanel.add(modifiersPanel, new GridConstraints(1, 0, 2, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label3 = new JLabel(); label3.setText(" Metadata file extensions (use ';' to separate)"); modifiersPanel.add(label3, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); includeTestClassesCheckBox = new JCheckBox(); includeTestClassesCheckBox.setText("Include Test classes"); modifiersPanel.add(includeTestClassesCheckBox, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); metadataExtensionTextField.setAlignmentX(0.5f); metadataExtensionTextField.setAutoscrolls(true); metadataExtensionTextField.setMargin(new Insets(1, 1, 1, 1)); modifiersPanel.add(metadataExtensionTextField, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); addToCompilerResourceCheckBox = new JCheckBox(); addToCompilerResourceCheckBox.setText("Add to compiler resource patterns"); modifiersPanel.add(addToCompilerResourceCheckBox, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); dependenciesPanel = new JPanel(); dependenciesPanel.setLayout(new GridLayoutManager(3, 1, new Insets(6, 2, 2, 2), -1, -1)); configTabbedPane.addTab("Dependencies", dependenciesPanel); final JPanel panel3 = new JPanel(); panel3.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), 5, 5)); dependenciesPanel.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); depProjectModuleRadioButton.setText("Project Module Dependencies"); panel3.add(depProjectModuleRadioButton, new GridConstraints(0, 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)); depManualRadioButton.setText("Manual Dependencies"); panel3.add(depManualRadioButton, 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)); final Spacer spacer1 = new Spacer(); panel3.add(spacer1, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); depManualUnsupportedLabel = new JLabel(); depManualUnsupportedLabel.setText("(Not supported by plugin extension)"); panel3.add(depManualUnsupportedLabel, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); manualDependenciesDisabledInfoPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); dependenciesPanel.add(manualDependenciesDisabledInfoPanel, 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)); final JLabel label4 = new JLabel(); label4.setHorizontalAlignment(0); label4.setHorizontalTextPosition(0); label4.setText("Using Enhancer and it's Dependencies from Project Module"); manualDependenciesDisabledInfoPanel.add(label4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); dependenciesPanel.add(dependenciesAddDeletePanel, new GridConstraints(2, 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)); generalPanel = new JPanel(); generalPanel.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); parentPanel.add(generalPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); enableEnhancerCheckBox = new JCheckBox(); enableEnhancerCheckBox.setText("Enable Enhancer"); generalPanel.add(enableEnhancerCheckBox, new GridConstraints(0, 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)); final JPanel panel4 = new JPanel(); panel4.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1)); generalPanel.add(panel4, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false)); jDORadioButton.setText("JDO"); panel4.add(jDORadioButton, new GridConstraints(0, 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)); jPARadioButton = new JRadioButton(); jPARadioButton.setText("JPA"); panel4.add(jPARadioButton, 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)); final Spacer spacer2 = new Spacer(); panel4.add(spacer2, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); generalPanel.add(persistenceImplComboBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); ButtonGroup buttonGroup; buttonGroup = new ButtonGroup(); buttonGroup.add(jDORadioButton); buttonGroup.add(jPARadioButton); buttonGroup = new ButtonGroup(); buttonGroup.add(depProjectModuleRadioButton); buttonGroup.add(depManualRadioButton); }
From source file:org.forester.archaeopteryx.ControlPanel.java
void addJButton(final JButton jb, final JPanel p) { jb.setFocusPainted(false);/*from w ww . j a va 2s .com*/ jb.setFont(ControlPanel.jcb_font); if (!_configuration.isUseNativeUI()) { jb.setBorder(BorderFactory.createLineBorder(ControlPanel.button_border_color)); jb.setBackground(ControlPanel.button_background_color); jb.setForeground(ControlPanel.button_text_color); } p.add(jb); jb.addActionListener(this); }
From source file:org.biojava.bio.view.MotifAnalyzer.java
/** * /*from ww w. ja v a 2 s.c o m*/ * @param f1 sequence file * @param motifs list of motifs to display */ public void showMotifs(SequenceIterator seqItr, List<Motif> motifs) { seqViewerTab.removeAll(); seqViewerTab.setLayout(new BorderLayout()); try { Vector<Sequence> seqs = new Vector<Sequence>(); Set<MotifFinder> finders = new HashSet<MotifFinder>(); while (seqItr.hasNext()) seqs.add(seqItr.nextSequence()); // labels panel JPanel labelPanel = new JPanel(); seqViewerTab.add(labelPanel, BorderLayout.NORTH); // Sequence panels array JPanel seqViewer = new JPanel(new GridLayout(seqs.size(), 1)); seqViewerTab.add(seqViewer, BorderLayout.CENTER); SequencePanel[] seqPanel = new SequencePanel[seqs.size()]; GridLayout seqPanelLayout = new GridLayout(2, 1); seqPanelLayout.setColumns(1); seqPanelLayout.setHgap(5); seqPanelLayout.setVgap(5); seqPanelLayout.setRows(2); int i = 0; for (Iterator<Sequence> itr = seqs.iterator(); itr.hasNext(); i++) { Sequence sourceSeq = itr.next(); String name = sourceSeq.getName().substring(sourceSeq.getName().indexOf("_") + 1); seqPanel[i] = new SequencePanel(); seqPanel[i].setLayout(seqPanelLayout); int num = 0; String[] f = new String[motifs.size()]; for (Iterator<Motif> m = motifs.iterator(); m.hasNext();) { Motif motif = m.next(); if (motif.getSites().get(name) == null) continue; for (Iterator<Site> itr2 = motif.getSites().get(name).iterator(); itr2.hasNext();) { Site seq = itr2.next(); finders.add(motif.getFinder()); seq.location = new RangeLocation(sourceSeq.length() + seq.location.getMin(), sourceSeq.length() + seq.location.getMax()); seq.type = motif.getFinder().name() + "_" + num; sourceSeq.createFeature(seq); } f[num] = motif.getFinder().name() + "_" + num; num++; } seqPanel[i].setSequence(sourceSeq); seqPanel[i].setRange(new RangeLocation(1, sourceSeq.length())); // Magic number from EmblViewer seqPanel[i].setScale(Math.exp(-INITIAL_SCALE / 7.0) * 20.0); seqPanel[i].setDirection(SequencePanel.HORIZONTAL); OptimizableFilter[] optFilter = new OptimizableFilter[num];//MotifFinder.values().length]; FeatureBlockSequenceRenderer[] renderer = new FeatureBlockSequenceRenderer[num];//MotifFinder.values().length]; for (int k = 0; k < num; k++)//MotifFinder.values().length; k++) { optFilter[k] = new FeatureFilter.ByType(f[k]);//MotifFinder.values()[k].name()); renderer[k] = new FeatureBlockSequenceRenderer(new RectangularBeadRenderer(10.0f, 5.0f, Color.black, MotifFinder.valueOf(f[k].substring(0, f[k].indexOf('_'))).color, new BasicStroke())); } MultiLineRenderer multi = new MultiLineRenderer(); for (int k = 0; k < renderer.length; k++) multi.addRenderer(new FilteringRenderer(renderer[k], optFilter[k], false)); multi.addRenderer(new SymbolSequenceRenderer()); multi.addRenderer(new RulerRenderer()); seqPanel[i].setRenderer(multi); seqPanel[i].setEnabled(false); JScrollPane seqScroll = new JScrollPane(seqPanel[i]); JPanel temp = new JPanel(new BorderLayout()); temp.add(getControlBox(seqPanel[i], sourceSeq.getName()), BorderLayout.NORTH); temp.add(seqScroll, BorderLayout.CENTER); seqViewer.add(temp); } for (Iterator<MotifFinder> itr = finders.iterator(); itr.hasNext();) { MotifFinder finder = itr.next(); // Add label of this MotifFinder labelPanel.add(new JLabel(finder.name())); JLabel l = new JLabel(" "); l.setOpaque(true); l.setBackground(finder.color); l.setBorder(BorderFactory.createLineBorder(Color.black)); labelPanel.add(l); } mainFrame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } }
From source file:net.sourceforge.pmd.util.designer.Designer.java
private JComponent createCodeEditorPanel() { JPanel p = new JPanel(); p.setLayout(new BorderLayout()); codeEditorPane.setBorder(BorderFactory.createLineBorder(Color.black)); makeTextComponentUndoable(codeEditorPane); p.add(new JLabel("Source code:"), BorderLayout.NORTH); p.add(new JScrollPane(codeEditorPane), BorderLayout.CENTER); return p;//from w ww. j a v a 2s . c om }
From source file:nl.detoren.ijsco.ui.Mainscreen.java
public JPanel createPanelGroepen() { JPanel panel = new JPanel(); panel.setLayout(new GridLayout(1, 0)); groepenText = new JTextArea(40, 40); groepenText.setBorder(BorderFactory.createLineBorder(Color.BLACK)); groepenText.setFont(new Font("courier new", Font.PLAIN, 12)); groepenText.setLineWrap(false);//w ww . ja va2 s.co m if (status.groepen != null) { groepenText.setText(status.groepen.getDescription()); groepenText.setCaretPosition(0); } JScrollPane scrollpane = new JScrollPane(groepenText); scrollpane.setAutoscrolls(true); scrollpane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); panel.add(scrollpane); return panel; }
From source file:net.rptools.maptool.launcher.MapToolLauncher.java
private JPanel buildTroubleshootingPanel() { final JPanel p = new JPanel(); p.setLayout(new BorderLayout()); ActionListener levelChange = new ActionListener() { @Override//from w ww .j a v a2 s . c o m public void actionPerformed(ActionEvent e) { Level x = Level.parse(e.getActionCommand()); if (Level.OFF.equals(x) || Level.INFO.equals(x) || Level.WARNING.equals(x) || Level.SEVERE.equals(x)) log.setLevel(x); } }; JPanel logPanel = new JPanel(); logPanel.setLayout(new GridLayout(0, 1)); logPanel.setBorder(new TitledBorder(new LineBorder(Color.BLACK), CopiedFromOtherJars.getText("msg.logDetailPanel.border"))); //$NON-NLS-1$ logPanel.setAlignmentX(Component.LEFT_ALIGNMENT); ButtonGroup logGroup = new ButtonGroup(); for (Level type : new Level[] { Level.OFF, Level.INFO, Level.WARNING, Level.SEVERE }) { JRadioButton jrb = new JRadioButton(type.toString()); jrb.setActionCommand(type.toString()); jrb.addActionListener(levelChange); jrb.setBorder( BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.red), jrb.getBorder())); logPanel.add(jrb); logGroup.add(jrb); if (type == Level.WARNING) { jrb.setSelected(true); log.setLevel(type); } } jcbEnableAssertions.setAlignmentX(Component.LEFT_ALIGNMENT); jcbEnableAssertions.setText(CopiedFromOtherJars.getText("msg.info.enableAssertions")); //$NON-NLS-1$ jcbEnableAssertions.setToolTipText(CopiedFromOtherJars.getText("msg.tooltip.enableAssertions")); //$NON-NLS-1$ jcbEnableAssertions.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { if (!extraArgs.contains(ASSERTIONS_OPTION)) { extraArgs = (ASSERTIONS_OPTION + " " + extraArgs); //$NON-NLS-1$ } } else if (e.getStateChange() == ItemEvent.DESELECTED) { extraArgs = extraArgs.replace(ASSERTIONS_OPTION, ""); //$NON-NLS-1$ } extraArgs = extraArgs.trim(); jtfArgs.setText(extraArgs); updateCommand(); } }); p.add(logPanel, BorderLayout.NORTH); Box other = new Box(BoxLayout.PAGE_AXIS); other.add(jcbEnableAssertions); other.add(Box.createVerticalGlue()); p.add(other, BorderLayout.CENTER); return p; }