List of usage examples for com.jgoodies.forms.builder PanelBuilder addSeparator
public final JComponent addSeparator(String textWithMnemonic)
addSeparator("Name"); // No Mnemonic addSeparator("N&ame"); // Mnemonic is 'a' addSeparator("Save &as"); // Mnemonic is the second 'a' addSeparator("Look&&Feel"); // No mnemonic, text is "look&feel" From source file:org.drugis.addis.gui.builder.LyndOBrienView.java
License:Open Source License
public JPanel buildPanel() { FormLayout layout = new FormLayout("fill:0:grow", "p, 3dlu, p, 3dlu, p, 3dlu, " + "p, 3dlu, p, 3dlu, p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder();/*www. j av a 2 s . co m*/ CellConstraints cc = new CellConstraints(); builder.addSeparator("Benefit-risk plane"); JScrollPane scatter = new JScrollPane(createWaiter(new ScatterplotBuilder())); scatter.setViewportBorder(null); builder.add(scatter, cc.xy(1, 3)); String alternativeName = ""; String baselineName = ""; Object baseline = d_BRpm.getBean().getBaseline(); Object alternative = d_BRpm.getBean().getNonBaselineAlternatives().get(0); if (d_BRpm.getBean() instanceof StudyBenefitRiskAnalysis) { Study s = ((StudyBenefitRiskAnalysis) d_BRpm.getBean()).getStudy(); Arm baseArm = (Arm) baseline; Arm altArm = (Arm) alternative; baselineName = s.getTreatment(baseArm).getLabel(); alternativeName = s.getTreatment(altArm).getLabel(); } else if (d_BRpm.getBean() instanceof MetaBenefitRiskAnalysis) { baselineName = ((TreatmentDefinition) baseline).getLabel(); alternativeName = ((TreatmentDefinition) alternative).getLabel(); } builder.add(AuxComponentFactory .createTextPane("Results of Monte Carlo simulations based on the difference-distributions of" + " the alternatives and criteria. Results in the NW quadrant indicate that " + baselineName + " is better and" + " results in the SE quadrant indicate that " + alternativeName + " is better."), cc.xy(1, 7)); builder.addSeparator("Benefit-Risk Aceptability curve", cc.xy(1, 9)); JScrollPane pvalue = new JScrollPane(createWaiter(new PvalueplotBuilder())); pvalue.setViewportBorder(null); builder.add(pvalue, cc.xy(1, 11)); builder.add(AuxComponentFactory.createTextPane("Probability for a given acceptability threshold " + "\u03BC that " + alternativeName + " is superior to " + baselineName + ". Indicates the" + " proportion of datapoints in the Benefit-Risk" + " plane that lie below the line y = \u03BC x"), cc.xy(1, 13)); d_panel = builder.getPanel(); return d_panel; }
From source file:org.surveyforge.runner.Frame.java
License:Open Source License
private JPanel createSectionPanel(Questionnaire questionnaire, Feed pageFeed, SectionFeed sectionFeed) { StringBuffer rowSpecification = new StringBuffer(); for (int elementIndex = 0; elementIndex <= questionnaire.getComponentElements().size(); elementIndex++) rowSpecification.append("3dlu, top:pref, 3dlu, pref, "); FormLayout sectionLayout = new FormLayout("3dlu, max(150dlu;pref):grow, 5dlu, left:pref, 3dlu:grow", rowSpecification.toString()); PanelBuilder pageSectionPanelBuilder = new PanelBuilder(sectionLayout); pageSectionPanelBuilder.setBorder(BorderFactory.createTitledBorder( BorderFactory.createLineBorder(Color.DARK_GRAY, 1), sectionFeed.getTitle(), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, Color.DARK_GRAY)); boolean firstElement = true; for (QuestionnaireElement element : questionnaire.getElementsInPageAndSection(pageFeed, sectionFeed)) { if (!firstElement) { pageSectionPanelBuilder.nextLine(2); pageSectionPanelBuilder.addSeparator(""); pageSectionPanelBuilder.nextLine(2); } else {// www . jav a 2s.co m pageSectionPanelBuilder.nextLine(); firstElement = false; } pageSectionPanelBuilder.nextColumn(); // Needed to place cursor in correct column if (element.getQuestion() != null) { JTextArea questionText = new JTextArea(element.getQuestion().getText()); questionText.setFocusable(false); questionText.setEditable(false); questionText.setLineWrap(true); questionText.setWrapStyleWord(true); pageSectionPanelBuilder.add(questionText); } else pageSectionPanelBuilder.nextColumn(1); pageSectionPanelBuilder.nextColumn(2); pageSectionPanelBuilder.add(this.createDataEntryComponent(element)); } // JButton cambioModelo = new JButton( "Cambio" ); // cambioModelo.addActionListener( new ActionListener( ) // { // public void actionPerformed( ActionEvent e ) // { // QuestionnaireRunner.TempQuestionnaire newData = new QuestionnaireRunner.TempQuestionnaire( ); // newData.setAnyoNacimiento( 1950 ); // newData.setMesNacimiento( 8 ); // Frame.this.dataModel.setBean( newData ); // } // } ); // pageSectionPanelBuilder.nextLine( ); // pageSectionPanelBuilder.nextLine( ); // pageSectionPanelBuilder.nextColumn( 3 ); // pageSectionPanelBuilder.add( cambioModelo ); return pageSectionPanelBuilder.getPanel(); }
From source file:presentation.recordInfo.GuiTabRecordInfo.java
License:Open Source License
private JPanel initRecordPanel() { recordTitle = new JTextArea(""); recordTitle.setEditable(false);//from ww w.j a va 2 s.co m recordTitle.setBorder(BorderFactory.createEtchedBorder()); JPanel p = new JPanel(); FormLayout layout = new FormLayout("710:grow", // columns "pref,5,pref"); // rows p.setLayout(layout); PanelBuilder builder = new PanelBuilder(p, layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); recordState = builder.addSeparator(ControlMain.getProperty("label_recordTitle")); builder.add(recordTitle, cc.xywh(1, 3, 1, 1)); return p; }
From source file:tvpearlplugin.TVPearlPluginSettingsTab.java
License:Open Source License
private void addSeparator(final PanelBuilder builder, final String label) { builder.appendRow(FormFactory.PARAGRAPH_GAP_ROWSPEC); builder.appendRow(FormFactory.PREF_ROWSPEC); builder.nextRow(2);/*from w ww. jav a2 s. co m*/ builder.addSeparator(label); }
From source file:zattooplugin.ZattooSettingsTab.java
License:Open Source License
public JPanel createSettingsPanel() { final PanelBuilder builder = new PanelBuilder(new FormLayout(FormFactory.RELATED_GAP_COLSPEC.encode() + "," + FormFactory.PREF_COLSPEC.encode() + "," + FormFactory.RELATED_GAP_COLSPEC.encode() + "," + FormFactory.PREF_COLSPEC.encode() + "," + FormFactory.GLUE_COLSPEC.encode(), "")); final CellConstraints cc = new CellConstraints(); final ZattooCountry[] countries = new ZattooCountry[] { new ZattooCountry("de", mLocalizer.msg("country_de", "Germany")), // new ZattooCountry("at", mLocalizer.msg("country_at", "Austria")), new ZattooCountry("ch", mLocalizer.msg("country_ch", "Switzerland")) }; mCountry = new JComboBox(countries); mCountry.setSelectedItem(new ZattooCountry(mSettings.getCountry(), "")); builder.appendRow(FormFactory.LINE_GAP_ROWSPEC); builder.appendRow(FormFactory.PREF_ROWSPEC); builder.nextRow();//from ww w. j a v a 2 s . c om builder.add(new JLabel(mLocalizer.msg("country", "Country:")), cc.xy(2, builder.getRow())); builder.add(mCountry, cc.xy(4, builder.getRow())); mRbLocalPlayer = new JRadioButton(mLocalizer.msg("localPlayer", "Use local player"), mSettings.getUseLocalPlayer()); mRbLocalPlayer.setEnabled(ZattooPlugin.canUseLocalPlayer()); mRbWebPlayer = new JRadioButton(mLocalizer.msg("webPlayer", "Use web player"), mSettings.getUseWebPlayer()); mRbPrism = new JRadioButton(mLocalizer.msg("prism", "Mozilla Prism"), mSettings.getUsePrismPlayer()); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(mRbLocalPlayer); buttonGroup.add(mRbWebPlayer); buttonGroup.add(mRbPrism); builder.appendRow(FormFactory.PARAGRAPH_GAP_ROWSPEC); builder.appendRow(FormFactory.PREF_ROWSPEC); builder.nextRow(2); builder.addSeparator(mLocalizer.msg("player", "Player")); builder.appendRow(FormFactory.LINE_GAP_ROWSPEC); builder.appendRow(FormFactory.PREF_ROWSPEC); builder.nextRow(2); builder.add(mRbLocalPlayer, cc.xyw(2, builder.getRow(), builder.getColumnCount() - 1)); builder.appendRow(FormFactory.LINE_GAP_ROWSPEC); builder.appendRow(FormFactory.PREF_ROWSPEC); builder.nextRow(2); builder.add(mRbWebPlayer, cc.xyw(2, builder.getRow(), builder.getColumnCount() - 1)); builder.appendRow(FormFactory.LINE_GAP_ROWSPEC); builder.appendRow(FormFactory.PREF_ROWSPEC); builder.nextRow(2); builder.add(mRbPrism, cc.xyw(2, builder.getRow(), builder.getColumnCount() - 1)); return builder.getPanel(); }