Example usage for javax.swing.border TitledBorder DEFAULT_POSITION

List of usage examples for javax.swing.border TitledBorder DEFAULT_POSITION

Introduction

In this page you can find the example usage for javax.swing.border TitledBorder DEFAULT_POSITION.

Prototype

int DEFAULT_POSITION

To view the source code for javax.swing.border TitledBorder DEFAULT_POSITION.

Click Source Link

Document

Use the default vertical orientation for the title text.

Usage

From source file:op.care.nursingprocess.PnlEval.java

/**
 * This method is called from within the constructor to
 * initialize the form.// w ww. j  a  v a 2  s.c om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the PrinterForm Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    pnlReason = new JPanel();
    jScrollPane1 = new JScrollPane();
    txtBemerkung = new JTextArea();
    panel2 = new JPanel();
    lblNextEval = new JLabel();
    jdcNextEval = new JDateChooser();
    panel1 = new JPanel();
    btnOK = new JButton();

    //======== this ========
    setLayout(new FormLayout("default, default:grow, $lcgap, default",
            "default, $lgap, fill:default:grow, 3*($lgap, default)"));

    //======== pnlReason ========
    {
        pnlReason.setBorder(new TitledBorder(null, "text", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION,
                new Font("Arial", Font.PLAIN, 14)));
        pnlReason.setFont(new Font("Arial", Font.PLAIN, 14));
        pnlReason.setLayout(new BoxLayout(pnlReason, BoxLayout.X_AXIS));

        //======== jScrollPane1 ========
        {

            //---- txtBemerkung ----
            txtBemerkung.setColumns(20);
            txtBemerkung.setRows(5);
            txtBemerkung.setFont(new Font("Arial", Font.PLAIN, 14));
            jScrollPane1.setViewportView(txtBemerkung);
        }
        pnlReason.add(jScrollPane1);
    }
    add(pnlReason, CC.xy(2, 3, CC.FILL, CC.FILL));

    //======== panel2 ========
    {
        panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS));

        //---- lblNextEval ----
        lblNextEval.setText("text ");
        lblNextEval.setFont(new Font("Arial", Font.PLAIN, 14));
        panel2.add(lblNextEval);

        //---- jdcNextEval ----
        jdcNextEval.setFont(new Font("Arial", Font.PLAIN, 14));
        panel2.add(jdcNextEval);
    }
    add(panel2, CC.xy(2, 5, CC.FILL, CC.DEFAULT));

    //======== panel1 ========
    {
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));

        //---- btnOK ----
        btnOK.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png")));
        btnOK.setText(null);
        btnOK.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                btnOKActionPerformed(e);
            }
        });
        panel1.add(btnOK);
    }
    add(panel1, CC.xy(2, 7, CC.RIGHT, CC.DEFAULT));
}

From source file:op.care.nursingprocess.PnlSchedule.java

/**
 * This method is called from within the constructor to
 * initialize the form.//from   ww w.  j a  v a 2  s .c  o  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the PrinterForm Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    panelMain = new JPanel();
    splitRegular = new JSplitPane();
    pnlTageszeit = new JPanel();
    jLabel6 = new JideLabel();
    jLabel1 = new JideLabel();
    jLabel2 = new JideLabel();
    jLabel11 = new JideLabel();
    jLabel3 = new JideLabel();
    jLabel4 = new JideLabel();
    txtNachtMo = new JTextField();
    txtMorgens = new JTextField();
    txtMittags = new JTextField();
    txtNachmittags = new JTextField();
    txtAbends = new JTextField();
    txtNachtAb = new JTextField();
    btnToTime = new JButton();
    pnlUhrzeit = new JPanel();
    lblUhrzeit = new JideLabel();
    btnToTimeOfDay = new JButton();
    txtUhrzeit = new JTextField();
    cmbUhrzeit = new JComboBox();
    tabWdh = new JideTabbedPane();
    pnlDaily = new JPanel();
    label3 = new JLabel();
    spinTaeglich = new JSpinner();
    jLabel7 = new JLabel();
    btnJedenTag = new JButton();
    pnlWeekly = new JPanel();
    panel3 = new JPanel();
    btnJedeWoche = new JButton();
    label2 = new JLabel();
    spinWoche = new JSpinner();
    jLabel8 = new JLabel();
    lblUhrzeit2 = new JideLabel();
    lblUhrzeit3 = new JideLabel();
    lblUhrzeit4 = new JideLabel();
    lblUhrzeit5 = new JideLabel();
    lblUhrzeit6 = new JideLabel();
    lblUhrzeit7 = new JideLabel();
    lblUhrzeit8 = new JideLabel();
    cbMon = new JCheckBox();
    cbDie = new JCheckBox();
    cbMit = new JCheckBox();
    cbDon = new JCheckBox();
    cbFre = new JCheckBox();
    cbSam = new JCheckBox();
    cbSon = new JCheckBox();
    pnlMonthly = new JPanel();
    label4 = new JLabel();
    spinMonat = new JSpinner();
    label6 = new JLabel();
    btnJedenMonat = new JButton();
    label5 = new JLabel();
    spinMonatTag = new JSpinner();
    cmbTag = new JComboBox<>();
    panel2 = new JPanel();
    jLabel13 = new JLabel();
    txtLDate = new JTextField();
    lblMinutes = new JLabel();
    txtMinutes = new JTextField();
    pnlBemerkung = new JPanel();
    jScrollPane1 = new JScrollPane();
    txtBemerkung = new JTextArea();
    btnSave = new JButton();

    //======== this ========
    setLayout(new BorderLayout());

    //======== panelMain ========
    {
        panelMain.setBorder(new LineBorder(Color.black, 2, true));
        panelMain.addComponentListener(new ComponentAdapter() {
            @Override
            public void componentResized(ComponentEvent e) {
                panelMainComponentResized(e);
            }
        });
        panelMain.setLayout(new FormLayout("$rgap, $lcgap, 223dlu:grow, $lcgap, $rgap",
                "$rgap, $lgap, pref, $lgap, default, $lgap, pref, $lgap, default, $lgap, 72dlu:grow, 2*($lgap, default)"));

        //======== splitRegular ========
        {
            splitRegular.setDividerSize(0);
            splitRegular.setEnabled(false);
            splitRegular.setDividerLocation(150);
            splitRegular.setDoubleBuffered(true);

            //======== pnlTageszeit ========
            {
                pnlTageszeit.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlTageszeit.setBorder(new EtchedBorder());
                pnlTageszeit.setLayout(
                        new FormLayout("6*(28dlu, $lcgap), default", "fill:default, $lgap, fill:default"));

                //---- jLabel6 ----
                jLabel6.setText("Nachts, fr\u00fch morgens");
                jLabel6.setOrientation(1);
                jLabel6.setFont(new Font("Arial", Font.PLAIN, 14));
                jLabel6.setClockwise(false);
                jLabel6.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlTageszeit.add(jLabel6, CC.xy(1, 1));

                //---- jLabel1 ----
                jLabel1.setForeground(new Color(0, 0, 204));
                jLabel1.setText("Morgens");
                jLabel1.setOrientation(1);
                jLabel1.setFont(new Font("Arial", Font.PLAIN, 14));
                jLabel1.setClockwise(false);
                jLabel1.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlTageszeit.add(jLabel1, CC.xy(3, 1));

                //---- jLabel2 ----
                jLabel2.setForeground(new Color(255, 102, 0));
                jLabel2.setText("Mittags");
                jLabel2.setOrientation(1);
                jLabel2.setFont(new Font("Arial", Font.PLAIN, 14));
                jLabel2.setClockwise(false);
                jLabel2.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlTageszeit.add(jLabel2, CC.xy(5, 1));

                //---- jLabel11 ----
                jLabel11.setForeground(new Color(0, 153, 51));
                jLabel11.setText("Nachmittag");
                jLabel11.setOrientation(1);
                jLabel11.setFont(new Font("Arial", Font.PLAIN, 14));
                jLabel11.setClockwise(false);
                jLabel11.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlTageszeit.add(jLabel11, CC.xy(7, 1));

                //---- jLabel3 ----
                jLabel3.setForeground(new Color(255, 0, 51));
                jLabel3.setText("Abends");
                jLabel3.setOrientation(1);
                jLabel3.setFont(new Font("Arial", Font.PLAIN, 14));
                jLabel3.setClockwise(false);
                jLabel3.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlTageszeit.add(jLabel3, CC.xy(9, 1));

                //---- jLabel4 ----
                jLabel4.setText("Nacht, sp\u00e4t abends");
                jLabel4.setOrientation(1);
                jLabel4.setFont(new Font("Arial", Font.PLAIN, 14));
                jLabel4.setClockwise(false);
                jLabel4.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlTageszeit.add(jLabel4, CC.xy(11, 1));

                //---- txtNachtMo ----
                txtNachtMo.setHorizontalAlignment(SwingConstants.RIGHT);
                txtNachtMo.setText("0.0");
                txtNachtMo.setFont(new Font("Arial", Font.PLAIN, 14));
                txtNachtMo.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        txtNachtMoActionPerformed(e);
                    }
                });
                txtNachtMo.addFocusListener(new FocusAdapter() {
                    @Override
                    public void focusGained(FocusEvent e) {
                        txtFocusGained(e);
                    }

                    @Override
                    public void focusLost(FocusEvent e) {
                        txtIntegerFocusLost(e);
                    }
                });
                pnlTageszeit.add(txtNachtMo, CC.xy(1, 3));

                //---- txtMorgens ----
                txtMorgens.setHorizontalAlignment(SwingConstants.RIGHT);
                txtMorgens.setText("1.0");
                txtMorgens.setFont(new Font("Arial", Font.PLAIN, 14));
                txtMorgens.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        txtMorgensActionPerformed(e);
                    }
                });
                txtMorgens.addFocusListener(new FocusAdapter() {
                    @Override
                    public void focusGained(FocusEvent e) {
                        txtFocusGained(e);
                    }

                    @Override
                    public void focusLost(FocusEvent e) {
                        txtIntegerFocusLost(e);
                    }
                });
                pnlTageszeit.add(txtMorgens, CC.xy(3, 3));

                //---- txtMittags ----
                txtMittags.setHorizontalAlignment(SwingConstants.RIGHT);
                txtMittags.setText("0.0");
                txtMittags.setFont(new Font("Arial", Font.PLAIN, 14));
                txtMittags.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        txtMittagsActionPerformed(e);
                    }
                });
                txtMittags.addFocusListener(new FocusAdapter() {
                    @Override
                    public void focusGained(FocusEvent e) {
                        txtFocusGained(e);
                    }

                    @Override
                    public void focusLost(FocusEvent e) {
                        txtIntegerFocusLost(e);
                    }
                });
                pnlTageszeit.add(txtMittags, CC.xy(5, 3));

                //---- txtNachmittags ----
                txtNachmittags.setHorizontalAlignment(SwingConstants.RIGHT);
                txtNachmittags.setText("0.0");
                txtNachmittags.setFont(new Font("Arial", Font.PLAIN, 14));
                txtNachmittags.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        txtNachmittagsActionPerformed(e);
                    }
                });
                txtNachmittags.addFocusListener(new FocusAdapter() {
                    @Override
                    public void focusGained(FocusEvent e) {
                        txtFocusGained(e);
                    }

                    @Override
                    public void focusLost(FocusEvent e) {
                        txtIntegerFocusLost(e);
                    }
                });
                pnlTageszeit.add(txtNachmittags, CC.xy(7, 3));

                //---- txtAbends ----
                txtAbends.setHorizontalAlignment(SwingConstants.RIGHT);
                txtAbends.setText("0.0");
                txtAbends.setFont(new Font("Arial", Font.PLAIN, 14));
                txtAbends.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        txtAbendsActionPerformed(e);
                    }
                });
                txtAbends.addFocusListener(new FocusAdapter() {
                    @Override
                    public void focusGained(FocusEvent e) {
                        txtFocusGained(e);
                    }

                    @Override
                    public void focusLost(FocusEvent e) {
                        txtIntegerFocusLost(e);
                    }
                });
                pnlTageszeit.add(txtAbends, CC.xy(9, 3));

                //---- txtNachtAb ----
                txtNachtAb.setHorizontalAlignment(SwingConstants.RIGHT);
                txtNachtAb.setText("0.0");
                txtNachtAb.setFont(new Font("Arial", Font.PLAIN, 14));
                txtNachtAb.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        txtNachtAbActionPerformed(e);
                    }
                });
                txtNachtAb.addFocusListener(new FocusAdapter() {
                    @Override
                    public void focusGained(FocusEvent e) {
                        txtFocusGained(e);
                    }

                    @Override
                    public void focusLost(FocusEvent e) {
                        txtIntegerFocusLost(e);
                    }
                });
                pnlTageszeit.add(txtNachtAb, CC.xy(11, 3));

                //---- btnToTime ----
                btnToTime.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/1rightarrow.png")));
                btnToTime.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        btnToTimeActionPerformed(e);
                    }
                });
                pnlTageszeit.add(btnToTime, CC.xy(13, 3));
            }
            splitRegular.setLeftComponent(pnlTageszeit);

            //======== pnlUhrzeit ========
            {
                pnlUhrzeit.setBorder(new EtchedBorder());
                pnlUhrzeit.setLayout(
                        new FormLayout("default, $ugap, 75dlu, $ugap, pref", "default:grow, $rgap, default"));

                //---- lblUhrzeit ----
                lblUhrzeit.setText("Anzahl Massnahmen");
                lblUhrzeit.setOrientation(2);
                lblUhrzeit.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit.setClockwise(false);
                lblUhrzeit.setHorizontalTextPosition(SwingConstants.LEFT);
                lblUhrzeit.setVerticalAlignment(SwingConstants.BOTTOM);
                pnlUhrzeit.add(lblUhrzeit, CC.xy(3, 1, CC.DEFAULT, CC.BOTTOM));

                //---- btnToTimeOfDay ----
                btnToTimeOfDay
                        .setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/1leftarrow.png")));
                btnToTimeOfDay.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        btnToTimeOfDayActionPerformed(e);
                    }
                });
                pnlUhrzeit.add(btnToTimeOfDay, CC.xy(1, 3));

                //---- txtUhrzeit ----
                txtUhrzeit.setHorizontalAlignment(SwingConstants.RIGHT);
                txtUhrzeit.setText("0.0");
                txtUhrzeit.setFont(new Font("Arial", Font.PLAIN, 14));
                txtUhrzeit.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        txtUhrzeitActionPerformed(e);
                    }
                });
                txtUhrzeit.addFocusListener(new FocusAdapter() {
                    @Override
                    public void focusGained(FocusEvent e) {
                        txtFocusGained(e);
                    }

                    @Override
                    public void focusLost(FocusEvent e) {
                        txtIntegerFocusLost(e);
                    }
                });
                pnlUhrzeit.add(txtUhrzeit, CC.xy(3, 3));

                //---- cmbUhrzeit ----
                cmbUhrzeit.addItemListener(new ItemListener() {
                    @Override
                    public void itemStateChanged(ItemEvent e) {
                        cmbUhrzeitItemStateChanged(e);
                    }
                });
                pnlUhrzeit.add(cmbUhrzeit, CC.xy(5, 3));
            }
            splitRegular.setRightComponent(pnlUhrzeit);
        }
        panelMain.add(splitRegular, CC.xy(3, 3));

        //======== tabWdh ========
        {

            //======== pnlDaily ========
            {
                pnlDaily.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlDaily.setLayout(new FormLayout("2*(default), $rgap, $lcgap, 40dlu, $rgap, default",
                        "default, $lgap, pref, $lgap, default"));

                //---- label3 ----
                label3.setText("alle");
                label3.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlDaily.add(label3, CC.xy(2, 3));

                //---- spinTaeglich ----
                spinTaeglich.setFont(new Font("Arial", Font.PLAIN, 14));
                spinTaeglich.setModel(new SpinnerNumberModel(1, null, null, 1));
                pnlDaily.add(spinTaeglich, CC.xy(5, 3));

                //---- jLabel7 ----
                jLabel7.setText("Tage");
                jLabel7.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlDaily.add(jLabel7, CC.xy(7, 3));

                //---- btnJedenTag ----
                btnJedenTag.setText("Jeden Tag");
                btnJedenTag.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        btnJedenTagActionPerformed(e);
                    }
                });
                pnlDaily.add(btnJedenTag, CC.xywh(2, 5, 6, 1));
            }
            tabWdh.addTab("T\u00e4glich", pnlDaily);

            //======== pnlWeekly ========
            {
                pnlWeekly.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlWeekly.setLayout(new FormLayout("default, 7*(13dlu), $lcgap, default:grow",
                        "$ugap, $lgap, default, $lgap, pref, default:grow, $lgap, $rgap"));

                //======== panel3 ========
                {
                    panel3.setLayout(
                            new FormLayout("default, $rgap, 40dlu, $rgap, 2*(default), $lcgap, default, $lcgap",
                                    "default:grow, $lgap, default"));

                    //---- btnJedeWoche ----
                    btnJedeWoche.setText("Jede Woche");
                    btnJedeWoche.setFont(new Font("Arial", Font.PLAIN, 14));
                    btnJedeWoche.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            btnJedeWocheActionPerformed(e);
                        }
                    });
                    panel3.add(btnJedeWoche, CC.xywh(3, 3, 3, 1));

                    //---- label2 ----
                    label2.setText("alle");
                    label2.setFont(new Font("Arial", Font.PLAIN, 14));
                    panel3.add(label2, CC.xy(1, 1));
                    panel3.add(spinWoche, CC.xy(3, 1));

                    //---- jLabel8 ----
                    jLabel8.setText("Wochen am");
                    jLabel8.setFont(new Font("Arial", Font.PLAIN, 14));
                    panel3.add(jLabel8, CC.xy(5, 1));
                }
                pnlWeekly.add(panel3, CC.xywh(2, 3, 9, 1));

                //---- lblUhrzeit2 ----
                lblUhrzeit2.setText("montags");
                lblUhrzeit2.setOrientation(1);
                lblUhrzeit2.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit2.setClockwise(false);
                lblUhrzeit2.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlWeekly.add(lblUhrzeit2, CC.xy(2, 5, CC.CENTER, CC.BOTTOM));

                //---- lblUhrzeit3 ----
                lblUhrzeit3.setText("dienstags");
                lblUhrzeit3.setOrientation(1);
                lblUhrzeit3.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit3.setClockwise(false);
                lblUhrzeit3.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlWeekly.add(lblUhrzeit3, CC.xy(3, 5, CC.CENTER, CC.BOTTOM));

                //---- lblUhrzeit4 ----
                lblUhrzeit4.setText("mittwochs");
                lblUhrzeit4.setOrientation(1);
                lblUhrzeit4.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit4.setClockwise(false);
                lblUhrzeit4.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlWeekly.add(lblUhrzeit4, CC.xy(4, 5, CC.CENTER, CC.BOTTOM));

                //---- lblUhrzeit5 ----
                lblUhrzeit5.setText("donnerstags");
                lblUhrzeit5.setOrientation(1);
                lblUhrzeit5.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit5.setClockwise(false);
                lblUhrzeit5.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlWeekly.add(lblUhrzeit5, CC.xy(5, 5, CC.CENTER, CC.BOTTOM));

                //---- lblUhrzeit6 ----
                lblUhrzeit6.setText("freitags");
                lblUhrzeit6.setOrientation(1);
                lblUhrzeit6.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit6.setClockwise(false);
                lblUhrzeit6.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlWeekly.add(lblUhrzeit6, CC.xy(6, 5, CC.CENTER, CC.BOTTOM));

                //---- lblUhrzeit7 ----
                lblUhrzeit7.setText("samstags");
                lblUhrzeit7.setOrientation(1);
                lblUhrzeit7.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit7.setClockwise(false);
                lblUhrzeit7.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlWeekly.add(lblUhrzeit7, CC.xy(7, 5, CC.CENTER, CC.BOTTOM));

                //---- lblUhrzeit8 ----
                lblUhrzeit8.setText("sonntags");
                lblUhrzeit8.setOrientation(1);
                lblUhrzeit8.setFont(new Font("Arial", Font.PLAIN, 14));
                lblUhrzeit8.setClockwise(false);
                lblUhrzeit8.setHorizontalTextPosition(SwingConstants.LEFT);
                pnlWeekly.add(lblUhrzeit8, CC.xy(8, 5, CC.CENTER, CC.BOTTOM));

                //---- cbMon ----
                cbMon.setBorder(BorderFactory.createEmptyBorder());
                cbMon.setMargin(new Insets(0, 0, 0, 0));
                cbMon.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cbMonActionPerformed(e);
                    }
                });
                pnlWeekly.add(cbMon, CC.xy(2, 6, CC.CENTER, CC.DEFAULT));

                //---- cbDie ----
                cbDie.setBorder(BorderFactory.createEmptyBorder());
                cbDie.setMargin(new Insets(0, 0, 0, 0));
                cbDie.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cbDieActionPerformed(e);
                    }
                });
                pnlWeekly.add(cbDie, CC.xy(3, 6, CC.CENTER, CC.DEFAULT));

                //---- cbMit ----
                cbMit.setBorder(BorderFactory.createEmptyBorder());
                cbMit.setMargin(new Insets(0, 0, 0, 0));
                cbMit.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cbMitActionPerformed(e);
                    }
                });
                pnlWeekly.add(cbMit, CC.xy(4, 6, CC.CENTER, CC.DEFAULT));

                //---- cbDon ----
                cbDon.setBorder(BorderFactory.createEmptyBorder());
                cbDon.setMargin(new Insets(0, 0, 0, 0));
                cbDon.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cbDonActionPerformed(e);
                    }
                });
                pnlWeekly.add(cbDon, CC.xy(5, 6, CC.CENTER, CC.DEFAULT));

                //---- cbFre ----
                cbFre.setBorder(BorderFactory.createEmptyBorder());
                cbFre.setMargin(new Insets(0, 0, 0, 0));
                cbFre.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cbFreActionPerformed(e);
                    }
                });
                pnlWeekly.add(cbFre, CC.xy(6, 6, CC.CENTER, CC.DEFAULT));

                //---- cbSam ----
                cbSam.setBorder(BorderFactory.createEmptyBorder());
                cbSam.setMargin(new Insets(0, 0, 0, 0));
                cbSam.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cbSamActionPerformed(e);
                    }
                });
                pnlWeekly.add(cbSam, CC.xy(7, 6, CC.CENTER, CC.DEFAULT));

                //---- cbSon ----
                cbSon.setBorder(BorderFactory.createEmptyBorder());
                cbSon.setMargin(new Insets(0, 0, 0, 0));
                cbSon.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cbSonActionPerformed(e);
                    }
                });
                pnlWeekly.add(cbSon, CC.xy(8, 6, CC.CENTER, CC.DEFAULT));
            }
            tabWdh.addTab("W\u00f6chentlich", pnlWeekly);

            //======== pnlMonthly ========
            {
                pnlMonthly.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlMonthly.setLayout(
                        new FormLayout("default, $lcgap, pref, $lcgap, 40dlu, $lcgap, pref, $lcgap, 61dlu",
                                "3*(default, $lgap), default"));

                //---- label4 ----
                label4.setText("jeden");
                label4.setFont(new Font("Arial", Font.PLAIN, 14));
                label4.setHorizontalAlignment(SwingConstants.TRAILING);
                pnlMonthly.add(label4, CC.xy(3, 3));

                //---- spinMonat ----
                spinMonat.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlMonthly.add(spinMonat, CC.xy(5, 3));

                //---- label6 ----
                label6.setText("Monat");
                label6.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlMonthly.add(label6, CC.xy(7, 3));

                //---- btnJedenMonat ----
                btnJedenMonat.setText("Jeden Monat");
                btnJedenMonat.setFont(new Font("Arial", Font.PLAIN, 14));
                btnJedenMonat.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        btnJedenMonatActionPerformed(e);
                    }
                });
                pnlMonthly.add(btnJedenMonat, CC.xywh(3, 5, 5, 1));

                //---- label5 ----
                label5.setText("jeweils am");
                label5.setFont(new Font("Arial", Font.PLAIN, 14));
                label5.setHorizontalAlignment(SwingConstants.TRAILING);
                pnlMonthly.add(label5, CC.xy(3, 7));

                //---- spinMonatTag ----
                spinMonatTag.setFont(new Font("Arial", Font.PLAIN, 14));
                spinMonatTag.addChangeListener(new ChangeListener() {
                    @Override
                    public void stateChanged(ChangeEvent e) {
                        spinMonatTagStateChanged(e);
                    }
                });
                pnlMonthly.add(spinMonatTag, CC.xy(5, 7));

                //---- cmbTag ----
                cmbTag.setModel(new DefaultComboBoxModel<>(new String[] { "Tag des Monats", "Montag",
                        "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag" }));
                cmbTag.setFont(new Font("Arial", Font.PLAIN, 14));
                pnlMonthly.add(cmbTag, CC.xywh(7, 7, 3, 1));
            }
            tabWdh.addTab("Monatlich", pnlMonthly);
        }
        panelMain.add(tabWdh, CC.xy(3, 7, CC.FILL, CC.FILL));

        //======== panel2 ========
        {
            panel2.setLayout(new FormLayout(
                    "default, $lcgap, default:grow, $ugap, default, $lcgap, default:grow", "default:grow"));

            //---- jLabel13 ----
            jLabel13.setText("Erst einplanen ab dem");
            jLabel13.setFont(new Font("Arial", Font.PLAIN, 14));
            panel2.add(jLabel13, CC.xy(1, 1));

            //---- txtLDate ----
            txtLDate.setFont(new Font("Arial", Font.PLAIN, 14));
            txtLDate.addFocusListener(new FocusAdapter() {
                @Override
                public void focusLost(FocusEvent e) {
                    txtLDateFocusLost(e);
                }
            });
            panel2.add(txtLDate, CC.xy(3, 1));

            //---- lblMinutes ----
            lblMinutes.setText("text");
            lblMinutes.setFont(new Font("Arial", Font.PLAIN, 14));
            panel2.add(lblMinutes, CC.xy(5, 1));

            //---- txtMinutes ----
            txtMinutes.setFont(new Font("Arial", Font.PLAIN, 14));
            txtMinutes.addFocusListener(new FocusAdapter() {
                @Override
                public void focusLost(FocusEvent e) {
                    txtMinutesFocusLost(e);
                }
            });
            panel2.add(txtMinutes, CC.xy(7, 1));
        }
        panelMain.add(panel2, CC.xy(3, 9));

        //======== pnlBemerkung ========
        {
            pnlBemerkung.setBorder(new TitledBorder(null, "Kommentar zur Anwendung (Erscheint im DFN)",
                    TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION, new Font("Arial", Font.PLAIN, 14)));
            pnlBemerkung.setLayout(new BoxLayout(pnlBemerkung, BoxLayout.X_AXIS));

            //======== jScrollPane1 ========
            {

                //---- txtBemerkung ----
                txtBemerkung.setColumns(20);
                txtBemerkung.setRows(5);
                jScrollPane1.setViewportView(txtBemerkung);
            }
            pnlBemerkung.add(jScrollPane1);
        }
        panelMain.add(pnlBemerkung, CC.xy(3, 11, CC.FILL, CC.FILL));

        //---- btnSave ----
        btnSave.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png")));
        btnSave.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                btnSaveActionPerformed(e);
            }
        });
        panelMain.add(btnSave, CC.xy(3, 13, CC.RIGHT, CC.DEFAULT));
    }
    add(panelMain, BorderLayout.CENTER);
}

From source file:op.care.prescription.DlgRegular.java

/**
 * This method is called from within the constructor to
 * initialize the form.// ww  w .  j av a 2 s . c  om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the PrinterForm Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    jPanel1 = new JPanel();
    txtMed = new JXSearchField();
    cmbMed = new JComboBox<>();
    panel4 = new JPanel();
    btnMed = new JButton();
    cmbIntervention = new JComboBox<>();
    txtIntervention = new JXSearchField();
    jPanel8 = new JPanel();
    jspDosis = new JScrollPane();
    tblDosis = new JTable();
    panel2 = new JPanel();
    btnAddDosis = new JButton();
    jPanel3 = new JPanel();
    pnlOFF = new JPanel();
    rbActive = new JRadioButton();
    rbDate = new JRadioButton();
    txtTo = new JTextField();
    rbEndOfPackage = new JRadioButton();
    jScrollPane3 = new JScrollPane();
    txtBemerkung = new JTextPane();
    lblText = new JLabel();
    pnlON = new JPanel();
    cmbDocON = new JComboBox<>();
    btnAddGP = new JButton();
    cmbHospitalON = new JComboBox<>();
    btnAddHospital = new JButton();
    panel1 = new JPanel();
    btnClose = new JButton();
    btnSave = new JButton();
    lblTX = new JLabel();

    //======== this ========
    setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
    setResizable(false);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    Container contentPane = getContentPane();
    contentPane.setLayout(new FormLayout("$rgap, $lcgap, default, $lcgap, pref, $lcgap, $rgap",
            "$rgap, $lgap, fill:default:grow, $lgap, fill:default, $lgap, $rgap"));

    //======== jPanel1 ========
    {
        jPanel1.setBorder(null);
        jPanel1.setLayout(new FormLayout("68dlu, $lcgap, 284dlu, $lcgap, pref",
                "2*(16dlu, $lgap), default, $lgap, fill:default:grow"));

        //---- txtMed ----
        txtMed.setFont(new Font("Arial", Font.PLAIN, 14));
        txtMed.setPrompt("Medikamente");
        txtMed.setFocusBehavior(PromptSupport.FocusBehavior.HIGHLIGHT_PROMPT);
        txtMed.addActionListener(e -> txtMedActionPerformed(e));
        txtMed.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent e) {
                txtMedFocusGained(e);
            }
        });
        jPanel1.add(txtMed, CC.xy(1, 1));

        //---- cmbMed ----
        cmbMed.setModel(new DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cmbMed.setFont(new Font("Arial", Font.PLAIN, 14));
        cmbMed.addItemListener(e -> cmbMedItemStateChanged(e));
        jPanel1.add(cmbMed, CC.xy(3, 1));

        //======== panel4 ========
        {
            panel4.setLayout(new BoxLayout(panel4, BoxLayout.LINE_AXIS));

            //---- btnMed ----
            btnMed.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/add.png")));
            btnMed.setBorderPainted(false);
            btnMed.setBorder(null);
            btnMed.setContentAreaFilled(false);
            btnMed.setToolTipText("Neues Medikament eintragen");
            btnMed.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnMed.setSelectedIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/add-pressed.png")));
            btnMed.addActionListener(e -> btnMedActionPerformed(e));
            panel4.add(btnMed);
        }
        jPanel1.add(panel4, CC.xy(5, 1));

        //---- cmbIntervention ----
        cmbIntervention
                .setModel(new DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cmbIntervention.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(cmbIntervention, CC.xywh(3, 3, 3, 1));

        //---- txtIntervention ----
        txtIntervention.setFont(new Font("Arial", Font.PLAIN, 14));
        txtIntervention.setPrompt("Massnahmen");
        txtIntervention.addActionListener(e -> txtMassActionPerformed(e));
        jPanel1.add(txtIntervention, CC.xy(1, 3));

        //======== jPanel8 ========
        {
            jPanel8.setBorder(new TitledBorder(null, "Dosis / H\u00e4ufigkeit", TitledBorder.LEADING,
                    TitledBorder.DEFAULT_POSITION, new Font("Arial", Font.PLAIN, 14)));
            jPanel8.setFont(new Font("Arial", Font.PLAIN, 14));
            jPanel8.setLayout(new FormLayout("370dlu", "fill:default:grow, $lgap, pref"));

            //======== jspDosis ========
            {
                jspDosis.setToolTipText(null);

                //---- tblDosis ----
                tblDosis.setModel(new DefaultTableModel(
                        new Object[][] { { null, null, null, null }, { null, null, null, null },
                                { null, null, null, null }, { null, null, null, null }, },
                        new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
                tblDosis.setSurrendersFocusOnKeystroke(true);
                tblDosis.setToolTipText(null);
                tblDosis.addMouseListener(new MouseAdapter() {
                    @Override
                    public void mousePressed(MouseEvent e) {
                        tblDosisMousePressed(e);
                    }
                });
                jspDosis.setViewportView(tblDosis);
            }
            jPanel8.add(jspDosis, CC.xy(1, 1));

            //======== panel2 ========
            {
                panel2.setLayout(new BoxLayout(panel2, BoxLayout.LINE_AXIS));

                //---- btnAddDosis ----
                btnAddDosis.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/add.png")));
                btnAddDosis.setBorderPainted(false);
                btnAddDosis.setBorder(null);
                btnAddDosis.setContentAreaFilled(false);
                btnAddDosis.setToolTipText("Neue Dosierung eintragen");
                btnAddDosis.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                btnAddDosis.setSelectedIcon(
                        new ImageIcon(getClass().getResource("/artwork/22x22/bw/add-pressed.png")));
                btnAddDosis.addActionListener(e -> btnAddDosisActionPerformed(e));
                panel2.add(btnAddDosis);
            }
            jPanel8.add(panel2, CC.xy(1, 3, CC.LEFT, CC.DEFAULT));
        }
        jPanel1.add(jPanel8, CC.xywh(1, 7, 5, 1));
    }
    contentPane.add(jPanel1, CC.xy(5, 3));

    //======== jPanel3 ========
    {
        jPanel3.setBorder(null);
        jPanel3.setLayout(new FormLayout("149dlu", "3*(fill:default, $lgap), fill:108dlu:grow, $lgap, 60dlu"));

        //======== pnlOFF ========
        {
            pnlOFF.setBorder(new TitledBorder("Absetzung"));
            pnlOFF.setLayout(new FormLayout("pref, 86dlu:grow", "2*(fill:17dlu, $lgap), fill:17dlu"));

            //---- rbActive ----
            rbActive.setText("text");
            rbActive.setSelected(true);
            rbActive.addItemListener(e -> rbActiveItemStateChanged(e));
            pnlOFF.add(rbActive, CC.xywh(1, 1, 2, 1));

            //---- rbDate ----
            rbDate.setText(null);
            rbDate.addItemListener(e -> rbDateItemStateChanged(e));
            pnlOFF.add(rbDate, CC.xy(1, 3));

            //---- txtTo ----
            txtTo.addFocusListener(new FocusAdapter() {
                @Override
                public void focusLost(FocusEvent e) {
                    txtToFocusLost(e);
                }
            });
            pnlOFF.add(txtTo, CC.xy(2, 3));

            //---- rbEndOfPackage ----
            rbEndOfPackage.setText("text");
            rbEndOfPackage.addItemListener(e -> rbEndOfPackageItemStateChanged(e));
            pnlOFF.add(rbEndOfPackage, CC.xywh(1, 5, 2, 1));
        }
        jPanel3.add(pnlOFF, CC.xy(1, 3));

        //======== jScrollPane3 ========
        {

            //---- txtBemerkung ----
            txtBemerkung.addCaretListener(e -> txtBemerkungCaretUpdate(e));
            jScrollPane3.setViewportView(txtBemerkung);
        }
        jPanel3.add(jScrollPane3, CC.xy(1, 7));

        //---- lblText ----
        lblText.setText("Bemerkung:");
        jPanel3.add(lblText, CC.xy(1, 5));

        //======== pnlON ========
        {
            pnlON.setBorder(new TitledBorder("Ansetzung"));
            pnlON.setLayout(new FormLayout("119dlu:grow, $lcgap, default", "default, $lgap, default"));

            //---- cmbDocON ----
            cmbDocON.setModel(
                    new DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
            cmbDocON.addKeyListener(new KeyAdapter() {
                @Override
                public void keyPressed(KeyEvent e) {
                    cmbDocONKeyPressed(e);
                }
            });
            pnlON.add(cmbDocON, CC.xy(1, 1));

            //---- btnAddGP ----
            btnAddGP.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/add.png")));
            btnAddGP.setBorderPainted(false);
            btnAddGP.setBorder(null);
            btnAddGP.setContentAreaFilled(false);
            btnAddGP.setToolTipText("Neues Medikament eintragen");
            btnAddGP.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnAddGP.setSelectedIcon(
                    new ImageIcon(getClass().getResource("/artwork/22x22/bw/add-pressed.png")));
            btnAddGP.addActionListener(e -> btnAddGPActionPerformed(e));
            pnlON.add(btnAddGP, CC.xy(3, 1));

            //---- cmbHospitalON ----
            cmbHospitalON.setModel(
                    new DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
            pnlON.add(cmbHospitalON, CC.xy(1, 3));

            //---- btnAddHospital ----
            btnAddHospital.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/add.png")));
            btnAddHospital.setBorderPainted(false);
            btnAddHospital.setBorder(null);
            btnAddHospital.setContentAreaFilled(false);
            btnAddHospital.setToolTipText("Neues Medikament eintragen");
            btnAddHospital.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnAddHospital.setSelectedIcon(
                    new ImageIcon(getClass().getResource("/artwork/22x22/bw/add-pressed.png")));
            btnAddHospital.addActionListener(e -> btnAddHospitalActionPerformed(e));
            pnlON.add(btnAddHospital, CC.xy(3, 3));
        }
        jPanel3.add(pnlON, CC.xy(1, 1));
    }
    contentPane.add(jPanel3, CC.xy(3, 3));

    //======== panel1 ========
    {
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.LINE_AXIS));

        //---- btnClose ----
        btnClose.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/cancel.png")));
        btnClose.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        btnClose.addActionListener(e -> btnCloseActionPerformed(e));
        panel1.add(btnClose);

        //---- btnSave ----
        btnSave.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png")));
        btnSave.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        btnSave.addActionListener(e -> btnSaveActionPerformed(e));
        panel1.add(btnSave);
    }
    contentPane.add(panel1, CC.xy(5, 5, CC.RIGHT, CC.DEFAULT));

    //---- lblTX ----
    lblTX.setText(null);
    lblTX.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/ambulance2.png")));
    contentPane.add(lblTX, CC.xy(3, 5));
    setSize(1015, 640);
    setLocationRelativeTo(getOwner());

    //---- bgMedikament ----
    ButtonGroup bgMedikament = new ButtonGroup();
    bgMedikament.add(rbActive);
    bgMedikament.add(rbDate);
    bgMedikament.add(rbEndOfPackage);
}

From source file:org.datanucleus.ide.idea.ui.DNEConfigForm.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL//ww  w  .ja  v  a 2 s .co  m
 */
private void $$$setupUI$$$() {
    createUIComponents();
    parentPanel.setLayout(new GridLayoutManager(2, 1, new Insets(1, 0, 0, 0), -1, -1));
    configTabbedPane = new JTabbedPane();
    parentPanel.add(configTabbedPane,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    configPanel = new JPanel();
    configPanel.setLayout(new GridLayoutManager(5, 3, new Insets(6, 2, 2, 2), -1, -1));
    configTabbedPane.addTab("Enhancer", configPanel);
    indexNotReadyPanel = new JPanel();
    indexNotReadyPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    configPanel.add(indexNotReadyPanel,
            new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    final JLabel label1 = new JLabel();
    label1.setText("Please wait until indexing is finished");
    indexNotReadyPanel.add(label1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    configPanel.add(contentPanel,
            new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.add(panel1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-3355444)),
            "Affected Modules"));
    final JScrollPane scrollPane1 = new JScrollPane();
    panel1.add(scrollPane1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    affectedModulesTable = new JTable();
    affectedModulesTable.setEnabled(true);
    affectedModulesTable.setFillsViewportHeight(false);
    affectedModulesTable.setPreferredScrollableViewportSize(new Dimension(450, 30));
    scrollPane1.setViewportView(affectedModulesTable);
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.add(panel2,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-3355444)),
            "Metadata and annotated classes for enhancement", TitledBorder.DEFAULT_JUSTIFICATION,
            TitledBorder.DEFAULT_POSITION, null, new Color(-16777216)));
    infoPanel = new JPanel();
    infoPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    panel2.add(infoPanel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label2 = new JLabel();
    label2.setText("Please click 'Make Project' to see affected files");
    infoPanel.add(label2,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    metaDataAndClassesScrollPane = new JScrollPane();
    panel2.add(metaDataAndClassesScrollPane,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    metadataAndClassesTable = new JTable();
    metadataAndClassesTable.setFillsViewportHeight(false);
    metadataAndClassesTable.setFont(new Font(metadataAndClassesTable.getFont().getName(),
            metadataAndClassesTable.getFont().getStyle(), metadataAndClassesTable.getFont().getSize()));
    metadataAndClassesTable.setPreferredScrollableViewportSize(new Dimension(450, 100));
    metaDataAndClassesScrollPane.setViewportView(metadataAndClassesTable);
    modifiersPanel = new JPanel();
    modifiersPanel.setLayout(new GridLayoutManager(2, 3, new Insets(0, 2, 0, 0), -1, -1));
    configPanel.add(modifiersPanel,
            new GridConstraints(1, 0, 2, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label3 = new JLabel();
    label3.setText(" Metadata file extensions (use ';' to separate)");
    modifiersPanel.add(label3,
            new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    includeTestClassesCheckBox = new JCheckBox();
    includeTestClassesCheckBox.setText("Include Test classes");
    modifiersPanel.add(includeTestClassesCheckBox,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    metadataExtensionTextField.setAlignmentX(0.5f);
    metadataExtensionTextField.setAutoscrolls(true);
    metadataExtensionTextField.setMargin(new Insets(1, 1, 1, 1));
    modifiersPanel.add(metadataExtensionTextField,
            new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
                    new Dimension(150, -1), null, 0, false));
    addToCompilerResourceCheckBox = new JCheckBox();
    addToCompilerResourceCheckBox.setText("Add to compiler resource patterns");
    modifiersPanel.add(addToCompilerResourceCheckBox,
            new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    dependenciesPanel = new JPanel();
    dependenciesPanel.setLayout(new GridLayoutManager(3, 1, new Insets(6, 2, 2, 2), -1, -1));
    configTabbedPane.addTab("Dependencies", dependenciesPanel);
    final JPanel panel3 = new JPanel();
    panel3.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), 5, 5));
    dependenciesPanel.add(panel3,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    depProjectModuleRadioButton.setText("Project Module Dependencies");
    panel3.add(depProjectModuleRadioButton,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    depManualRadioButton.setText("Manual Dependencies");
    panel3.add(depManualRadioButton,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    panel3.add(spacer1,
            new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    depManualUnsupportedLabel = new JLabel();
    depManualUnsupportedLabel.setText("(Not supported by plugin extension)");
    panel3.add(depManualUnsupportedLabel,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    manualDependenciesDisabledInfoPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    dependenciesPanel.add(manualDependenciesDisabledInfoPanel,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label4 = new JLabel();
    label4.setHorizontalAlignment(0);
    label4.setHorizontalTextPosition(0);
    label4.setText("Using Enhancer and it's Dependencies from Project Module");
    manualDependenciesDisabledInfoPanel.add(label4,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    dependenciesPanel.add(dependenciesAddDeletePanel,
            new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    generalPanel = new JPanel();
    generalPanel.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
    parentPanel.add(generalPanel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    enableEnhancerCheckBox = new JCheckBox();
    enableEnhancerCheckBox.setText("Enable Enhancer");
    generalPanel.add(enableEnhancerCheckBox,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JPanel panel4 = new JPanel();
    panel4.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
    generalPanel.add(panel4,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    jDORadioButton.setText("JDO");
    panel4.add(jDORadioButton,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    jPARadioButton = new JRadioButton();
    jPARadioButton.setText("JPA");
    panel4.add(jPARadioButton,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer2 = new Spacer();
    panel4.add(spacer2,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    generalPanel.add(persistenceImplComboBox,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    ButtonGroup buttonGroup;
    buttonGroup = new ButtonGroup();
    buttonGroup.add(jDORadioButton);
    buttonGroup.add(jPARadioButton);
    buttonGroup = new ButtonGroup();
    buttonGroup.add(depProjectModuleRadioButton);
    buttonGroup.add(depManualRadioButton);
}

From source file:org.isatools.isacreator.filechooser.FileChooserUI.java

/**
 * Creates the FileSelection panel containing the list of selected files, and the toolbar to modify the list
 *
 * @return JPanel containing a selection pane
 *//*from   w  w w  .j av  a2 s. co  m*/
private JPanel createFilesSelectedPanel() {
    JPanel selectionContainer = new JPanel(new BorderLayout());
    selectionContainer.setBackground(UIHelper.BG_COLOR);
    selectionContainer.setBorder(
            new TitledBorder(UIHelper.GREEN_ROUNDED_BORDER, "selection(s)", TitledBorder.DEFAULT_JUSTIFICATION,
                    TitledBorder.DEFAULT_POSITION, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR));

    selectedFiles = new DirectoryFileList();
    listModel = (DefaultListModel) selectedFiles.getModel();

    selectedFiles.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    selectedFiles.setDragEnabled(false);

    JScrollPane selectedFileScroller = new JScrollPane(selectedFiles, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    selectedFileScroller.setPreferredSize(new Dimension(200, 175));
    selectedFileScroller.setBorder(new EmptyBorder(0, 0, 0, 0));

    IAppWidgetFactory.makeIAppScrollPane(selectedFileScroller);

    selectionContainer.add(selectedFileScroller, BorderLayout.CENTER);

    // add list modification toolbar to sort, move, and delete files from the list.
    JPanel optionsPanel = new JPanel();
    optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.LINE_AXIS));
    optionsPanel.setBackground(UIHelper.BG_COLOR);

    final JLabel moveDown = new JLabel(downIcon);
    moveDown.setOpaque(false);
    moveDown.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            moveDown.setIcon(downIcon);

            if (!selectedFiles.isSelectionEmpty()) {
                int toMoveDown = selectedFiles.getSelectedIndex();

                if (toMoveDown != (listModel.getSize() - 1)) {
                    swapElements(toMoveDown, toMoveDown + 1);
                }
            }
        }

        public void mouseEntered(MouseEvent event) {
            moveDown.setIcon(downIconOver);
        }

        public void mouseExited(MouseEvent event) {
            moveDown.setIcon(downIcon);
        }
    });

    optionsPanel.add(moveDown);
    optionsPanel.add(Box.createHorizontalStrut(5));

    final JLabel moveUp = new JLabel(upIcon);
    moveUp.setOpaque(false);
    moveUp.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            moveUp.setIcon(upIcon);

            if (!selectedFiles.isSelectionEmpty()) {
                int toMoveUp = selectedFiles.getSelectedIndex();

                if (toMoveUp != 0) {
                    swapElements(toMoveUp, toMoveUp - 1);
                }
            }
        }

        public void mouseEntered(MouseEvent event) {
            moveUp.setIcon(upIconOver);
        }

        public void mouseExited(MouseEvent event) {
            moveUp.setIcon(upIcon);
        }
    });

    optionsPanel.add(moveUp);
    optionsPanel.add(Box.createHorizontalStrut(5));

    final JLabel deleteItem = new JLabel(deleteIcon);
    deleteItem.setOpaque(false);
    deleteItem.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            deleteItem.setIcon(deleteIcon);

            if (selectedFiles.getSelectedValues() != null) {
                for (Object o : selectedFiles.getSelectedValues()) {
                    listModel.removeElement(o);
                }
            }
        }

        public void mouseEntered(MouseEvent event) {
            deleteItem.setIcon(deleteIconOver);
        }

        public void mouseExited(MouseEvent event) {
            deleteItem.setIcon(deleteIcon);
        }
    });

    optionsPanel.add(deleteItem);
    optionsPanel.add(Box.createHorizontalStrut(5));

    final JLabel sortAsc = new JLabel(sortAscIcon);
    sortAsc.setOpaque(false);
    sortAsc.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            sortAsc.setIcon(sortAscIcon);
            if (listModel.getSize() > 0) {
                sort(true);
            }
        }

        public void mouseEntered(MouseEvent event) {
            sortAsc.setIcon(sortAscIconOver);
        }

        public void mouseExited(MouseEvent event) {
            sortAsc.setIcon(sortAscIcon);
        }
    });

    optionsPanel.add(sortAsc);
    optionsPanel.add(Box.createHorizontalStrut(5));

    final JLabel sortDesc = new JLabel(sortDescIcon);
    sortDesc.setOpaque(false);
    sortDesc.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            sortDesc.setIcon(sortDescIcon);
            if (listModel.getSize() > 0) {
                sort(false);
            }
        }

        public void mouseEntered(MouseEvent event) {
            sortDesc.setIcon(sortDescIconOver);
        }

        public void mouseExited(MouseEvent event) {
            sortDesc.setIcon(sortDescIcon);
        }
    });

    optionsPanel.add(sortDesc);
    optionsPanel.add(Box.createHorizontalStrut(5));

    selectionContainer.add(optionsPanel, BorderLayout.SOUTH);

    return selectionContainer;
}

From source file:org.isatools.isacreator.filechooser.FileChooserUI.java

/**
 * Create the Navigation Tree panel//from   w  w  w. ja  va  2 s. co  m
 *
 * @return @see JPanel containing the navigation tree to browse a file system.
 */
private JPanel createNavTree() {
    JPanel treeContainer = new JPanel(new BorderLayout());
    treeContainer.setBackground(UIHelper.BG_COLOR);
    treeContainer
            .setBorder(new TitledBorder(UIHelper.GREEN_ROUNDED_BORDER, "", TitledBorder.DEFAULT_JUSTIFICATION,
                    TitledBorder.DEFAULT_POSITION, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR));

    JPanel navigationControls = new JPanel();
    navigationControls.setLayout(new BoxLayout(navigationControls, BoxLayout.LINE_AXIS));
    navigationControls.setOpaque(false);

    final JLabel navToParentDir = new JLabel(upIcon);
    navToParentDir.setOpaque(false);
    navToParentDir.addMouseListener(new CommonMouseAdapter() {

        public void mousePressed(MouseEvent event) {
            super.mousePressed(event);
            navToParentDir.setIcon(upIcon);
            try {
                updateTree(fileBrowser.getParentDirectory());
            } catch (IOException e) {
                errorAction("problem occurred!");
            }
        }

        public void mouseEntered(MouseEvent event) {
            super.mouseEntered(event);
            navToParentDir.setIcon(upIconOver);
        }

        public void mouseExited(MouseEvent event) {
            super.mouseExited(event);
            navToParentDir.setIcon(upIcon);
        }
    });

    navigationControls.add(navToParentDir);
    navigationControls.add(Box.createHorizontalStrut(5));

    final JLabel navToHomeDir = new JLabel(homeIcon);
    navToHomeDir.setOpaque(false);
    navToHomeDir.addMouseListener(new CommonMouseAdapter() {

        public void mousePressed(MouseEvent event) {
            super.mousePressed(event);
            navToHomeDir.setIcon(homeIcon);
            try {
                updateTree(fileBrowser.getHomeDirectory());

            } catch (IOException e) {
                if (e instanceof ConnectionException) {
                    status.setText("<html>status: not connected!</html>");
                }
                FileBrowserTreeNode defaultFTPNode = new FileBrowserTreeNode("problem occurred!", false,
                        FileBrowserTreeNode.DIRECTORY);
                updateTree(defaultFTPNode);
            }
        }

        public void mouseEntered(MouseEvent event) {
            super.mouseEntered(event);
            navToHomeDir.setIcon(homeIconOver);
        }

        public void mouseExited(MouseEvent event) {
            super.mouseExited(event);
            navToHomeDir.setIcon(homeIcon);
        }
    });

    navigationControls.add(navToHomeDir);
    navigationControls.add(Box.createGlue());

    treeContainer.add(navigationControls, BorderLayout.NORTH);

    try {
        treeModel = new DefaultTreeModel(fileBrowser.getHomeDirectory());
        directoryTree = new JTree(treeModel);
        directoryTree.setFont(UIHelper.VER_11_PLAIN);
        directoryTree.setCellRenderer(new FileSystemTreeCellRenderer());
    } catch (IOException e) {
        FileBrowserTreeNode defaultFTPNode = new FileBrowserTreeNode("problem occurred!", false,
                FileBrowserTreeNode.DIRECTORY);
        updateTree(defaultFTPNode);
    }

    directoryTree.addMouseListener(new CommonMouseAdapter() {

        public void mousePressed(MouseEvent event) {
            super.mousePressed(event);
            int selRow = directoryTree.getRowForLocation(event.getX(), event.getY());

            TreePath selPath = directoryTree.getPathForLocation(event.getX(), event.getY());

            if (selRow != -1) {
                final FileBrowserTreeNode node = (FileBrowserTreeNode) selPath.getLastPathComponent();

                if (SwingUtilities.isLeftMouseButton(event)) {

                    if (event.getClickCount() == 2) {
                        if ((node.getType() == FileBrowserTreeNode.DIRECTORY) && (node.getLevel() != 0)) {

                            String newPath;
                            if (fileBrowser instanceof LocalBrowser) {
                                newPath = ((File) fileBrowser.getDirFiles().get(node.toString())).getPath();
                            } else {
                                newPath = node.toString();
                            }
                            updateTree(fileBrowser.changeDirectory(newPath));
                        }

                        // else, if a leaf node, then add file to to list
                        if (node.isLeaf() && (node.getType() != FileBrowserTreeNode.DIRECTORY)) {
                            String extension = node.toString().substring(node.toString().lastIndexOf(".") + 1)
                                    .trim().toUpperCase();

                            FileChooserFile toAdd = null;

                            for (Object o : fileBrowser.getFileMap().get(extension)) {
                                String fileName;
                                String filePath;
                                if (fileBrowser instanceof LocalBrowser) {
                                    File file = (File) o;
                                    fileName = file.getName();
                                    filePath = file.getPath();

                                    if (fileName.equals(node.toString())) {
                                        toAdd = new CustomFile(filePath);
                                        break;
                                    }
                                } else {
                                    FTPFile ftpFile = (FTPFile) o;
                                    fileName = ftpFile.getName();
                                    filePath = fileBrowser.getAbsoluteWorkingDirectory() + File.separator
                                            + ftpFile.getName();

                                    if (fileName.equals(node.toString())) {
                                        toAdd = new CustomFTPFile(ftpFile, filePath);
                                        break;
                                    }
                                }

                            }

                            if (toAdd != null && !checkIfInList(toAdd)) {
                                selectedFiles.addFileItem(toAdd);
                            }
                        }
                    }
                } else {
                    if ((node.getType() == FileBrowserTreeNode.DIRECTORY) && (node.getLevel() != 0)) {

                        // show popup to add the directory to the selected files
                        JPopupMenu popup = new JPopupMenu();

                        JMenuItem addDirectory = new JMenuItem("add directory");
                        addDirectory.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent ae) {

                                Object fileToAdd = fileBrowser.getDirFiles().get(node.toString());
                                FileChooserFile toAdd;

                                if (fileToAdd instanceof File) {
                                    toAdd = new CustomFile(((File) fileToAdd).getPath());
                                } else {
                                    FTPFile ftpFile = (FTPFile) fileToAdd;
                                    String filePath = fileBrowser.getAbsoluteWorkingDirectory() + File.separator
                                            + ftpFile.getName();

                                    toAdd = new CustomFTPFile(ftpFile, filePath);
                                }

                                if (!checkIfInList(toAdd)) {
                                    selectedFiles.addDirectoryItem(toAdd);
                                }
                            }
                        });

                        popup.add(addDirectory);
                        popup.show(directoryTree, event.getX(), event.getY());
                    }
                }
            }
        }

    });

    BasicTreeUI ui = new BasicTreeUI() {
        public Icon getCollapsedIcon() {
            return null;
        }

        public Icon getExpandedIcon() {
            return null;
        }
    };

    directoryTree.setUI(ui);
    directoryTree.setFont(UIHelper.VER_12_PLAIN);

    JScrollPane treeScroll = new JScrollPane(directoryTree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    treeScroll.setPreferredSize(new Dimension(300, 200));
    treeScroll.setBorder(new EmptyBorder(0, 0, 0, 0));
    treeContainer.add(treeScroll, BorderLayout.CENTER);

    IAppWidgetFactory.makeIAppScrollPane(treeScroll);

    return treeContainer;
}

From source file:org.isatools.isacreator.wizard.GeneralCreationAlgorithm.java

public JPanel instantiatePanel() {
    final JPanel generalQuestionCont = new JPanel();
    generalQuestionCont.setLayout(new BoxLayout(generalQuestionCont, BoxLayout.PAGE_AXIS));
    generalQuestionCont.setBackground(UIHelper.BG_COLOR);

    JLabel info = new JLabel("<html><b>" + assay.getMeasurementEndpoint() + "</b> using <b>"
            + assay.getTechnologyType() + "</b></html>", JLabel.LEFT);
    UIHelper.renderComponent(info, UIHelper.VER_12_PLAIN, UIHelper.GREY_COLOR, false);

    if (assay.getTechnologyType().equals("")) {
        info.setText("<html><b>" + assay.getMeasurementEndpoint() + "</html>");
    }/*from   w ww .j a  v  a 2s .  com*/

    info.setPreferredSize(new Dimension(300, 40));

    JPanel infoPanel = new JPanel(new GridLayout(1, 1));
    infoPanel.setBackground(UIHelper.BG_COLOR);

    infoPanel.add(info);

    generalQuestionCont.add(infoPanel);

    JPanel labelPanel = new JPanel(new GridLayout(1, 2));
    labelPanel.setBackground(UIHelper.BG_COLOR);

    labelCapture = new LabelCapture("Label");
    labelCapture.setVisible(false);

    labelUsed = new JCheckBox("Label used?", false);
    UIHelper.renderComponent(labelUsed, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR, UIHelper.BG_COLOR);

    labelUsed.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            labelCapture.setVisible(labelUsed.isSelected());

        }
    });

    labelPanel.add(labelUsed);
    labelPanel.add(labelCapture);

    generalQuestionCont.add(labelPanel);

    final JPanel extractPanel = new JPanel(new GridLayout(2, 2));
    extractPanel.setBackground(UIHelper.BG_COLOR);

    extractDetails.clear();

    JLabel extractsUsedLab = UIHelper.createLabel("Sample(s) used *");
    extractsUsedLab.setHorizontalAlignment(JLabel.LEFT);
    extractsUsedLab.setVerticalAlignment(JLabel.TOP);

    final JPanel extractNameContainer = new JPanel();
    extractNameContainer.setLayout(new BoxLayout(extractNameContainer, BoxLayout.PAGE_AXIS));
    extractNameContainer.setBackground(UIHelper.BG_COLOR);

    extract = new ExtractDetailsCapture("Sample " + (extractDetails.size() + 1),
            ApplicationManager.getUserInterfaceForISASection(study).getDataEntryEnvironment());

    extractDetails.add(extract);
    extractNameContainer.add(extract);

    JLabel addButton = new JLabel("add sample", addRecordIcon, JLabel.RIGHT);
    UIHelper.renderComponent(addButton, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR, false);

    addButton.setVerticalAlignment(JLabel.TOP);
    addButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            extract = new ExtractDetailsCapture("Sample " + (extractDetails.size() + 1),
                    ApplicationManager.getUserInterfaceForISASection(study).getDataEntryEnvironment());
            extractDetails.add(extract);
            extractNameContainer.add(extract);

            extractNameContainer.revalidate();
            generalQuestionCont.revalidate();
        }

    });

    addButton.setToolTipText(
            "<html><b>add new sample</b><p>add another sample (e.g. Liver, Heart, Urine, Blood)</p></html>");

    JLabel removeButton = new JLabel("remove sample", removeIcon, JLabel.RIGHT);
    removeButton.setVerticalAlignment(JLabel.TOP);
    UIHelper.renderComponent(removeButton, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    removeButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            if (extractDetails.size() > 1) {
                extract = extractDetails.get(extractDetails.size() - 1);
                extractDetails.remove(extract);
                extractNameContainer.remove(extract);
                generalQuestionCont.revalidate();
            }
        }

    });
    removeButton.setToolTipText(
            "<html><b>remove previously added sample</b><p>remove the sample field last added</p></html>");

    extractPanel.add(extractsUsedLab);
    extractPanel.add(extractNameContainer);

    JPanel buttonContainer = new JPanel(new GridLayout(1, 2));
    buttonContainer.setBackground(UIHelper.BG_COLOR);

    buttonContainer.add(addButton);
    buttonContainer.add(removeButton);

    extractPanel.add(new JLabel());
    extractPanel.add(buttonContainer);

    generalQuestionCont.add(extractPanel);

    generalQuestionCont.add(Box.createVerticalStrut(5));
    generalQuestionCont.add(Box.createHorizontalGlue());

    generalQuestionCont.setBorder(new TitledBorder(new RoundedBorder(UIHelper.DARK_GREEN_COLOR, 9),
            assay.getAssayReference(), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
            UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR));

    return generalQuestionCont;
}

From source file:org.isatools.isacreator.wizard.MicroarrayCreationAlgorithm.java

private JPanel instantiatePanel() {
    final JPanel microArrayQuestionCont = new JPanel();
    microArrayQuestionCont.setLayout(new BoxLayout(microArrayQuestionCont, BoxLayout.PAGE_AXIS));
    microArrayQuestionCont.setOpaque(false);

    StringBuilder text = new StringBuilder("<html><b>" + assay.getMeasurementEndpoint() + "</b> using <b>"
            + assay.getTechnologyType() + "</b>");

    if (!StringUtils.isEmpty(assay.getAssayPlatform())) {
        text.append(" on <b>").append(assay.getAssayPlatform()).append("</b>");
    }/*  w  w  w .j a va2 s  .  c  om*/

    JLabel info = new JLabel(text.append("</html>").toString(), JLabel.LEFT);

    UIHelper.renderComponent(info, UIHelper.VER_12_PLAIN, UIHelper.GREY_COLOR, false);
    info.setPreferredSize(new Dimension(300, 40));

    JPanel infoPanel = new JPanel(new GridLayout(1, 1));
    infoPanel.setOpaque(false);

    infoPanel.add(info);

    microArrayQuestionCont.add(infoPanel);

    // create reference sample used checkbox

    JPanel labelPanel = new JPanel(new GridLayout(2, 2));
    labelPanel.setBackground(UIHelper.BG_COLOR);

    final DataEntryForm studyUISection = ApplicationManager.getUserInterfaceForISASection(study);
    System.out.println("Study user interface is null? " + (studyUISection == null));
    System.out
            .println("Study user interface dep is null? " + (studyUISection.getDataEntryEnvironment() == null));

    label1Capture = new LabelCapture("Label (e.g. Cy3)");
    label2Capture = new LabelCapture("Label (e.g. Cy5)");
    label2Capture.setVisible(false);

    // create dye swap check box
    dyeSwapUsed = new JCheckBox("dye-swap performed?", false);
    UIHelper.renderComponent(dyeSwapUsed, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR, false);

    dyeSwapUsed.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            label2Capture.setVisible(dyeSwapUsed.isSelected());

        }
    });

    labelPanel.add(UIHelper.createLabel("Label(s) used"));
    labelPanel.add(label1Capture);
    labelPanel.add(dyeSwapUsed);
    labelPanel.add(label2Capture);

    microArrayQuestionCont.add(labelPanel);

    final JPanel extractPanel = new JPanel(new GridLayout(2, 2));
    extractPanel.setOpaque(false);

    extractDetails.clear();

    JLabel extractsUsedLab = UIHelper.createLabel("sample(s) used *");
    extractsUsedLab.setHorizontalAlignment(JLabel.LEFT);
    extractsUsedLab.setVerticalAlignment(JLabel.TOP);

    final JPanel extractNameContainer = new JPanel();
    extractNameContainer.setLayout(new BoxLayout(extractNameContainer, BoxLayout.PAGE_AXIS));
    extractNameContainer.setOpaque(false);

    extract = new ExtractDetailsCapture("Sample " + (extractDetails.size() + 1),
            studyUISection.getDataEntryEnvironment());

    extractDetails.add(extract);
    extractNameContainer.add(extract);

    JLabel addExtractButton = new JLabel("add sample", addRecordIcon, JLabel.RIGHT);
    UIHelper.renderComponent(addExtractButton, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR, false);

    addExtractButton.setVerticalAlignment(JLabel.TOP);
    addExtractButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            extract = new ExtractDetailsCapture("Sample " + (extractDetails.size() + 1),
                    studyUISection.getDataEntryEnvironment());
            extractDetails.add(extract);
            extractNameContainer.add(extract);

            extractNameContainer.revalidate();
            microArrayQuestionCont.revalidate();
        }
    });

    addExtractButton.setToolTipText(
            "<html><b>add new sample</b><p>add another sample (e.g. Liver, Heart, Urine, Blood)</p></html>");

    JLabel removeExtractButton = new JLabel("remove sample", removeIcon, JLabel.RIGHT);
    removeExtractButton.setVerticalAlignment(JLabel.TOP);
    UIHelper.renderComponent(removeExtractButton, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    removeExtractButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            if (extractDetails.size() > 1) {
                extract = extractDetails.get(extractDetails.size() - 1);
                extractDetails.remove(extract);
                extractNameContainer.remove(extract);
                microArrayQuestionCont.revalidate();
            }
        }
    });
    removeExtractButton.setToolTipText(
            "<html><b>remove previously added sample</b><p>remove the array design field last added</p></html>");

    extractPanel.add(extractsUsedLab);
    extractPanel.add(extractNameContainer);

    JPanel extractButtonContainer = new JPanel(new GridLayout(1, 2));
    extractButtonContainer.setOpaque(false);

    extractButtonContainer.add(addExtractButton);
    extractButtonContainer.add(removeExtractButton);

    extractPanel.add(new JLabel());
    extractPanel.add(extractButtonContainer);

    microArrayQuestionCont.add(extractPanel);

    // ask for array designs used...
    // create array designs panel
    final JPanel arrayDesignPanel = new JPanel(new GridLayout(2, 2));
    arrayDesignPanel.setOpaque(false);

    arrayDesignsUsed.clear();

    JLabel arrayDesignLab = UIHelper.createLabel("array design(s) used *");
    arrayDesignLab.setVerticalAlignment(JLabel.TOP);
    // the array designs container must adjust to an unknown number of fields. therefore, a JPanel with a BoxLayout
    // will be used since it is flexible!
    final JPanel arrayDesignsContainer = new JPanel();
    arrayDesignsContainer.setLayout(new BoxLayout(arrayDesignsContainer, BoxLayout.PAGE_AXIS));
    arrayDesignsContainer.setOpaque(false);

    newArrayDesign = new AutoFilterCombo(arrayDesigns, true);

    UIHelper.renderComponent(newArrayDesign, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, false);
    newArrayDesign.setPreferredSize(new Dimension(70, 30));

    arrayDesignsContainer.add(newArrayDesign);
    arrayDesignsUsed.add(newArrayDesign);

    JLabel addButton = new JLabel("add design", addRecordIcon, JLabel.RIGHT);

    UIHelper.renderComponent(addButton, UIHelper.VER_10_PLAIN, UIHelper.DARK_GREEN_COLOR, false);
    addButton.setVerticalAlignment(JLabel.TOP);
    addButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            newArrayDesign = new AutoFilterCombo(arrayDesigns, true);
            UIHelper.renderComponent(newArrayDesign, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, false);
            newArrayDesign.setPreferredSize(new Dimension(70, 30));
            arrayDesignsUsed.add(newArrayDesign);
            arrayDesignsContainer.add(newArrayDesign);
            arrayDesignsContainer.revalidate();
            microArrayQuestionCont.revalidate();
        }

    });
    addButton.setToolTipText("<html><b>add new array design</b><p>add another array design</p></html>");

    JLabel removeButton = new JLabel("remove design", removeIcon, JLabel.RIGHT);
    removeButton.setVerticalAlignment(JLabel.TOP);
    UIHelper.renderComponent(removeButton, UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    removeButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            if (arrayDesignsUsed.size() > 1) {
                newArrayDesign = arrayDesignsUsed.get(arrayDesignsUsed.size() - 1);
                arrayDesignsUsed.remove(newArrayDesign);
                arrayDesignsContainer.remove(newArrayDesign);
                arrayDesignPanel.revalidate();
                microArrayQuestionCont.validate();
            }
        }

    });
    removeButton.setToolTipText(
            "<html><b>remove previously added array design</b><p>remove the array design field last added</p></html>");

    arrayDesignPanel.add(arrayDesignLab);
    arrayDesignPanel.add(arrayDesignsContainer);

    JPanel buttonContainer = new JPanel(new GridLayout(1, 2));
    buttonContainer.setOpaque(false);

    buttonContainer.add(addButton);
    buttonContainer.add(removeButton);

    arrayDesignPanel.add(new JLabel());
    arrayDesignPanel.add(buttonContainer);

    microArrayQuestionCont.add(arrayDesignPanel);

    microArrayQuestionCont.add(Box.createVerticalStrut(5));
    microArrayQuestionCont.add(Box.createHorizontalGlue());

    microArrayQuestionCont.setBorder(new TitledBorder(new RoundedBorder(UIHelper.DARK_GREEN_COLOR, 9),
            assay.getAssayReference(), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
            UIHelper.VER_12_BOLD, UIHelper.DARK_GREEN_COLOR));

    return microArrayQuestionCont;
}

From source file:org.isatools.isacreatorconfigurator.configui.FieldInterface.java

private void instantiateFields(String initFieldName) {
    // OVERALL CONTAINER
    JPanel container = new JPanel();
    container.setLayout(new BoxLayout(container, BoxLayout.PAGE_AXIS));
    container.setBackground(UIHelper.BG_COLOR);

    JLabel fieldDefinitionLab = new JLabel(fieldDefinitionHeader, JLabel.CENTER);
    container.add(fieldDefinitionLab);//from   w ww . j av a 2 s  .co m

    container.add(Box.createVerticalStrut(5));

    // FIELD LABEL & INPUT BOX CONTAINER
    JPanel fieldCont = new JPanel(new GridLayout(1, 2));
    fieldCont.setBackground(UIHelper.BG_COLOR);

    fieldName = new RoundedJTextField(15);
    fieldName.setText(initFieldName);
    fieldName.setEditable(false);
    UIHelper.renderComponent(fieldName, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, false);

    JLabel fieldNameLab = UIHelper.createLabel("Field Name: ", UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR);
    fieldCont.add(fieldNameLab);
    fieldCont.add(fieldName);
    container.add(fieldCont);

    JPanel descCont = new JPanel(new GridLayout(1, 2));
    descCont.setBackground(UIHelper.BG_COLOR);
    description = new RoundedJTextArea();
    description.setLineWrap(true);
    description.setWrapStyleWord(true);
    UIHelper.renderComponent(description, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, false);

    JScrollPane descScroll = new JScrollPane(description, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    descScroll.setBackground(UIHelper.BG_COLOR);
    descScroll.setPreferredSize(new Dimension(150, 65));
    descScroll.getViewport().setBackground(UIHelper.BG_COLOR);

    IAppWidgetFactory.makeIAppScrollPane(descScroll);

    JLabel descLab = UIHelper.createLabel("Description: ", UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR);
    descLab.setVerticalAlignment(JLabel.TOP);
    descCont.add(descLab);
    descCont.add(descScroll);
    container.add(descCont);

    // add datatype information
    JPanel datatypeCont = new JPanel(new GridLayout(1, 2));
    datatypeCont.setBackground(UIHelper.BG_COLOR);

    DataTypes[] allowedDataTypes = initFieldName.equals(UNIT_STR) ? new DataTypes[] { DataTypes.ONTOLOGY_TERM }
            : DataTypes.values();

    datatype = new JComboBox(allowedDataTypes);
    datatype.addActionListener(this);
    UIHelper.renderComponent(datatype, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, UIHelper.BG_COLOR);

    JLabel dataTypeLab = UIHelper.createLabel("Datatype:", UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR);
    datatypeCont.add(dataTypeLab);
    datatypeCont.add(datatype);
    container.add(datatypeCont);

    defaultValContStd = new JPanel(new GridLayout(1, 2));
    defaultValContStd.setBackground(UIHelper.BG_COLOR);

    defaultValCont = Box.createHorizontalBox();
    defaultValCont.setPreferredSize(new Dimension(150, 25));

    defaultValStd = new RoundedFormattedTextField(null, UIHelper.TRANSPARENT_LIGHT_GREEN_COLOR,
            UIHelper.DARK_GREEN_COLOR);
    defaultValCont.setPreferredSize(new Dimension(120, 25));
    defaultValStd.setFormatterFactory(new DefaultFormatterFactory(
            new RegExFormatter(".*", defaultValStd, false, UIHelper.DARK_GREEN_COLOR, UIHelper.RED_COLOR,
                    UIHelper.TRANSPARENT_LIGHT_GREEN_COLOR, UIHelper.TRANSPARENT_LIGHT_GREEN_COLOR)));
    defaultValStd.setForeground(UIHelper.DARK_GREEN_COLOR);
    defaultValStd.setFont(UIHelper.VER_11_PLAIN);

    defaultValCont.add(defaultValStd);

    defaultValLabStd = UIHelper.createLabel(DEFAULT_VAL_STR, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR);

    defaultValContStd.add(defaultValLabStd);
    defaultValContStd.add(defaultValCont);
    container.add(defaultValContStd);

    defaultValContBool = new JPanel(new GridLayout(1, 2));
    defaultValContBool.setBackground(UIHelper.BG_COLOR);
    defaultValContBool.setVisible(false);

    listDataSourceCont = new JPanel(new GridLayout(2, 1));
    listDataSourceCont.setBackground(UIHelper.BG_COLOR);
    listDataSourceCont.setVisible(false);

    JLabel listValLab = UIHelper.createLabel("Please enter comma separated list of values:",
            UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR);
    listDataSourceCont.add(listValLab);

    listValues = new RoundedJTextArea("SampleVal1, SampleVal2, SampleVal3", 3, 5);
    listValues.setLineWrap(true);
    listValues.setWrapStyleWord(true);
    UIHelper.renderComponent(listValues, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, false);

    JScrollPane listScroll = new JScrollPane(listValues, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    listScroll.setBackground(UIHelper.BG_COLOR);
    listScroll.getViewport().setBackground(UIHelper.BG_COLOR);

    listDataSourceCont.add(listScroll);
    container.add(listDataSourceCont);

    IAppWidgetFactory.makeIAppScrollPane(listScroll);

    sourceEntryPanel = new JPanel(new BorderLayout());
    sourceEntryPanel.setSize(new Dimension(125, 190));
    sourceEntryPanel.setOpaque(false);
    sourceEntryPanel.setVisible(false);

    preferredOntologySource = new JPanel();
    preferredOntologySource.setLayout(new BoxLayout(preferredOntologySource, BoxLayout.PAGE_AXIS));
    preferredOntologySource.setVisible(false);
    recommendOntologySource = new JCheckBox("Use recommended ontology source?", false);

    UIHelper.renderComponent(recommendOntologySource, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    recommendOntologySource.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (recommendOntologySource.isSelected()) {
                sourceEntryPanel.setVisible(true);
            } else {
                sourceEntryPanel.setVisible(false);
            }
        }
    });

    JPanel useOntologySourceCont = new JPanel(new GridLayout(1, 1));
    useOntologySourceCont.add(recommendOntologySource);

    preferredOntologySource.add(useOntologySourceCont);

    JPanel infoCont = new JPanel(new GridLayout(1, 1));
    JLabel infoLab = UIHelper.createLabel(
            "<html>click on the <strong>configure ontologies</strong> button to open the ontology configurator to edit the list of ontologies and search areas within an ontology</html>",
            UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR);
    infoLab.setPreferredSize(new Dimension(100, 40));
    infoCont.add(infoLab);

    sourceEntryPanel.add(infoCont, BorderLayout.NORTH);

    JLabel preferredOntologiesLab = new JLabel(preferredOntologiesSidePanelIcon);
    preferredOntologiesLab.setVerticalAlignment(SwingConstants.TOP);

    sourceEntryPanel.add(preferredOntologiesLab, BorderLayout.WEST);

    ontologiesToUseModel = new DefaultTableModel(new String[0][2], ontologyColumnHeaders) {
        @Override
        public boolean isCellEditable(int i, int i1) {
            return false;
        }
    };
    ontologiesToUse = new JTable(ontologiesToUseModel);
    ontologiesToUse.getTableHeader().setBackground(UIHelper.BG_COLOR);

    try {
        ontologiesToUse.setDefaultRenderer(Class.forName("java.lang.Object"),
                new CustomSpreadsheetCellRenderer());
    } catch (ClassNotFoundException e) {
        // empty
    }

    renderTableHeader();

    JScrollPane ontologiesToUseScroller = new JScrollPane(ontologiesToUse,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    ontologiesToUseScroller.setBorder(new EmptyBorder(0, 0, 0, 0));
    ontologiesToUseScroller.setPreferredSize(new Dimension(100, 80));
    ontologiesToUseScroller.setBackground(UIHelper.BG_COLOR);
    ontologiesToUseScroller.getViewport().setBackground(UIHelper.BG_COLOR);

    IAppWidgetFactory.makeIAppScrollPane(ontologiesToUseScroller);

    sourceEntryPanel.add(ontologiesToUseScroller);

    JPanel buttonCont = new JPanel(new BorderLayout());
    final JLabel openConfigButton = new JLabel(ontologyConfigIcon);
    openConfigButton.setVerticalAlignment(SwingConstants.TOP);
    openConfigButton.setHorizontalAlignment(SwingConstants.RIGHT);

    MouseAdapter showOntologyConfigurator = new MouseAdapter() {

        public void mouseEntered(MouseEvent mouseEvent) {
            openConfigButton.setIcon(ontologyConfigIconOver);
        }

        public void mouseExited(MouseEvent mouseEvent) {
            openConfigButton.setIcon(ontologyConfigIcon);
        }

        public void mousePressed(MouseEvent mouseEvent) {

            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    if (openConfigButton.isEnabled()) {
                        openConfigButton.setIcon(ontologyConfigIcon);
                        ontologyConfig = new OntologyConfigUI(ontologiesToQuery, selectedOntologies);
                        ontologyConfig.addPropertyChangeListener("ontologySelected",
                                new PropertyChangeListener() {
                                    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
                                        selectedOntologies = (ListOrderedMap<String, RecommendedOntology>) propertyChangeEvent
                                                .getNewValue();
                                        updateTable();
                                    }
                                });
                        showPopupInCenter(ontologyConfig);
                    }
                }
            });
        }

    };

    openConfigButton.addMouseListener(showOntologyConfigurator);

    buttonCont.add(openConfigButton, BorderLayout.EAST);

    sourceEntryPanel.add(buttonCont, BorderLayout.SOUTH);
    preferredOntologySource.add(sourceEntryPanel);
    container.add(preferredOntologySource);

    String[] contents = new String[] { "true", "false" };
    defaultValBool = new

    JComboBox(contents);

    UIHelper.renderComponent(defaultValBool, UIHelper.VER_12_PLAIN, UIHelper.DARK_GREEN_COLOR,
            UIHelper.BG_COLOR);

    JLabel defaultValLabBool = UIHelper.createLabel(DEFAULT_VAL_STR, UIHelper.VER_12_BOLD,
            UIHelper.DARK_GREEN_COLOR);

    defaultValContBool.add(defaultValLabBool);
    defaultValContBool.add(defaultValBool);
    container.add(defaultValContBool);

    // RegExp data entry
    isInputFormatted = new JCheckBox("Is the input formatted?", false);
    isInputFormatted.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
    isInputFormatted.setHorizontalAlignment(SwingConstants.LEFT);

    UIHelper.renderComponent(isInputFormatted, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    isInputFormatted.addActionListener(this);
    container.add(UIHelper.wrapComponentInPanel(isInputFormatted));

    inputFormatCont = new JPanel();

    inputFormatCont.setLayout(new BoxLayout(inputFormatCont, BoxLayout.LINE_AXIS));
    inputFormatCont.setVisible(false);
    inputFormatCont.setBackground(UIHelper.BG_COLOR);
    inputFormat = new RoundedJTextField(10);
    inputFormat.setText(".*");
    inputFormat.setSize(new Dimension(150, 19));

    inputFormat.setPreferredSize(new Dimension(160, 25));
    inputFormat.setToolTipText("Field expects a regular expression describing the input format.");
    UIHelper.renderComponent(inputFormat, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, false);

    JLabel inputFormatLab = UIHelper.createLabel("Input format:", UIHelper.VER_11_BOLD,
            UIHelper.DARK_GREEN_COLOR);
    inputFormatLab.setVerticalAlignment(SwingConstants.TOP);

    inputFormatCont.add(inputFormatLab);
    inputFormatCont.add(inputFormat);
    JLabel checkRegExp = new JLabel(checkRegExIcon, JLabel.RIGHT);
    checkRegExp.setOpaque(false);
    checkRegExp.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent event) {
            String regexToCheck = inputFormat.getText();

            final CheckRegExGUI regexChecker = new CheckRegExGUI(regexToCheck);
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    regexChecker.createGUI();
                }
            });
            regexChecker.addPropertyChangeListener("close", new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent evt) {
                    main.getApplicationContainer().hideSheet();
                }
            });
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    main.getApplicationContainer().showJDialogAsSheet(regexChecker);
                }
            });
        }

    }

    );
    inputFormatCont.add(checkRegExp);
    container.add(inputFormatCont);

    usesTemplateForWizard = new JCheckBox("Requires template for wizard?", false);
    usesTemplateForWizard.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
    usesTemplateForWizard.setHorizontalAlignment(SwingConstants.LEFT);

    UIHelper.renderComponent(usesTemplateForWizard, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    usesTemplateForWizard.addActionListener(this);
    container.add(UIHelper.wrapComponentInPanel(usesTemplateForWizard));

    wizardTemplatePanel = new JPanel(new GridLayout(1, 2));
    wizardTemplatePanel.setVisible(false);
    wizardTemplatePanel.setBackground(UIHelper.BG_COLOR);

    wizardTemplate = new RoundedJTextArea();
    wizardTemplate.setToolTipText("A template for the wizard to auto-create the data...");
    wizardTemplate.setLineWrap(true);
    wizardTemplate.setWrapStyleWord(true);
    UIHelper.renderComponent(wizardTemplate, UIHelper.VER_11_PLAIN, UIHelper.DARK_GREEN_COLOR, false);

    JScrollPane wizScroll = new JScrollPane(wizardTemplate, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    wizScroll.getViewport().setBackground(UIHelper.BG_COLOR);
    wizScroll.setPreferredSize(new Dimension(70, 60));

    IAppWidgetFactory.makeIAppScrollPane(wizScroll);

    JLabel wizardTemplateLab = UIHelper.createLabel("Template definition:", UIHelper.VER_11_BOLD,
            UIHelper.DARK_GREEN_COLOR);
    wizardTemplateLab.setVerticalAlignment(JLabel.TOP);

    wizardTemplatePanel.add(wizardTemplateLab);
    wizardTemplatePanel.add(wizScroll);

    container.add(wizardTemplatePanel);

    JPanel checkCont = new JPanel(new GridLayout(3, 2));
    checkCont.setBackground(UIHelper.BG_COLOR);
    checkCont.setBorder(new TitledBorder(new RoundedBorder(UIHelper.DARK_GREEN_COLOR, 4),
            "Behavioural Attributes", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
            UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR));

    required = new JCheckBox("Required ", true);

    UIHelper.renderComponent(required, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    checkCont.add(required);

    acceptsMultipleValues = new JCheckBox("Allow multiple instances", false);

    UIHelper.renderComponent(acceptsMultipleValues, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    checkCont.add(acceptsMultipleValues);
    acceptsFileLocations = new JCheckBox("Accepts file locations", false);

    acceptsFileLocations.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            acceptsMultipleValues.setSelected(false);
            acceptsMultipleValues.setEnabled(!acceptsFileLocations.isSelected());
        }
    });

    UIHelper.renderComponent(acceptsFileLocations, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    checkCont.add(acceptsFileLocations);

    hidden = new JCheckBox("hidden?", false);

    UIHelper.renderComponent(hidden, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);
    checkCont.add(hidden);

    forceOntologySelection = new JCheckBox("Force ontology selection", false);
    UIHelper.renderComponent(forceOntologySelection, UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR, false);

    checkCont.add(forceOntologySelection);

    container.add(checkCont);

    JScrollPane contScroll = new JScrollPane(container, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    contScroll.setBorder(null);
    contScroll.setAutoscrolls(true);

    IAppWidgetFactory.makeIAppScrollPane(contScroll);

    add(contScroll, BorderLayout.NORTH);
}

From source file:org.isatools.isacreatorconfigurator.ontologyconfigurationtool.OntologyConfigUI.java

public void createGUI() {
    HUDTitleBar titlePanel = new HUDTitleBar(null, null, true);
    add(titlePanel, BorderLayout.NORTH);
    titlePanel.installListeners();//from ww  w  . ja  v a2s  .com
    titlePanel.addPropertyChangeListener("windowClosed", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
            firePropertyChange("ontologyClosed", "", "closed");
        }
    });
    // create left panel with list of selected ontology terms and Expandable panel
    createOntologySelectionPanel();
    // create right panel containing tree showing the entirety of the ontology selected from the left pane.
    JPanel ontologySelectionPanel = new JPanel(new BorderLayout());

    ontologyViewContainer = new JPanel(new BorderLayout());
    ontologyViewContainer.setPreferredSize(new Dimension(500, 300));
    // add placeholder panel by default with some image describing what to do
    setOntologySelectionPanelPlaceholder(infoImage);
    ontologyViewContainer.setBorder(new TitledBorder(new RoundedBorder(UIHelper.LIGHT_GREEN_COLOR, 7),
            "browse ontology", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
            UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR));

    ontologySelectionPanel.add(ontologyViewContainer, BorderLayout.CENTER);
    ontologySelectionPanel.add(Box.createVerticalStrut(20), BorderLayout.SOUTH);
    add(ontologySelectionPanel, BorderLayout.CENTER);

    JPanel functionWrapper = new JPanel(new BorderLayout());

    searchAndTermDefinitionViewer = new SearchAndDefinitionUI();
    searchAndTermDefinitionViewer.setBorder(new TitledBorder(new RoundedBorder(UIHelper.LIGHT_GREEN_COLOR, 7),
            "functions", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
            UIHelper.VER_11_BOLD, UIHelper.DARK_GREEN_COLOR));

    functionWrapper.add(searchAndTermDefinitionViewer);
    functionWrapper.add(createButtonPanel(), BorderLayout.SOUTH);

    add(functionWrapper, BorderLayout.EAST);

    this.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent componentEvent) {
            if (currentlyActiveBrowser != null && currentlyActiveBrowser.isShowing()) {
                ontologyViewContainer.setPreferredSize(getMaxBrowserSize());
                currentlyActiveBrowser.setBrowserSize(getMaxBrowserSize());
                ontologyViewContainer.repaint();
                currentlyActiveBrowser.repaint();
            }
        }
    });

    FooterPanel footer = new FooterPanel(this);
    add(footer, BorderLayout.SOUTH);

    pack();
    setVisible(true);
}