List of usage examples for com.jgoodies.forms.layout CellConstraints DEFAULT
Alignment DEFAULT
To view the source code for com.jgoodies.forms.layout CellConstraints DEFAULT.
Click Source Link
From source file:com.aw.swing.mvp.cmp.pick.FrmPickMovAlm.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL//from w ww . ja va2s .com */ private void $$$setupUI$$$() { createUIComponents(); pnlMain = new JPanel(); pnlMain.setLayout(new FormLayout( "left:25dlu:noGrow,fill:52dlu:noGrow,left:8dlu:noGrow,fill:43dlu:noGrow,left:10dlu:noGrow,fill:13px:noGrow,left:19dlu:noGrow,fill:8px:noGrow,left:56dlu:noGrow,fill:10px:noGrow,fill:50dlu:noGrow,left:22dlu:noGrow", "center:12dlu:noGrow,top:4dlu:noGrow,center:12dlu:noGrow,top:5dlu:noGrow,center:12dlu:noGrow,top:3dlu:noGrow,center:18px:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:149dlu:noGrow,top:4dlu:noGrow,top:12dlu:noGrow,center:max(d;4dlu):noGrow,center:12dlu:noGrow")); pnlMain.setMinimumSize(new Dimension(501, 425)); pnlMain.setOpaque(true); pnlMain.setPreferredSize(new Dimension(501, 425)); lblSearch = new JLabel(); lblSearch.setText("Descripcin"); lblSearch.setDisplayedMnemonic('D'); lblSearch.setDisplayedMnemonicIndex(0); CellConstraints cc = new CellConstraints(); pnlMain.add(lblSearch, cc.xyw(1, 3, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); btnSearch = new JButton(); btnSearch.setText("Buscar"); btnSearch.setMnemonic('B'); btnSearch.setDisplayedMnemonicIndex(0); pnlMain.add(btnSearch, cc.xy(11, 3)); footerPanel.setLayout( new FormLayout("fill:73dlu:noGrow,left:191dlu:noGrow,fill:48dlu:noGrow", "center:12dlu:noGrow")); pnlMain.add(footerPanel, cc.xyw(1, 14, 12, CellConstraints.DEFAULT, CellConstraints.FILL)); lblF10 = new JLabel(); lblF10.setText(" [F10] Aceptar"); footerPanel.add(lblF10, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); lblEsc = new JLabel(); lblEsc.setText(" [Esc] Salir"); footerPanel.add(lblEsc, cc.xy(3, 1)); sepCriterioBusqueda.setSeparatorTitle("Criterio de Bsqueda"); pnlMain.add(sepCriterioBusqueda, cc.xyw(1, 1, 12, CellConstraints.FILL, CellConstraints.FILL)); pnlTitGrid.setLayout( new FormLayout("fill:204dlu:noGrow,left:88dlu:noGrow,fill:15dlu:noGrow", "center:12dlu:noGrow")); pnlMain.add(pnlTitGrid, cc.xyw(1, 9, 12, CellConstraints.FILL, CellConstraints.FILL)); lblTitGrid = new JLabel(); lblTitGrid.setText(" Relacin :"); lblTitGrid.setDisplayedMnemonic('R'); lblTitGrid.setDisplayedMnemonicIndex(1); pnlTitGrid.add(lblTitGrid, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); chkSel = new JCheckBox(); chkSel.setBackground(new Color(-16747105)); chkSel.setText(""); pnlTitGrid.add(chkSel, cc.xy(3, 1)); final JScrollPane scrollPane1 = new JScrollPane(); scrollPane1.setMinimumSize(new Dimension(454, 418)); pnlMain.add(scrollPane1, cc.xyw(1, 10, 12, CellConstraints.FILL, CellConstraints.FILL)); tblGrid = new JTable(); tblGrid.setMinimumSize(new Dimension(450, 400)); scrollPane1.setViewportView(tblGrid); final JLabel label1 = new JLabel(); label1.setText(" Nmero de Registros:"); pnlMain.add(label1, cc.xyw(1, 12, 3)); lblNumRegistros = new JLabel(); lblNumRegistros.setText("Label"); pnlMain.add(lblNumRegistros, cc.xyw(4, 12, 7)); txtSearch = new JTextField(); pnlMain.add(txtSearch, cc.xyw(4, 3, 6, CellConstraints.FILL, CellConstraints.DEFAULT)); lblSearch2 = new JLabel(); lblSearch2.setText("Descripcin2"); lblSearch2.setDisplayedMnemonic('D'); lblSearch2.setDisplayedMnemonicIndex(0); pnlMain.add(lblSearch2, cc.xyw(1, 7, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); cmbAlmacen = new JComboBox(); pnlMain.add(cmbAlmacen, cc.xyw(4, 7, 6)); lblFecIni = new JLabel(); lblFecIni.setText("Fecha del"); pnlMain.add(lblFecIni, cc.xyw(1, 5, 2, CellConstraints.RIGHT, CellConstraints.CENTER)); txtFecIni = new JTextField(); pnlMain.add(txtFecIni, cc.xyw(4, 5, 3, CellConstraints.FILL, CellConstraints.DEFAULT)); lblFecFin = new JLabel(); lblFecFin.setText("al"); pnlMain.add(lblFecFin, cc.xy(7, 5, CellConstraints.RIGHT, CellConstraints.CENTER)); txtFecFin = new JTextField(); pnlMain.add(txtFecFin, cc.xy(9, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); lblSearch.setLabelFor(txtSearch); lblSearch2.setLabelFor(txtSearch); lblFecIni.setLabelFor(txtSearch); lblFecFin.setLabelFor(txtSearch); }
From source file:com.aw.swing.mvp.ui.FormLayout.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL/* w w w. j a va2 s. co m*/ */ private void $$$setupUI$$$() { createUIComponents(); mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout(0, 0)); mainPanel.setPreferredSize(new Dimension(600, 400)); mainPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createRaisedBevelBorder(), null)); contentPanel = new JPanel(); contentPanel.setLayout(new com.jgoodies.forms.layout.FormLayout( "fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:max(d;4px):noGrow")); mainPanel.add(contentPanel, BorderLayout.CENTER); contentPanel .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10), null)); headerPanel = new JPanel(); headerPanel.setLayout(new com.jgoodies.forms.layout.FormLayout("fill:d:grow", "center:52px:noGrow,center:max(d;4px):noGrow")); headerPanel.setPreferredSize(new Dimension(0, 74)); mainPanel.add(headerPanel, BorderLayout.NORTH); titlePanel.setLayout(new BorderLayout(0, 0)); titlePanel.setBackground(new Color(-1)); titlePanel.setMinimumSize(new Dimension(0, 50)); titlePanel.setPreferredSize(new Dimension(0, 60)); CellConstraints cc = new CellConstraints(); headerPanel.add(titlePanel, cc.xy(1, 1)); titlePanel.add(formTitle, BorderLayout.CENTER); errorPanel.setLayout(new com.jgoodies.forms.layout.FormLayout("fill:d:grow", "center:d:grow")); errorPanel.setBackground(new Color(-52378)); errorPanel.setPreferredSize(new Dimension(0, 30)); headerPanel.add(errorPanel, cc.xy(1, 2)); lblErrorMessage.setFont( new Font(lblErrorMessage.getFont().getName(), Font.BOLD, lblErrorMessage.getFont().getSize())); lblErrorMessage.setForeground(new Color(-1)); lblErrorMessage.setHorizontalAlignment(2); lblErrorMessage.setHorizontalTextPosition(11); lblErrorMessage.setMinimumSize(new Dimension(128, 18)); lblErrorMessage.setText("El campo es requerido"); errorPanel.add(lblErrorMessage, cc.xy(1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); }
From source file:com.devdaily.heidi.LicenseReminderDialog.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents dialogPane = new JPanel(); contentPanel = new JPanel(); htmlMessageScrollPane = new JScrollPane(); htmlMessageArea = new JEditorPane(); closeButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {//from w ww. java2 s .c om dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel .setLayout( new FormLayout( new ColumnSpec[] { FormFactory.GLUE_COLSPEC, new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW), new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), new ColumnSpec(Sizes.dluX(0)), FormFactory.GLUE_COLSPEC }, new RowSpec[] { FormFactory.LINE_GAP_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //======== htmlMessageScrollPane ======== { //---- htmlMessageArea ---- htmlMessageArea.setContentType("text/html"); htmlMessageArea.setEditable(false); htmlMessageArea.setFont(new Font("Monaco", Font.PLAIN, 13)); htmlMessageArea.setMargin(new Insets(4, 4, 4, 4)); htmlMessageArea.setMinimumSize(new Dimension(360, 240)); htmlMessageArea.setPreferredSize(new Dimension(360, 240)); htmlMessageScrollPane.setViewportView(htmlMessageArea); } contentPanel.add(htmlMessageScrollPane, cc.xy(3, 3)); //---- closeButton ---- closeButton.setText("Close"); contentPanel.add(closeButton, cc.xywh(3, 5, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); } dialogPane.add(contentPanel, BorderLayout.CENTER); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.devdaily.justwrite.view.OpenRecentFileDialog.java
License:Open Source License
private void doLayoutForm() { FormLayout layout = new FormLayout("fill:pref, 3dlu, fill:80dlu:grow, 3dlu, left:pref", "pref, 6dlu, pref, 6dlu, pref"); JPanel panel = new JPanel(); DefaultFormBuilder builder = new DefaultFormBuilder(layout, panel); builder.setDefaultDialogBorder();//from ww w .ja v a 2 s . c o m CellConstraints cc = new CellConstraints(); builder.addSeparator("Recent Files", cc.xyw(1, 1, 5)); builder.add(scrollPane, cc.xyw(1, 3, 5)); builder.add(ButtonBarFactory.buildCenteredBar(cancelButton, okButton), cc.xy(3, 5, CellConstraints.CENTER, CellConstraints.DEFAULT)); //builder.add(okButton, cc.xy(3,5,CellConstraints.CENTER, CellConstraints.DEFAULT)); this.setContentPane(builder.getPanel()); }
From source file:com.facetoe.jreader.ui.NewProfileWindow.java
License:Open Source License
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL//from w w w . j av a2 s . com */ private void $$$setupUI$$$() { parentPanel = new JPanel(); parentPanel.setLayout(new FormLayout("fill:d:grow", "center:max(d;4px):noGrow,top:4dlu:noGrow,center:d:grow,top:4dlu:noGrow,center:d:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow")); parentPanel .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null)); pnlName = new JPanel(); pnlName.setLayout(new FormLayout("fill:104px:noGrow,left:17dlu:noGrow,fill:d:grow", "center:d:noGrow,top:4dlu:noGrow,center:d:grow")); CellConstraints cc = new CellConstraints(); parentPanel.add(pnlName, cc.xy(1, 5)); pnlName.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null)); txtName = new JTextField(); txtName.setPreferredSize(new Dimension(350, 20)); txtName.setToolTipText("Name for this profile"); pnlName.add(txtName, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.FILL)); final JLabel label1 = new JLabel(); label1.setText("Profile Name:"); pnlName.add(label1, cc.xy(1, 1)); final Spacer spacer1 = new Spacer(); pnlName.add(spacer1, cc.xy(3, 3, CellConstraints.DEFAULT, CellConstraints.FILL)); pnlDocs = new JPanel(); pnlDocs.setLayout(new FormLayout( "fill:101px:noGrow,left:19dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:d:noGrow")); parentPanel.add(pnlDocs, cc.xy(1, 7)); pnlDocs.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null)); final JLabel label2 = new JLabel(); label2.setPreferredSize(new Dimension(300, 14)); label2.setText("Javadoc Directory:"); pnlDocs.add(label2, cc.xyw(1, 1, 2)); txtDocs = new JTextField(); txtDocs.setText(""); txtDocs.setToolTipText("Path to the Javadocs"); pnlDocs.add(txtDocs, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); btnDocs = new JButton(); btnDocs.setText("..."); btnDocs.setToolTipText("Choose directory"); pnlDocs.add(btnDocs, cc.xy(5, 1)); pnlSrc = new JPanel(); pnlSrc.setLayout(new FormLayout( "fill:101px:noGrow,left:19dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:d:noGrow")); parentPanel.add(pnlSrc, cc.xy(1, 9)); pnlSrc.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null)); final JLabel label3 = new JLabel(); label3.setPreferredSize(new Dimension(300, 14)); label3.setText("Source Directory:"); pnlSrc.add(label3, cc.xyw(1, 1, 2)); txtSrc = new JTextField(); txtSrc.setToolTipText("Path to the source code"); pnlSrc.add(txtSrc, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); btnSrc = new JButton(); btnSrc.setText("..."); btnSrc.setToolTipText("Choose directory"); pnlSrc.add(btnSrc, cc.xy(5, 1)); final JPanel panel1 = new JPanel(); panel1.setLayout( new FormLayout("fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:d:noGrow")); parentPanel.add(panel1, cc.xy(1, 11)); btnOK = new JButton(); btnOK.setText("OK"); panel1.add(btnOK, cc.xy(1, 1)); btnCancel = new JButton(); btnCancel.setText("Cancel"); panel1.add(btnCancel, cc.xy(3, 1)); final JPanel panel2 = new JPanel(); panel2.setLayout(new FormLayout("fill:d:grow", "center:d:grow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow")); parentPanel.add(panel2, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); final JLabel label4 = new JLabel(); label4.setFont(new Font(label4.getFont().getName(), Font.BOLD, label4.getFont().getSize())); label4.setText("Select a name, source and documentation directory for this profile."); panel2.add(label4, cc.xy(1, 3)); progressBar = new JProgressBar(); progressBar.setVerifyInputWhenFocusTarget(true); progressBar.setVisible(false); panel2.add(progressBar, cc.xy(1, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); lblStatus = new JLabel(); lblStatus.setText("Preparing to parse..."); lblStatus.setVisible(false); panel2.add(lblStatus, cc.xy(1, 7)); final Spacer spacer2 = new Spacer(); parentPanel.add(spacer2, cc.xy(1, 3, CellConstraints.DEFAULT, CellConstraints.FILL)); }
From source file:com.intellij.uiDesigner.make.FormLayoutSourceGenerator.java
License:Apache License
public void generateComponentLayout(final LwComponent component, final FormSourceCodeGenerator generator, final String variable, final String parentVariable) { if (!myHaveCc) { generator.append(// w w w . j a va 2 s. c o m "com.jgoodies.forms.layout.CellConstraints cc = new com.jgoodies.forms.layout.CellConstraints();\n"); myHaveCc = true; } generator.startMethodCall(parentVariable, "add"); generator.pushVar(variable); CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); GridConstraints constraints = component.getConstraints(); final boolean haveInsets = !cc.insets.equals(new Insets(0, 0, 0, 0)); if (haveInsets) { generator.startConstructor(CellConstraints.class.getName()); } else { if (constraints.getColSpan() == 1 && constraints.getRowSpan() == 1) { generator.startMethodCall("cc", "xy"); } else if (constraints.getRowSpan() == 1) { generator.startMethodCall("cc", "xyw"); } else { generator.startMethodCall("cc", "xywh"); } } generator.push(constraints.getColumn() + 1); generator.push(constraints.getRow() + 1); if (constraints.getColSpan() > 1 || constraints.getRowSpan() > 1 || haveInsets) { generator.push(constraints.getColSpan()); } if (constraints.getRowSpan() > 1 || haveInsets) { generator.push(constraints.getRowSpan()); } if (cc.hAlign != CellConstraints.DEFAULT || cc.vAlign != CellConstraints.DEFAULT || haveInsets) { @NonNls String hAlign = (cc.hAlign == CellConstraints.DEFAULT) ? "DEFAULT" : FormLayoutCodeGenerator.HORZ_ALIGN_FIELDS[Utils.alignFromConstraints(constraints, true)]; @NonNls String vAlign = (cc.vAlign == CellConstraints.DEFAULT) ? "DEFAULT" : FormLayoutCodeGenerator.VERT_ALIGN_FIELDS[Utils.alignFromConstraints(constraints, false)]; generator.pushVar("com.jgoodies.forms.layout.CellConstraints." + hAlign); generator.pushVar("com.jgoodies.forms.layout.CellConstraints." + vAlign); } if (haveInsets) { generator.newInsets(cc.insets); } generator.endMethod(); generator.endMethod(); }
From source file:com.intellij.uiDesigner.radComponents.RadFormLayoutManager.java
License:Apache License
private static CellConstraints gridToCellConstraints(final RadComponent component) { GridConstraints gc = component.getConstraints(); CellConstraints.Alignment hAlign = ((gc.getHSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) ? CellConstraints.FILL// ww w. j a va 2 s. com : CellConstraints.DEFAULT; CellConstraints.Alignment vAlign = ((gc.getVSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) ? CellConstraints.FILL : CellConstraints.DEFAULT; if (component.getCustomLayoutConstraints() instanceof CellConstraints) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); hAlign = cc.hAlign; vAlign = cc.vAlign; } return new CellConstraints(gc.getColumn() + 1, gc.getRow() + 1, gc.getColSpan(), gc.getRowSpan(), hAlign, vAlign); }
From source file:com.intellij.uiDesigner.radComponents.RadFormLayoutManager.java
License:Apache License
@Override public void writeChildConstraints(final XmlWriter writer, final RadComponent child) { writeGridConstraints(writer, child); if (child.getCustomLayoutConstraints() instanceof CellConstraints) { CellConstraints cc = (CellConstraints) child.getCustomLayoutConstraints(); writer.startElement(UIFormXmlConstants.ELEMENT_FORMS); try {/*from w ww. jav a2s . c o m*/ if (!cc.insets.equals(new Insets(0, 0, 0, 0))) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_TOP, cc.insets.top); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_LEFT, cc.insets.left); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_BOTTOM, cc.insets.bottom); writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_RIGHT, cc.insets.right); } if (cc.hAlign != CellConstraints.DEFAULT) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_DEFAULTALIGN_HORZ, false); } if (cc.vAlign != CellConstraints.DEFAULT) { writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_DEFAULTALIGN_VERT, false); } } finally { writer.endElement(); } } }
From source file:com.intellij.uiDesigner.radComponents.RadFormLayoutManager.java
License:Apache License
public int getAlignment(RadComponent component, boolean horizontal) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); CellConstraints.Alignment al = horizontal ? cc.hAlign : cc.vAlign; if (al == CellConstraints.DEFAULT) { FormLayout formLayout = (FormLayout) component.getParent().getLayout(); FormSpec formSpec = horizontal ? formLayout.getColumnSpec(component.getConstraints().getColumn() + 1) : formLayout.getRowSpec(component.getConstraints().getRow() + 1); final FormSpec.DefaultAlignment defaultAlignment = formSpec.getDefaultAlignment(); if (defaultAlignment.equals(RowSpec.FILL)) { return GridConstraints.ALIGN_FILL; }/*from w w w.ja v a2s . c o m*/ if (defaultAlignment.equals(RowSpec.TOP) || defaultAlignment.equals(ColumnSpec.LEFT)) { return GridConstraints.ALIGN_LEFT; } if (defaultAlignment.equals(RowSpec.CENTER)) { return GridConstraints.ALIGN_CENTER; } return GridConstraints.ALIGN_RIGHT; } return Utils.alignFromConstraints(component.getConstraints(), horizontal); }
From source file:com.intellij.uiDesigner.radComponents.RadFormLayoutManager.java
License:Apache License
public void resetAlignment(RadComponent component, boolean horizontal) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); if (horizontal) { cc.hAlign = CellConstraints.DEFAULT; } else {/*from w ww. j a v a2 s. c o m*/ cc.vAlign = CellConstraints.DEFAULT; } updateConstraints(component); }