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

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

Introduction

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

Prototype

public CellConstraints xywh(int col, int row, int colSpan, int rowSpan) 

Source Link

Document

Sets the column, row, width, and height; uses default alignments.

Examples:

 cc.xywh(1, 3, 2, 1); cc.xywh(1, 3, 7, 3); 

Usage

From source file:de.erdesignerng.visual.editor.domain.DomainEditorView.java

License:Open Source License

/**
 * Getter method for component Component_15.
 *
 * @return the initialized component/* w  w  w  .  j  av a  2  s.c om*/
 */
public JPanel getComponent15() {

    if (component15 == null) {
        component15 = new JPanel();

        FormLayout theLayout = new FormLayout("fill:10dlu:grow,2dlu,60dlu,2dlu,60dlu",
                "fill:10dlu:grow,2dlu,p");
        component15.setLayout(theLayout);

        CellConstraints cons = new CellConstraints();
        domainTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
        domainTable.setModel(domainTableModel);
        domainTable.getColumnModel().getColumn(0).setPreferredWidth(200);
        domainTable.getColumnModel().getColumn(1).setPreferredWidth(100);
        domainTable.getColumnModel().getColumn(2).setPreferredWidth(60);
        domainTable.getColumnModel().getColumn(3).setPreferredWidth(60);
        domainTable.getColumnModel().getColumn(4).setPreferredWidth(60);
        domainTable.getColumnModel().getColumn(5).setPreferredWidth(50);
        domainTable.getColumnModel().getColumn(6).setPreferredWidth(300);
        domainTable.getTableHeader().setResizingAllowed(true);
        domainTable.getTableHeader().setReorderingAllowed(false);
        domainTable.setAutoResizeMode(DefaultTable.AUTO_RESIZE_OFF);
        domainTable.setRowHeight(22);

        DefaultComboBox theBox = new DefaultComboBox();
        theBox.setBorder(BorderFactory.createEmptyBorder());
        theBox.setModel(dataTypesModel);
        domainTable.setDefaultEditor(DataType.class, new DefaultCellEditor(theBox));
        domainTable.setDefaultRenderer(DataType.class, ModelItemDefaultCellRenderer.getInstance());
        domainTable.setDefaultRenderer(String.class, ModelItemDefaultCellRenderer.getInstance());
        domainTable.setDefaultRenderer(Integer.class, ModelItemDefaultCellRenderer.getInstance());
        domainTable.setDefaultRenderer(Boolean.class, CheckboxCellRenderer.getInstance());

        component15.add(domainTable.getScrollPane(), cons.xywh(1, 1, 5, 1));
        component15.add(getNewButton(), cons.xy(3, 3));
        component15.add(getDeleteButton(), cons.xy(5, 3));
    }

    return component15;
}

From source file:de.erdesignerng.visual.editor.exception.ExceptionEditorView.java

License:Open Source License

/**
 * Initialize method.// w  w w .  j a v  a2s .  c om
 */
private void initialize() {

    String rowDef = "2dlu,fill:250dlu,10dlu,p,2dlu";
    String colDef = "2dlu,250dlu,2dlu";

    FormLayout layout = new FormLayout(colDef, rowDef);
    setLayout(layout);

    CellConstraints cons = new CellConstraints();

    add(getButtonPanel(), cons.xywh(2, 4, 1, 1));
    add(getExceptionText().getScrollPane(), cons.xywh(2, 2, 1, 1));
}

From source file:de.erdesignerng.visual.editor.exception.ExceptionEditorView.java

License:Open Source License

/**
 * Getter method for component buttonpanel.
 *
 * @return the initialized component//w w w  . j a v  a2 s. c  o m
 */
public JPanel getButtonPanel() {

    if (buttonPanel == null) {
        buttonPanel = new JPanel();

        String rowDef = "p";
        String colDef = "fill:60dlu,2dlu:grow,fill:60dlu,2dlu,fill:60dlu";

        FormLayout layout = new FormLayout(colDef, rowDef);
        buttonPanel.setLayout(layout);

        CellConstraints cons = new CellConstraints();

        buttonPanel.add(getCloseButton(), cons.xywh(1, 1, 1, 1));
        buttonPanel.setName("buttonpanel");
    }

    return buttonPanel;
}

From source file:de.erdesignerng.visual.editor.openxavaexport.OpenXavaExportEditorView.java

License:Open Source License

/**
 * Initialize method./* ww  w .j a  va  2  s  .  c o  m*/
 */
private void initialize() {

    String rowDef = "2dlu,p,8dlu,p,2dlu,p,8dlu,p,2dlu,fill:300dlu,8dlu,p,2dlu";
    String colDef = "2dlu,60dlu,2dlu,fill:250dlu:grow,2dlu,30dlu,2dlu";

    FormLayout layout = new FormLayout(colDef, rowDef);
    setLayout(layout);

    CellConstraints cons = new CellConstraints();

    add(new DefaultSeparator(ERDesignerBundle.TARGET), cons.xywh(2, 2, 5, 1));
    add(new DefaultLabel(ERDesignerBundle.SRCDIRECTORY), cons.xywh(2, 4, 1, 1));
    add(getSrcDirectory(), cons.xywh(4, 4, 1, 1));
    add(getSearchDirectoryButton(), cons.xywh(6, 4, 1, 1));
    add(new DefaultLabel(ERDesignerBundle.PACKAGENAME), cons.xywh(2, 6, 1, 1));
    add(getPackageName(), cons.xywh(4, 6, 3, 1));
    add(new DefaultSeparator(ERDesignerBundle.DATATYPEMAPPING), cons.xywh(2, 8, 5, 1));
    add(getMappingTable().getScrollPane(), cons.xywh(2, 10, 5, 1));

    add(getComponent8(), cons.xywh(2, 12, 5, 1));
}

From source file:de.erdesignerng.visual.editor.preferences.PreferencesPanel.java

License:Open Source License

private void initialize() {

    String theColDef = "2dlu,p,2dlu,p:grow,2dlu,20dlu,2";
    String theRowDef = "2dlu,p,2dlu,p,2dlu,p,2dlu,p,2dlu,p,2dlu,p,2dlu,p,50dlu";

    FormLayout theLayout = new FormLayout(theColDef, theRowDef);
    setLayout(theLayout);//from  w ww.  ja  v a2s  .  com

    CellConstraints cons = new CellConstraints();

    add(new DefaultLabel(ERDesignerBundle.EDITORGRIDSIZE), cons.xy(2, 2));
    add(gridSize, cons.xywh(4, 2, 3, 1));

    add(new DefaultLabel(ERDesignerBundle.AUTOMATICRELATIONATTRIBUTEPATTERN), cons.xy(2, 4));
    add(automaticRelationAttributePattern, cons.xywh(4, 4, 3, 1));

    DefaultComboBoxModel theDefaultOnUpdateModel = new DefaultComboBoxModel();
    DefaultComboBoxModel theDefaultOnDeleteModel = new DefaultComboBoxModel();
    for (CascadeType theType : CascadeType.values()) {
        theDefaultOnUpdateModel.addElement(theType);
        theDefaultOnDeleteModel.addElement(theType);
    }

    add(new DefaultLabel(ERDesignerBundle.DEFAULTFORONDELETE), cons.xy(2, 6));
    add(onDeleteDefault, cons.xywh(4, 6, 3, 1));
    onDeleteDefault.setModel(theDefaultOnDeleteModel);

    add(new DefaultLabel(ERDesignerBundle.DEFAULTFORONUPDATE), cons.xy(2, 8));
    add(onUpdateDefault, cons.xywh(4, 8, 3, 1));
    onUpdateDefault.setModel(theDefaultOnUpdateModel);

    add(new DefaultLabel(ERDesignerBundle.GRIDSIZEAFTERREVERSEENGINEERING), cons.xy(2, 10));
    add(gridWidth, cons.xywh(4, 10, 3, 1));

    add(new DefaultLabel(ERDesignerBundle.XMLINDENTATION), cons.xy(2, 12));
    add(xmlIndentation, cons.xywh(4, 12, 3, 1));

    UIInitializer.getInstance().initialize(this);

    bindinginfo = new BindingInfo<>();
    bindinginfo.addBinding("gridSize", gridSize, true);
    bindinginfo.addBinding("automaticRelationAttributePattern", automaticRelationAttributePattern, true);
    bindinginfo.addBinding("onUpdateDefault", onUpdateDefault, true);
    bindinginfo.addBinding("onDeleteDefault", onDeleteDefault, true);
    bindinginfo.addBinding("gridWidthAfterReverseEngineering", gridWidth, true);
    bindinginfo.addBinding("xmlIndentation", xmlIndentation, true);

    bindinginfo.configure();
}

From source file:de.erdesignerng.visual.editor.relation.RelationEditorView.java

License:Open Source License

/**
 * Initialize method./*from w  w  w  . ja v a 2  s .  com*/
 */
private void initialize() {

    String rowDef = "2dlu,p,8dlu,p,8dlu,p,2dlu,fill:100dlu,8dlu,p,2dlu,p,2dlu,p,2dlu,p,2dlu,p,2dlu,p,20dlu,p,2dlu";
    String colDef = "2dlu,60dlu,2dlu,fill:150dlu:grow,2dlu";

    FormLayout layout = new FormLayout(colDef, rowDef);
    setLayout(layout);

    CellConstraints cons = new CellConstraints();

    add(getComponent1(), cons.xywh(2, 4, 1, 1));
    add(new DefaultSeparator(ERDesignerBundle.RELATIONPROPERTIES), cons.xywh(2, 2, 3, 1));
    add(getRelationName(), cons.xywh(4, 4, 1, 1));
    add(new DefaultSeparator(ERDesignerBundle.ATTRIBUTEMAPPING), cons.xywh(2, 6, 3, 1));
    add(new JScrollPane(getAttributeMappingTable()), cons.xywh(2, 8, 3, 1));
    add(new DefaultSeparator(ERDesignerBundle.ONDELETEHANDLING), cons.xywh(2, 10, 3, 1));
    add(getOnDeleteContainer(), cons.xywh(2, 12, 3, 1));
    add(new DefaultSeparator(ERDesignerBundle.ONUPDATEHANDLING), cons.xywh(2, 14, 3, 1));
    add(getOnUpdateContainer(), cons.xywh(2, 18, 3, 1));

    add(getPropertiesPanel(), cons.xywh(2, 20, 3, 1));

    add(getComponent8(), cons.xywh(2, 22, 3, 1));

    buildGroups();
}

From source file:de.erdesignerng.visual.editor.relation.RelationEditorView.java

License:Open Source License

public JPanel getOnDeleteContainer() {

    if (onDeleteContainer == null) {
        onDeleteContainer = new JPanel();

        String rowDef = "p,2dlu";
        String colDef = "p,p,p,p";

        FormLayout layout = new FormLayout(colDef, rowDef);
        onDeleteContainer.setLayout(layout);

        CellConstraints cons = new CellConstraints();

        onDeleteContainer.add(getOnDeleteCascadeNothing(), cons.xywh(1, 1, 1, 1));
        onDeleteContainer.add(getOnDeleteCascade(), cons.xywh(2, 1, 1, 1));
        onDeleteContainer.add(getOnDeleteRestrict(), cons.xywh(3, 1, 1, 1));
        onDeleteContainer.add(getOnDeleteSetNull(), cons.xywh(4, 1, 1, 1));
        onDeleteContainer.setName("Component_7");
    }/*  w w  w. j a v a  2  s.  co m*/

    return onDeleteContainer;
}

From source file:de.erdesignerng.visual.editor.relation.RelationEditorView.java

License:Open Source License

public JPanel getOnUpdateContainer() {

    if (onUpdateContainer == null) {
        onUpdateContainer = new JPanel();

        String rowDef = "p,2dlu";
        String colDef = "p,p,p,p";

        FormLayout layout = new FormLayout(colDef, rowDef);
        onUpdateContainer.setLayout(layout);

        CellConstraints cons = new CellConstraints();

        onUpdateContainer.add(getOnUpdateCascadeNothing(), cons.xywh(1, 1, 1, 1));
        onUpdateContainer.add(getOnUpdateCascade(), cons.xywh(2, 1, 1, 1));
        onUpdateContainer.add(getOnUpdateRestrict(), cons.xywh(3, 1, 1, 1));
        onUpdateContainer.add(getOnUpdateSetNull(), cons.xywh(4, 1, 1, 1));
        onUpdateContainer.setName("Component_7");
    }//from   ww w  .j a  va2 s . c  o m

    return onUpdateContainer;
}

From source file:de.erdesignerng.visual.editor.relation.RelationEditorView.java

License:Open Source License

public JPanel getComponent8() {

    if (component8 == null) {
        component8 = new JPanel();

        String rowDef = "p";
        String colDef = "60dlu,2dlu:grow,60dlu";

        FormLayout layout = new FormLayout(colDef, rowDef);
        component8.setLayout(layout);/* ww  w.ja  va2  s .c  o  m*/

        CellConstraints cons = new CellConstraints();

        component8.add(getOKButton(), cons.xywh(1, 1, 1, 1));
        component8.add(getCancelButton(), cons.xywh(3, 1, 1, 1));
        component8.setName("Component_8");
    }

    return component8;
}

From source file:de.erdesignerng.visual.editor.repository.LoadFromRepositoryView.java

License:Open Source License

private void initialize() {

    String theColDef = "2dlu,50dlu,2dlu,fill:100dlu:grow,2dlu";
    String theRowDef = "2dlu,p,50dlu,p,2dlu";

    FormLayout theLayout = new FormLayout(theColDef, theRowDef);
    setLayout(theLayout);/*  ww  w  .  j a va  2  s  .  c om*/

    CellConstraints cons = new CellConstraints();

    add(new DefaultLabel(ERDesignerBundle.NAME), cons.xy(2, 2));
    add(existingNameBox, cons.xy(4, 2));

    JPanel thePanel = new JPanel();

    theColDef = "60dlu,fill:2dlu:grow,60dlu";
    theRowDef = "p";

    theLayout = new FormLayout(theColDef, theRowDef);
    thePanel.setLayout(theLayout);

    thePanel.add(okButton, cons.xy(1, 1));
    okButton.setText("Ok");
    thePanel.add(cancelButton, cons.xy(3, 1));
    cancelButton.setText("Cancel");

    add(thePanel, cons.xywh(2, 4, 3, 1));
}