List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder appendSeparator
public JComponent appendSeparator(String text)
From source file:org.tsho.dmc2.ui.coweb.CowebAlgorithmForm.java
License:Open Source License
private void createForm(boolean step) { boolean debug = false; FormLayout layout = new FormLayout( //"l:9dlu:n, r:p:g, l:4dlu:n, c:49dlu:n, l:9dlu:n", FormHelper.JGOODIES_SHORT_COLUMN_SPECS, ""); DefaultFormBuilder builder; if (debug)// ww w . ja v a2s . c o m builder = new DefaultFormBuilder(new FormDebugPanel(), layout); else builder = new DefaultFormBuilder(this, layout); builder.setDefaultDialogBorder(); builder.setLeadingColumnOffset(1); builder.appendSeparator("Algorithm"); builder.nextLine(); builder.appendRow(builder.getLineGapSpec()); builder.nextLine(); builder.append(LABEL_POWER_SIZE, fieldPower); builder.nextLine(); builder.appendRow(builder.getLineGapSpec()); builder.appendRow(builder.getLineGapSpec()); builder.nextLine(2); if (step) { builder.append(LABEL_STEP_SIZE, fieldStepSize); builder.nextLine(); builder.appendRow(builder.getLineGapSpec()); builder.appendRow(builder.getLineGapSpec()); builder.nextLine(2); } builder.append(LABEL_TRANSIENTS, fieldTransients); builder.nextLine(); builder.append(LABEL_ITERATIONS, fieldIterations); builder.nextLine(); if (debug) { setLayout(new BorderLayout()); add(builder.getContainer()); FormDebugUtils.dumpAll(builder.getPanel()); } }
From source file:org.tsho.dmc2.ui.InfoPanel.java
License:Open Source License
public InfoPanel(Model model) { super();/*from w ww. j av a 2s . com*/ String modelName = null; String modelType = null; String modelDesc = null; String modelText = null; String modelDim = null; String modelPar = null; if (model != null) { modelName = model.getName(); if (model instanceof SimpleMap) { modelType = "discrete"; } else if (model instanceof ODE) { modelType = "continuous"; } else { modelType = "undefined (error)"; } //modelDesc = model.getDescription(); modelDesc = null; modelText = model.getModelText(); modelDim = Integer.toString(model.getNVar()); modelPar = Integer.toString(model.getNPar()); } //DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); FormLayout layout = new FormLayout( // "l:9dlu:n, l:p:n, l:4dlu:n, l:90dlu:n, l:8dlu:n", "l:9dlu:n, l:p:n, l:4dlu:n, l:p:g, l:8dlu:n", ""); DefaultFormBuilder builder = new DefaultFormBuilder(this, layout); CellConstraints cc = new CellConstraints(); builder.setDefaultDialogBorder(); builder.setLeadingColumnOffset(1); builder.appendSeparator("Model specification"); JTextArea textField = new JTextArea(modelName); textField.setEditable(false); textField.setLineWrap(true); builder.append("Name:", textField); textField = new JTextArea(modelType); textField.setEditable(false); textField.setLineWrap(true); builder.append("Type:", textField); textField = new JTextArea(modelDim); textField.setEditable(false); textField.setLineWrap(true); builder.append("Dimension:", textField); textField = new JTextArea(modelPar); textField.setEditable(false); textField.setLineWrap(true); builder.append("Parameters:", textField); String str; if (model instanceof InvertibleMap) { str = "yes"; } else { str = "no"; } textField = new JTextArea(str); textField.setEditable(false); textField.setLineWrap(true); builder.append("Has inverse:", textField); if (model instanceof DifferentiableMap) { str = "yes"; } else { str = "no"; } textField = new JTextArea(str); textField.setEditable(false); textField.setLineWrap(true); builder.append("Has jacobian:", textField); if (modelDesc != null) { builder.appendSeparator("Model description"); textField = new JTextArea(modelDesc); textField.setEditable(false); textField.setLineWrap(true); textField.setWrapStyleWord(true); builder.appendRow(builder.getLineGapSpec()); builder.appendRow("t:p:n"); builder.nextLine(2); //builder.append("Model description:"); builder.add(textField, cc.xywh(builder.getColumn(), builder.getRow(), 3, 1)); builder.nextLine(); } if (modelText != null) { builder.appendSeparator("Model text"); JPanel panel = new JPanel(new BorderLayout()); JTextArea area = new JTextArea(modelText); area.setLineWrap(false); //area.setWrapStyleWord(true); area.setCaretPosition(0); area.setEditable(false); panel.add(new JScrollPane(area)); builder.appendRow(builder.getLineGapSpec()); builder.appendRow("t:50dlu:g"); builder.nextLine(2); //builder.append("Model description:"); builder.add(panel, cc.xywh(builder.getColumn(), builder.getRow(), 3, 1)); builder.nextLine(); } builder.appendSeparator("Memory"); final JTextArea maxMem = new JTextArea("1"); maxMem.setEditable(false); maxMem.setLineWrap(true); builder.append("Max memory:", maxMem); final JTextArea totMem = new JTextArea(); totMem.setEditable(false); totMem.setLineWrap(true); builder.append("Total memory:", totMem); final JTextArea freeMem = new JTextArea(); freeMem.setEditable(false); freeMem.setLineWrap(true); builder.append("Free memory:", freeMem); // TODO kludge if (showMemoryThread != null) { showMemoryThread.interrupt(); } // TODO change this to a swing timer showMemoryThread = new Thread("showMemory") { public void run() { Runtime runtime; do { runtime = Runtime.getRuntime(); maxMem.setText(Long.toString(runtime.maxMemory() / (1024 * 1024)) + " MB"); totMem.setText(Long.toString(runtime.totalMemory() / (1024 * 1024)) + " MB"); freeMem.setText(Long.toString(runtime.freeMemory() / (1024 * 1024)) + " MB"); if (Thread.interrupted()) { break; } try { Thread.sleep(2000); } catch (InterruptedException e) { break; } } while (true); } }; showMemoryThread.start(); }
From source file:org.tsho.dmc2.ui.WindowsSizePanel.java
License:Open Source License
/** * *///w w w . j a v a 2 s . c o m public WindowsSizePanel(int width, int height) { super(); hModel = new SpinnerNumberModel(width, 0, Integer.MAX_VALUE, 10); vModel = new SpinnerNumberModel(height, 0, Integer.MAX_VALUE, 10); wSpinner.setModel(hModel); hSpinner.setModel(vModel); checkBox = new JCheckBox(); checkBox.addItemListener(this); if (DEFAULT_CHECKBOX_SELECTED == true) { checkBox.setSelected(true); } FormLayout layout = new FormLayout("right:max(40dlu;pref), 3dlu, fill:min(30dlu;pref), 20dlu", ""); DefaultFormBuilder builder; builder = new DefaultFormBuilder(this, layout); builder.setDefaultDialogBorder(); builder.appendSeparator("Plot dimensions"); builder.nextLine(); builder.appendRow(builder.getLineGapSpec()); builder.nextLine(); builder.append("Width", wSpinner); builder.nextLine(); builder.append("Height", hSpinner); builder.nextLine(); builder.append("Square", checkBox); builder.nextLine(); }
From source file:phex.gui.dialogs.ExportDialog.java
License:Open Source License
@Override protected JPanel createDialogContentPanel() { initComponents();//from w w w .j av a 2 s . c o m JPanel contentPanel = new JPanel(); FormLayout layout = new FormLayout("7dlu, d, 3dlu, fill:d:grow, 2dlu, d"); DefaultFormBuilder builder = new DefaultFormBuilder(layout, contentPanel); builder.setLeadingColumnOffset(1); // format section builder.appendSeparator(Localizer.getString("ExportDialog_ExportFormat")); builder.append(standardExport); builder.append(standardExportFormatCB); builder.nextLine(); builder.append(customExport); builder.append(customExportFormatTF); builder.append(browseCustomFormat); // source section builder.appendSeparator(Localizer.getString("ExportDialog_ExportSource")); builder.append(exportAllFiles, 3); builder.nextLine(); builder.append(exportSelectedFiles, 3); builder.nextLine(); // output section builder.appendSeparator(Localizer.getString("ExportDialog_Output")); builder.append(Localizer.getString("ExportDialog_FileName"), outputFileTF, browseOutFile); // option section builder.appendSeparator(Localizer.getString("ExportDialog_Options")); magnetInclXs = new JCheckBox(Localizer.getString("ExportDialog_MagnetIncludeXS")); magnetInclXs.setToolTipText(Localizer.getString("ExportDialog_TTTMagnetIncludeXS")); builder.append(magnetInclXs, 3); builder.nextLine(); builder.append(magnetInclFreebase, 3); return contentPanel; }
From source file:phex.gui.dialogs.security.SecurityRuleDialog.java
License:Open Source License
@Override protected JPanel createDialogContentPanel() { initComponents();/*from www . j av a 2s . co m*/ JPanel contentPanel = new JPanel(); FormLayout layout = new FormLayout("7dlu, d, 3dlu, d, 1dlu, d, 1dlu, d, fill:d:grow"); DefaultFormBuilder builder = new DefaultFormBuilder(layout, contentPanel); builder.setLeadingColumnOffset(1); builder.appendSeparator(Localizer.getString("SecurityRuleDialog_SecurityRule")); builder.append(Localizer.getString("SecurityRuleDialog_Description"), descriptionTF, 6); builder.append(disableRuleCkBx, 8); builder.appendSeparator(Localizer.getString("SecurityRuleDialog_NetworkAddress")); builder.append(Localizer.getString("SecurityRuleDialog_IP_CIDR"), ipTF); builder.append(Localizer.getString("SecurityRuleDialog_IP_CIDR_Separator"), cidrTF, true); builder.appendSeparator(Localizer.getString("SecurityRuleDialog_Options")); //builder.append( Localizer.getString( "SecurityRuleDialog_ActionType" ), // ruleTypeCBox, 5 ); builder.append(Localizer.getString("SecurityRuleDialog_Expires"), expiresCBox, 5); builder.append(Box.createGlue()); builder.append(createTimePanel(), 6); builder.append(Box.createGlue()); builder.append(isDeletedOnExpiryCkbx, 6); refreshExpiryDisplayState(); return contentPanel; }
From source file:pl.edu.agh.iisg.salomon.plugin.datasetvis.result.VisResultComponent.java
License:Open Source License
private JComponent createResultComponent() { JScrollPane scrollPanel = new JScrollPane(_table); scrollPanel.setBorder(BorderFactory.createLoweredBevelBorder()); JButton showButton = new JButton("Show"); showButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showDataSet();//from w w w. j a va 2 s . com } }); // building form FormLayout layout = new FormLayout("fill:default, 3dlu, fill:100dlu:grow, 3dlu, fill:min", "top:default, default, fill:200dlu:grow"); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder(); builder.append("Dataset name", _txtDataSetName); builder.append(showButton); builder.appendSeparator("Dataset data"); builder.append(scrollPanel, 5); return builder.getPanel(); }
From source file:pl.mariuszczarny.investorsimulator.view.InvestmentFundsView.java
public JPanel buildPanel() { FormLayout layout = new FormLayout( "right:max(40dlu;pref), 3dlu, 70dlu, 7dlu, " + "right:max(40dlu;pref), 3dlu, 70dlu", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();// www . j a v a 2 s . co m builder.appendSeparator(ViewConstants.INVESTMENT_FUND.getValue()); builder.append("Button1", getSellButton()); builder.nextLine(); builder.append("Button2", getBuyButton()); builder.append(ViewConstants.FUDS_TYPE.getValue(), getFundTypesComboBox()); builder.append("Spinner", getUnitSpinner()); builder.append("Konto", getAmountTextfield()); builder.append("Warto funduszu", getFundValueTextfield()); builder.append("Liczba jednostek", getUnitOfFundTextfield()); getRadioButtonGroup(); builder.append("Typ A", getRadioButtonTypeA()); builder.append("Typ B", getRadioButtonTypeB()); return builder.getPanel(); }
From source file:rvsnoop.ui.RvConnectionDialog.java
License:Apache License
private void buildContentArea(RvConnection conn) { DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("r:default, 3dlu, p:grow", "")); builder.appendSeparator("Rendezvous Parameters"); builder.append("Description", description).setLabelFor(description); builder.nextLine();/*from ww w. ja v a 2s. c o m*/ builder.append("Service", service).setLabelFor(service); builder.nextLine(); builder.append("Network", network).setLabelFor(network); builder.nextLine(); builder.append("Daemon", daemon).setLabelFor(daemon); builder.nextLine(); builder.appendSeparator("Subscribed Subjects"); builder.append("Subjects", subject).setLabelFor(subject); builder.nextLine(); description.setText(conn.getDescription()); service.setText(conn.getService()); network.setText(conn.getNetwork()); network.setToolTipText("networkcardid;networkaddress"); daemon.setText(conn.getDaemon()); subject.setToolTipText("Put multiple subjects on separate lines"); subject.setBorder(daemon.getBorder()); if (conn.getNumSubjects() > 0) { subject.setText(Joiner.on("\n").join(conn.getSubjects())); } else { subject.setText(">\n"); } final JPanel panel = builder.getPanel(); panel.setBorder(Borders.DLU2_BORDER); getContentPane().add(panel, BorderLayout.CENTER); }
From source file:salomon.engine.controller.gui.agentconfig.AgentConfigManagerGUI.java
License:Open Source License
private JPanel createAgentListPanel() { LOGGER.info("AgentConfigManagerGUI.createAgentListPanel()"); FormLayout layout = new FormLayout("pref:grow", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();//from w w w . j a v a2 s.com builder.appendSeparator("Agents"); builder.append(new JScrollPane(_agentsList)); JPanel buttonsPanel = ButtonBarFactory .buildCenteredBar(new JButton[] { _addAgentConfig, _removeAgentConfig, _configureAgent }); builder.append(buttonsPanel); return builder.getPanel(); }
From source file:salomon.engine.controller.gui.agentconfig.AgentConfigManagerGUI.java
License:Open Source License
private JPanel createAgentPanel() { FormLayout layout = new FormLayout("left:pref, 3dlu, right:100dlu:grow", "fill:default"); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.setDefaultDialogBorder();//from w w w . jav a2 s.c om builder.appendSeparator("Agent data"); builder.append(_cmbAgents, 3); // TODO: store in DB builder.appendSeparator("Agent config info"); builder.append(new JScrollPane(new JTextField()), 3); return builder.getPanel(); }