List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints
public CellConstraints()
From source file:com.od.jtimeseries.ui.visualizer.chart.ChartControlPanel.java
License:Open Source License
private JComponent createDisplayControls() { FormLayout f = new FormLayout("pref:grow", "pref, 10px, pref, 10px, pref, 10px"); JPanel p = new JPanel(); p.setLayout(f);/*from w w w .ja va 2 s .c o m*/ CellConstraints cc = new CellConstraints(); p.add(colorComboBox, cc.xy(1, 1)); p.add(chartTypeCombo, cc.xy(1, 3)); p.add(showLegendCheckbox, cc.xy(1, 5)); return p; }
From source file:com.od.jtimeseries.ui.visualizer.chart.ChartControlPanel.java
License:Open Source License
private JComponent createWidgetBox(JComponent widget, String title) { FormLayout f = new FormLayout("10px, max(175px;pref), 10px:grow", "5px,pref,5px"); JPanel p = new JPanel(); p.setLayout(f);/*from w ww .jav a 2 s. c o m*/ CellConstraints cc = new CellConstraints(); p.add(widget, cc.xy(2, 2)); TitledBorder border = new TitledBorder(title); border.setTitleFont(border.getTitleFont()); p.setBorder(border); return p; }
From source file:com.pari.license.ui.LicenseGenDialog.java
License:Open Source License
@Override public JComponent createContentPanel() { JPanel contentPanel = new JPanel(); contentPanel.setLayout(new BorderLayout()); contentPanel.setBackground(Color.white); seedTextArea = new AutoResizingTextArea(100, 100); seedTextArea.addMouseListener(new TextFieldMenu(seedTextArea)); seedTextArea.setEditable(true);/*from www . j ava 2 s.c om*/ evaluationCheckBox = new JCheckBox("Evaluation License Only"); evaluationCheckBox.setOpaque(false); evaluationCheckBox.setMargin(new Insets(0, 0, 0, 0)); evaluationCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { enableControls(); } }); allowDeviceBeyondLicenseCheck = new JCheckBox("Allow to add devices beyond Maximum Devices"); allowDeviceBeyondLicenseCheck.setOpaque(false); allowDeviceBeyondLicenseCheck.setMargin(new Insets(0, 0, 0, 0)); allowDeviceBeyondLicenseCheck.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { } }); JPanel optionsPane = new JPanel(); optionsPane.setOpaque(false); String columnSpecs = "5dlu, pref, 5dlu, 175dlu, 5dlu, 30dlu"; String rowSpecs = "pref, 4dlu, top:100dlu, 8dlu, pref, 4dlu, pref, 5dlu, pref, 5dlu, pref, 8dlu, pref, 6dlu, pref, 8dlu, pref"; FormLayout formLayout = new FormLayout(columnSpecs, rowSpecs); DefaultFormBuilder builder = new DefaultFormBuilder(formLayout, optionsPane); builder.setDefaultDialogBorder(); evaluationPeriod = new NumericTextField(); evaluationPeriod.addMouseListener(new TextFieldMenu(evaluationPeriod)); maxDevices = new NumericTextField(); maxDevices.addMouseListener(new TextFieldMenu(maxDevices)); JLabel seedLabel = ControlFactory.createLabelFor("License Seed", true, seedTextArea, 'S'); JLabel evalPeriodLabel = ControlFactory.createLabelFor("Evaluation Period", false, evaluationPeriod, 'E'); JLabel maxDevicesLabel = ControlFactory.createLabelFor("Maximum Devices", true, maxDevices, 'M'); CellConstraints cc = new CellConstraints(); int rowIndex = 1; builder.addSeparator("License Seed Information", cc.xyw(1, rowIndex, 6)); rowIndex += 2; builder.add(seedLabel, cc.xy(2, rowIndex)); builder.add(new JScrollPane(seedTextArea), cc.xyw(4, rowIndex, 3)); rowIndex += 2; builder.addSeparator("License Details", cc.xyw(1, rowIndex, 6)); rowIndex += 2; builder.add(evaluationCheckBox, cc.xyw(2, rowIndex, 4)); rowIndex += 2; builder.add(evalPeriodLabel, cc.xy(2, rowIndex)); builder.add(evaluationPeriod, cc.xy(4, rowIndex)); builder.add(new JLabel("(days)"), cc.xy(6, rowIndex)); rowIndex += 2; builder.add(maxDevicesLabel, cc.xy(2, rowIndex)); builder.add(maxDevices, cc.xy(4, rowIndex)); rowIndex += 2; builder.add(allowDeviceBeyondLicenseCheck, cc.xyw(2, rowIndex, 4)); contentPanel.add(optionsPane, BorderLayout.CENTER); licensedComponentsList = new CheckBoxList(getAllComponentNames()); licensedComponentsList.setPreferredSize(new Dimension(350, 175)); SearchableUtils.installSearchable(licensedComponentsList); JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3), BorderFactory.createTitledBorder("Select Licensed Components"))); panel.setOpaque(false); panel.setLayout(new BorderLayout()); panel.add(new JScrollPane(licensedComponentsList), BorderLayout.CENTER); contentPanel.add(panel, BorderLayout.SOUTH); contentPanel.setBackground(Color.white); setResizable(true); enableControls(); return contentPanel; }
From source file:com.pavelfatin.sleeparchiver.gui.main.StatusBar.java
License:Open Source License
StatusBar() { setLayout(new FormLayout("$lcgap, default", "default")); _label = new JLabel(); _label.setName("labelStatus"); add(_label, new CellConstraints().xy(2, 1)); }
From source file:com.pianobakery.complsa.MainGui.java
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL//from w w w .java 2 s . co m */ private void $$$setupUI$$$() { createUIComponents(); mainPanel = new JPanel(); mainPanel.setLayout(new FormLayout("fill:max(m;620px):grow", "center:max(m;600px):grow")); tabbedPane1 = new JTabbedPane(); tabbedPane1.setEnabled(true); CellConstraints cc = new CellConstraints(); mainPanel.add(tabbedPane1, cc.xy(1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); setupPanel = new JPanel(); setupPanel.setLayout(new FormLayout( "fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:126px:noGrow,fill:max(d;4px):noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:5dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:52px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,fill:d:grow,fill:d:grow,fill:66px:noGrow", "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:d:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow")); tabbedPane1.addTab("Project", setupPanel); newFolderButton = new JButton(); newFolderButton.setText("New Folder"); setupPanel.add(newFolderButton, cc.xy(1, 5)); final JLabel label1 = new JLabel(); label1.setText("Project Folder:"); setupPanel.add(label1, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); selectFolderButton = new JButton(); selectFolderButton.setText("Select Folder"); setupPanel.add(selectFolderButton, cc.xy(5, 5)); wDirText = new JTextField(); wDirText.setEditable(false); wDirText.setText("Create or select Project Folder"); setupPanel.add(wDirText, cc.xyw(7, 5, 48, CellConstraints.FILL, CellConstraints.DEFAULT)); final JLabel label2 = new JLabel(); label2.setText("The Project Folder contains all the Project Data."); setupPanel.add(label2, cc.xyw(1, 3, 54)); final JLabel label3 = new JLabel(); label3.setText("Arrange your Documents in a Folder. Then add it to the Software."); setupPanel.add(label3, cc.xyw(1, 15, 54)); downloadModelButton = new JButton(); downloadModelButton.setText("Download Models"); setupPanel.add(downloadModelButton, cc.xy(1, 9)); final JLabel label4 = new JLabel(); label4.setText("Language Models:"); setupPanel.add(label4, cc.xy(5, 9)); langModelsText = new JLabel(); langModelsText.setText(""); setupPanel.add(langModelsText, cc.xyw(7, 9, 48)); trainCorpButton = new JButton(); trainCorpButton.setText("Train Semantics"); setupPanel.add(trainCorpButton, cc.xy(1, 33, CellConstraints.FILL, CellConstraints.DEFAULT)); final JLabel label5 = new JLabel(); label5.setText("Create Semantic Knowledge with selected Training Corpus:"); setupPanel.add(label5, cc.xyw(1, 25, 7)); addTopicCorpusButton = new JButton(); addTopicCorpusButton.setEnabled(true); addTopicCorpusButton.setText(" Add Corpus Folder"); setupPanel.add(addTopicCorpusButton, cc.xy(1, 19)); addCorpRecursiveCheckBox = new JCheckBox(); addCorpRecursiveCheckBox.setSelected(true); addCorpRecursiveCheckBox.setText("Recursive"); setupPanel.add(addCorpRecursiveCheckBox, cc.xy(5, 19)); createChunksCheckBox = new JCheckBox(); createChunksCheckBox.setSelected(true); createChunksCheckBox.setText("Split in Paragraph of:"); setupPanel.add(createChunksCheckBox, cc.xy(7, 19)); final JLabel label6 = new JLabel(); label6.setText("Add/Remove Training Corpus:"); setupPanel.add(label6, cc.xyw(1, 17, 5)); final JLabel label7 = new JLabel(); label7.setText("Select Training Corpus:"); setupPanel.add(label7, cc.xyw(1, 21, 54)); selectTrainCorp = new JComboBox(); selectTrainCorp.setEnabled(true); setupPanel.add(selectTrainCorp, cc.xyw(1, 23, 5)); removeTopicCorpusButton = new JButton(); removeTopicCorpusButton.setEnabled(true); removeTopicCorpusButton.setHorizontalAlignment(2); removeTopicCorpusButton.setText("Remove Training Corpus"); setupPanel.add(removeTopicCorpusButton, cc.xy(7, 23)); setupPanel.add(indexTypeComboBox, cc.xy(7, 33)); amountOfSentencesPerTextField = new JTextField(); amountOfSentencesPerTextField.setHorizontalAlignment(2); amountOfSentencesPerTextField.setText("20"); setupPanel.add(amountOfSentencesPerTextField, cc.xyw(9, 19, 6, CellConstraints.FILL, CellConstraints.DEFAULT)); posIndRadiusTextField = new JTextField(); posIndRadiusTextField.setHorizontalAlignment(2); posIndRadiusTextField.setText("20"); setupPanel.add(posIndRadiusTextField, cc.xyw(9, 33, 6, CellConstraints.FILL, CellConstraints.DEFAULT)); final JLabel label8 = new JLabel(); label8.setText("Indextype:"); setupPanel.add(label8, cc.xy(5, 33, CellConstraints.RIGHT, CellConstraints.DEFAULT)); final JLabel label9 = new JLabel(); label9.setHorizontalAlignment(2); label9.setText("Sentences"); setupPanel.add(label9, cc.xy(15, 19)); final JLabel label10 = new JLabel(); label10.setHorizontalAlignment(2); label10.setText("Words"); setupPanel.add(label10, cc.xy(15, 33)); setupPanel.add(termComboBox, cc.xyw(31, 33, 19)); final JLabel label11 = new JLabel(); label11.setText("Termweight:"); setupPanel.add(label11, cc.xyw(18, 33, 13)); updateIndexButton = new JButton(); updateIndexButton.setText("Update Index"); setupPanel.add(updateIndexButton, cc.xy(1, 29)); removeIndexButton = new JButton(); removeIndexButton.setText("Remove Index"); setupPanel.add(removeIndexButton, cc.xy(5, 29)); final JLabel label12 = new JLabel(); label12.setText("Add/Remove Search Corpus:"); setupPanel.add(label12, cc.xyw(1, 41, 5)); impSearchCorpButton = new JButton(); impSearchCorpButton.setText("Add Search Corpus"); setupPanel.add(impSearchCorpButton, cc.xy(1, 43)); impSearchCorpRecursiveCheckBox = new JCheckBox(); impSearchCorpRecursiveCheckBox.setSelected(true); impSearchCorpRecursiveCheckBox.setText("Recursive"); setupPanel.add(impSearchCorpRecursiveCheckBox, cc.xy(5, 43)); splitSearchCorpCheckBox = new JCheckBox(); splitSearchCorpCheckBox.setSelected(true); splitSearchCorpCheckBox.setText("Split in Paragraph of:"); setupPanel.add(splitSearchCorpCheckBox, cc.xy(7, 43)); amountSearchCorpSent = new JTextField(); amountSearchCorpSent.setHorizontalAlignment(2); amountSearchCorpSent.setText("20"); setupPanel.add(amountSearchCorpSent, cc.xyw(9, 43, 6, CellConstraints.FILL, CellConstraints.DEFAULT)); final JLabel label13 = new JLabel(); label13.setHorizontalAlignment(2); label13.setText("Sentences"); setupPanel.add(label13, cc.xy(15, 43)); searchCorpComboBox = new JComboBox(); setupPanel.add(searchCorpComboBox, cc.xyw(1, 47, 5, CellConstraints.DEFAULT, CellConstraints.TOP)); removeSearchCorpButton = new JButton(); removeSearchCorpButton.setText("Remove Search Corpus"); setupPanel.add(removeSearchCorpButton, cc.xy(7, 47)); final JLabel label14 = new JLabel(); label14.setText("Select Search Corpus:"); setupPanel.add(label14, cc.xyw(1, 45, 5)); final JLabel label15 = new JLabel(); label15.setText("Arrange your Search Corpus in a Folder. Then add it to the Software. "); setupPanel.add(label15, cc.xyw(1, 39, 54)); final JLabel label16 = new JLabel(); label16.setText("First update the Index."); setupPanel.add(label16, cc.xyw(1, 27, 5)); final JLabel label17 = new JLabel(); label17.setText( "Then select an Algorithm and train the Software. On the Search Tab you can select the Algorithms to run your semantic searches."); setupPanel.add(label17, cc.xyw(1, 31, 54)); final JLabel label18 = new JLabel(); label18.setText("Download Language Models:"); setupPanel.add(label18, cc.xyw(1, 7, 54)); final JLabel label19 = new JLabel(); label19.setText("Training Corpora:"); setupPanel.add(label19, cc.xyw(1, 13, 54)); final JLabel label20 = new JLabel(); label20.setText("Search Corpora:"); setupPanel.add(label20, cc.xyw(1, 37, 54)); final JLabel label21 = new JLabel(); label21.setEnabled(true); label21.setText(" "); setupPanel.add(label21, cc.xy(1, 11)); final JLabel label22 = new JLabel(); label22.setText(" "); setupPanel.add(label22, cc.xy(1, 35)); searchDocs = new JPanel(); searchDocs.setLayout(new FormLayout( "left:4dlu:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:277px:noGrow,left:4dlu:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(m;400px):grow,left:4dlu:noGrow,fill:max(m;200px):grow", "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,top:3dlu:noGrow,center:d:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:243px:grow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:38px:noGrow,top:3dlu:noGrow")); searchDocs.setEnabled(true); tabbedPane1.addTab("Search", searchDocs); final JLabel label23 = new JLabel(); label23.setText("Choose Semantic Knowledge Algorithm:"); searchDocs.add(label23, cc.xyw(3, 1, 5)); final JLabel label24 = new JLabel(); label24.setText("Enter Search Text or select Search Document:"); searchDocs.add(label24, cc.xyw(3, 20, 5)); final JLabel label25 = new JLabel(); label25.setText("Document Search Results:"); searchDocs.add(label25, cc.xyw(10, 1, 3)); final JLabel label26 = new JLabel(); label26.setText("Selection Metadata:"); searchDocs.add(label26, cc.xyw(10, 27, 3)); selectIndexTypeComboBox = new JComboBox(); searchDocs.add(selectIndexTypeComboBox, cc.xyw(7, 10, 3)); final JLabel label27 = new JLabel(); label27.setText("Index Type:"); searchDocs.add(label27, cc.xy(7, 8)); final JLabel label28 = new JLabel(); label28.setText("Termweight:"); searchDocs.add(label28, cc.xy(7, 12)); selectTermweightComboBox = new JComboBox(); searchDocs.add(selectTermweightComboBox, cc.xy(7, 14)); final JLabel label29 = new JLabel(); label29.setText("Number of search results:"); searchDocs.add(label29, cc.xy(7, 16)); noOfSearchResultsText = new JTextField(); noOfSearchResultsText.setText("20"); searchDocs.add(noOfSearchResultsText, cc.xy(7, 18, CellConstraints.FILL, CellConstraints.DEFAULT)); final JScrollPane scrollPane1 = new JScrollPane(); searchDocs.add(scrollPane1, cc.xywh(7, 22, 1, 2, CellConstraints.FILL, CellConstraints.FILL)); searchTextArea = new JTextArea(); searchTextArea.setLineWrap(true); searchTextArea.setText(""); searchTextArea.setWrapStyleWord(true); scrollPane1.setViewportView(searchTextArea); selTextRadioButton = new JRadioButton(); selTextRadioButton.setSelected(true); selTextRadioButton.setText(""); searchDocs.add(selTextRadioButton, cc.xy(5, 22)); algTextField = new JLabel(); algTextField.setText("Knowledge Corpus: null"); searchDocs.add(algTextField, cc.xy(7, 3, CellConstraints.DEFAULT, CellConstraints.FILL)); selectDocumentButton = new JButton(); selectDocumentButton.setEnabled(false); selectDocumentButton.setText("Select Document"); searchDocs.add(selectDocumentButton, cc.xy(7, 25)); selDocRadioButton = new JRadioButton(); selDocRadioButton.setText(""); searchDocs.add(selDocRadioButton, cc.xy(5, 25)); final JLabel label30 = new JLabel(); label30.setText("Select Corpus to Search:"); searchDocs.add(label30, cc.xyw(3, 30, 5)); searchTopCorpRadioButton = new JRadioButton(); searchTopCorpRadioButton.setSelected(true); searchTopCorpRadioButton.setText("Topic Corpus"); searchDocs.add(searchTopCorpRadioButton, cc.xy(7, 32, CellConstraints.DEFAULT, CellConstraints.TOP)); searchSearchCorpRadioButton = new JRadioButton(); searchSearchCorpRadioButton.setSelected(false); searchSearchCorpRadioButton.setText("Search Corpus"); searchDocs.add(searchSearchCorpRadioButton, cc.xy(7, 34, CellConstraints.DEFAULT, CellConstraints.TOP)); searchButton = new JButton(); searchButton.setText("Search"); searchDocs.add(searchButton, cc.xy(7, 36)); final JScrollPane scrollPane2 = new JScrollPane(); searchDocs.add(scrollPane2, cc.xywh(10, 30, 3, 7, CellConstraints.FILL, CellConstraints.FILL)); metadataTextField = new JTextArea(); metadataTextField.setEditable(false); scrollPane2.setViewportView(metadataTextField); termTablePane = new JScrollPane(); termTablePane.setEnabled(true); termTablePane.setVerticalScrollBarPolicy(22); searchDocs.add(termTablePane, cc.xywh(14, 3, 1, 21, CellConstraints.FILL, CellConstraints.FILL)); termSearchResTable.setAutoCreateRowSorter(true); termSearchResTable.setAutoResizeMode(2); termSearchResTable.setFillsViewportHeight(false); termSearchResTable.setForeground(new Color(-16777216)); termTablePane.setViewportView(termSearchResTable); docTablePane = new JScrollPane(); docTablePane.setVerticalScrollBarPolicy(22); searchDocs.add(docTablePane, cc.xywh(10, 3, 3, 21, CellConstraints.FILL, CellConstraints.FILL)); docSearchResTable.setAutoCreateRowSorter(true); docTablePane.setViewportView(docSearchResTable); final JLabel label31 = new JLabel(); label31.setText("Term Search Result:"); searchDocs.add(label31, cc.xy(14, 1)); searchDocValue = new JLabel(); searchDocValue.setText("nothing selected"); searchDocs.add(searchDocValue, cc.xyw(12, 25, 3, CellConstraints.LEFT, CellConstraints.DEFAULT)); openSearchDocumentButton = new JButton(); openSearchDocumentButton.setEnabled(false); openSearchDocumentButton.setText("Open Search Document"); searchDocs.add(openSearchDocumentButton, cc.xy(10, 25, CellConstraints.LEFT, CellConstraints.DEFAULT)); }
From source file:com.projity.dialog.AboutDialog.java
License:Common Public License
/** * Builds the panel. Initializes and configures components first, then * creates a FormLayout, configures the layout, creates a builder, sets a * border, and finally adds the components. * /*w w w . java 2 s . c o m*/ * @return the built panel */ public JComponent createContentPanel() { // Separating the component initialization and configuration // from the layout code makes both parts easier to read. //TODO set minimum size FormLayout layout = new FormLayout("default", // cols //$NON-NLS-1$ "p, 3dlu,p, 3dlu, p, 3dlu, p, 10dlu,p"); // rows //$NON-NLS-1$ // Create a builder that assists in adding components to the container. // Wrap the panel with a standardized border. DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); JLabel logo = new JLabel(IconManager.getIcon("logo.ProjectLibre")); logo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); logo.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent arg0) { BrowserControl.displayURL("http://www.projectlibre.com");//$NON-NLS-1$ } }); builder.append(logo); builder.nextLine(2); builder.append(Messages.getContextString("Text.ShortTitle")); //$NON-NLS-1$ builder.nextLine(2); String version = VersionUtils.getVersion(); builder.append("Version " + (version == null ? "Unknown" : version)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ builder.nextLine(2); builder.append(Messages.getString("AboutDialog.copyright")); //$NON-NLS-1$ if (Environment.isOpenProj()) { builder.nextLine(2); builder.append(Main.getRunSinceMessage()); //$NON-NLS-1$ } return builder.getPanel(); }
From source file:com.projity.dialog.assignment.AssignmentDialog.java
License:Common Public License
public JComponent createContentPanel() { // Separating the component initialization and configuration // from the layout code makes both parts easier to read. initControls();//from w w w .j a v a2s .c o m FormLayout layout = new FormLayout("p, 1dlu, default ,3dlu, default", // cols //$NON-NLS-1$ "p, 3dlu," + (Environment.getStandAlone() ? "" : "p, 3dlu,") + "fill:200dlu:grow"); // rows //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ // Create a builder that assists in adding components to the container. // Wrap the panel with a standardized border. DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); // task names span whole dialog builder.add(taskNames, cc.xyw(builder.getColumn(), builder.getRow(), builder.getColumnCount())); builder.nextLine(2); if (!Environment.getStandAlone()) { if (!Environment.isExternal()) builder.add(getTeamOrAllLabel(), cc.xyw(builder.getColumn(), builder.getRow(), builder.getColumnCount())); builder.nextLine(2); } // builder.append(projectName); // builder.nextLine(2); builder.append(spreadSheetPane, createEditorsButtons(), createButtons()); return builder.getPanel(); }
From source file:com.projity.dialog.assignment.ReplaceAssignmentDialog.java
License:Common Public License
/** * Builds the panel. Initializes and configures components first, then * creates a FormLayout, configures the layout, creates a builder, sets a * border, and finally adds the components. * //from w ww . j a va 2 s . c om * @return the built panel */ public JComponent createContentPanel() { // Separating the component initialization and configuration // from the layout code makes both parts easier to read. initControls(); //TODO set minimum size FormLayout layout = new FormLayout("140dlu:grow", // cols "p, 3dlu, p, 3dlu, fill:200dlu:grow"); // rows // Create a builder that assists in adding components to the container. // Wrap the panel with a standardized border. DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.append(resourceName); builder.nextLine(2); builder.append(Messages.getString("Text.With")); builder.nextLine(2); builder.append(spreadSheetPane); return builder.getPanel(); }
From source file:com.projity.dialog.BaselineDialog.java
License:Common Public License
/** * Builds the panel. Initializes and configures components first, then * creates a FormLayout, configures the layout, creates a builder, sets a * border, and finally adds the components. * //from www.java 2 s. com * @return the built panel */ public JComponent createContentPanel() { // Separating the component initialization and configuration // from the layout code makes both parts easier to read. initControls(); //TODO set minimum size FormLayout layout = new FormLayout("default, 3dlu, fill:80dlu:grow", // cols //$NON-NLS-1$ "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p"); // rows //$NON-NLS-1$ // Create a builder that assists in adding components to the container. // Wrap the panel with a standardized border. DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.append(Messages.getString("BaselineDialog.Baseline")); //$NON-NLS-1$ builder.append(baseline); builder.nextLine(2); builder.addSeparator(""); //$NON-NLS-1$ builder.nextLine(2); builder.append(Messages.getString("BaselineDialog.For")); //$NON-NLS-1$ builder.nextLine(2); builder.append(entireProject); builder.nextLine(2); builder.append(selectedTasks); return builder.getPanel(); }
From source file:com.projity.dialog.calendar.ChangeWorkingTimeDialogBox.java
License:Common Public License
public JComponent createContentPanel() { initControls();/*from w ww . jav a2 s . c o m*/ FormLayout layout = new FormLayout("300dlu:grow", //$NON-NLS-1$ "p,p,fill:260dlu:grow"); //$NON-NLS-1$ DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); // JSplitPane settingsPanel=new JSplitPane(JSplitPane.VERTICAL_SPLIT); // settingsPanel.setTopComponent(createSettingsPanel()); // settingsPanel.setBottomComponent(new JPanel()); // settingsPanel.setDividerSize(0); JSplitPane panel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); // panel.setLeftComponent(settingsPanel); panel.setLeftComponent(createSettingsPanel()); panel.setRightComponent(sdCalendar); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); JButton backButton = new JButton(IconManager.getIcon("calendar.back")); //$NON-NLS-1$ backButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { long first = sdCalendar.getFirstDisplayedDate(); Calendar calendar = DateTime.calendarInstance(); calendar.setTimeInMillis(sdCalendar.getLastDisplayedDate()); int nbMonth = 0; while (calendar.getTimeInMillis() > first) { calendar.add(Calendar.MONTH, -1); nbMonth++; } calendar.setTimeInMillis(first); calendar.add(Calendar.MONTH, -nbMonth); sdCalendar.setFirstDisplayedDate(calendar.getTimeInMillis()); } }); JButton todayButton = new JButton(IconManager.getIcon("calendar.today")); //$NON-NLS-1$ todayButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Calendar calendar = DateTime.calendarInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.set(Calendar.DATE, 1); sdCalendar.setFirstDisplayedDate(calendar.getTimeInMillis()); } }); JButton forwardButton = new JButton(IconManager.getIcon("calendar.forward")); //$NON-NLS-1$ forwardButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Calendar calendar = DateTime.calendarInstance(); calendar.setTimeInMillis(sdCalendar.getLastDisplayedDate()); calendar.add(Calendar.DATE, 1); sdCalendar.setFirstDisplayedDate(calendar.getTimeInMillis()); } }); buttonPanel.add(backButton); buttonPanel.add(todayButton); buttonPanel.add(forwardButton); builder.nextLine(); builder.append(buttonPanel); builder.nextLine(); builder.append(panel); // builder.append(newCalendar); return builder.getPanel(); }