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

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

Introduction

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

Prototype

public CellConstraints xy(int col, int row) 

Source Link

Document

Sets column and row origins; sets width and height to 1; uses the default alignments.

Examples:

 cc.xy(1, 1); cc.xy(1, 3); 

Usage

From source file:anl.verdi.plot.gui.TitlePanel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    lblText = new JLabel();
    separator1 = compFactory.createSeparator("");
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setBackground(Color.white);//from  www  .ja v a  2  s  .  c o m
    // 2014
    ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("default:grow");
    RowSpec aRowSpec = new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    setLayout(new FormLayout(aColumnSpec,
            new RowSpec[] { aRowSpec, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC }));
    //      setLayout(new FormLayout(
    //            ColumnSpec.decodeSpecs("default:grow"),
    //            new RowSpec[] {
    //               new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
    //               FormFactory.LINE_GAP_ROWSPEC,
    //               FormFactory.DEFAULT_ROWSPEC
    //            }));

    //---- lblText ----
    lblText.setFont(new Font("Tahoma", Font.BOLD, 16));
    lblText.setHorizontalAlignment(SwingConstants.CENTER);
    add(lblText, cc.xy(1, 1));
    add(separator1, cc.xy(1, 3));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:anl.verdi.plot.gui.VectorDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    statusLbl = new JLabel();
    separator2 = compFactory.createSeparator("Select Components");
    scrollPane1 = new JScrollPane();
    formulaList = new JList();
    label1 = new JLabel();
    fldX = new JTextField();
    label2 = new JLabel();
    fldY = new JTextField();
    label3 = new JLabel();
    fldTile = new JTextField();
    clearTileBtn = new JButton();
    panel1 = new JPanel();
    btnX = new JButton();
    btnY = new JButton();
    tileBtn = new JButton();
    separator1 = compFactory.createSeparator("");
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setModal(true);/*from   ww  w .  j  a va2  s.  c  o m*/
    setTitle("Vector Plot");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {
        dialogPane.setBorder(Borders.DIALOG_BORDER);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            // 2014
            ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("min(min;5dlu):grow");
            ColumnSpec[] bColumnSpec = ColumnSpec.decodeSpecs("max(min;75dlu)");
            contentPanel.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.PREF_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.PREF_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec[0],
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, bColumnSpec[0],
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
                    new RowSpec[] { FormFactory.PREF_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 }));
            //            contentPanel.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                     FormFactory.PREF_COLSPEC,
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     FormFactory.PREF_COLSPEC,
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     new ColumnSpec("min(min;5dlu):grow"),
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     FormFactory.RELATED_GAP_COLSPEC,
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     new ColumnSpec("max(min;75dlu)"),
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     FormFactory.DEFAULT_COLSPEC
            //                  },
            //                  new RowSpec[] {
            //                     FormFactory.PREF_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
            //                  }));

            //---- statusLbl ----
            statusLbl.setForeground(Color.red);
            statusLbl.setText(" ");
            contentPanel.add(statusLbl, cc.xywh(1, 1, 9, 1));
            contentPanel.add(separator2, cc.xywh(1, 3, 9, 1));

            //======== scrollPane1 ========
            {
                scrollPane1.setViewportView(formulaList);
            }
            contentPanel.add(scrollPane1, cc.xywh(1, 5, 5, 11));

            //---- label1 ----
            label1.setText("Horizontal Component:");
            contentPanel.add(label1, cc.xywh(8, 5, 2, 1));

            //---- fldX ----
            fldX.setEditable(false);
            contentPanel.add(fldX, cc.xywh(9, 7, 3, 1));

            //---- label2 ----
            label2.setText("Vertical Component:");
            contentPanel.add(label2, cc.xywh(8, 9, 2, 1));

            //---- fldY ----
            fldY.setEditable(false);
            contentPanel.add(fldY, cc.xywh(9, 11, 3, 1));

            //---- label3 ----
            label3.setText("Tile (Optional):");
            contentPanel.add(label3, cc.xywh(8, 13, 2, 1));

            //---- fldTile ----
            fldTile.setBackground(new Color(224, 223, 227));
            fldTile.setEditable(false);
            contentPanel.add(fldTile, cc.xy(9, 15));

            //---- clearTileBtn ----
            clearTileBtn.setText("-");
            clearTileBtn.setToolTipText("Clear Tile");
            contentPanel.add(clearTileBtn, cc.xy(11, 15));

            //======== panel1 ========
            {
                // 2014
                RowSpec[] aRowSpec = RowSpec.decodeSpecs("default");
                panel1.setLayout(
                        new FormLayout(
                                new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC,
                                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
                                aRowSpec));
                //               panel1.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")));

                //---- btnX ----
                btnX.setText("Horiz.");
                panel1.add(btnX, cc.xy(1, 1));

                //---- btnY ----
                btnY.setText("Vert.");
                panel1.add(btnY, cc.xy(3, 1));

                //---- tileBtn ----
                tileBtn.setText("Tile");
                panel1.add(tileBtn, cc.xy(5, 1));
            }
            contentPanel.add(panel1, cc.xywh(1, 17, 5, 1));
            contentPanel.add(separator1, cc.xywh(1, 19, 11, 1));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
            // 2014
            RowSpec[] bRowSpec = RowSpec.decodeSpecs("pref");
            buttonBar
                    .setLayout(
                            new FormLayout(
                                    new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC,
                                            FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC },
                                    bRowSpec));
            //            buttonBar.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                     FormFactory.GLUE_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC,
            //                     FormFactory.RELATED_GAP_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC
            //                  },
            //                  RowSpec.decodeSpecs("pref")));

            //---- okButton ----
            okButton.setText("OK");
            buttonBar.add(okButton, cc.xy(2, 1));

            //---- cancelButton ----
            cancelButton.setText("Cancel");
            buttonBar.add(cancelButton, cc.xy(4, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:anl.verdi.plot.gui.VectorOverlayDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    statusLbl = new JLabel();
    separator2 = compFactory.createSeparator("Select Components");
    scrollPane1 = new JScrollPane();
    formulaList = new JList();
    label1 = new JLabel();
    labelV = new JLabel(); // 2015 text "Vector Sampling Increment" 
    fldV = new JFormattedTextField(NumberFormat.getIntegerInstance()); // 2015 field for user-entered input
    fldV.setColumns(3);/*  ww  w. ja v  a2s.c  o m*/
    fldX = new JTextField();
    label2 = new JLabel();
    fldY = new JTextField();
    //      panel1 = new JPanel();
    btnX = new JButton();
    btnY = new JButton();
    separator1 = compFactory.createSeparator("");
    separatorV = compFactory.createSeparator("");
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setModal(true);
    setTitle("Vector Overlay");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {
        dialogPane.setBorder(Borders.DIALOG_BORDER);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            // 2014
            ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("min(min;5dlu):grow");
            ColumnSpec[] bColumnSpec = ColumnSpec.decodeSpecs("max(min;100dlu)"); // CHANGED 75 TO 100
            contentPanel.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.PREF_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.PREF_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec[0],
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, bColumnSpec[0],
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
                    new RowSpec[] { FormFactory.PREF_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,
                            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 }));

            //---- statusLbl ----
            statusLbl.setForeground(Color.red);
            statusLbl.setText(" ");
            contentPanel.add(statusLbl, cc.xywh(1, 1, 9, 1));
            contentPanel.add(separator2, cc.xywh(1, 3, 9, 1));

            //======== scrollPane1 ========
            {
                scrollPane1.setViewportView(formulaList);
            }
            contentPanel.add(scrollPane1, cc.xywh(1, 5, 5, 8));

            //---- label1 ----
            label1.setText("Horizontal (X) Component:");
            contentPanel.add(label1, cc.xywh(8, 5, 2, 1));

            //---- fldX ----
            fldX.setEditable(false);
            contentPanel.add(fldX, cc.xywh(9, 7, 3, 1));

            //---- label2 ----
            label2.setText("Vertical (Y) Component:");
            contentPanel.add(label2, cc.xywh(8, 9, 2, 1));

            //---- fldY ----
            fldY.setEditable(false);
            contentPanel.add(fldY, cc.xywh(9, 11, 3, 1));

            //            //======== panel1 ========
            //            {
            //               // 2014
            //               RowSpec[] aRowSpec = RowSpec.decodeSpecs("default");
            //               panel1.setLayout(new FormLayout(
            //                     new ColumnSpec[]{
            //                           FormFactory.DEFAULT_COLSPEC,
            //                           FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                           FormFactory.DEFAULT_COLSPEC,
            //                           FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                           FormFactory.DEFAULT_COLSPEC
            //                     },
            //                     new RowSpec[]{
            //                     FormFactory.PREF_ROWSPEC,
            //                     FormFactory.LINE_GAP_ROWSPEC,
            //                     FormFactory.DEFAULT_ROWSPEC,
            //                     FormFactory.LINE_GAP_ROWSPEC,
            //                     FormFactory.DEFAULT_ROWSPEC,
            //                     FormFactory.LINE_GAP_ROWSPEC}
            //                     ));

            //---- btnX ----
            btnX.setText("Horizontal");
            contentPanel.add(btnX, cc.xywh(1, 13, 1, 1));

            //---- btnY ----
            btnY.setText("Vertical");
            contentPanel.add(btnY, cc.xywh(3, 13, 1, 1));
            //            }

            //            contentPanel.add(panel1, cc.xywh(1, 15, 5, 1));
            contentPanel.add(separator1, cc.xywh(1, 19, 11, 1));
            labelV.setText("Vector Sampling Increment: ");
            contentPanel.add(labelV, cc.xy(1, 21));
            fldV.setEditable(true);
            fldV.setToolTipText("Enter 1 to show all vectors, 5 for every 5th vector, etc.");
            fldV.setSize(20, 10); // trying to make the box larger
            int anInt = 1;
            fldV.setValue(new Integer(anInt)); // default value is 1 (show all vectors)
            fldV.addPropertyChangeListener("value", this);
            contentPanel.add(fldV, cc.xywh(3, 21, 1, 1)); // 2 columns, 1 row
            contentPanel.add(separatorV, cc.xywh(1, 23, 11, 1));
            pack();
            dialogPane.add(contentPanel, BorderLayout.CENTER);

            //======== buttonBar ========
            {
                buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
                // 2014
                RowSpec[] bRowSpec = RowSpec.decodeSpecs("pref");
                buttonBar
                        .setLayout(new FormLayout(
                                new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC,
                                        FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC },
                                bRowSpec));

                //---- okButton ----
                okButton.setText("OK");
                buttonBar.add(okButton, cc.xy(2, 1));

                //---- cancelButton ----
                cancelButton.setText("Cancel");
                buttonBar.add(cancelButton, cc.xy(4, 1));
            }
            dialogPane.add(buttonBar, BorderLayout.SOUTH);
            pack();
        }
        contentPane.add(dialogPane, BorderLayout.CENTER);
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }
}

From source file:anl.verdi.plot.gui.VerticalCrossDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    separator1 = compFactory.createSeparator("Select Cross Section");
    rbX = new JRadioButton();
    lblColumn = new JLabel();
    xSpinner = new JSpinner();
    rbY = new JRadioButton();
    lblRow = new JLabel();
    ySpinner = new JSpinner();
    separator2 = compFactory.createSeparator("");
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setModal(true);// www  .  j  av  a2s  .c o  m
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {
        dialogPane.setBorder(Borders.DIALOG_BORDER);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            // 2014
            ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("max(default;50dlu)");
            ColumnSpec bColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
            contentPanel.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            aColumnSpec[0], FormFactory.LABEL_COMPONENT_GAP_COLSPEC, bColumnSpec },
                    new 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 }));
            //            contentPanel.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                     FormFactory.DEFAULT_COLSPEC,
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     FormFactory.DEFAULT_COLSPEC,
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     new ColumnSpec("max(default;50dlu)"),
            //                     FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                     new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
            //                  },
            //                  new 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
            //                  }));
            contentPanel.add(separator1, cc.xywh(1, 1, 7, 1));

            //---- rbX ----
            rbX.setText("X-Axis Cross Section");
            contentPanel.add(rbX, cc.xywh(1, 3, 5, 1));

            //---- lblColumn ----
            lblColumn.setText("Column:");
            contentPanel.add(lblColumn, cc.xy(3, 5));
            contentPanel.add(xSpinner, cc.xy(5, 5));

            //---- rbY ----
            rbY.setText("Y-Axis Cross Section");
            contentPanel.add(rbY, cc.xywh(1, 7, 5, 1));

            //---- lblRow ----
            lblRow.setText("Row:");
            contentPanel.add(lblRow, cc.xy(3, 9));
            contentPanel.add(ySpinner, cc.xy(5, 9));
            contentPanel.add(separator2, cc.xywh(1, 11, 7, 1));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
            // 2014
            RowSpec[] aRowSpec = RowSpec.decodeSpecs("pref");
            buttonBar
                    .setLayout(
                            new FormLayout(
                                    new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC,
                                            FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC },
                                    aRowSpec));
            //            buttonBar.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                     FormFactory.GLUE_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC,
            //                     FormFactory.RELATED_GAP_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC
            //                  },
            //                  RowSpec.decodeSpecs("pref")));

            //---- okButton ----
            okButton.setText("OK");
            buttonBar.add(okButton, cc.xy(2, 1));

            //---- cancelButton ----
            cancelButton.setText("Cancel");
            buttonBar.add(cancelButton, cc.xy(4, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:at.lame.hellonzb.HelloNzbCradle.java

License:Open Source License

/**
 * Create the status bar inclusive all contents.
 * /*from  w  w w  . ja  v  a 2s. c  o m*/
 * @param progBar The previously create JProgressBar object
 * @return The newly created JPanel object
 */
protected JPanel createStatusBar(JProgressBar progBar) {
    // create layout for this tab/panel
    FormLayout layout = new FormLayout("pref:grow, 10dlu, pref, 10dlu, [100dlu,pref,150dlu]", // cols
            "p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // status bar text field
    statusBarText = new JLabel(localer.getBundleText("StatusBarRunningThreads") + " 0");
    builder.add(statusBarText, cc.xy(1, 1));

    // ETA & total file size text field
    etaAndTotalText = new JLabel("");
    builder.add(etaAndTotalText, cc.xy(3, 1));
    etaAndTotalText.setToolTipText(localer.getBundleText("StatusBarEtaAndTotalTooltip"));

    // create background task progress bar in status bar
    builder.add(progBar, cc.xy(5, 1));

    return builder.getPanel();
}

From source file:at.lame.hellonzb.preferences.tabs.PrefDownloadTab.java

License:Open Source License

private void createPanel() {
    String sepString = null;//w w w .  j ava2s.co  m
    CompContainer compc = new CompContainer(null, null);

    par2CmdLineAppButton = new JButton(localer.getBundleText("DownloadSettingsPar2ChooseButton"));
    par2CmdLineAppButton.setName("DownloadSettingsPar2ExeLocation-Button");
    unrarCmdLineAppButton = new JButton(localer.getBundleText("DownloadSettingsPar2ChooseButton"));
    unrarCmdLineAppButton.setName("DownloadSettingsUnrarExeLocation-Button");

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, [100dlu,pref]:grow, 3dlu, pref", // cols
            "p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "connection"
    sepString = localer.getBundleText("DownloadSettingsGroupConnection");
    builder.addSeparator(sepString, cc.xyw(1, 1, 5));

    // max connection speed
    createTextfield(compc, "DownloadSettingsMaxConnectionSpeed", "NumericTextField");
    compc.label.setText(compc.label.getText() + " (KB/s)");
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));

    //////////////////////////////////////////////////////////////////////
    // group "par2 check"
    sepString = localer.getBundleText("DownloadSettingsGroupPar2Check");
    builder.addSeparator(sepString, cc.xyw(1, 5, 5));

    // par2 check after download
    createCheckbox(compc, "DownloadSettingsPar2Check", false);
    par2ExtractCheckbox = (JCheckBox) compc.comp;
    builder.add(compc.label, cc.xy(1, 7));
    builder.add(compc.comp, cc.xy(3, 7));

    // path to par2 command line tool
    createTextfield(compc, "DownloadSettingsPar2ExeLocation", "JTextField");
    par2LocationTextField = (JTextField) compc.comp;
    builder.add(compc.label, cc.xy(1, 9));
    builder.add(compc.comp, cc.xy(3, 9));
    builder.add(par2CmdLineAppButton, cc.xy(5, 9));

    if (!par2ExtractCheckbox.isSelected()) {
        par2LocationTextField.setEnabled(false);
        par2CmdLineAppButton.setEnabled(false);
    }

    //////////////////////////////////////////////////////////////////////
    // group "RAR archives"
    sepString = localer.getBundleText("DownloadSettingsGroupArcExtract");
    builder.addSeparator(sepString, cc.xyw(1, 11, 5));

    // automatically extract (RAR) archive files
    createCheckbox(compc, "DownloadSettingsExtractRARArchives", false);
    rarExtractCheckbox = (JCheckBox) compc.comp;
    builder.add(compc.label, cc.xy(1, 13));
    builder.add(compc.comp, cc.xy(3, 13));

    // path to unrar command line tool
    createTextfield(compc, "DownloadSettingsUnrarExeLocation", "JTextField");
    unrarLocationTextField = (JTextField) compc.comp;
    builder.add(compc.label, cc.xy(1, 15));
    builder.add(compc.comp, cc.xy(3, 15));
    builder.add(unrarCmdLineAppButton, cc.xy(5, 15));

    if (!rarExtractCheckbox.isSelected()) {
        unrarLocationTextField.setEnabled(false);
        unrarCmdLineAppButton.setEnabled(false);
    }
}

From source file:at.lame.hellonzb.preferences.tabs.PrefExtendedTab.java

License:Open Source License

private void createPanel() {
    CompContainer compc = new CompContainer(null, null);
    String sepString = null;/*from  ww w  . j  av  a  2s  .  c  o  m*/

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, pref:grow", // cols
            "p, 3dlu, p, 9dlu, p, 3dlu, p, 9dlu, p, 9dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "locale settings"
    sepString = localer.getBundleText("ExtendedSettingsGroupLocaleSettings");
    builder.addSeparator(sepString, cc.xyw(1, 1, 3));

    // choose language
    String[] boxvalues = new String[] { "-default-", "English", "German", "Dutch", "Turkish" };
    createCombobox(compc, "ExtendedSettingsChooseLanguage", boxvalues, 0);
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));

    //////////////////////////////////////////////////////////////////////
    // group "console output"
    sepString = localer.getBundleText("ExtendedSettingsGroupConsole");
    builder.addSeparator(sepString, cc.xyw(1, 5, 3));

    // activate console output 
    createCheckbox(compc, "ExtendedSettingsConsoleOutput", true);
    builder.add(compc.label, cc.xy(1, 7));
    builder.add(compc.comp, cc.xy(3, 7));

    //////////////////////////////////////////////////////////////////////
    // group "program settings"
    sepString = localer.getBundleText("GeneralSettingsGroupProgramSettings");
    builder.addSeparator(sepString, cc.xyw(1, 9, 3));

    // reset all hidden messages
    resetAllMsg = new JButton(localer.getBundleText("ExtendedSettingsResetMessages"));
    builder.add(resetAllMsg, cc.xyw(1, 11, 3));
}

From source file:at.lame.hellonzb.preferences.tabs.PrefGeneralTab.java

License:Open Source License

private void createPanel() {
    String sepString = null;//from   w  w w. j ava  2s.  c o m
    CompContainer compc = new CompContainer(null, null);
    downloadDirChooseButton = new JButton(localer.getBundleText("GeneralSettingsChooseDownloadDir"));
    downloadDirChooseButton.setName("GeneralSettingsChooseDownloadDir-Button");
    autoLoadDirChooseButton = new JButton(localer.getBundleText("GeneralSettingsChooseAutoLoadDir"));
    autoLoadDirChooseButton.setName("GeneralSettingsChooseAutoLoadDir-Button");

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, [200dlu,pref]:grow, 3dlu, pref", // cols
            "p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "general settings"
    sepString = localer.getBundleText("GeneralSettingsGroupGeneralSettings");
    builder.addSeparator(sepString, cc.xyw(1, 1, 5));

    // download directory
    createTextfield(compc, "GeneralSettingsDownloadDir", "JTextField");
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));
    builder.add(downloadDirChooseButton, cc.xy(5, 3));

    // auto-load directory
    createTextfield(compc, "GeneralSettingsAutoLoadDir", "JTextField");
    builder.add(compc.label, cc.xy(1, 5));
    builder.add(compc.comp, cc.xy(3, 5));
    builder.add(autoLoadDirChooseButton, cc.xy(5, 5));

    //////////////////////////////////////////////////////////////////////
    // group "nzb file loading"
    sepString = localer.getBundleText("GeneralSettingsGroupNzbLoadBehaviour");
    builder.addSeparator(sepString, cc.xyw(1, 7, 5));

    // delete nzb file after loading
    createCheckbox(compc, "GeneralSettingsDelNzbAfterLoading", true);
    builder.add(compc.label, cc.xy(1, 9));
    builder.add(compc.comp, cc.xy(3, 9));

    //////////////////////////////////////////////////////////////////////
    // group "program settings"
    sepString = localer.getBundleText("GeneralSettingsGroupProgramSettings");
    builder.addSeparator(sepString, cc.xyw(1, 11, 5));

    // show system tray icon
    createCheckbox(compc, "GeneralSettingsShowTrayIcon", false);
    builder.add(compc.label, cc.xy(1, 13));
    builder.add(compc.comp, cc.xy(3, 13));

    // check for new progarm version
    createCheckbox(compc, "GeneralSettingsCheckForUpdates", true);
    builder.add(compc.label, cc.xy(1, 15));
    builder.add(compc.comp, cc.xy(3, 15));
}

From source file:at.lame.hellonzb.preferences.tabs.PrefServerTab.java

License:Open Source License

private void createPanel() {
    String sepString = null;/*w w  w  .ja v  a  2  s.c  o m*/
    CompContainer compc = new CompContainer(null, null);

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, pref:grow, 3dlu, [20dlu,pref]", // cols
            "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "connection"
    sepString = localer.getBundleText("ServerSettingsGroupConnection");
    builder.addSeparator(sepString, cc.xyw(1, 1, 5));

    // server name
    createTextfield(compc, "ServerSettingsServerName", "JTextField");
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));

    // host
    createTextfield(compc, "ServerSettingsHost", "JTextField");
    builder.add(compc.label, cc.xy(1, 5));
    builder.add(compc.comp, cc.xy(3, 5));

    // port
    createTextfield(compc, "ServerSettingsPort", "NumericTextField");
    if (prefMap.get("ServerSettingsPort").equals(""))
        ((JTextField) compc.comp).setText("119");
    stdServerPort = (NumericTextField) compc.comp;
    builder.add(compc.label, cc.xy(1, 7));
    builder.add(compc.comp, cc.xy(3, 7));

    // "use SSL connections" checkbox
    createCheckbox(compc, "ServerSettingsUseSSL", false);
    stdSslCB = ((JCheckBox) compc.comp);
    builder.add(compc.label, cc.xy(1, 9));
    builder.add(compc.comp, cc.xy(3, 9));

    // SSL server port number
    createTextfield(compc, "ServerSettingsSSLPort", "NumericTextField");
    if (prefMap.get("ServerSettingsSSLPort").equals(""))
        ((JTextField) compc.comp).setText("563");
    sslServerPort = (NumericTextField) compc.comp;
    builder.add(compc.label, cc.xy(1, 11));
    builder.add(compc.comp, cc.xy(3, 11));

    if (!stdSslCB.isSelected()) {
        stdServerPort.setEnabled(true);
        sslServerPort.setEnabled(false);
    } else {
        stdServerPort.setEnabled(false);
        sslServerPort.setEnabled(true);
    }

    // create slider and add to layout (via new row)
    createSlider(compc, "ServerSettingsTimeout", 30, 310, 10, 40, 60, "s");
    builder.add(compc.label, cc.xy(1, 13));
    builder.add(compc.comp, cc.xy(3, 13));
    builder.add(compc.extraLabel, cc.xy(5, 13));

    // create slider and add to layout (via new row)
    createSlider(compc, "ServerSettingsThreadCount", 1, 51, 1, 5, 1, "");
    builder.add(compc.label, cc.xy(1, 15));
    builder.add(compc.comp, cc.xy(3, 15));
    builder.add(compc.extraLabel, cc.xy(5, 15));

    //////////////////////////////////////////////////////////////////////
    // group "authentication"
    sepString = localer.getBundleText("ServerSettingsGroupAuthentication");
    builder.addSeparator(sepString, cc.xyw(1, 17, 5));

    // username
    createTextfield(compc, "ServerSettingsUsername", "JTextField");
    builder.add(compc.label, cc.xy(1, 19));
    builder.add(compc.comp, cc.xy(3, 19));

    // password
    createTextfield(compc, "ServerSettingsPassword", "JPasswordField");
    builder.add(compc.label, cc.xy(1, 21));
    builder.add(compc.comp, cc.xy(3, 21));
}

From source file:at.lame.hellonzb.preferences.tabs.PrefUsageStatsTab.java

License:Open Source License

private void createPanel() {
    CompContainer compc = new CompContainer(null, null);
    String sepString = null;/*www.j  av a 2 s . c  o m*/

    // create layout for this tab/panel
    FormLayout layout = new FormLayout("right:pref, 3dlu, pref:grow", // cols
            "p, 3dlu, p, 9dlu, p"); // rows

    // create builder
    PanelBuilder builder = new PanelBuilder(layout, panel);
    builder.setDefaultDialogBorder();
    CellConstraints cc = new CellConstraints();

    // fill the grid with components

    //////////////////////////////////////////////////////////////////////
    // group "usage statistics"
    sepString = localer.getBundleText("PrefDialogUsageStatsSettingsPane");
    builder.addSeparator(sepString, cc.xyw(1, 1, 3));

    // actiave usage statistics?
    createCheckbox(compc, "UsageStatsSettingsActivate", true);
    activateUsageStats = ((JCheckBox) compc.comp);
    builder.add(compc.label, cc.xy(1, 3));
    builder.add(compc.comp, cc.xy(3, 3));

    // info label
    JLabel infotxt = new JLabel(localer.getBundleText("UsageStatsSettingsInfoTxt"));
    infotxt.setName("Label-UsageStatsSettingsInfoTxt");
    infotxt.setFont(infotxt.getFont().deriveFont(Font.PLAIN));
    builder.add(infotxt, cc.xy(3, 5));
}