Example usage for com.jgoodies.forms.layout Sizes DLUX11

List of usage examples for com.jgoodies.forms.layout Sizes DLUX11

Introduction

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

Prototype

ConstantSize DLUX11

To view the source code for com.jgoodies.forms.layout Sizes DLUX11.

Click Source Link

Usage

From source file:com.spirit.nomina.gui.panel.JPContrato.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    jtpContrato = new JideTabbedPane();
    panelGeneral = new JPanel();
    lblCodigo = new JLabel();
    txtCodigo = new JTextField();
    lblTipoContrato = new JLabel();
    cmbTipoContrato = new JComboBox();
    lblEmpleado = new JLabel();
    txtEmpleado = new JTextField();
    btnEmpleado = new JButton();
    lblFechaElaboracion = new JLabel();
    cmbFechaElaboracion = new DateComboBox();
    lblFechaInicio = new JLabel();
    cmbFechaInicio = new DateComboBox();
    lblFondoReservaDiasPrevios = new JLabel();
    txtFondoReservaDiasPrevios = new JTextField();
    lblFechaFin = new JLabel();
    cmbFechaFin = new DateComboBox();
    lblEstado = new JLabel();
    cmbEstado = new JComboBox();
    lblObservacion = new JLabel();
    txtObservacion = new JTextField();
    panelRubrosContrato = new JPanel();
    gfsRubros = compFactory.createSeparator("Rubros");
    spTblRubro = new JScrollPane();
    tblRubro = new JTable();
    cbTemporal = new JCheckBox();
    lblFechaInicioRubro = new JLabel();
    cmbFechaInicioRubro = new DateComboBox();
    lblFechaFinRubro = new JLabel();
    cmbFechaFinRubro = new DateComboBox();
    gfsRubrosContrato = compFactory.createSeparator("Rubros por Contrato");
    panelBotones = new JPanel();
    btnRemoverRubroContrato = new JButton();
    btnAgregarRubroContrato = new JButton();
    spTblRubroContrato = new JScrollPane();
    tblRubroContrato = new JTable();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setName("Contrato");
    setLayout(new FormLayout("default:grow", "fill:default:grow"));

    //======== jtpContrato ========
    {// w w  w . j  a  v  a2s . co m

        //======== panelGeneral ========
        {
            panelGeneral.setLayout(new FormLayout(
                    new ColumnSpec[] { new ColumnSpec(Sizes.dluX(12)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(60)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(25)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.DLUX11), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(30)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(60)),
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(12)) },
                    new RowSpec[] { new RowSpec(Sizes.dluY(12)), FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            new RowSpec(Sizes.dluY(12)) }));

            //---- lblCodigo ----
            lblCodigo.setText("C\u00f3digo:");
            panelGeneral.add(lblCodigo, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

            //---- txtCodigo ----
            txtCodigo.setEditable(true);
            panelGeneral.add(txtCodigo, cc.xywh(5, 3, 3, 1));

            //---- lblTipoContrato ----
            lblTipoContrato.setText("Tipo de Contrato:");
            panelGeneral.add(lblTipoContrato,
                    cc.xywh(3, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
            panelGeneral.add(cmbTipoContrato, cc.xywh(5, 5, 11, 1));

            //---- lblEmpleado ----
            lblEmpleado.setText("Empleado:");
            panelGeneral.add(lblEmpleado, cc.xywh(3, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

            //---- txtEmpleado ----
            txtEmpleado.setEditable(false);
            panelGeneral.add(txtEmpleado, cc.xywh(5, 7, 11, 1));
            panelGeneral.add(btnEmpleado, cc.xywh(17, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));

            //---- lblFechaElaboracion ----
            lblFechaElaboracion.setText("Fecha de Elaboraci\u00f3n:");
            panelGeneral.add(lblFechaElaboracion,
                    cc.xywh(3, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
            panelGeneral.add(cmbFechaElaboracion, cc.xywh(5, 9, 5, 1));

            //---- lblFechaInicio ----
            lblFechaInicio.setText("Fecha Inicio:");
            panelGeneral.add(lblFechaInicio,
                    cc.xywh(3, 11, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

            //---- cmbFechaInicio ----
            cmbFechaInicio.setEditable(false);
            panelGeneral.add(cmbFechaInicio, cc.xywh(5, 11, 5, 1));

            //---- lblFondoReservaDiasPrevios ----
            lblFondoReservaDiasPrevios.setText("F.R. d\u00edas previos:");
            panelGeneral.add(lblFondoReservaDiasPrevios, cc.xy(13, 11));

            //---- txtFondoReservaDiasPrevios ----
            txtFondoReservaDiasPrevios.setHorizontalAlignment(SwingConstants.RIGHT);
            panelGeneral.add(txtFondoReservaDiasPrevios, cc.xy(15, 11));

            //---- lblFechaFin ----
            lblFechaFin.setText("Fecha Fin:");
            panelGeneral.add(lblFechaFin, cc.xywh(3, 13, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

            //---- cmbFechaFin ----
            cmbFechaFin.setEditable(false);
            panelGeneral.add(cmbFechaFin, cc.xywh(5, 13, 5, 1));

            //---- lblEstado ----
            lblEstado.setText("Estado:");
            panelGeneral.add(lblEstado, cc.xywh(3, 15, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));

            //---- cmbEstado ----
            cmbEstado.setModel(new DefaultComboBoxModel(new String[] { "ACTIVO", "INACTIVO", "TERMINADO" }));
            panelGeneral.add(cmbEstado, cc.xy(5, 15));

            //---- lblObservacion ----
            lblObservacion.setText("Observaci\u00f3n:");
            panelGeneral.add(lblObservacion,
                    cc.xywh(3, 17, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
            panelGeneral.add(txtObservacion, cc.xywh(5, 17, 15, 1));
        }
        jtpContrato.addTab("General", panelGeneral);

        //======== panelRubrosContrato ========
        {
            panelRubrosContrato.setLayout(new FormLayout(
                    new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(12)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(95)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(12)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(Sizes.dluX(95)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) },
                    new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                            FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                            FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.DLUY7),
                            FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                            FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                            FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                            FormFactory.LINE_GAP_ROWSPEC,
                            new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) }));
            panelRubrosContrato.add(gfsRubros, cc.xywh(3, 3, 17, 1));

            //======== spTblRubro ========
            {

                //---- tblRubro ----
                tblRubro.setModel(new DefaultTableModel(new Object[][] { { false, null, null }, },
                        new String[] { " ", "Rubro", "Tipo de Rubro" }) {
                    Class[] columnTypes = new Class[] { Boolean.class, Object.class, Object.class };
                    boolean[] columnEditable = new boolean[] { true, false, false };

                    @Override
                    public Class<?> getColumnClass(int columnIndex) {
                        return columnTypes[columnIndex];
                    }

                    @Override
                    public boolean isCellEditable(int rowIndex, int columnIndex) {
                        return columnEditable[columnIndex];
                    }
                });
                spTblRubro.setViewportView(tblRubro);
            }
            panelRubrosContrato.add(spTblRubro, cc.xywh(3, 5, 17, 5));

            //---- cbTemporal ----
            cbTemporal.setText("Temporal");
            panelRubrosContrato.add(cbTemporal, cc.xy(3, 11));

            //---- lblFechaInicioRubro ----
            lblFechaInicioRubro.setText("Fecha Inicio:");
            panelRubrosContrato.add(lblFechaInicioRubro, cc.xy(7, 11));
            panelRubrosContrato.add(cmbFechaInicioRubro, cc.xy(9, 11));

            //---- lblFechaFinRubro ----
            lblFechaFinRubro.setText("Fecha Fin:");
            panelRubrosContrato.add(lblFechaFinRubro, cc.xy(13, 11));
            panelRubrosContrato.add(cmbFechaFinRubro, cc.xy(15, 11));
            panelRubrosContrato.add(gfsRubrosContrato, cc.xywh(3, 15, 17, 1));

            //======== panelBotones ========
            {
                panelBotones
                        .setLayout(new FormLayout(
                                new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC,
                                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
                                RowSpec.decodeSpecs("default")));

                //---- btnRemoverRubroContrato ----
                btnRemoverRubroContrato.setText("D");
                panelBotones.add(btnRemoverRubroContrato, cc.xy(3, 1));

                //---- btnAgregarRubroContrato ----
                btnAgregarRubroContrato.setText("A");
                panelBotones.add(btnAgregarRubroContrato, cc.xy(1, 1));
            }
            panelRubrosContrato.add(panelBotones, cc.xywh(3, 17, 18, 1));

            //======== spTblRubroContrato ========
            {

                //---- tblRubroContrato ----
                tblRubroContrato.setModel(new DefaultTableModel(
                        new Object[][] { { null, null, null, "", null }, },
                        new String[] { "Rubro", "Tipo de Rubro", "Valor", "Fecha Inicio", "Fecha Fin" }) {
                    boolean[] columnEditable = new boolean[] { false, false, true, false, false };

                    @Override
                    public boolean isCellEditable(int rowIndex, int columnIndex) {
                        return columnEditable[columnIndex];
                    }
                });
                spTblRubroContrato.setViewportView(tblRubroContrato);
            }
            panelRubrosContrato.add(spTblRubroContrato, cc.xywh(3, 19, 17, 3));
        }
        jtpContrato.addTab("Rubros por Contrato", panelRubrosContrato);

    }
    add(jtpContrato, cc.xy(1, 1));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:se.streamsource.streamflow.client.ui.workspace.cases.general.CaseGeneralView.java

License:Apache License

public CaseGeneralView(@Service ApplicationContext appContext, @Uses CaseGeneralModel generalModel,
        @Uses CaseLogView caseLogView, @Structure Module module) {
    this.appContext = appContext;
    this.model = generalModel;
    RefreshComponents refreshComponents = new RefreshComponents();
    model.addObserver(refreshComponents);
    ObjectBuilderFactory obf = module.objectBuilderFactory();
    this.labels = obf.newObjectBuilder(CaseLabelsView.class).use(generalModel.newLabelsModel()).newInstance();
    this.caseNotes = obf.newObjectBuilder(CaseNoteView.class).use(generalModel.newCaseNoteModel())
            .newInstance();/*from  ww  w .  ja  v a  2s.c om*/

    RefreshComponents refreshLabelComponents = new RefreshComponents();
    labels.getModel().addObserver(refreshLabelComponents);

    this.forms = obf.newObjectBuilder(PossibleFormsView.class).use(generalModel.newPossibleFormsModel())
            .newInstance();
    refreshComponents.visibleOn("changedescription", forms);
    this.setBorder(BorderFactory.createEmptyBorder());
    getVerticalScrollBar().setUnitIncrement(30);

    setActionMap(appContext.getActionMap(this));
    ActionMap am = getActionMap();
    MacOsUIWrapper.convertAccelerators(appContext.getActionMap(CaseGeneralView.class, this));

    actionBinder = obf.newObjectBuilder(ActionBinder.class).use(am).newInstance();
    valueBinder = obf.newObject(ValueBinder.class);
    actionBinder.setResourceMap(appContext.getResourceMap(getClass()));

    // Layout and form for the right panel
    FormLayout leftLayout = new FormLayout("70dlu, 2dlu, 200:grow, 70dlu",
            "pref, pref, pref, pref, 20dlu, pref, pref, pref, pref");

    leftPane = new JPanel(leftLayout);
    leftPane.setFocusable(false);
    DefaultFormBuilder leftBuilder = new DefaultFormBuilder(leftLayout, leftPane);
    leftBuilder.setBorder(Borders.createEmptyBorder(Sizes.DLUY2, Sizes.DLUX2, Sizes.DLUY2, Sizes.DLUX11));

    selectedCaseType.getLabel().setFont(selectedCaseType.getLabel().getFont().deriveFont(Font.BOLD));
    selectedCaseType.getButton().addActionListener(am.get("removeCaseType"));
    valueBinder.bind("caseType", selectedCaseType);

    // Description & DueDate
    leftBuilder.setExtent(3, 1);
    JLabel descriptionLabel = leftBuilder.getComponentFactory()
            .createLabel(i18n.text(WorkspaceResources.description_label));
    leftBuilder.add(descriptionLabel);
    descriptionLabel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
    leftBuilder.nextColumn(3);
    JLabel dueOnLabel = leftBuilder.append(i18n.text(WorkspaceResources.due_on_label));
    dueOnLabel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));

    leftBuilder.nextLine();
    leftBuilder.setExtent(3, 1);
    JPanel descPanel = new JPanel(new BorderLayout());
    descPanel.add(valueBinder.bind("description",
            actionBinder.bind("changeDescription", descriptionField = (JTextField) TEXTFIELD.newField())),
            BorderLayout.WEST);
    leftBuilder.add(descPanel);
    descriptionField.setName("txtCaseDescription");
    leftBuilder.add(
            valueBinder.bind("dueOn",
                    actionBinder.bind("changeDueOn", dueOnField = (JXDatePicker) DATEPICKER.newField())),
            new CellConstraints(4, 2, 1, 1, CellConstraints.LEFT, CellConstraints.BOTTOM,
                    new Insets(4, 0, 0, 0)));
    leftBuilder.nextLine();
    descriptionLabel.setLabelFor(descriptionField);
    dueOnLabel.setLabelFor(dueOnField);
    refreshComponents.enabledOn("changedescription", descriptionField);
    refreshComponents.enabledOn("changedueon", dueOnField);

    // Select case type
    javax.swing.Action caseTypeAction = am.get("changeCaseType");
    caseTypeButton = new StreamflowButton(caseTypeAction);
    caseTypeButton.registerKeyboardAction(caseTypeAction,
            (KeyStroke) caseTypeAction.getValue(javax.swing.Action.ACCELERATOR_KEY),
            JComponent.WHEN_IN_FOCUSED_WINDOW);
    caseTypeButton.setHorizontalAlignment(SwingConstants.LEFT);
    refreshComponents.enabledOn("casetype", caseTypeButton, selectedCaseType);

    leftBuilder.add(caseTypeButton,
            new CellConstraints(1, 3, 1, 1, CellConstraints.FILL, CellConstraints.TOP, new Insets(2, 0, 5, 0)));
    leftBuilder.add(selectedCaseType, new CellConstraints(3, 3, 1, 1, CellConstraints.LEFT,
            CellConstraints.BOTTOM, new Insets(5, 5, 0, 0)));

    JLabel priorityLabel = leftBuilder.getComponentFactory()
            .createLabel(i18n.text(WorkspaceResources.priority_label));
    priorityLabel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));

    leftBuilder.add(priorityLabel, new CellConstraints(4, 3, 1, 1, CellConstraints.FILL, CellConstraints.BOTTOM,
            new Insets(4, 0, 0, 0)));

    leftBuilder.nextLine();

    // Select labels
    javax.swing.Action labelAction = labels.getActionMap().get("addLabel");
    labelButton = new StreamflowButton(labelAction);
    // NotificationGlassPane.registerButton(labelButton);
    labelButton.registerKeyboardAction(labelAction,
            (KeyStroke) labelAction.getValue(javax.swing.Action.ACCELERATOR_KEY),
            JComponent.WHEN_IN_FOCUSED_WINDOW);

    labelButton.setHorizontalAlignment(SwingConstants.LEFT);
    labels.setButtonRelation(labelButton);
    refreshLabelComponents.enabledOn("addlabel", labelButton, labels);

    leftBuilder.add(labelButton,
            new CellConstraints(1, 4, 1, 1, CellConstraints.FILL, CellConstraints.TOP, new Insets(5, 0, 0, 0)));

    labels.setPreferredSize(new Dimension(500, 50));
    leftBuilder.add(labels,
            new CellConstraints(3, 4, 1, 1, CellConstraints.LEFT, CellConstraints.TOP, new Insets(5, 0, 0, 0)));

    JPanel prioPanel = new JPanel(new BorderLayout());
    prioPanel.add(valueBinder.bind("priority",
            actionBinder.bind("changePriority", casePriority = (JComboBox) COMBOBOX.newField())));
    leftBuilder.add(prioPanel, new CellConstraints(4, 4, 1, 1, CellConstraints.FILL, CellConstraints.TOP,

            new Insets(2, 0, 0, 0)));

    priorityLabel.setLabelFor(casePriority);
    refreshComponents.visibleOn("changepriority", casePriority, priorityLabel);
    refreshComponents.enabledOn("changepriority", casePriority, priorityLabel);
    casePriority.setRenderer(new DefaultListCellRenderer() {
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                boolean cellHasFocus) {

            final PriorityValue itemValue = (PriorityValue) value;
            String val = itemValue == null ? "" : itemValue.text().get();

            JPanel panel = new JPanel();
            panel.setOpaque(false);
            FormLayout layout = new FormLayout("10dlu, 60dlu:grow", "pref");
            DefaultFormBuilder formBuilder = new DefaultFormBuilder(layout, panel);

            panel.setBorder(BorderFactory.createEmptyBorder(2, 0, 1, 0));
            JLabel label = new JLabel() {
                @Override
                protected void paintComponent(Graphics g) {
                    Color color = getBackground();
                    if (itemValue != null) {
                        if (!Strings.empty(itemValue.color().get()))
                            color = new Color(parseInt(itemValue.color().get()));
                        else
                            color = Color.BLACK;
                    }
                    final Color FILL_COLOR = ColorUtil.removeAlpha(color);

                    Graphics2D g2 = (Graphics2D) g.create();

                    try {
                        g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
                        g2.setColor(Color.LIGHT_GRAY);
                        final int DIAM = Math.min(getWidth(), getHeight());
                        final int inset = 3;
                        g2.fill(new Ellipse2D.Float(inset, inset, DIAM - 2 * inset, DIAM - 2 * inset));
                        g2.setColor(FILL_COLOR);
                        final int border = 1;
                        g2.fill(new Ellipse2D.Float(inset + border, inset + border,
                                DIAM - 2 * inset - 2 * border, DIAM - 2 * inset - 2 * border));
                    } finally {
                        g2.dispose();
                    }
                }
            };
            label.setPreferredSize(new Dimension(10, 10));
            formBuilder.add((Strings.empty(val) || "-".equals(val)) ? new JLabel() : label, new CellConstraints(
                    1, 1, 1, 1, CellConstraints.FILL, CellConstraints.FILL, new Insets(0, 0, 0, 0)));
            JLabel text = new JLabel(val);
            formBuilder.add(text, new CellConstraints(2, 1, 1, 1, CellConstraints.LEFT, CellConstraints.FILL,
                    new Insets(0, 0, 0, 0)));

            return panel;
        }
    });
    leftBuilder.nextLine();

    leftBuilder.add(caseNotes,
            new CellConstraints(1, 6, 4, 1, CellConstraints.FILL, CellConstraints.TOP, new Insets(0, 2, 5, 0)));

    // Forms
    JLabel formsLabel = new JLabel(i18n.text(WorkspaceResources.forms_label));
    refreshComponents.visibleOn("changedescription", formsLabel);
    leftBuilder.add(formsLabel,
            new CellConstraints(1, 7, 1, 1, CellConstraints.LEFT, CellConstraints.TOP, new Insets(5, 0, 0, 0)));
    leftBuilder.nextLine();

    JPanel formsPanel = new JPanel(new BorderLayout());
    formsPanel.add(forms, BorderLayout.WEST);
    leftBuilder.add(formsPanel, new CellConstraints(1, 8, 3, 1, CellConstraints.FILL, CellConstraints.FILL,
            new Insets(5, 0, 0, 0)));

    // Limit pickable dates to future
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(new Date());
    calendar.add(Calendar.DAY_OF_MONTH, 1);
    dueOnField.getMonthView().setLowerBound(calendar.getTime());

    final DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
    dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    dueOnField.getEditor().setFormatterFactory(
            new DefaultFormatterFactory(new DatePickerFormatter(new DateFormat[] { dateFormat }) {
                @Override
                public Object stringToValue(String text) throws ParseException {
                    Object result;
                    try {
                        result = super.stringToValue(text);
                    } catch (ParseException pe) {
                        dialogs.showMessageDialog(dueOnField,
                                text(WorkspaceResources.wrong_format_msg) + " "
                                        + ((SimpleDateFormat) dateFormat).toPattern(),
                                text(WorkspaceResources.wrong_format_title));
                        throw pe;
                    }
                    return result;
                }
            }));

    // Main panel that contains both left and right pane
    JPanel formsContainer = new JPanel();
    formsContainer.setLayout(new GridLayout(1, 2));
    formsContainer.setBorder(Borders.createEmptyBorder("2dlu, 2dlu, 2dlu, 2dlu"));
    formsContainer.add(leftPane);
    formsContainer.add(caseLogView);

    setViewportView(formsContainer);

    setFocusTraversalPolicy(new LayoutFocusTraversalPolicy());
    setFocusCycleRoot(true);
    setFocusable(true);

    new RefreshWhenShowing(this, this);
}