Example usage for com.jgoodies.forms.layout CellConstraints CellConstraints

List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout CellConstraints CellConstraints.

Prototype

public CellConstraints() 

Source Link

Document

Constructs a default instance of CellConstraints .

Usage

From source file:com.projity.dialog.ProjectInformationDialog.java

License:Common Public License

public JComponent createContentPanel() {

    FormLayout layout = new FormLayout("350dlu:grow", "fill:250dlu:grow"); //$NON-NLS-1$ //$NON-NLS-2$
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/* w  w  w  .ja va  2  s.  c o  m*/
    CellConstraints cc = new CellConstraints();

    tabbedPane = new JTabbedPane();
    tabbedPane.addTab(Messages.getString("ProjectInformationDialog.General"), createGeneralPanel()); //$NON-NLS-1$
    tabbedPane.addTab(Messages.getString("ProjectInformationDialog.Statistics"), createStatisticsPanel()); //$NON-NLS-1$
    tabbedPane.addTab(Messages.getString("ProjectInformationDialog.Notes"), createNotesPanel()); //$NON-NLS-1$
    builder.add(tabbedPane);
    mainComponent = tabbedPane;
    return builder.getPanel();
}

From source file:com.projity.dialog.ProjectInformationDialog.java

License:Common Public License

private JComponent createGeneralPanel() {
    FieldComponentMap map = createMap();
    FormLayout layout = new FormLayout("max(50dlu;pref), 3dlu, 90dlu, 10dlu, p, 3dlu,max(90dlu;pref),60dlu", // extra padding on right is for estimated field //$NON-NLS-1$
            "p,3dlu,p, 3dlu,p, 3dlu, p, 3dlu, p, 3dlu,p, 3dlu,p,3dlu,p,3dlu,p, 3dlu,p,3dlu,p, 6dlu, fill:50dlu:grow"); //$NON-NLS-1$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();
    builder.setDefaultDialogBorder();//w  w  w .  ja v  a 2s .com
    builder.add(createHeaderFieldsPanel(map), cc.xyw(builder.getColumn(), builder.getRow(), 8));
    builder.nextLine(2);
    map.append(builder, "Field.manager"); //$NON-NLS-1$
    builder.nextLine(2);

    map.appendSometimesReadOnly(builder, "Field.startDate"); //$NON-NLS-1$
    map.append(builder, "Field.currentDate"); //$NON-NLS-1$
    builder.nextLine(2);
    map.appendSometimesReadOnly(builder, "Field.finishDate"); //$NON-NLS-1$
    map.append(builder, "Field.statusDate"); //$NON-NLS-1$

    builder.nextLine(2);
    map.append(builder, "Field.forward"); //$NON-NLS-1$
    builder.nextColumn(2);
    map.append(builder, "Field.baseCalendar"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.priority"); //$NON-NLS-1$
    map.append(builder, "Field.projectStatus"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.projectType"); //$NON-NLS-1$
    map.append(builder, "Field.expenseType"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.projectDivision"); //$NON-NLS-1$
    map.append(builder, "Field.projectGroup"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.netPresentValue"); //$NON-NLS-1$
    map.append(builder, "Field.benefit"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.risk"); //$NON-NLS-1$
    builder.nextLine(2);

    if (!Environment.getStandAlone()) {
        map.append(builder, "Field.accessControlPolicy", 3); //$NON-NLS-1$
        builder.nextLine(2);
    }
    Collection extraFields = FieldDictionary
            .extractExtraFields(FieldDictionary.getInstance().getProjectFields(), false);
    JComponent extra = createFieldsPanel(map, extraFields);
    if (extra != null) {
        builder.add(extra, cc.xyw(builder.getColumn(), builder.getRow(), 7));
    }
    return builder.getPanel();
}

From source file:com.projity.dialog.ProjectInformationDialog.java

License:Common Public License

private JComponent createStatisticsPanel() {
    FieldComponentMap map = createMap();
    FormLayout layout = new FormLayout("p, 3dlu, 50dlu, 20dlu, p, 3dlu, 50dlu:grow", //$NON-NLS-1$
            "p, 3dlu, p, 3dlu,p, 3dlu, p, 10dlu, p,3dlu,p, 10dlu, p, 3dlu, p, 10dlu, p, 3dlu, p"); //$NON-NLS-1$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*  w ww . j  a  va2s.c o m*/
    CellConstraints cc = new CellConstraints();
    builder.setDefaultDialogBorder();
    builder.add(createHeaderFieldsPanel(map), cc.xyw(builder.getColumn(), builder.getRow(), 7));
    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.startDate"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.finishDate"); //$NON-NLS-1$
    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.baselineStart"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.baselineFinish"); //$NON-NLS-1$
    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.actualStart"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.actualFinish"); //$NON-NLS-1$

    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.duration"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.baselineDuration"); //$NON-NLS-1$
    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.actualDuration"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.remainingDuration"); //$NON-NLS-1$

    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.work"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.baselineWork"); //$NON-NLS-1$
    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.actualWork"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.remainingWork"); //$NON-NLS-1$

    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.cost"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.baselineCost"); //$NON-NLS-1$
    builder.nextLine(2);
    map.appendReadOnly(builder, "Field.actualCost"); //$NON-NLS-1$
    map.appendReadOnly(builder, "Field.remainingCost"); //$NON-NLS-1$
    return builder.getPanel();
}

From source file:com.projity.dialog.RenameProjectDialog.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  w  w w.j av a 2s . 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("250dlu:grow", // cols //$NON-NLS-1$
            "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.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();
    if (form.isSaveAs())
        builder.append(Messages.getString("Message.saveProjectAs1") + form.getName() //$NON-NLS-1$
                + Messages.getString("Message.saveProjectAs2")); //$NON-NLS-1$
    else
        builder.append(Messages.getString("Message.renameProject1") + form.getName() //$NON-NLS-1$
                + Messages.getString("Message.renameProject2")); //$NON-NLS-1$
    builder.nextLine(2);
    builder.append(createFieldPanel());
    return builder.getPanel();
}

From source file:com.projity.dialog.RenameProjectDialog.java

License:Common Public License

public JComponent createFieldPanel() {
    FormLayout layout = new FormLayout("p,3dlu,100dlu:grow", // cols //$NON-NLS-1$
            "p"); // rows //$NON-NLS-1$
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();//from  w w w.  j  ava 2 s . c  om
    CellConstraints cc = new CellConstraints();
    builder.append(Messages.getString("RenameProjectDialog.NewProjectName"), nameField); //$NON-NLS-1$
    return builder.getPanel();
}

From source file:com.projity.dialog.ResourceAdditionDialog.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   w  w w . j a v  a2  s.  c  o m
 * @return the built panel
 */

public JComponent createContentPanel() {
    initControls();
    //TODO set minimum size
    FormLayout layout = new FormLayout("200dlu:grow", // cols //$NON-NLS-1$
            "p,3dlu,p,3dlu,p"); // 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();
    builder.append(createFieldPanel());
    builder.nextLine(2);
    builder.add(new JScrollPane(resources));
    return builder.getPanel();
}

From source file:com.projity.dialog.ResourceAdditionDialog.java

License:Common Public License

public JComponent createFieldPanel() {
    FormLayout layout = new FormLayout("p", // cols //$NON-NLS-1$
            "p"); // rows //$NON-NLS-1$
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*  w w w  .ja v a2s .  c  o  m*/
    CellConstraints cc = new CellConstraints();
    builder.append(field1Label);
    return builder.getPanel();
}

From source file:com.projity.dialog.ResourceInformationDialog.java

License:Common Public License

public JComponent createGeneralPanel() {
    FieldComponentMap map = createMap();

    FormLayout layout = new FormLayout("p, 3dlu, 160dlu, 3dlu, p, 3dlu, p:grow", //$NON-NLS-1$
            "p,3dlu,p,3dlu,p,3dlu,p,3dlu,p,0dlu,p"); //$NON-NLS-1$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();// w  w w.j  ava 2 s  .c  om
    CellConstraints cc = new CellConstraints();
    map.append(builder, "Field.name"); //$NON-NLS-1$
    map.append(builder, "Field.initials"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.emailAddress"); //$NON-NLS-1$
    map.append(builder, "Field.group"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.rbsCode"); //$NON-NLS-1$
    map.append(builder, "Field.generic"); //$NON-NLS-1$
    map.append(builder, "Field.inactive"); //$NON-NLS-1$
    builder.nextLine(2);
    map.append(builder, "Field.resourceType"); //$NON-NLS-1$
    map.appendSometimesReadOnly(builder, "Field.materialLabel"); //$NON-NLS-1$
    builder.nextLine(2);
    builder.addLabel(map.getLabel("Field.baseCalendar") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    builder.nextColumn(2);
    changeWorkingTimeButton = getChangeWorkingTimeButton();
    builder.append(pairedComponents(map, "Field.baseCalendar", 0, changeWorkingTimeButton)); //$NON-NLS-1$
    return builder.getPanel();

}

From source file:com.projity.dialog.ResourceInformationDialog.java

License:Common Public License

public JComponent createAvailabilityPanel() {
    FieldComponentMap map = createMap();

    FormLayout layout = new FormLayout("p:grow", "p,3dlu,p,3dlu,fill:150dlu:grow"); //$NON-NLS-1$ //$NON-NLS-2$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*from w w w  .  j  a  va 2s.c om*/
    CellConstraints cc = new CellConstraints();
    builder.add(createHeaderFieldsPanel(map), cc.xyw(builder.getColumn(), builder.getRow(), 1));
    builder.nextLine(2);
    builder.add(createAvailabilitySpreadsheet(), cc.xyw(builder.getColumn(), builder.getRow(), 1));

    return builder.getPanel();
}

From source file:com.projity.dialog.ResourceInformationDialog.java

License:Common Public License

public JComponent createTasksPanel() {
    FieldComponentMap map = createMap();

    FormLayout layout = new FormLayout("p:grow", "p,3dlu,p,3dlu,fill:150dlu:grow"); //$NON-NLS-1$ //$NON-NLS-2$

    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.setDefaultDialogBorder();/*  w w w. ja  v a2  s . c o  m*/
    CellConstraints cc = new CellConstraints();
    builder.add(createHeaderFieldsPanel(map), cc.xyw(builder.getColumn(), builder.getRow(), 1));
    builder.nextLine(2);
    builder.append(Messages.getString("ResourceInformationDialog.AssignedToTasks")); // not using assigned button //$NON-NLS-1$
    builder.nextLine(2);
    builder.add(createAssignmentSpreadsheet(), cc.xyw(builder.getColumn(), builder.getRow(), 1));
    JComponent panel = builder.getPanel();
    HelpUtil.addDocHelp(panel, "Assign_Resources");

    return panel;
}