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

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

Introduction

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

Prototype

public DefaultFormBuilder(FormLayout layout) 

Source Link

Document

Constructs a DefaultFormBuilder for the given layout.

Usage

From source file:com.projity.dialog.UserInfoDialog.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.
 *
 * @return the built panel/*from   ww  w. j  av  a  2s. c om*/
 */

public JComponent createContentPanel() {
    FormLayout layout = new FormLayout("p,3dlu,p,3dlu", // cols //$NON-NLS-1$
            "p,10dlu,p,10dlu"); // 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();
    JEditorPane l = new JEditorPane("text/html", Messages.getString("LicenseDialog.Email"));
    l.setEditable(false);
    l.setOpaque(false);
    l.setFont(l.getFont().deriveFont(Font.PLAIN));
    JLabel emailLabel = new JLabel(Messages.getString("LicenseDialog.EmailLabel") + ":");
    //emailLabel.setFont(emailLabel.getFont().deriveFont(Font.PLAIN));
    builder.add(l, cc.xyw(1, 1, 4));
    builder.nextLine(2);
    builder.append(emailLabel, email);
    builder.nextLine(2);

    JComponent result = builder.getPanel();
    return result;
}

From source file:com.projity.dialog.WelcomeDialog.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   ww w. ja va2  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.
    initControls();
    //TODO set minimum size
    FormLayout layout = new FormLayout("default, 3dlu, default, 3dlu, default", // cols //$NON-NLS-1$
            "p, 8dlu, p, 3dlu, p, 3dlu, p, 3dlu"); // 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.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); // use bigger border to fit title bar text
    builder.append(Messages.getString("WelcomeDialog.WhatWouldYouLikeToDo") + "      "); // adding spaces to widen dialog //$NON-NLS-1$ //$NON-NLS-2$
    builder.nextLine(2);
    builder.append(createProject);
    builder.nextLine(2);
    builder.append(openProject);
    if (Environment.isAdministrator()) {
        builder.nextLine(2);
        builder.append(manageResources);
    }
    requestFocusInWindow();
    return builder.getPanel();
}

From source file:com.projity.dialog.XbsDependencyDialog.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 va2  s  .  com*/
    //TODO set minimum size
    FormLayout layout = new FormLayout("50dlu,3dlu,50dlu,3dlu,50dlu,3dlu,50dlu", // cols
            "p,3dlu,p,3dlu,p,3dlu"); // 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(Messages.getString("Text.From") + ":");
    builder.add(preLabel, cc.xyw(builder.getColumn(), builder.getRow(), 5));
    builder.nextLine(2);
    builder.append(Messages.getString("Text.To") + ":");
    builder.add(sucLabel, cc.xyw(builder.getColumn(), builder.getRow(), 5));

    return builder.getPanel();
}

From source file:com.projity.pm.graphic.chart.ChartLegend.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 a 2s . c  o  m
    FormLayout layout = new FormLayout("p:grow, 3dlu,100dlu:grow,5dlu, default, 5dlu", // cols //$NON-NLS-1$
            "p, 3dlu, p, 3dlu, p, 3dlu, " + (simple ? "" : "fill:") + "p:grow, 5dlu"); // 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.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    CellConstraints cc = new CellConstraints();

    builder.addLabel(Messages.getString("ChartLegend.ResourceFilter"), cc.xy(1, 1)); //$NON-NLS-1$
    builder.add(filterComboBox, cc.xy(3, 1));
    builder.add(treeScrollPane, cc.xywh(1, 3, 3, 5));
    builder.add(tracesScrollPane, cc.xy(5, 7));
    if (simple) {
        builder.add(selectedOnTop, cc.xy(5, 1));
    } else {
        builder.add(cumulative, cc.xy(5, 1));
        builder.add(histogram, cc.xy(5, 3));
        builder.add(workCostRadioPanel(), cc.xy(5, 5));
    }
    return builder.getPanel();
}

From source file:com.projity.pm.graphic.TabbedNavigation.java

License:Common Public License

public JComponent createContentPanel(MenuManager menuManager, JToolBar toolbar, int group, int tabPlacement,
        boolean addFilterButtons) {
    this.menuManager = menuManager;
    menuManager.add(this);
    boolean top = (tabPlacement == JTabbedPane.TOP);
    int height = top ? 45 : 15;
    FormLayout layout = new FormLayout("p:grow", "fill:" + height + "dlu:grow");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();
    builder.setBorder(BorderFactory.createEmptyBorder());
    tabbedPane = new ExtTabbedPane();
    tabbedPane.setTabPlacement(tabPlacement);
    int tabCount = 0;
    int groupCount = 0;
    for (int i = 0; i < toolbar.getComponentCount(); i++) {
        Object obj = toolbar.getComponent(i);
        if (obj instanceof JToolbarSeparator)
            groupCount++;/*  ww w . j av  a 2  s . co  m*/
        if (!(obj instanceof AbstractButton))
            continue;
        if (group != -1 && group != groupCount)
            continue;
        AbstractButton b = (AbstractButton) obj;
        Action action = b.getAction();
        if (action == menuManager.getActionFromId(ACTION_TRACKING_GANTT))
            continue;
        if (action == menuManager.getActionFromId(ACTION_PROJECTS))
            continue;
        JComponent component;
        if (top)
            component = createSubPanel(action, addFilterButtons);
        else
            component = dummy();
        component.setBorder(BorderFactory.createEmptyBorder());
        if (Environment.isNewLook() && !Environment.isNewLaf())
            component.setOpaque(false);
        String text = HyperLinkToolTip.extractTip(b.getToolTipText());
        tabbedPane.addTab(text, component);
        if (action == menuManager.getActionFromId(ACTION_RESOURCES))
            this.resourceTabCount = tabCount;
        tabbedPane.setToolTipTextAt(tabCount, text); // don't use version with F1
        actions.add(action);
        tabCount++;
    }
    builder.add(tabbedPane);
    JComponent c = builder.getPanel();
    c.setBorder(BorderFactory.createEmptyBorder());

    return c;
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createDialogPanel() {
    FormLayout layout = new FormLayout("p, 3dlu, p, 3dlu", "p, 3dlu,p, 3dlu, p, 3dlu,p,3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();
    builder.setDefaultDialogBorder();/*from w  ww .j a  v  a  2 s  .com*/
    builder.add(createPrinterPanel(), cc.xyw(1, 1, 3));
    builder.add(createPaperPanel(), cc.xywh(1, 3, 1, 3));
    builder.add(createOrientationPanel(), cc.xy(3, 3));
    builder.add(createMarginsPanel(), cc.xy(3, 5));
    builder.add(createScalingPanel(), cc.xyw(1, 7, 3));
    return builder.getPanel();
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createPrinterPanel() {
    FormLayout layout = new FormLayout("p", "p, 3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.append(printers);//from  w w w .j  av  a  2s  .  c  om
    return builder.getPanel();
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createVerticalPanel() {
    FormLayout layout = new FormLayout("p",
            printSpreadSheet == null ? "p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu"
                    : "p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();//  www.  j  a v  a2s. c  om
    //      builder.append(createFlowSettingsPanel());
    //      builder.nextLine(2);
    builder.append(createFlowPrinterPanel());
    builder.nextLine(2);
    builder.append(createFlowOrientationPanel());
    builder.nextLine(2);
    builder.append(createFlowPaperPanel());
    builder.nextLine(2);
    builder.append(createFlowMarginsPanel());
    builder.nextLine(2);
    if (printSpreadSheet != null) {
        builder.append(createFlowPartPanel());
        builder.nextLine(2);
    }
    builder.append(createFlowScalingPanel());
    builder.nextLine(2);
    builder.append(saveSettings);
    //      builder.nextLine(2);
    //      builder.append(saveWebPDFSettings);
    return builder.getPanel();
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createFlowPrinterPanel() {
    FormLayout layout = new FormLayout("1dlu,p:grow,1dlu", "p, 3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.nextColumn();//from   w  w  w . j  av  a 2  s. c o  m
    builder.append(printers);
    JPanel panel = builder.getPanel();
    panel.setBorder(new TitledBorder(Messages.getString("PageSetupDialog.Printers")));
    return panel;
}

From source file:com.projity.print.PageSetup.java

License:Common Public License

private JComponent createPaperPanel() {
    FormLayout layout = new FormLayout("8dlu, p,p,8dlu", "p, 3dlu:grow,p, 2dlu");

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();
    builder.add(createPaperSizePanel(), cc.xyw(2, 1, 2));
    JPanel panel = builder.getPanel();
    panel.setBorder(new TitledBorder(Messages.getString("PageSetupDialog.Paper")));
    return panel;
}