Example usage for com.jgoodies.forms.builder DefaultFormBuilder setLeadingColumnOffset

List of usage examples for com.jgoodies.forms.builder DefaultFormBuilder setLeadingColumnOffset

Introduction

In this page you can find the example usage for com.jgoodies.forms.builder DefaultFormBuilder setLeadingColumnOffset.

Prototype

@Deprecated
public void setLeadingColumnOffset(int columnOffset) 

Source Link

Document

Sets the offset of the leading column, often 0 or 1.

Usage

From source file:org.openthinclient.console.wizards.initrealm.SetupADSACIPanel.java

License:Open Source License

public JComponent getComponent() {
    if (null == component) {
        final DefaultFormBuilder dfb = new DefaultFormBuilder(
                new FormLayout("15dlu, 15dlu, fill:max(200dlu;pref)"), Messages.getBundle()); //$NON-NLS-1$
        final ActionListener changeForwarder = new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                updateComponentStates();
                fireChangeEvent();// w ww  .  j a  v  a2  s.co  m
            }
        };

        baseCheckBox = new JCheckBox();
        baseCheckBox.setVerticalTextPosition(SwingConstants.TOP);
        baseCheckBox.setSelected(true);
        baseCheckBox.addActionListener(changeForwarder);
        dfb.append(baseCheckBox, dfb.getColumnCount());
        dfb.nextLine();

        dfb.setLeadingColumnOffset(1);

        adminAccessCheckBox = new JCheckBox();
        adminAccessCheckBox.setVerticalAlignment(SwingConstants.TOP);
        adminAccessCheckBox.setVerticalTextPosition(SwingConstants.TOP);
        adminAccessCheckBox.addActionListener(changeForwarder);
        adminAccessCheckBox.setSelected(true);
        dfb.append(adminAccessCheckBox, 2);
        dfb.nextLine();

        searchForAllCheckBox = new JCheckBox();
        searchForAllCheckBox.setVerticalTextPosition(SwingConstants.TOP);
        searchForAllCheckBox.setSelected(true);
        dfb.append(searchForAllCheckBox, 2);
        dfb.nextLine();

        updateComponentStates();

        component = dfb.getPanel();
        component.setName(Messages.getString("SetupADSACIPanel.name")); //$NON-NLS-1$
    }

    return component;
}

From source file:org.tsho.dmc2.ui.bifurcation.BifVerticalAxisForm.java

License:Open Source License

private void createForm(String[] labels) {

    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)//from  w  w  w .  j  ava  2  s  .c om
        builder = new DefaultFormBuilder(new FormDebugPanel(), layout);
    else
        builder = new DefaultFormBuilder(this, layout);

    builder.setDefaultDialogBorder();
    builder.setLeadingColumnOffset(1);

    builder.appendSeparator("Vertical axis");
    builder.nextLine();

    builder.appendRow(builder.getLineGapSpec());
    builder.nextLine(1);

    box1 = new JComboBox(labels);
    builder.append("variable", box1);
    builder.nextLine();

    //        box2 = new JComboBox(labels);
    //        box2.addItemListener(myListener);
    //        builder.append("Range axis", box2);
    //        builder.nextLine();
    //
    //        int box1Width = box1.getPreferredSize().width;
    //        int box1Height = box1.getPreferredSize().height;
    //        int box2Width = box2.getPreferredSize().width;
    //        int box2Height = box2.getPreferredSize().height;
    //        
    //        int max = (box1Width > box2Width ? box1Width : box2Width);
    //        box1.setPreferredSize(new Dimension(max, box1Height));
    //        box2.setPreferredSize(new Dimension(max, box2Height));

    if (debug) {
        setLayout(new BorderLayout());
        add(builder.getContainer());
        FormDebugUtils.dumpAll(builder.getPanel());
    }
}

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)//from ww  w .  j ava2s .com
        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();/*  www.  jav a2s  .  c o  m*/

    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:phex.gui.dialogs.ExportDialog.java

License:Open Source License

@Override
protected JPanel createDialogContentPanel() {
    initComponents();//from w  w w  .  java2  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();//  w w  w .  j  ava 2 s . 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;
}