Java Code Examples for java.awt.FlowLayout#LEADING
The following examples show how to use
java.awt.FlowLayout#LEADING .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SearchPanelProvider.java From lucene-solr with Apache License 2.0 | 6 votes |
private JPanel initSearchResultsTablePane() { JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); JPanel note = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 2)); note.setOpaque(false); note.add(new JLabel(MessageUtils.getLocalizedMessage("search.label.results.note"))); panel.add(note, BorderLayout.PAGE_START); TableUtils.setupTable(resultsTable, ListSelectionModel.SINGLE_SELECTION, new SearchResultsTableModel(), new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { listeners.showContextMenuInResultsTable(e); } }, SearchResultsTableModel.Column.DOCID.getColumnWidth(), SearchResultsTableModel.Column.SCORE.getColumnWidth()); JScrollPane scrollPane = new JScrollPane(resultsTable); panel.add(scrollPane, BorderLayout.CENTER); return panel; }
Example 2
Source File: ExportTermsDialogFactory.java From lucene-solr with Apache License 2.0 | 6 votes |
private JPanel destinationDirPanel() { JPanel panel = new JPanel(new GridLayout(2, 1)); panel.setOpaque(false); panel.add(new JLabel(MessageUtils.getLocalizedMessage("export.terms.label.output_path"))); JPanel inputPanel = new JPanel(new FlowLayout(FlowLayout.LEADING)); inputPanel.setBorder(BorderFactory.createEmptyBorder()); inputPanel.setOpaque(false); destDir.setText(System.getProperty("user.home")); destDir.setColumns(60); destDir.setPreferredSize(new Dimension(200, 30)); destDir.setFont(StyleConstants.FONT_MONOSPACE_LARGE); destDir.setEditable(false); destDir.setBackground(Color.white); inputPanel.add(destDir); JButton browseBtn = new JButton(MessageUtils.getLocalizedMessage("export.terms.button.browse")); browseBtn.setFont(StyleConstants.FONT_BUTTON_LARGE); browseBtn.setMargin(new Insets(3, 0, 3, 0)); browseBtn.addActionListener(listeners::browseDirectory); inputPanel.add(browseBtn); panel.add(inputPanel); return panel; }
Example 3
Source File: AddDocumentDialogFactory.java From lucene-solr with Apache License 2.0 | 6 votes |
private JPanel header() { JPanel panel = new JPanel(); panel.setOpaque(false); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); JPanel analyzerHeader = new JPanel(new FlowLayout(FlowLayout.LEADING, 10, 10)); analyzerHeader.setOpaque(false); analyzerHeader.add(new JLabel(MessageUtils.getLocalizedMessage("add_document.label.analyzer"))); analyzerHeader.add(analyzerNameLbl); JLabel changeLbl = new JLabel(MessageUtils.getLocalizedMessage("add_document.hyperlink.change")); changeLbl.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { dialog.dispose(); tabSwitcher.switchTab(TabbedPaneProvider.Tab.ANALYZER); } }); analyzerHeader.add(FontUtils.toLinkText(changeLbl)); panel.add(analyzerHeader); return panel; }
Example 4
Source File: PresetAnalyzerPanelProvider.java From lucene-solr with Apache License 2.0 | 6 votes |
public JPanel get() { JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); JLabel header = new JLabel(MessageUtils.getLocalizedMessage("analysis_preset.label.preset")); panel.add(header, BorderLayout.PAGE_START); JPanel center = new JPanel(new FlowLayout(FlowLayout.LEADING)); center.setOpaque(false); center.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); center.setPreferredSize(new Dimension(400, 40)); analyzersCB.addActionListener(listeners::setAnalyzer); analyzersCB.setEnabled(false); center.add(analyzersCB); panel.add(center, BorderLayout.CENTER); return panel; }
Example 5
Source File: FlowLayoutBeanInfo.java From netbeans with Apache License 2.0 | 6 votes |
public AlignmentPropertyEditor() { super( new int[] { FlowLayout.CENTER, FlowLayout.LEFT, FlowLayout.RIGHT, FlowLayout.LEADING, FlowLayout.TRAILING }, new String[] { "java.awt.FlowLayout.CENTER", // NOI18N "java.awt.FlowLayout.LEFT", // NOI18N "java.awt.FlowLayout.RIGHT", // NOI18N "java.awt.FlowLayout.LEADING", // NOI18N "java.awt.FlowLayout.TRAILING" // NOI18N }, new String[] { "VALUE_AlignmentCenter", // NOI18N "VALUE_AlignmentLeft", // NOI18N "VALUE_AlignmentRight", // NOI18N "VALUE_AlignmentLeading", // NOI18N "VALUE_AlignmentTrailing" // NOI18N } ); }
Example 6
Source File: MosaicIOPanel.java From snap-desktop with GNU General Public License v3.0 | 5 votes |
private static JPanel createTargetProductSelectorPanel(final TargetProductSelector selector) { final JPanel subPanel1 = new JPanel(new BorderLayout(3, 3)); subPanel1.add(selector.getProductNameLabel(), BorderLayout.NORTH); subPanel1.add(selector.getProductNameTextField(), BorderLayout.CENTER); final JPanel subPanel2 = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); subPanel2.add(selector.getSaveToFileCheckBox()); subPanel2.add(selector.getFormatNameComboBox()); final JPanel subPanel3 = new JPanel(new BorderLayout(3, 3)); subPanel3.add(selector.getProductDirLabel(), BorderLayout.NORTH); subPanel3.add(selector.getProductDirTextField(), BorderLayout.CENTER); subPanel3.add(selector.getProductDirChooserButton(), BorderLayout.EAST); final TableLayout tableLayout = new TableLayout(1); tableLayout.setTableAnchor(TableLayout.Anchor.WEST); tableLayout.setTableFill(TableLayout.Fill.HORIZONTAL); tableLayout.setTableWeightX(1.0); tableLayout.setCellPadding(0, 0, new Insets(3, 3, 3, 3)); tableLayout.setCellPadding(1, 0, new Insets(3, 0, 3, 3)); tableLayout.setCellPadding(2, 0, new Insets(0, 21, 3, 3)); final JPanel panel = new JPanel(tableLayout); panel.add(subPanel1); panel.add(subPanel2); panel.add(subPanel3); return panel; }
Example 7
Source File: CustomAnalyzerPanelProvider.java From lucene-solr with Apache License 2.0 | 5 votes |
private JPanel initCustomAnalyzerHeaderPanel() { JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEADING)); panel.setOpaque(false); panel.add(new JLabel(MessageUtils.getLocalizedMessage("analysis.label.config_dir"))); confDirTF.setColumns(30); confDirTF.setPreferredSize(new Dimension(200, 30)); panel.add(confDirTF); confDirBtn.setText(FontUtils.elegantIconHtml("n", MessageUtils.getLocalizedMessage("analysis.button.browse"))); confDirBtn.setFont(StyleConstants.FONT_BUTTON_LARGE); confDirBtn.setMargin(new Insets(3, 3, 3, 3)); confDirBtn.addActionListener(listeners::chooseConfigDir); panel.add(confDirBtn); buildBtn.setText(FontUtils.elegantIconHtml("", MessageUtils.getLocalizedMessage("analysis.button.build_analyzser"))); buildBtn.setFont(StyleConstants.FONT_BUTTON_LARGE); buildBtn.setMargin(new Insets(3, 3, 3, 3)); buildBtn.addActionListener(listeners::buildAnalyzer); panel.add(buildBtn); loadJarLbl.setText(MessageUtils.getLocalizedMessage("analysis.hyperlink.load_jars")); loadJarLbl.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { listeners.loadExternalJars(e); } }); panel.add(FontUtils.toLinkText(loadJarLbl)); return panel; }
Example 8
Source File: OpenIndexDialogFactory.java From lucene-solr with Apache License 2.0 | 5 votes |
private JPanel basicSettings() { JPanel panel = new JPanel(new GridLayout(2, 1)); panel.setOpaque(false); JPanel idxPath = new JPanel(new FlowLayout(FlowLayout.LEADING)); idxPath.setOpaque(false); idxPath.add(new JLabel(MessageUtils.getLocalizedMessage("openindex.label.index_path"))); idxPathCombo.removeAllItems(); for (String path : prefs.getHistory()) { idxPathCombo.addItem(path); } idxPath.add(idxPathCombo); idxPath.add(browseBtn); panel.add(idxPath); JPanel readOnly = new JPanel(new FlowLayout(FlowLayout.LEADING)); readOnly.setOpaque(false); readOnly.add(readOnlyCB); JLabel roIconLB = new JLabel(FontUtils.elegantIconHtml("")); readOnly.add(roIconLB); panel.add(readOnly); return panel; }
Example 9
Source File: QueryParserPaneProvider.java From lucene-solr with Apache License 2.0 | 5 votes |
private JPanel initFuzzyQuerySettingsPanel() { JPanel panel = new JPanel(); panel.setOpaque(false); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); JPanel header = new JPanel(new FlowLayout(FlowLayout.LEADING)); header.setOpaque(false); header.add(new JLabel(MessageUtils.getLocalizedMessage("search_parser.label.fuzzy_query"))); panel.add(header); JPanel minSim = new JPanel(new FlowLayout(FlowLayout.LEADING)); minSim.setOpaque(false); minSim.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); JLabel minSimLabel = new JLabel(MessageUtils.getLocalizedMessage("search_parser.label.fuzzy_minsim")); minSim.add(minSimLabel); minSimFTF.setColumns(5); minSimFTF.setValue(config.getFuzzyMinSim()); minSim.add(minSimFTF); minSim.add(new JLabel(MessageUtils.getLocalizedMessage("label.float_required"))); panel.add(minSim); JPanel prefLen = new JPanel(new FlowLayout(FlowLayout.LEADING)); prefLen.setOpaque(false); prefLen.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); JLabel prefLenLabel = new JLabel(MessageUtils.getLocalizedMessage("search_parser.label.fuzzy_preflen")); prefLen.add(prefLenLabel); prefLenFTF.setColumns(5); prefLenFTF.setValue(config.getFuzzyPrefixLength()); prefLen.add(prefLenFTF); prefLen.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required"))); panel.add(prefLen); return panel; }
Example 10
Source File: ExportTermsDialogFactory.java From lucene-solr with Apache License 2.0 | 5 votes |
private JPanel currentOpenIndexPanel() { JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEADING)); panel.setBorder(BorderFactory.createEmptyBorder()); panel.setOpaque(false); JLabel label = new JLabel(MessageUtils.getLocalizedMessage("export.terms.label.index_path")); JLabel value = new JLabel(indexHandler.getState().getIndexPath()); value.setToolTipText(indexHandler.getState().getIndexPath()); panel.add(label); panel.add(value); return panel; }
Example 11
Source File: MLTPaneProvider.java From lucene-solr with Apache License 2.0 | 5 votes |
private JPanel initMltParamsPanel() { JPanel panel = new JPanel(new GridLayout(3, 1)); panel.setOpaque(false); JPanel maxDocFreq = new JPanel(new FlowLayout(FlowLayout.LEADING)); maxDocFreq.setOpaque(false); maxDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("search_mlt.label.max_doc_freq"))); maxDocFreqFTF.setColumns(10); maxDocFreqFTF.setValue(config.getMaxDocFreq()); maxDocFreq.add(maxDocFreqFTF); maxDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required"))); panel.add(maxDocFreq); JPanel minDocFreq = new JPanel(new FlowLayout(FlowLayout.LEADING)); minDocFreq.setOpaque(false); minDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("search_mlt.label.min_doc_freq"))); minDocFreqFTF.setColumns(5); minDocFreqFTF.setValue(config.getMinDocFreq()); minDocFreq.add(minDocFreqFTF); minDocFreq.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required"))); panel.add(minDocFreq); JPanel minTermFreq = new JPanel(new FlowLayout(FlowLayout.LEADING)); minTermFreq.setOpaque(false); minTermFreq.add(new JLabel(MessageUtils.getLocalizedMessage("serach_mlt.label.min_term_freq"))); minTermFreqFTF.setColumns(5); minTermFreqFTF.setValue(config.getMinTermFreq()); minTermFreq.add(minTermFreqFTF); minTermFreq.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required"))); panel.add(minTermFreq); return panel; }
Example 12
Source File: CommitsPanelProvider.java From lucene-solr with Apache License 2.0 | 5 votes |
private JPanel initFilesPanel() { JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); JPanel header = new JPanel(new FlowLayout(FlowLayout.LEADING)); header.setOpaque(false); header.add(new JLabel(MessageUtils.getLocalizedMessage("commits.label.files"))); panel.add(header, BorderLayout.PAGE_START); TableUtils.setupTable(filesTable, ListSelectionModel.SINGLE_SELECTION, new FilesTableModel(), null, FilesTableModel.Column.FILENAME.getColumnWidth()); panel.add(new JScrollPane(filesTable), BorderLayout.CENTER); return panel; }
Example 13
Source File: SimilarityPaneProvider.java From lucene-solr with Apache License 2.0 | 4 votes |
private JPanel initSimilaritySettingsPanel() { JPanel panel = new JPanel(new GridLayout(4, 1)); panel.setOpaque(false); panel.setMaximumSize(new Dimension(700, 220)); tfidfCB.setText(MessageUtils.getLocalizedMessage("search_similarity.checkbox.use_classic")); tfidfCB.addActionListener(listeners::toggleTfIdf); tfidfCB.setOpaque(false); panel.add(tfidfCB); discardOverlapsCB.setText(MessageUtils.getLocalizedMessage("search_similarity.checkbox.discount_overlaps")); discardOverlapsCB.setSelected(config.isUseClassicSimilarity()); discardOverlapsCB.setOpaque(false); panel.add(discardOverlapsCB); JLabel bm25Label = new JLabel(MessageUtils.getLocalizedMessage("search_similarity.label.bm25_params")); panel.add(bm25Label); JPanel bm25Params = new JPanel(new FlowLayout(FlowLayout.LEADING)); bm25Params.setOpaque(false); bm25Params.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); JPanel k1Val = new JPanel(new FlowLayout(FlowLayout.LEADING)); k1Val.setOpaque(false); k1Val.add(new JLabel("k1: ")); k1FTF.setColumns(5); k1FTF.setValue(config.getK1()); k1Val.add(k1FTF); k1Val.add(new JLabel(MessageUtils.getLocalizedMessage("label.float_required"))); bm25Params.add(k1Val); JPanel bVal = new JPanel(new FlowLayout(FlowLayout.LEADING)); bVal.setOpaque(false); bVal.add(new JLabel("b: ")); bFTF.setColumns(5); bFTF.setValue(config.getB()); bVal.add(bFTF); bVal.add(new JLabel(MessageUtils.getLocalizedMessage("label.float_required"))); bm25Params.add(bVal); panel.add(bm25Params); return panel; }
Example 14
Source File: QueryParserPaneProvider.java From lucene-solr with Apache License 2.0 | 4 votes |
private JPanel initPhraseQuerySettingsPanel() { JPanel panel = new JPanel(); panel.setOpaque(false); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); JPanel header = new JPanel(new FlowLayout(FlowLayout.LEADING)); header.setOpaque(false); header.add(new JLabel(MessageUtils.getLocalizedMessage("search_parser.label.phrase_query"))); panel.add(header); JPanel genPQ = new JPanel(new FlowLayout(FlowLayout.LEADING)); genPQ.setOpaque(false); genPQ.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); genPhraseQueryCB.setText(MessageUtils.getLocalizedMessage("search_parser.checkbox.gen_pq")); genPhraseQueryCB.setEnabled(config.isAutoGeneratePhraseQueries()); genPhraseQueryCB.setOpaque(false); genPQ.add(genPhraseQueryCB); panel.add(genPQ); JPanel genMTPQ = new JPanel(new FlowLayout(FlowLayout.LEADING)); genMTPQ.setOpaque(false); genMTPQ.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); genMultiTermSynonymsPhraseQueryCB.setText(MessageUtils.getLocalizedMessage("search_parser.checkbox.gen_mts")); genMultiTermSynonymsPhraseQueryCB.setEnabled(config.isAutoGenerateMultiTermSynonymsPhraseQuery()); genMultiTermSynonymsPhraseQueryCB.setOpaque(false); genMTPQ.add(genMultiTermSynonymsPhraseQueryCB); panel.add(genMTPQ); JPanel slop = new JPanel(new FlowLayout(FlowLayout.LEADING)); slop.setOpaque(false); slop.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); JLabel slopLabel = new JLabel(MessageUtils.getLocalizedMessage("search_parser.label.phrase_slop")); slop.add(slopLabel); slopFTF.setColumns(5); slopFTF.setValue(config.getPhraseSlop()); slop.add(slopFTF); slop.add(new JLabel(MessageUtils.getLocalizedMessage("label.int_required"))); panel.add(slop); return panel; }
Example 15
Source File: PropertySheetPanel.java From orbit-image-analysis with GNU General Public License v3.0 | 4 votes |
private void buildUI() { LookAndFeelTweaks.setBorderLayout(this); LookAndFeelTweaks.setBorder(this); actionPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 2, 0)); actionPanel.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)); add("North", actionPanel); sortButton = new JToggleButton(new ToggleSortingAction()); sortButton.setUI(new BlueishButtonUI()); sortButton.setText(null); actionPanel.add(sortButton); asCategoryButton = new JToggleButton(new ToggleModeAction()); asCategoryButton.setUI(new BlueishButtonUI()); asCategoryButton.setText(null); actionPanel.add(asCategoryButton); descriptionButton = new JToggleButton(new ToggleDescriptionAction()); descriptionButton.setUI(new BlueishButtonUI()); descriptionButton.setText(null); actionPanel.add(descriptionButton); split = new JSplitPane(JSplitPane.VERTICAL_SPLIT); split.setBorder(null); split.setResizeWeight(1.0); split.setContinuousLayout(true); add("Center", split); tableScroll = new JScrollPane(); split.setTopComponent(tableScroll); descriptionPanel = new JEditorPane("text/html", "<html>"); descriptionPanel.setBorder(BorderFactory.createEmptyBorder()); descriptionPanel.setEditable(false); descriptionPanel.setBackground(UIManager.getColor("Panel.background")); LookAndFeelTweaks.htmlize(descriptionPanel); selectionListener = new SelectionListener(); descriptionScrollPane = new JScrollPane(descriptionPanel); descriptionScrollPane.setBorder(LookAndFeelTweaks.addMargin(BorderFactory .createLineBorder(UIManager.getColor("controlDkShadow")))); descriptionScrollPane.getViewport().setBackground( descriptionPanel.getBackground()); descriptionScrollPane.setMinimumSize(new Dimension(50, 50)); split.setBottomComponent(descriptionScrollPane); // by default description is not visible, toolbar is visible. setDescriptionVisible(false); setToolBarVisible(true); }
Example 16
Source File: DocumentsPanelProvider.java From lucene-solr with Apache License 2.0 | 4 votes |
private JPanel initLowerPanel() { JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); JPanel browseDocsPanel = new JPanel(); browseDocsPanel.setOpaque(false); browseDocsPanel.setLayout(new BoxLayout(browseDocsPanel, BoxLayout.PAGE_AXIS)); browseDocsPanel.add(initBrowseDocsBar()); JPanel browseDocsNote1 = new JPanel(new FlowLayout(FlowLayout.LEADING)); browseDocsNote1.setOpaque(false); browseDocsNote1.add(new JLabel(MessageUtils.getLocalizedMessage("documents.label.doc_table_note1"))); browseDocsPanel.add(browseDocsNote1); JPanel browseDocsNote2 = new JPanel(new FlowLayout(FlowLayout.LEADING)); browseDocsNote2.setOpaque(false); browseDocsNote2.add(new JLabel(MessageUtils.getLocalizedMessage("documents.label.doc_table_note2"))); browseDocsPanel.add(browseDocsNote2); panel.add(browseDocsPanel, BorderLayout.PAGE_START); TableUtils.setupTable(documentTable, ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, new DocumentsTableModel(), new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { listeners.showDocumentContextMenu(e); } }, DocumentsTableModel.Column.FIELD.getColumnWidth(), DocumentsTableModel.Column.FLAGS.getColumnWidth(), DocumentsTableModel.Column.NORM.getColumnWidth(), DocumentsTableModel.Column.VALUE.getColumnWidth()); JPanel flagsHeader = new JPanel(new FlowLayout(FlowLayout.CENTER)); flagsHeader.setOpaque(false); flagsHeader.add(new JLabel("Flags")); flagsHeader.add(new JLabel("Help")); documentTable.getColumnModel().getColumn(DocumentsTableModel.Column.FLAGS.getIndex()).setHeaderValue(flagsHeader); JScrollPane scrollPane = new JScrollPane(documentTable); scrollPane.getHorizontalScrollBar().setAutoscrolls(false); panel.add(scrollPane, BorderLayout.CENTER); return panel; }
Example 17
Source File: DocumentsPanelProvider.java From lucene-solr with Apache License 2.0 | 4 votes |
private JPanel initBrowseTermsPanel() { JPanel panel = new JPanel(new BorderLayout()); panel.setOpaque(false); panel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); JPanel top = new JPanel(new FlowLayout(FlowLayout.LEADING)); top.setOpaque(false); JLabel label = new JLabel(MessageUtils.getLocalizedMessage("documents.label.browse_terms")); top.add(label); panel.add(top, BorderLayout.PAGE_START); JPanel center = new JPanel(new GridBagLayout()); center.setOpaque(false); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.BOTH; fieldsCombo.addActionListener(listeners::showFirstTerm); c.gridx = 0; c.gridy = 0; c.insets = new Insets(5, 5, 5, 5); c.weightx = 0.0; c.gridwidth = 2; center.add(fieldsCombo, c); firstTermBtn.setText(FontUtils.elegantIconHtml("8", MessageUtils.getLocalizedMessage("documents.button.first_term"))); firstTermBtn.setMaximumSize(new Dimension(80, 30)); firstTermBtn.addActionListener(listeners::showFirstTerm); c.gridx = 0; c.gridy = 1; c.insets = new Insets(5, 5, 5, 5); c.weightx = 0.2; c.gridwidth = 1; center.add(firstTermBtn, c); termTF.setColumns(20); termTF.setMinimumSize(new Dimension(50, 25)); termTF.setFont(StyleConstants.FONT_MONOSPACE_LARGE); termTF.addActionListener(listeners::seekNextTerm); c.gridx = 1; c.gridy = 1; c.insets = new Insets(5, 5, 5, 5); c.weightx = 0.5; c.gridwidth = 1; center.add(termTF, c); nextTermBtn.setText(MessageUtils.getLocalizedMessage("documents.button.next")); nextTermBtn.addActionListener(listeners::showNextTerm); c.gridx = 2; c.gridy = 1; c.insets = new Insets(5, 5, 5, 5); c.weightx = 0.1; c.gridwidth = 1; center.add(nextTermBtn, c); panel.add(center, BorderLayout.CENTER); JPanel footer = new JPanel(new FlowLayout(FlowLayout.LEADING, 20, 5)); footer.setOpaque(false); JLabel hintLbl = new JLabel(MessageUtils.getLocalizedMessage("documents.label.browse_terms_hint")); footer.add(hintLbl); panel.add(footer, BorderLayout.PAGE_END); return panel; }
Example 18
Source File: OpenIndexDialogFactory.java From lucene-solr with Apache License 2.0 | 4 votes |
private JPanel expertSettings() { JPanel panel = new JPanel(new GridLayout(6, 1)); panel.setOpaque(false); JPanel header = new JPanel(new FlowLayout(FlowLayout.LEADING)); header.setOpaque(false); header.add(new JLabel(MessageUtils.getLocalizedMessage("openindex.label.expert"))); panel.add(header); JPanel dirImpl = new JPanel(new FlowLayout(FlowLayout.LEADING)); dirImpl.setOpaque(false); dirImpl.add(new JLabel(MessageUtils.getLocalizedMessage("openindex.label.dir_impl"))); dirImpl.add(dirImplCombo); panel.add(dirImpl); JPanel noReader = new JPanel(new FlowLayout(FlowLayout.LEADING)); noReader.setOpaque(false); noReader.add(noReaderCB); JLabel noReaderIcon = new JLabel(FontUtils.elegantIconHtml("")); noReader.add(noReaderIcon); panel.add(noReader); JPanel iwConfig = new JPanel(new FlowLayout(FlowLayout.LEADING)); iwConfig.setOpaque(false); iwConfig.add(new JLabel(MessageUtils.getLocalizedMessage("openindex.label.iw_config"))); panel.add(iwConfig); JPanel compound = new JPanel(new FlowLayout(FlowLayout.LEADING)); compound.setOpaque(false); compound.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); compound.add(useCompoundCB); panel.add(compound); JPanel keepCommits = new JPanel(new FlowLayout(FlowLayout.LEADING)); keepCommits.setOpaque(false); keepCommits.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); keepCommits.add(keepLastCommitRB); keepCommits.add(keepAllCommitsRB); ButtonGroup group = new ButtonGroup(); group.add(keepLastCommitRB); group.add(keepAllCommitsRB); panel.add(keepCommits); return panel; }
Example 19
Source File: LoadingSavegameDialog.java From freecol with GNU General Public License v2.0 | 4 votes |
/** * Creates a dialog to set the options for loading a saved game. * * @param freeColClient The {@code FreeColClient} for the game. * @param frame The owner frame. */ public LoadingSavegameDialog(FreeColClient freeColClient, JFrame frame) { super(freeColClient, frame); JPanel panel = new JPanel(); panel.setBorder(Utility.blankBorder(10, 10, 10, 10)); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); panel.setOpaque(false); JLabel header = Utility.localizedHeaderLabel( Messages.nameKey("loadingSavegameDialog"), JLabel.CENTER, FontLibrary.FontSize.MEDIUM); header.setBorder(Utility.blankBorder(20, 0, 0, 0)); JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEADING)); p1.add(Utility.localizedLabel("loadingSavegameDialog.serverName")); serverNameField = new JTextField(); JPanel p2 = new JPanel(new FlowLayout(FlowLayout.LEADING)); p2.add(Utility.localizedLabel("loadingSavegameDialog.port")); portField = new JSpinner(new SpinnerNumberModel(FreeCol.getServerPort(), 1, 65536, 1)); ButtonGroup bg = new ButtonGroup(); String str = Messages.message("loadingSavegameDialog.singlePlayer"); singlePlayer = new JRadioButton(str); bg.add(singlePlayer); str = Messages.message("loadingSavegameDialog.privateMultiplayer"); privateMultiplayer = new JRadioButton(str); bg.add(privateMultiplayer); str = Messages.message("loadingSavegameDialog.publicMultiplayer"); publicMultiplayer = new JRadioButton(str); bg.add(publicMultiplayer); panel.add(header); panel.add(p1); panel.add(serverNameField); panel.add(p2); panel.add(portField); panel.add(singlePlayer); panel.add(privateMultiplayer); panel.add(publicMultiplayer); panel.setSize(panel.getPreferredSize()); initializeConfirmDialog(frame, true, panel, null, "ok", "cancel"); }
Example 20
Source File: BuildingPanelPower.java From mars-sim with GNU General Public License v3.0 | 4 votes |
/** * Constructor. * @param building the building the panel is for. * @param desktop The main desktop. */ public BuildingPanelPower(Building building, MainDesktopPane desktop) { // Use BuildingFunctionPanel constructor super(building, desktop); // Check if the building is a power producer. isProducer = building.hasFunction(FunctionType.POWER_GENERATION); generator = building.getPowerGeneration(); // Set the layout setLayout(new BorderLayout()); // 2014-11-21 Changed font type, size and color and label text WebLabel titleLabel = new WebLabel( Msg.getString("BuildingPanelPower.title"), //$NON-NLS-1$ WebLabel.CENTER); titleLabel.setFont(new Font("Serif", Font.BOLD, 16)); //titleLabel.setForeground(new Color(102, 51, 0)); // dark brown add(titleLabel, BorderLayout.NORTH); WebPanel springPanel = new WebPanel(new SpringLayout()); add(springPanel, BorderLayout.CENTER); // Prepare power status label. powerStatusCache = building.getPowerMode(); powerStatusLabel = new WebLabel( Msg.getString("BuildingPanelPower.powerStatus"), //$NON-NLS-1$ WebLabel.RIGHT); springPanel.add(powerStatusLabel); WebPanel wrapper1 = new WebPanel(new FlowLayout(0, 0, FlowLayout.LEADING)); statusTF = new WebTextField(powerStatusCache.getName()); statusTF.setEditable(false); statusTF.setColumns(7); statusTF.setPreferredSize(new Dimension(120, 25)); wrapper1.add(statusTF); springPanel.add(wrapper1); // If power producer, prepare power producer label. if (isProducer) { //PowerGeneration generator = building.getPowerGeneration();//(PowerGeneration) building.getFunction(FunctionType.POWER_GENERATION); powerCache = generator.getGeneratedPower(); powerLabel = new WebLabel( Msg.getString("BuildingPanelPower.powerProduced"), //$NON-NLS-1$ WebLabel.RIGHT); springPanel.add(powerLabel); WebPanel wrapper2 = new WebPanel(new FlowLayout(0, 0, FlowLayout.LEADING)); producedTF = new WebTextField(formatter.format(powerCache) + kW); producedTF.setEditable(false); producedTF.setColumns(7); producedTF.setPreferredSize(new Dimension(120, 25)); wrapper2.add(producedTF); springPanel.add(wrapper2); } // Prepare power used label. if (powerStatusCache == PowerMode.FULL_POWER) usedCache = building.getFullPowerRequired(); else if (powerStatusCache == PowerMode.POWER_DOWN) usedCache = building.getPoweredDownPowerRequired(); else usedCache = 0D; usedLabel = new WebLabel( Msg.getString("BuildingPanelPower.powerUsed"), //$NON-NLS-1$ WebLabel.RIGHT ); springPanel.add(usedLabel); WebPanel wrapper3 = new WebPanel(new FlowLayout(0, 0, FlowLayout.LEADING)); usedTF = new WebTextField(formatter.format(usedCache) + kW); usedTF.setEditable(false); usedTF.setColumns(7); usedTF.setPreferredSize(new Dimension(120, 25)); wrapper3.add(usedTF); springPanel.add(wrapper3); //Lay out the spring panel. if (isProducer) { SpringUtilities.makeCompactGrid(springPanel, 3, 2, //rows, cols 75, 10, //initX, initY 3, 1); //xPad, yPad } else SpringUtilities.makeCompactGrid(springPanel, 2, 2, //rows, cols 75, 10, //initX, initY 3, 1); //xPad, yPad }