List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder appendSeparator
public JComponent appendSeparator()
From source file:org.apache.cayenne.modeler.dialog.codegen.GeneratorTabPanel.java
License:Apache License
public GeneratorTabPanel(String[] modeNames, Component[] modePanels) { this.generationMode = new JComboBox(modeNames); this.modeLayout = new CardLayout(); this.modesPanel = new JPanel(modeLayout); generationMode.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { modeLayout.show(modesPanel, generationMode.getSelectedItem().toString()); }//from www. ja v a2 s .c o m }); // assemble FormLayout layout = new FormLayout("right:70dlu, 3dlu, fill:300, fill:100dlu:grow", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); builder.append("Type:", generationMode, 1); builder.appendSeparator(); for (int i = 0; i < modeNames.length; i++) { modesPanel.add(modePanels[i], modeNames[i]); } setLayout(new BorderLayout()); add(builder.getPanel(), BorderLayout.NORTH); add(modesPanel, BorderLayout.CENTER); }
From source file:org.apache.cayenne.modeler.editor.cgen.GeneratorTabPanel.java
License:Apache License
public GeneratorTabPanel(String[] modeNames, Component[] modePanels) { setLayout(new BorderLayout()); JPanel panel = new JPanel(); this.generationMode = new JComboBox<>(modeNames); this.modeLayout = new CardLayout(); this.modesPanel = new JPanel(modeLayout); generationMode.addItemListener(e -> modeLayout.show(modesPanel, Objects.requireNonNull(generationMode.getSelectedItem()).toString())); // assemble/*from ww w . j a v a 2 s . c o m*/ FormLayout layout = new FormLayout("right:77dlu, 3dlu, fill:240, fill:300dlu:grow", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); builder.append("Type:", generationMode, 1); builder.appendSeparator(); for (int i = 0; i < modeNames.length; i++) { modesPanel.add(modePanels[i], modeNames[i]); } panel.setLayout(new BorderLayout()); panel.add(builder.getPanel(), BorderLayout.NORTH); panel.add(modesPanel, BorderLayout.CENTER); add(panel, BorderLayout.CENTER); }
From source file:org.qedeq.gui.se.pane.PluginPreferencesDialog.java
License:Open Source License
/** * Assembles settings for {@link ProofFinderPlugin}. * * @param plugin The transformation plugin. * @return Created panel./*from w w w . j av a 2s . c o m*/ */ private PluginGuiPreferencesCreator proofFinderConfig(final PluginBo plugin) { return new PluginGuiPreferencesCreator(plugin) { JComponent create(final Parameters parameters) { FormLayout layout = new FormLayout("left:pref, 5dlu, fill:50dlu, 5dlu, fill:50dlu, fill:pref:grow"); // columns DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); builder.getPanel().setOpaque(false); builder.append("Maximum proof lines"); proofFinderMaximumProofLengthTF = new JTextField(parameters.getString("maximumProofLines")); proofFinderMaximumProofLengthTF.setToolTipText("After this proof line number we abandom." + " the search. This is not the maximum proof line length of the final proof but the" + " but the maximum number of all generated proof lines."); builder.append(proofFinderMaximumProofLengthTF); builder.nextLine(); builder.append("Log frequence"); proofFinderLogFrequenceTF = new JTextField(parameters.getString("logFrequence")); proofFinderLogFrequenceTF .setToolTipText("After this number of new proof lines we" + " create a logging output."); builder.append(proofFinderLogFrequenceTF); builder.nextLine(); builder.append("Skip formulas"); proofFinderSkipFormulasTF = new JTextField(parameters.getString("skipFormulas")); proofFinderSkipFormulasTF.setToolTipText("Skip these list of formula numbers (see log output)." + " This a comma separated list of numbers."); builder.append(proofFinderSkipFormulasTF); builder.nextLine(); proofFinderExtraVarsTF = new JTextField(parameters.getString("extraVars")); builder.append("Extra proposition variables"); builder.append(proofFinderExtraVarsTF); proofFinderExtraVarsTF.setToolTipText("We use these number of extra proposition variables" + " beside the ones we have in our initial formulas and the goal formula."); builder.nextLine(); builder.appendSeparator(); builder.append("Operator"); builder.append("Order"); builder.append("Weight"); builder.nextLine(); builder.append("Proposition variable"); proofFinderPropositionVariableOrderTF = new JTextField( parameters.getString("propositionVariableOrder")); builder.append(proofFinderPropositionVariableOrderTF); proofFinderPropositionVariableWeightTF = new JTextField( parameters.getString("propositionVariableWeight")); builder.append(proofFinderPropositionVariableWeightTF); builder.nextLine(); builder.append("Part formula"); proofFinderPartFormulaOrderTF = new JTextField(parameters.getString("partFormulaOrder")); builder.append(proofFinderPartFormulaOrderTF); proofFinderPartFormulaWeightTF = new JTextField(parameters.getString("partFormulaWeight")); builder.append(proofFinderPartFormulaWeightTF); builder.nextLine(); builder.append("Disjunction"); proofFinderDisjunctionOrderTF = new JTextField(parameters.getString("disjunctionOrder")); builder.append(proofFinderDisjunctionOrderTF); proofFinderDisjunctionWeightTF = new JTextField(parameters.getString("disjunctionWeight")); builder.append(proofFinderDisjunctionWeightTF); builder.nextLine(); builder.append("Implication"); proofFinderImplicationOrderTF = new JTextField(parameters.getString("implicationOrder")); builder.append(proofFinderImplicationOrderTF); proofFinderImplicationWeightTF = new JTextField(parameters.getString("implicationWeight")); builder.append(proofFinderImplicationWeightTF); builder.nextLine(); builder.append("Negation"); proofFinderNegationOrderTF = new JTextField(parameters.getString("negationOrder")); builder.append(proofFinderNegationOrderTF); proofFinderNegationWeightTF = new JTextField(parameters.getString("negationWeight")); builder.append(proofFinderNegationWeightTF); builder.nextLine(); builder.append("Conjunction"); proofFinderConjunctionOrderTF = new JTextField(parameters.getString("conjunctionOrder")); builder.append(proofFinderConjunctionOrderTF); proofFinderConjunctionWeightTF = new JTextField(parameters.getString("conjunctionWeight")); builder.append(proofFinderConjunctionWeightTF); builder.nextLine(); builder.append("Equivalence"); proofFinderEquivalenceOrderTF = new JTextField(parameters.getString("equivalenceOrder")); builder.append(proofFinderEquivalenceOrderTF); proofFinderEquivalenceWeightTF = new JTextField(parameters.getString("equivalenceWeight")); builder.append(proofFinderEquivalenceWeightTF); builder.nextLine(); return GuiHelper.addSpaceAndTitle(builder.getPanel(), plugin.getServiceDescription()); } }; }