Example usage for java.awt GridBagConstraints NORTHWEST

List of usage examples for java.awt GridBagConstraints NORTHWEST

Introduction

In this page you can find the example usage for java.awt GridBagConstraints NORTHWEST.

Prototype

int NORTHWEST

To view the source code for java.awt GridBagConstraints NORTHWEST.

Click Source Link

Document

Put the component at the top-left corner of its display area.

Usage

From source file:ca.uhn.hl7v2.testpanel.ui.conn.Hl7ConnectionPanelBackup.java

/**
 * Create the panel.// w  w  w. ja  va2  s  .  c o m
 */
public Hl7ConnectionPanelBackup(Controller theController) {
    myController = theController;

    setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.columnWidths = new int[] { 150, 0 };
    gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
    gridBagLayout.columnWeights = new double[] { 0.0, 1.0 };
    gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE };
    setLayout(gridBagLayout);

    mySinglePortRadio = new JRadioButton("Single Port MLLP");
    mySinglePortRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updatePortsModel();
            updatePortsUi();
        }
    });
    myPortButtonGroup.add(mySinglePortRadio);
    GridBagConstraints gbc_SinglePortRadio = new GridBagConstraints();
    gbc_SinglePortRadio.anchor = GridBagConstraints.WEST;
    gbc_SinglePortRadio.insets = new Insets(0, 0, 5, 5);
    gbc_SinglePortRadio.gridx = 0;
    gbc_SinglePortRadio.gridy = 0;
    add(mySinglePortRadio, gbc_SinglePortRadio);

    JPanel panel_4 = new JPanel();
    panel_4.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel_4 = new GridBagConstraints();
    gbc_panel_4.fill = GridBagConstraints.BOTH;
    gbc_panel_4.insets = new Insets(0, 0, 5, 0);
    gbc_panel_4.gridx = 1;
    gbc_panel_4.gridy = 0;
    add(panel_4, gbc_panel_4);
    GridBagLayout gbl_panel_4 = new GridBagLayout();
    gbl_panel_4.columnWidths = new int[] { 0, 0, 0 };
    gbl_panel_4.rowHeights = new int[] { 0, 0 };
    gbl_panel_4.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_panel_4.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel_4.setLayout(gbl_panel_4);

    mySinglePortTextBox = new JTextField();
    mySinglePortTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = mySinglePortTextBox.getText();
            text = text.replaceAll("[^0-9]+", "");
            if (!StringUtils.equals(mySinglePortTextBox.getText(), text)) {
                final String newVal = text;
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        mySinglePortTextBox.setText(newVal);
                    }
                });
            }
            if (mySinglePortRadio.isSelected()) {
                if (text.length() > 0) {
                    myConnection.setIncomingOrSinglePort(Integer.parseInt(text));
                } else {
                    myConnection.setIncomingOrSinglePort(-1);
                }
            }
        }
    });

    mylabel = new JLabel("Port");
    mylabel.setHorizontalAlignment(SwingConstants.CENTER);
    mylabel.setPreferredSize(new Dimension(60, 16));
    mylabel.setMinimumSize(new Dimension(60, 16));
    mylabel.setMaximumSize(new Dimension(60, 16));
    GridBagConstraints gbc_label = new GridBagConstraints();
    gbc_label.anchor = GridBagConstraints.EAST;
    gbc_label.insets = new Insets(0, 0, 0, 5);
    gbc_label.gridx = 0;
    gbc_label.gridy = 0;
    panel_4.add(mylabel, gbc_label);
    GridBagConstraints gbc_SinglePortTextBox = new GridBagConstraints();
    gbc_SinglePortTextBox.insets = new Insets(0, 5, 0, 0);
    gbc_SinglePortTextBox.anchor = GridBagConstraints.WEST;
    gbc_SinglePortTextBox.gridx = 1;
    gbc_SinglePortTextBox.gridy = 0;
    panel_4.add(mySinglePortTextBox, gbc_SinglePortTextBox);
    mySinglePortTextBox.setMinimumSize(new Dimension(100, 28));
    mySinglePortTextBox.setMaximumSize(new Dimension(100, 2147483647));
    mySinglePortTextBox.setColumns(10);

    myDualPortRadio = new JRadioButton("Dual Port MLLP");
    myDualPortRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updatePortsModel();
            updatePortsUi();
        }
    });
    myPortButtonGroup.add(myDualPortRadio);
    GridBagConstraints gbc_DualPortRadio = new GridBagConstraints();
    gbc_DualPortRadio.anchor = GridBagConstraints.WEST;
    gbc_DualPortRadio.insets = new Insets(0, 0, 5, 5);
    gbc_DualPortRadio.gridx = 0;
    gbc_DualPortRadio.gridy = 1;
    add(myDualPortRadio, gbc_DualPortRadio);

    JPanel panel = new JPanel();
    panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_BottomPanel = new GridBagConstraints();
    gbc_BottomPanel.insets = new Insets(0, 0, 5, 0);
    gbc_BottomPanel.fill = GridBagConstraints.BOTH;
    gbc_BottomPanel.gridx = 1;
    gbc_BottomPanel.gridy = 1;
    add(panel, gbc_BottomPanel);
    GridBagLayout gbl_panel = new GridBagLayout();
    gbl_panel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0 };
    gbl_panel.rowHeights = new int[] { 0, 0 };
    gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
    gbl_panel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel.setLayout(gbl_panel);

    JLabel lblInbound = new JLabel("Inbound");
    lblInbound.setHorizontalAlignment(SwingConstants.CENTER);
    lblInbound.setPreferredSize(new Dimension(60, 16));
    lblInbound.setMinimumSize(new Dimension(60, 16));
    lblInbound.setMaximumSize(new Dimension(60, 16));
    GridBagConstraints gbc_lblInbound = new GridBagConstraints();
    gbc_lblInbound.insets = new Insets(0, 5, 0, 5);
    gbc_lblInbound.anchor = GridBagConstraints.EAST;
    gbc_lblInbound.gridx = 0;
    gbc_lblInbound.gridy = 0;
    panel.add(lblInbound, gbc_lblInbound);

    myDualIncomingTextBox = new JTextField();
    myDualIncomingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = myDualIncomingTextBox.getText();
            text = text.replaceAll("[^0-9]+", "");
            if (!StringUtils.equals(myDualIncomingTextBox.getText(), text)) {
                final String newVal = text;
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        myDualIncomingTextBox.setText(newVal);
                    }
                });
            }
            if (myDualPortRadio.isSelected()) {
                if (text.length() > 0) {
                    myConnection.setIncomingOrSinglePort(Integer.parseInt(text));
                } else {
                    myConnection.setIncomingOrSinglePort(-1);
                }
            }
        }
    });
    myDualIncomingTextBox.setMaximumSize(new Dimension(100, 2147483647));
    myDualIncomingTextBox.setMinimumSize(new Dimension(100, 28));
    GridBagConstraints gbc_DualIncomingTextBox = new GridBagConstraints();
    gbc_DualIncomingTextBox.anchor = GridBagConstraints.WEST;
    gbc_DualIncomingTextBox.insets = new Insets(0, 0, 0, 5);
    gbc_DualIncomingTextBox.gridx = 1;
    gbc_DualIncomingTextBox.gridy = 0;
    panel.add(myDualIncomingTextBox, gbc_DualIncomingTextBox);
    myDualIncomingTextBox.setColumns(10);

    JLabel lblOutbound = new JLabel("Outbound");
    GridBagConstraints gbc_lblOutbound = new GridBagConstraints();
    gbc_lblOutbound.anchor = GridBagConstraints.EAST;
    gbc_lblOutbound.insets = new Insets(0, 0, 0, 5);
    gbc_lblOutbound.gridx = 2;
    gbc_lblOutbound.gridy = 0;
    panel.add(lblOutbound, gbc_lblOutbound);

    myDualOutgoingTextBox = new JTextField();
    myDualOutgoingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = myDualOutgoingTextBox.getText();
            text = text.replaceAll("[^0-9]+", "");
            if (!StringUtils.equals(myDualOutgoingTextBox.getText(), text)) {
                final String newVal = text;
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        myDualOutgoingTextBox.setText(newVal);
                    }
                });
            }
            if (myDualPortRadio.isSelected()) {
                if (text.length() > 0) {
                    myConnection.setOutgoingPort(Integer.parseInt(text));
                } else {
                    myConnection.setOutgoingPort(-1);
                }
            }
        }
    });
    myDualOutgoingTextBox.setMinimumSize(new Dimension(100, 28));
    myDualOutgoingTextBox.setMaximumSize(new Dimension(100, 2147483647));
    GridBagConstraints gbc_DualOutgoingTextBox = new GridBagConstraints();
    gbc_DualOutgoingTextBox.insets = new Insets(0, 0, 0, 5);
    gbc_DualOutgoingTextBox.anchor = GridBagConstraints.WEST;
    gbc_DualOutgoingTextBox.gridx = 3;
    gbc_DualOutgoingTextBox.gridy = 0;
    panel.add(myDualOutgoingTextBox, gbc_DualOutgoingTextBox);
    myDualOutgoingTextBox.setColumns(10);

    myHl7OverHttpRadioButton = new JRadioButton("HL7 over HTTP");
    myHl7OverHttpRadioButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updatePortsModel();
            updatePortsUi();
        }
    });
    myPortButtonGroup.add(myHl7OverHttpRadioButton);
    GridBagConstraints gbc_Hl7OverHttpRadioButton = new GridBagConstraints();
    gbc_Hl7OverHttpRadioButton.anchor = GridBagConstraints.WEST;
    gbc_Hl7OverHttpRadioButton.insets = new Insets(0, 0, 5, 5);
    gbc_Hl7OverHttpRadioButton.gridx = 0;
    gbc_Hl7OverHttpRadioButton.gridy = 2;
    add(myHl7OverHttpRadioButton, gbc_Hl7OverHttpRadioButton);

    mypanel = new JPanel();
    mypanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel = new GridBagConstraints();
    gbc_panel.insets = new Insets(0, 0, 5, 0);
    gbc_panel.fill = GridBagConstraints.BOTH;
    gbc_panel.gridx = 1;
    gbc_panel.gridy = 2;
    add(mypanel, gbc_panel);
    GridBagLayout gbl_panel2 = new GridBagLayout();
    gbl_panel2.columnWidths = new int[] { 0, 0 };
    gbl_panel2.rowHeights = new int[] { 0, 0 };
    gbl_panel2.columnWeights = new double[] { 0.0, 1.0 };
    gbl_panel2.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    mypanel.setLayout(gbl_panel2);

    mylabel_1 = new JLabel("URL");
    mylabel_1.setHorizontalAlignment(SwingConstants.CENTER);
    mylabel_1.setPreferredSize(new Dimension(60, 16));
    mylabel_1.setMinimumSize(new Dimension(60, 16));
    mylabel_1.setMaximumSize(new Dimension(60, 16));
    GridBagConstraints gbc_label_1 = new GridBagConstraints();
    gbc_label_1.anchor = GridBagConstraints.EAST;
    gbc_label_1.insets = new Insets(0, 0, 0, 5);
    gbc_label_1.gridx = 0;
    gbc_label_1.gridy = 0;
    mypanel.add(mylabel_1, gbc_label_1);

    myHoHUrlTextField = new JTextField();
    myHoHUrlTextField.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            if (myHohUrlTextFieldUpdating) {
                return;
            }

            String value = myHoHUrlTextField.getText();
            try {
                URL url = new URL(value);
                boolean tls;
                if (url.getProtocol().equals("http")) {
                    tls = false;
                } else if (url.getProtocol().equals("https")) {
                    tls = true;
                } else {
                    ourLog.info("Unknown protocol: {}", url.getProtocol());
                    myHoHUrlTextField.setBackground(ERROR_BG);
                    return;
                }

                myConnection.setTls(tls);
                myConnection.setHost(url.getHost());
                myConnection
                        .setIncomingOrSinglePort(url.getPort() != -1 ? url.getPort() : url.getDefaultPort());
                myConnection.setHttpUriPath(url.getPath());

                myHohUrlTextFieldUpdating = true;
                updatePortsUi();
                myHohUrlTextFieldUpdating = false;

                myTlsCheckbox.setSelected(tls);
                myHohTlsCheckbox.setSelected(tls);

                myHoHUrlTextField.setBackground(Color.white);
            } catch (MalformedURLException e) {
                myHoHUrlTextField.setBackground(ERROR_BG);
            }

        }
    });
    GridBagConstraints gbc_HohUsernameTextbox = new GridBagConstraints();
    gbc_HohUsernameTextbox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohUsernameTextbox.gridx = 1;
    gbc_HohUsernameTextbox.gridy = 0;
    mypanel.add(myHoHUrlTextField, gbc_HohUsernameTextbox);
    myHoHUrlTextField.setColumns(10);

    JLabel lblEncoding = new JLabel("Encoding");
    GridBagConstraints gbc_lblEncoding = new GridBagConstraints();
    gbc_lblEncoding.insets = new Insets(0, 0, 5, 5);
    gbc_lblEncoding.gridx = 0;
    gbc_lblEncoding.gridy = 3;
    add(lblEncoding, gbc_lblEncoding);

    JPanel encodingPanel = new JPanel();
    GridBagConstraints gbc_encodingPanel = new GridBagConstraints();
    gbc_encodingPanel.fill = GridBagConstraints.HORIZONTAL;
    gbc_encodingPanel.insets = new Insets(0, 0, 5, 0);
    gbc_encodingPanel.gridx = 1;
    gbc_encodingPanel.gridy = 3;
    add(encodingPanel, gbc_encodingPanel);
    encodingPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gbl_encodingPanel = new GridBagLayout();
    gbl_encodingPanel.columnWidths = new int[] { 144, 58, 0 };
    gbl_encodingPanel.rowHeights = new int[] { 23, 0 };
    gbl_encodingPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    gbl_encodingPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    encodingPanel.setLayout(gbl_encodingPanel);

    myXmlRadio = new JRadioButton("XML");
    myXmlRadio.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent theE) {
            updateEncodingModel();
        }
    });

    myEr7Radio = new JRadioButton("ER7 (Pipe and hat)");
    myEr7Radio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateEncodingModel();
        }
    });
    encodingButtonGroup.add(myEr7Radio);
    GridBagConstraints gbc_Er7Radio = new GridBagConstraints();
    gbc_Er7Radio.anchor = GridBagConstraints.NORTHWEST;
    gbc_Er7Radio.insets = new Insets(0, 0, 0, 5);
    gbc_Er7Radio.gridx = 0;
    gbc_Er7Radio.gridy = 0;
    encodingPanel.add(myEr7Radio, gbc_Er7Radio);
    encodingButtonGroup.add(myXmlRadio);
    GridBagConstraints gbc_XmlRadio = new GridBagConstraints();
    gbc_XmlRadio.anchor = GridBagConstraints.NORTHWEST;
    gbc_XmlRadio.gridx = 1;
    gbc_XmlRadio.gridy = 0;
    encodingPanel.add(myXmlRadio, gbc_XmlRadio);

    JLabel lblCharset = new JLabel("Charset");
    GridBagConstraints gbc_lblCharset = new GridBagConstraints();
    gbc_lblCharset.insets = new Insets(0, 0, 5, 5);
    gbc_lblCharset.gridx = 0;
    gbc_lblCharset.gridy = 4;
    add(lblCharset, gbc_lblCharset);

    JPanel panel_2 = new JPanel();
    GridBagConstraints gbc_panel_2 = new GridBagConstraints();
    gbc_panel_2.fill = GridBagConstraints.HORIZONTAL;
    gbc_panel_2.insets = new Insets(0, 0, 5, 0);
    gbc_panel_2.gridx = 1;
    gbc_panel_2.gridy = 4;
    add(panel_2, gbc_panel_2);
    panel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gbl_panel_2 = new GridBagLayout();
    gbl_panel_2.columnWidths = new int[] { 28, 198, 0, 0 };
    gbl_panel_2.rowHeights = new int[] { 27, 0 };
    gbl_panel_2.columnWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    gbl_panel_2.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel_2.setLayout(gbl_panel_2);

    myCharsetSelectRadio = new JRadioButton("");
    myCharsetSelectRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCharsetModel();
        }
    });
    charsetButtonGroup.add(myCharsetSelectRadio);
    GridBagConstraints gbc_CharsetSelectRadio = new GridBagConstraints();
    gbc_CharsetSelectRadio.anchor = GridBagConstraints.WEST;
    gbc_CharsetSelectRadio.insets = new Insets(0, 0, 0, 5);
    gbc_CharsetSelectRadio.gridx = 0;
    gbc_CharsetSelectRadio.gridy = 0;
    panel_2.add(myCharsetSelectRadio, gbc_CharsetSelectRadio);

    myCharsetCombo = new JComboBox();
    myCharsetCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCharsetModel();
        }
    });
    GridBagConstraints gbc_CharsetCombo = new GridBagConstraints();
    gbc_CharsetCombo.anchor = GridBagConstraints.NORTHWEST;
    gbc_CharsetCombo.insets = new Insets(0, 0, 0, 5);
    gbc_CharsetCombo.gridx = 1;
    gbc_CharsetCombo.gridy = 0;
    panel_2.add(myCharsetCombo, gbc_CharsetCombo);

    myCharsetDetectRadio = new JRadioButton("Detect in Message (MSH-18)");
    myCharsetDetectRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCharsetModel();
        }
    });
    charsetButtonGroup.add(myCharsetDetectRadio);
    GridBagConstraints gbc_CharsetDetectRadio = new GridBagConstraints();
    gbc_CharsetDetectRadio.anchor = GridBagConstraints.NORTH;
    gbc_CharsetDetectRadio.gridwidth = 2;
    gbc_CharsetDetectRadio.gridx = 2;
    gbc_CharsetDetectRadio.gridy = 0;
    panel_2.add(myCharsetDetectRadio, gbc_CharsetDetectRadio);

    mylabel_5 = new JLabel("Debug");
    GridBagConstraints gbc_label_5 = new GridBagConstraints();
    gbc_label_5.insets = new Insets(0, 0, 5, 5);
    gbc_label_5.gridx = 0;
    gbc_label_5.gridy = 5;
    add(mylabel_5, gbc_label_5);

    mypanel_2 = new JPanel();
    mypanel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel_75 = new GridBagConstraints();
    gbc_panel_75.insets = new Insets(0, 0, 5, 0);
    gbc_panel_75.fill = GridBagConstraints.BOTH;
    gbc_panel_75.gridx = 1;
    gbc_panel_75.gridy = 5;
    add(mypanel_2, gbc_panel_75);
    GridBagLayout gbl_panel_74 = new GridBagLayout();
    gbl_panel_74.columnWidths = new int[] { 0, 0 };
    gbl_panel_74.rowHeights = new int[] { 0, 0 };
    gbl_panel_74.columnWeights = new double[] { 0.0, Double.MIN_VALUE };
    gbl_panel_74.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    mypanel_2.setLayout(gbl_panel_74);

    myCaptureByteStreamCheckbox = new JCheckBox("Capture Bytes");
    GridBagConstraints gbc_CaptureByteStreamCheckbox = new GridBagConstraints();
    gbc_CaptureByteStreamCheckbox.gridx = 0;
    gbc_CaptureByteStreamCheckbox.gridy = 0;
    mypanel_2.add(myCaptureByteStreamCheckbox, gbc_CaptureByteStreamCheckbox);
    myCaptureByteStreamCheckbox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myConnection.setCaptureBytes(myCaptureByteStreamCheckbox.isSelected());
        }
    });
    myCaptureByteStreamCheckbox.setToolTipText("Check this box to capture the transport level communication");

    myInterfaceTypeCardPanel = new JPanel();
    myInterfaceTypeCardPanel.setBorder(null);
    GridBagConstraints gbc_InterfaceTypeCardPanel = new GridBagConstraints();
    gbc_InterfaceTypeCardPanel.gridwidth = 2;
    gbc_InterfaceTypeCardPanel.fill = GridBagConstraints.BOTH;
    gbc_InterfaceTypeCardPanel.gridx = 0;
    gbc_InterfaceTypeCardPanel.gridy = 6;
    add(myInterfaceTypeCardPanel, gbc_InterfaceTypeCardPanel);
    myInterfaceTypeCardPanel.setLayout(new CardLayout(0, 0));

    myMllpCard = new JPanel();
    myMllpCard.setBorder(null);
    myInterfaceTypeCardPanel.add(myMllpCard, IFACE_TYPE_CARD_MLLP);
    GridBagLayout gbl_MllpCard = new GridBagLayout();
    gbl_MllpCard.columnWidths = new int[] { 150, 0, 0 };
    gbl_MllpCard.rowHeights = new int[] { 0, 0, 0, 0 };
    gbl_MllpCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_MllpCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    myMllpCard.setLayout(gbl_MllpCard);

    JLabel lblHost = new JLabel("Host");
    GridBagConstraints gbc_lblHost = new GridBagConstraints();
    gbc_lblHost.insets = new Insets(0, 0, 5, 5);
    gbc_lblHost.gridx = 0;
    gbc_lblHost.gridy = 0;
    myMllpCard.add(lblHost, gbc_lblHost);

    mypanel_1 = new JPanel();
    mypanel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel_1 = new GridBagConstraints();
    gbc_panel_1.insets = new Insets(0, 0, 5, 0);
    gbc_panel_1.fill = GridBagConstraints.BOTH;
    gbc_panel_1.gridx = 1;
    gbc_panel_1.gridy = 0;
    myMllpCard.add(mypanel_1, gbc_panel_1);
    GridBagLayout gbl_panel_1 = new GridBagLayout();
    gbl_panel_1.columnWidths = new int[] { 134, 0 };
    gbl_panel_1.rowHeights = new int[] { 28, 0 };
    gbl_panel_1.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gbl_panel_1.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    mypanel_1.setLayout(gbl_panel_1);

    myHostBox = new JTextField();
    GridBagConstraints gbc_HostBox = new GridBagConstraints();
    gbc_HostBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HostBox.anchor = GridBagConstraints.NORTH;
    gbc_HostBox.gridx = 0;
    gbc_HostBox.gridy = 0;
    mypanel_1.add(myHostBox, gbc_HostBox);
    myHostBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHost(myHostBox.getText());
        }
    });
    myHostBox.setColumns(10);

    JLabel lblTransport = new JLabel("Transport");
    GridBagConstraints gbc_lblTransport = new GridBagConstraints();
    gbc_lblTransport.insets = new Insets(0, 0, 5, 5);
    gbc_lblTransport.gridx = 0;
    gbc_lblTransport.gridy = 1;
    myMllpCard.add(lblTransport, gbc_lblTransport);

    JPanel panel_3 = new JPanel();
    GridBagConstraints gbc_hohAuthPanel = new GridBagConstraints();
    gbc_hohAuthPanel.fill = GridBagConstraints.HORIZONTAL;
    gbc_hohAuthPanel.insets = new Insets(0, 0, 5, 0);
    gbc_hohAuthPanel.gridx = 1;
    gbc_hohAuthPanel.gridy = 1;
    myMllpCard.add(panel_3, gbc_hohAuthPanel);
    panel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gbl_hohAuthPanel = new GridBagLayout();
    gbl_hohAuthPanel.columnWidths = new int[] { 0, 0, 0 };
    gbl_hohAuthPanel.rowHeights = new int[] { 0, 0 };
    gbl_hohAuthPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    gbl_hohAuthPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel_3.setLayout(gbl_hohAuthPanel);

    myTlsCheckbox = new JCheckBox("Use TLS/SSL");
    myTlsCheckbox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myHohTlsCheckbox.setSelected(myTlsCheckbox.isSelected());
            myConnection.setTls(myTlsCheckbox.isSelected());
        }
    });
    GridBagConstraints gbc_TlsCheckbox = new GridBagConstraints();
    gbc_TlsCheckbox.insets = new Insets(0, 0, 0, 5);
    gbc_TlsCheckbox.anchor = GridBagConstraints.WEST;
    gbc_TlsCheckbox.gridx = 0;
    gbc_TlsCheckbox.gridy = 0;
    panel_3.add(myTlsCheckbox, gbc_TlsCheckbox);

    myHoHCard = new JPanel();
    myInterfaceTypeCardPanel.add(myHoHCard, IFACE_TYPE_CARD_HOH);
    GridBagLayout gbl_HoHCard = new GridBagLayout();
    gbl_HoHCard.columnWidths = new int[] { 150, 0, 0 };
    gbl_HoHCard.rowHeights = new int[] { 0, 0, 0, 0 };
    gbl_HoHCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_HoHCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    myHoHCard.setLayout(gbl_HoHCard);

    mylabel_6 = new JLabel("Authorization");
    GridBagConstraints gbc_label_6 = new GridBagConstraints();
    gbc_label_6.insets = new Insets(0, 0, 5, 5);
    gbc_label_6.gridx = 0;
    gbc_label_6.gridy = 0;
    myHoHCard.add(mylabel_6, gbc_label_6);

    hohAuthPanel = new JPanel();
    hohAuthPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_hohAuthPanel2 = new GridBagConstraints();
    gbc_hohAuthPanel2.insets = new Insets(0, 0, 5, 0);
    gbc_hohAuthPanel2.fill = GridBagConstraints.BOTH;
    gbc_hohAuthPanel2.gridx = 1;
    gbc_hohAuthPanel2.gridy = 0;
    myHoHCard.add(hohAuthPanel, gbc_hohAuthPanel2);
    GridBagLayout gbl_hohAuthPanel3 = new GridBagLayout();
    gbl_hohAuthPanel3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0 };
    gbl_hohAuthPanel3.rowHeights = new int[] { 0, 0 };
    gbl_hohAuthPanel3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE };
    gbl_hohAuthPanel3.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    hohAuthPanel.setLayout(gbl_hohAuthPanel3);

    myHohAuthEnabledCheckbox = new JCheckBox("Enabled");
    myHohAuthEnabledCheckbox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent theE) {
            myConnection.setHohAuthenticationEnabled(myHohAuthEnabledCheckbox.isSelected());
        }
    });
    GridBagConstraints gbc_HohAuthEnabledCheckbox = new GridBagConstraints();
    gbc_HohAuthEnabledCheckbox.insets = new Insets(0, 0, 0, 5);
    gbc_HohAuthEnabledCheckbox.gridx = 0;
    gbc_HohAuthEnabledCheckbox.gridy = 0;
    hohAuthPanel.add(myHohAuthEnabledCheckbox, gbc_HohAuthEnabledCheckbox);

    mylabel_7 = new JLabel("Username:");
    GridBagConstraints gbc_label_7 = new GridBagConstraints();
    gbc_label_7.insets = new Insets(0, 0, 0, 5);
    gbc_label_7.anchor = GridBagConstraints.EAST;
    gbc_label_7.gridx = 1;
    gbc_label_7.gridy = 0;
    hohAuthPanel.add(mylabel_7, gbc_label_7);

    myHohAuthUsernameTextbox = new JTextField();
    myHohAuthUsernameTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHohAuthenticationUsername(myHohAuthUsernameTextbox.getText());
        }
    });
    myHohAuthUsernameTextbox.setMaximumSize(new Dimension(200, 2147483647));
    myHohAuthUsernameTextbox.setMinimumSize(new Dimension(100, 28));
    myHohAuthUsernameTextbox.setPreferredSize(new Dimension(100, 28));
    GridBagConstraints gbc_HohUsernameTextbox2 = new GridBagConstraints();
    gbc_HohUsernameTextbox2.insets = new Insets(0, 0, 0, 5);
    gbc_HohUsernameTextbox2.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohUsernameTextbox2.gridx = 2;
    gbc_HohUsernameTextbox2.gridy = 0;
    hohAuthPanel.add(myHohAuthUsernameTextbox, gbc_HohUsernameTextbox2);
    myHohAuthUsernameTextbox.setColumns(10);

    mylabel_8 = new JLabel("Password:");
    GridBagConstraints gbc_label_8 = new GridBagConstraints();
    gbc_label_8.insets = new Insets(0, 0, 0, 5);
    gbc_label_8.anchor = GridBagConstraints.EAST;
    gbc_label_8.gridx = 3;
    gbc_label_8.gridy = 0;
    hohAuthPanel.add(mylabel_8, gbc_label_8);

    myHohAuthPasswordTextbox = new JTextField();
    myHohAuthPasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHohAuthenticationPassword(myHohAuthPasswordTextbox.getText());
        }
    });
    myHohAuthPasswordTextbox.setPreferredSize(new Dimension(100, 28));
    myHohAuthPasswordTextbox.setMaximumSize(new Dimension(200, 2147483647));
    myHohAuthPasswordTextbox.setMinimumSize(new Dimension(100, 28));
    GridBagConstraints gbc_textField = new GridBagConstraints();
    gbc_textField.insets = new Insets(0, 0, 0, 5);
    gbc_textField.fill = GridBagConstraints.HORIZONTAL;
    gbc_textField.gridx = 4;
    gbc_textField.gridy = 0;
    hohAuthPanel.add(myHohAuthPasswordTextbox, gbc_textField);
    myHohAuthPasswordTextbox.setColumns(10);

    mylabel_2 = new JLabel("Security Profile");
    GridBagConstraints gbc_label_2 = new GridBagConstraints();
    gbc_label_2.insets = new Insets(0, 0, 5, 5);
    gbc_label_2.gridx = 0;
    gbc_label_2.gridy = 1;
    myHoHCard.add(mylabel_2, gbc_label_2);

    securityProfilePanel = new JPanel();
    GridBagConstraints gbc_securityProfilePanel = new GridBagConstraints();
    gbc_securityProfilePanel.insets = new Insets(0, 0, 5, 0);
    gbc_securityProfilePanel.fill = GridBagConstraints.BOTH;
    gbc_securityProfilePanel.gridx = 1;
    gbc_securityProfilePanel.gridy = 1;
    myHoHCard.add(securityProfilePanel, gbc_securityProfilePanel);
    securityProfilePanel.setLayout(new BorderLayout(0, 0));

    myHohTlsCheckbox = new JCheckBox("TLS Enabled");
    myHohTlsCheckbox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myConnection.setTls(myHohTlsCheckbox.isSelected());
            myTlsCheckbox.setSelected(myHohTlsCheckbox.isSelected());
            updatePortsUi();
        }
    });
    securityProfilePanel.add(myHohTlsCheckbox, BorderLayout.WEST);

    tlsKeystorePanel = new JPanel();
    tlsKeystorePanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    securityProfilePanel.add(tlsKeystorePanel, BorderLayout.CENTER);
    GridBagLayout gbl_tlsKeystorePanel = new GridBagLayout();
    gbl_tlsKeystorePanel.columnWidths = new int[] { 58, 107, 77, 0, 0 };
    gbl_tlsKeystorePanel.rowHeights = new int[] { 28, 16, 0 };
    gbl_tlsKeystorePanel.columnWeights = new double[] { 0.0, 1.0, 1.0, 0.0, Double.MIN_VALUE };
    gbl_tlsKeystorePanel.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    tlsKeystorePanel.setLayout(gbl_tlsKeystorePanel);

    mylabel_3 = new JLabel("Keystore:");
    GridBagConstraints gbc_label_3 = new GridBagConstraints();
    gbc_label_3.anchor = GridBagConstraints.WEST;
    gbc_label_3.fill = GridBagConstraints.VERTICAL;
    gbc_label_3.insets = new Insets(0, 0, 5, 5);
    gbc_label_3.gridx = 0;
    gbc_label_3.gridy = 0;
    tlsKeystorePanel.add(mylabel_3, gbc_label_3);

    myHohSecurityKeystoreTextbox = new JTextField();
    GridBagConstraints gbc_HohKeystoreTextbox = new GridBagConstraints();
    gbc_HohKeystoreTextbox.gridwidth = 2;
    gbc_HohKeystoreTextbox.anchor = GridBagConstraints.NORTH;
    gbc_HohKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohKeystoreTextbox.insets = new Insets(0, 0, 5, 5);
    gbc_HohKeystoreTextbox.gridx = 1;
    gbc_HohKeystoreTextbox.gridy = 0;
    tlsKeystorePanel.add(myHohSecurityKeystoreTextbox, gbc_HohKeystoreTextbox);
    myHohSecurityKeystoreTextbox.setColumns(10);
    myHohSecurityKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = myHohSecurityKeystoreTextbox.getText();
            myHohSecurityKeyPwTextBox.setEnabled(isNotBlank(text));
            myConnection.setTlsKeystoreLocation(text);
            scheduleHohSecurityKeystoreCheck();
        }
    });

    myHohSecurityKeystoreChooseBtn = new JButton("Choose");
    myHohSecurityKeystoreChooseBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String directory = Prefs.getInstance().getInterfaceHohSecurityKeystoreDirectory();
            directory = StringUtils.defaultString(directory, ".");
            JFileChooser chooser = new JFileChooser(directory);
            chooser.setDialogType(JFileChooser.OPEN_DIALOG);
            chooser.setDialogTitle("Select a Java Keystore");
            int result = chooser.showOpenDialog(Hl7ConnectionPanelBackup.this);
            if (result == JFileChooser.APPROVE_OPTION) {
                Prefs.getInstance()
                        .setInterfaceHohSecurityKeystoreDirectory(chooser.getSelectedFile().getParent());
                myHohSecurityKeystoreTextbox.setText(chooser.getSelectedFile().getAbsolutePath());
            }
        }
    });
    myHohSecurityKeystoreChooseBtn.setIcon(new ImageIcon(
            Hl7ConnectionPanelBackup.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png")));
    GridBagConstraints gbc_button = new GridBagConstraints();
    gbc_button.insets = new Insets(0, 0, 5, 0);
    gbc_button.gridx = 3;
    gbc_button.gridy = 0;
    tlsKeystorePanel.add(myHohSecurityKeystoreChooseBtn, gbc_button);

    mylabel_4 = new JLabel("Store Pass:");
    GridBagConstraints gbc_label_4 = new GridBagConstraints();
    gbc_label_4.insets = new Insets(0, 0, 0, 5);
    gbc_label_4.anchor = GridBagConstraints.EAST;
    gbc_label_4.gridx = 0;
    gbc_label_4.gridy = 1;
    tlsKeystorePanel.add(mylabel_4, gbc_label_4);

    myHohSecurityKeyPwTextBox = new JTextField();
    myHohSecurityKeyPwTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setTlsKeystorePassword(myHohSecurityKeyPwTextBox.getText());
            scheduleHohSecurityKeystoreCheck();
        }
    });
    GridBagConstraints gbc_HohSecurityKeyPwTextBox = new GridBagConstraints();
    gbc_HohSecurityKeyPwTextBox.insets = new Insets(0, 0, 0, 5);
    gbc_HohSecurityKeyPwTextBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSecurityKeyPwTextBox.gridx = 1;
    gbc_HohSecurityKeyPwTextBox.gridy = 1;
    tlsKeystorePanel.add(myHohSecurityKeyPwTextBox, gbc_HohSecurityKeyPwTextBox);
    myHohSecurityKeyPwTextBox.setColumns(10);

    myHohSecurityProfileKeystoreStatus = new JLabel("Value goes here");
    myHohSecurityProfileKeystoreStatus.setHorizontalAlignment(SwingConstants.LEFT);
    GridBagConstraints gbc_HohSecurityProfileKeystoreStatus = new GridBagConstraints();
    gbc_HohSecurityProfileKeystoreStatus.anchor = GridBagConstraints.NORTH;
    gbc_HohSecurityProfileKeystoreStatus.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSecurityProfileKeystoreStatus.gridwidth = 2;
    gbc_HohSecurityProfileKeystoreStatus.gridx = 2;
    gbc_HohSecurityProfileKeystoreStatus.gridy = 1;
    tlsKeystorePanel.add(myHohSecurityProfileKeystoreStatus, gbc_HohSecurityProfileKeystoreStatus);

    init();

}

From source file:Citas.FrameCita.java

private void dibujarPanelCita(Medico medico) {
    min = medico.getMinutosDeAtencionxPaciente();
    int horaInicio;
    int minInicio;
    int horaActual;
    int minActual;

    GridBagConstraints gbc = new GridBagConstraints();

    horaInicio = medico.getHoraInicio();
    horaActual = medico.getHoraInicio();
    minInicio = medico.getMinInicio();//from   w  ww.j  a  v a2s .  c  om
    minActual = medico.getMinInicio();
    gbc.gridx = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.BOTH;

    for (int i = 0; i < medico.getCitasPorDia(); i++) {
        minActual += medico.getMinutosDeAtencionxPaciente();
        if (minActual == 60) {
            horaActual += 1;
            minActual = 0;
        }
        gbc.gridy = i + 1;
        System.out.print(String.format("%02d", horaInicio));
        citas[i] = new Citas(
                ("" + String.format("%02d", horaInicio) + ":" + String.format("%02d", minInicio) + " - "
                        + String.format("%02d", horaActual) + ":" + String.format("%02d", minActual)),
                ("" + String.format("%02d", horaInicio) + ":" + String.format("%02d", minInicio) + ":"
                        + String.format("%02d", 0)));
        citas[i].setBorder(BorderFactory.createLineBorder(Color.black));
        citas[i].setOpaque(true);
        citas[i].addMouseListener(new MouseListener() {
            @Override
            public void mousePressed(MouseEvent e) {
            }

            @Override
            public void mouseReleased(MouseEvent e) {
            }

            @Override
            public void mouseEntered(MouseEvent e) {
            }

            @Override
            public void mouseExited(MouseEvent e) {
            }

            @Override
            public void mouseClicked(MouseEvent e) {
                fechaJ.setText(jCalendar1.getDate().toString());
                fechaJ.setEnabled(true);
                acciones(null);
            }
        });
        PanelCita.add(citas[i], gbc);
        System.out.print(i);
        horaInicio = horaActual;
        minInicio = minActual;
    }

}

From source file:ca.uhn.hl7v2.testpanel.ui.editor.Hl7V2MessageEditorPanel.java

/**
 * Create the panel.//  w w w . j a  v a 2 s  . c o m
 */
public Hl7V2MessageEditorPanel(final Controller theController) {
    setBorder(null);
    myController = theController;

    ButtonGroup encGrp = new ButtonGroup();
    setLayout(new BorderLayout(0, 0));

    mysplitPane = new JSplitPane();
    mysplitPane.setResizeWeight(0.5);
    mysplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    add(mysplitPane);

    mysplitPane.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent theEvt) {
            double ratio = (double) mysplitPane.getDividerLocation() / mysplitPane.getHeight();
            ourLog.debug("Resizing split to ratio: {}", ratio);
            Prefs.getInstance().setHl7EditorSplit(ratio);
        }
    });

    EventQueue.invokeLater(new Runnable() {
        public void run() {
            mysplitPane.setDividerLocation(Prefs.getInstance().getHl7EditorSplit());
        }
    });

    messageEditorContainerPanel = new JPanel();
    messageEditorContainerPanel.setBorder(null);
    mysplitPane.setRightComponent(messageEditorContainerPanel);
    messageEditorContainerPanel.setLayout(new BorderLayout(0, 0));

    myMessageEditor = new JEditorPane();
    Highlighter h = new UnderlineHighlighter();
    myMessageEditor.setHighlighter(h);
    // myMessageEditor.setFont(Prefs.getHl7EditorFont());
    myMessageEditor.setSelectedTextColor(Color.black);

    myMessageEditor.setCaret(new EditorCaret());

    myMessageScrollPane = new JScrollPane(myMessageEditor);
    messageEditorContainerPanel.add(myMessageScrollPane);

    JToolBar toolBar = new JToolBar();
    messageEditorContainerPanel.add(toolBar, BorderLayout.NORTH);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);

    myFollowToggle = new JToggleButton("Follow");
    myFollowToggle.setToolTipText("Keep the message tree (above) and the message editor (below) in sync");
    myFollowToggle.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            theController.setMessageEditorInFollowMode(myFollowToggle.isSelected());
        }
    });
    myFollowToggle.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/updown.png")));
    myFollowToggle.setSelected(theController.isMessageEditorInFollowMode());
    toolBar.add(myFollowToggle);

    myhorizontalStrut = Box.createHorizontalStrut(20);
    toolBar.add(myhorizontalStrut);

    mylabel_4 = new JLabel("Encoding");
    toolBar.add(mylabel_4);

    myRdbtnEr7 = new JRadioButton("ER7");
    myRdbtnEr7.setMargin(new Insets(1, 2, 0, 1));
    toolBar.add(myRdbtnEr7);

    myRdbtnXml = new JRadioButton("XML");
    myRdbtnXml.setMargin(new Insets(1, 5, 0, 1));
    toolBar.add(myRdbtnXml);
    encGrp.add(myRdbtnEr7);
    encGrp.add(myRdbtnXml);

    treeContainerPanel = new JPanel();
    mysplitPane.setLeftComponent(treeContainerPanel);
    treeContainerPanel.setLayout(new BorderLayout(0, 0));

    mySpinnerIconOn = new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/spinner.gif"));
    mySpinnerIconOff = new ImageIcon();

    myTreePanel = new Hl7V2MessageTree(theController);
    myTreePanel.setWorkingListener(new IWorkingListener() {

        public void startedWorking() {
            mySpinner.setText("");
            mySpinner.setIcon(mySpinnerIconOn);
            mySpinnerIconOn.setImageObserver(mySpinner);
        }

        public void finishedWorking(String theStatus) {
            mySpinner.setText(theStatus);

            mySpinner.setIcon(mySpinnerIconOff);
            mySpinnerIconOn.setImageObserver(null);
        }
    });
    myTreeScrollPane = new JScrollPane(myTreePanel);

    myTopTabBar = new JTabbedPane();
    treeContainerPanel.add(myTopTabBar);
    myTopTabBar.setBorder(null);

    JPanel treeContainer = new JPanel();
    treeContainer.setLayout(new BorderLayout(0, 0));
    treeContainer.add(myTreeScrollPane);

    myTopTabBar.add("Message Tree", treeContainer);

    mytoolBar_1 = new JToolBar();
    mytoolBar_1.setFloatable(false);
    treeContainer.add(mytoolBar_1, BorderLayout.NORTH);

    mylabel_3 = new JLabel("Show");
    mytoolBar_1.add(mylabel_3);

    myShowCombo = new JComboBox();
    mytoolBar_1.add(myShowCombo);
    myShowCombo.setPreferredSize(new Dimension(130, 27));
    myShowCombo.setMinimumSize(new Dimension(130, 27));
    myShowCombo.setMaximumSize(new Dimension(130, 32767));

    collapseAllButton = new JButton();
    collapseAllButton.setBorderPainted(false);
    collapseAllButton.addMouseListener(new HoverButtonMouseAdapter(collapseAllButton));
    collapseAllButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myTreePanel.collapseAll();
        }
    });
    collapseAllButton.setToolTipText("Collapse All");
    collapseAllButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/collapse_all.png")));
    mytoolBar_1.add(collapseAllButton);

    expandAllButton = new JButton();
    expandAllButton.setBorderPainted(false);
    expandAllButton.addMouseListener(new HoverButtonMouseAdapter(expandAllButton));
    expandAllButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myTreePanel.expandAll();
        }
    });
    expandAllButton.setToolTipText("Expand All");
    expandAllButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/expand_all.png")));
    mytoolBar_1.add(expandAllButton);

    myhorizontalGlue = Box.createHorizontalGlue();
    mytoolBar_1.add(myhorizontalGlue);

    mySpinner = new JButton("");
    mySpinner.setForeground(Color.DARK_GRAY);
    mySpinner.setHorizontalAlignment(SwingConstants.RIGHT);
    mySpinner.setMaximumSize(new Dimension(200, 15));
    mySpinner.setPreferredSize(new Dimension(200, 15));
    mySpinner.setMinimumSize(new Dimension(200, 15));
    mySpinner.setBorderPainted(false);
    mySpinner.setSize(new Dimension(16, 16));
    mytoolBar_1.add(mySpinner);
    myProfileComboboxModel = new ProfileComboModel();

    myTablesComboModel = new TablesComboModel(myController);

    mytoolBar = new JToolBar();
    mytoolBar.setFloatable(false);
    mytoolBar.setRollover(true);
    treeContainerPanel.add(mytoolBar, BorderLayout.NORTH);

    myOutboundInterfaceCombo = new JComboBox();
    myOutboundInterfaceComboModel = new DefaultComboBoxModel();

    mylabel_1 = new JLabel("Send");
    mytoolBar.add(mylabel_1);
    myOutboundInterfaceCombo.setModel(myOutboundInterfaceComboModel);
    myOutboundInterfaceCombo.setMaximumSize(new Dimension(200, 32767));
    mytoolBar.add(myOutboundInterfaceCombo);

    mySendButton = new JButton("Send");
    mySendButton.addMouseListener(new HoverButtonMouseAdapter(mySendButton));
    mySendButton.setBorderPainted(false);
    mySendButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            // int selectedIndex =
            // myOutboundInterfaceComboModel.getIndexOf(myOutboundInterfaceComboModel.getSelectedItem());
            int selectedIndex = myOutboundInterfaceCombo.getSelectedIndex();
            OutboundConnection connection = myController.getOutboundConnectionList().getConnections()
                    .get(selectedIndex);
            activateSendingActivityTabForConnection(connection);
            myController.sendMessages(connection, myMessage,
                    mySendingActivityTable.provideTransmissionCallback());
        }
    });

    myhorizontalStrut_2 = Box.createHorizontalStrut(20);
    myhorizontalStrut_2.setPreferredSize(new Dimension(2, 0));
    myhorizontalStrut_2.setMinimumSize(new Dimension(2, 0));
    myhorizontalStrut_2.setMaximumSize(new Dimension(2, 32767));
    mytoolBar.add(myhorizontalStrut_2);

    mySendOptionsButton = new JButton("Options");
    mySendOptionsButton.setBorderPainted(false);
    final HoverButtonMouseAdapter sendOptionsHoverAdaptor = new HoverButtonMouseAdapter(mySendOptionsButton);
    mySendOptionsButton.addMouseListener(sendOptionsHoverAdaptor);
    mySendOptionsButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/sendoptions.png")));
    mytoolBar.add(mySendOptionsButton);
    mySendOptionsButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent theE) {
            if (mySendOptionsPopupDialog != null) {
                mySendOptionsPopupDialog.doHide();
                mySendOptionsPopupDialog = null;
                return;
            }
            mySendOptionsPopupDialog = new SendOptionsPopupDialog(Hl7V2MessageEditorPanel.this, myMessage,
                    mySendOptionsButton, sendOptionsHoverAdaptor);
            Point los = mySendOptionsButton.getLocationOnScreen();
            mySendOptionsPopupDialog.setLocation(los.x, los.y + mySendOptionsButton.getHeight());
            mySendOptionsPopupDialog.setVisible(true);
        }
    });

    mySendButton.setIcon(new ImageIcon(
            Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/button_execute.png")));
    mytoolBar.add(mySendButton);

    myhorizontalStrut_1 = Box.createHorizontalStrut(20);
    mytoolBar.add(myhorizontalStrut_1);

    mylabel_2 = new JLabel("Validate");
    mytoolBar.add(mylabel_2);

    myProfileCombobox = new JComboBox();
    mytoolBar.add(myProfileCombobox);
    myProfileCombobox.setPreferredSize(new Dimension(200, 27));
    myProfileCombobox.setMinimumSize(new Dimension(200, 27));
    myProfileCombobox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            if (myHandlingProfileComboboxChange) {
                return;
            }

            myHandlingProfileComboboxChange = true;
            try {
                if (myProfileCombobox.getSelectedIndex() == 0) {
                    myMessage.setValidationContext(null);
                } else if (myProfileCombobox.getSelectedIndex() == 1) {
                    myMessage.setValidationContext(new DefaultValidation());
                } else if (myProfileCombobox.getSelectedIndex() > 0) {
                    ProfileGroup profile = myProfileComboboxModel.myProfileGroups
                            .get(myProfileCombobox.getSelectedIndex());
                    myMessage.setRuntimeProfile(profile);

                    // } else if (myProfileCombobox.getSelectedItem() ==
                    // ProfileComboModel.APPLY_CONFORMANCE_PROFILE) {
                    // IOkCancelCallback<Void> callback = new
                    // IOkCancelCallback<Void>() {
                    // public void ok(Void theArg) {
                    // myProfileComboboxModel.update();
                    // }
                    //
                    // public void cancel(Void theArg) {
                    // myProfileCombobox.setSelectedIndex(0);
                    // }
                    // };
                    // myController.chooseAndLoadConformanceProfileForMessage(myMessage,
                    // callback);
                }
            } catch (ProfileException e2) {
                ourLog.error("Failed to load profile", e2);
            } finally {
                myHandlingProfileComboboxChange = false;
            }
        }
    });
    myProfileCombobox.setMaximumSize(new Dimension(300, 32767));
    myProfileCombobox.setModel(myProfileComboboxModel);

    myhorizontalStrut_4 = Box.createHorizontalStrut(20);
    myhorizontalStrut_4.setPreferredSize(new Dimension(2, 0));
    myhorizontalStrut_4.setMinimumSize(new Dimension(2, 0));
    myhorizontalStrut_4.setMaximumSize(new Dimension(2, 32767));
    mytoolBar.add(myhorizontalStrut_4);

    // mySendingPanel = new JPanel();
    // mySendingPanel.setBorder(null);
    // myTopTabBar.addTab("Sending", null, mySendingPanel, null);
    // mySendingPanel.setLayout(new BorderLayout(0, 0));

    mySendingActivityTable = new ActivityTable();
    mySendingActivityTable.setController(myController);
    myTopTabBar.addTab("Sending", null, mySendingActivityTable, null);

    // mySendingPanelScrollPanel = new JScrollPane();
    // mySendingPanelScrollPanel.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    // mySendingPanelScrollPanel.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    // mySendingPanelScrollPanel.setColumnHeaderView(mySendingActivityTable);
    //
    // mySendingPanel.add(mySendingPanelScrollPanel, BorderLayout.CENTER);

    bottomPanel = new JPanel();
    bottomPanel.setPreferredSize(new Dimension(10, 20));
    bottomPanel.setMinimumSize(new Dimension(10, 20));
    add(bottomPanel, BorderLayout.SOUTH);
    GridBagLayout gbl_bottomPanel = new GridBagLayout();
    gbl_bottomPanel.columnWidths = new int[] { 98, 74, 0 };
    gbl_bottomPanel.rowHeights = new int[] { 16, 0 };
    gbl_bottomPanel.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_bottomPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    bottomPanel.setLayout(gbl_bottomPanel);

    mylabel = new JLabel("Terser Path:");
    mylabel.setHorizontalTextPosition(SwingConstants.LEFT);
    mylabel.setHorizontalAlignment(SwingConstants.LEFT);
    GridBagConstraints gbc_label = new GridBagConstraints();
    gbc_label.fill = GridBagConstraints.VERTICAL;
    gbc_label.weighty = 1.0;
    gbc_label.anchor = GridBagConstraints.NORTHWEST;
    gbc_label.gridx = 0;
    gbc_label.gridy = 0;
    bottomPanel.add(mylabel, gbc_label);

    myTerserPathTextField = new JLabel();
    myTerserPathTextField.setForeground(Color.BLUE);
    myTerserPathTextField.setFont(new Font("Lucida Console", Font.PLAIN, 13));
    myTerserPathTextField.setBorder(null);
    myTerserPathTextField.setBackground(SystemColor.control);
    myTerserPathTextField.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            if (StringUtils.isNotEmpty(myTerserPathTextField.getText())) {
                myTerserPathPopupMenu.show(myTerserPathTextField, 0, 0);
            }
        }
    });

    GridBagConstraints gbc_TerserPathTextField = new GridBagConstraints();
    gbc_TerserPathTextField.weightx = 1.0;
    gbc_TerserPathTextField.fill = GridBagConstraints.HORIZONTAL;
    gbc_TerserPathTextField.gridx = 1;
    gbc_TerserPathTextField.gridy = 0;
    bottomPanel.add(myTerserPathTextField, gbc_TerserPathTextField);

    initLocal();

}

From source file:org.openconcerto.erp.core.sales.invoice.component.SaisieVenteFactureSQLComponent.java

public void addViews() {
    this.setLayout(new GridBagLayout());
    final GridBagConstraints c = new DefaultGridBagConstraints();

    this.checkPrevisionnelle = new JCheckBox();
    this.checkComplement = new JCheckBox();
    this.fieldTTC = new DeviseField();

    final ComptaPropsConfiguration comptaPropsConfiguration = ((ComptaPropsConfiguration) Configuration
            .getInstance());/*from   w  w  w . ja va 2s .  c om*/

    this.textAvoirTTC = new DeviseField();

    // Champ Module
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = GridBagConstraints.REMAINDER;
    final JPanel addP = ComptaSQLConfElement.createAdditionalPanel();
    this.setAdditionalFieldsPanel(new FormLayouter(addP, 1));
    this.add(addP, c);

    c.gridy++;
    c.gridwidth = 1;

    if (getTable().contains("ID_POLE_PRODUIT")) {
        JLabel labelPole = new JLabel(getLabelFor("ID_POLE_PRODUIT"));
        labelPole.setHorizontalAlignment(SwingConstants.RIGHT);
        this.add(labelPole, c);
        c.gridx++;
        ElementComboBox pole = new ElementComboBox();

        this.add(pole, c);
        this.addSQLObject(pole, "ID_POLE_PRODUIT");
        c.gridy++;
        c.gridwidth = 1;
        c.gridx = 0;
    }

    /*******************************************************************************************
     * * RENSEIGNEMENTS
     ******************************************************************************************/
    // Ligne 1 : Numero de facture
    JLabel labelNum = new JLabel(getLabelFor("NUMERO"));
    labelNum.setHorizontalAlignment(SwingConstants.RIGHT);
    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    this.add(labelNum, c);

    this.textNumeroUnique = new JUniqueTextField(16);
    c.gridx++;
    c.weightx = 0;
    c.fill = GridBagConstraints.NONE;
    DefaultGridBagConstraints.lockMinimumSize(this.textNumeroUnique);
    this.add(textNumeroUnique, c);

    // Date
    c.gridx++;
    c.weightx = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    this.add(new JLabel(getLabelFor("DATE"), SwingConstants.RIGHT), c);

    c.gridx++;
    c.weightx = 1;
    c.fill = GridBagConstraints.NONE;
    final JDate dateSaisie = new JDate(true);

    // listener permettant la mise  jour du numro de facture en fonction de la date
    // slectionne
    dateSaisie.addValueListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (!isFilling() && dateSaisie.getValue() != null) {

                final String nextNumero = NumerotationAutoSQLElement
                        .getNextNumero(SaisieVenteFactureSQLElement.class, dateSaisie.getValue());

                if (textNumeroUnique.getText().trim().length() > 0
                        && !nextNumero.equalsIgnoreCase(textNumeroUnique.getText())) {

                    int answer = JOptionPane.showConfirmDialog(SaisieVenteFactureSQLComponent.this,
                            "Voulez vous actualiser le numro de la facture?",
                            "Changement du numro de facture", JOptionPane.YES_NO_OPTION);
                    if (answer == JOptionPane.NO_OPTION) {
                        return;
                    }
                }

                textNumeroUnique.setText(nextNumero);

            }

        }
    });
    this.add(dateSaisie, c);

    // Ligne 2 : reference
    c.gridx = 0;
    c.gridwidth = 1;
    c.gridy++;
    c.weightx = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    JLabel labelLibelle = new JLabel(getLabelFor("NOM"));
    labelLibelle.setHorizontalAlignment(SwingConstants.RIGHT);
    this.add(labelLibelle, c);

    SQLTextCombo textLibelle = new SQLTextCombo();
    c.gridx++;
    c.weightx = 1;
    c.fill = GridBagConstraints.BOTH;
    this.add(textLibelle, c);

    this.addSQLObject(textLibelle, "NOM");
    c.fill = GridBagConstraints.HORIZONTAL;
    this.comboCommercial = new ElementComboBox(false);
    // Commercial
    String field;
    field = "ID_COMMERCIAL";
    c.gridx++;
    c.weightx = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    this.add(new JLabel(getLabelFor(field), SwingConstants.RIGHT), c);

    c.gridx++;
    c.weightx = 1;
    c.fill = GridBagConstraints.NONE;

    this.add(this.comboCommercial, c);
    this.addRequiredSQLObject(this.comboCommercial, field);
    // Client
    c.gridx = 0;
    c.gridy++;
    c.weightx = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    this.add(new JLabel(getLabelFor("ID_CLIENT"), SwingConstants.RIGHT), c);

    c.gridx++;
    c.weightx = 1;
    c.fill = GridBagConstraints.NONE;
    this.comboClient = new ElementComboBox();

    this.add(this.comboClient, c);

    if (getTable().contains("ID_ECHEANCIER_CCI")) {
        // Echeancier
        c.gridx++;
        c.weightx = 0;
        c.fill = GridBagConstraints.HORIZONTAL;
        this.add(new JLabel(getLabelFor("ID_ECHEANCIER_CCI"), SwingConstants.RIGHT), c);

        c.gridx++;
        c.weightx = 1;
        c.fill = GridBagConstraints.NONE;
        final ElementComboBox echeancier = new ElementComboBox();
        final SQLElement contactElement = Configuration.getInstance().getDirectory()
                .getElement("ECHEANCIER_CCI");
        echeancier.init(contactElement, contactElement.getComboRequest(true));
        DefaultGridBagConstraints.lockMinimumSize(echeancier);
        this.addView(echeancier, "ID_ECHEANCIER_CCI");

        selAffaire.addValueListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent arg0) {
                // TODO Raccord de mthode auto-gnr
                if (selAffaire.getSelectedRow() != null) {
                    echeancier.getRequest().setWhere(new Where(contactElement.getTable().getField("ID_AFFAIRE"),
                            "=", selAffaire.getSelectedRow().getID()));

                    if (!isFilling()) {
                        SQLRow rowPole = selAffaire.getSelectedRow().getForeignRow("ID_POLE_PRODUIT");
                        comboCommercial.setValue(rowPole);
                    }
                } else {
                    echeancier.getRequest().setWhere(null);
                }
            }
        });
        this.add(echeancier, c);

    }

    this.comboClient.addValueListener(this.changeClientListener);

    this.comboAdresse = new ElementComboBox();
    this.comboAdresse.setAddIconVisible(false);
    this.comboAdresse.setListIconVisible(false);
    JLabel labelAdresse = new JLabel(getLabelFor("ID_ADRESSE"), SwingConstants.RIGHT);
    c.gridy++;
    c.gridx = 0;
    c.gridwidth = 1;
    c.weightx = 0;
    c.fill = GridBagConstraints.HORIZONTAL;
    labelAdresse.setHorizontalAlignment(SwingConstants.RIGHT);
    this.add(labelAdresse, c);

    c.gridx++;
    c.fill = GridBagConstraints.NONE;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weightx = 1;
    this.add(this.comboAdresse, c);

    // Acompte
    this.checkAcompte = new JCheckBox(getLabelFor("ACOMPTE"));
    c.gridx++;
    c.gridwidth = GridBagConstraints.REMAINDER;
    // this.add(this.checkAcompte, c);
    c.gridwidth = 1;
    this.addView(this.checkAcompte, "ACOMPTE");

    // Compte Service
    this.checkCompteServiceAuto = new JCheckBox(getLabelFor("COMPTE_SERVICE_AUTO"));
    this.addSQLObject(this.checkCompteServiceAuto, "COMPTE_SERVICE_AUTO");
    this.compteSelService = new ISQLCompteSelector();

    this.labelCompteServ = new JLabel("Compte Service");
    c.gridy++;
    c.gridx = 0;
    c.gridwidth = 1;
    c.weightx = 0;
    this.labelCompteServ.setHorizontalAlignment(SwingConstants.RIGHT);
    this.add(this.labelCompteServ, c);

    c.gridx++;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weightx = 1;
    this.add(this.compteSelService, c);

    String valServ = DefaultNXProps.getInstance().getStringProperty("ArticleService");
    Boolean bServ = Boolean.valueOf(valServ);

    this.checkCompteServiceAuto.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            setCompteServiceVisible(!SaisieVenteFactureSQLComponent.this.checkCompteServiceAuto.isSelected());
        }
    });

    // FIXME A checker si utile pour Preventec ou KD
    setCompteServiceVisible(false);
    // setCompteServiceVisible(!(bServ != null && !bServ.booleanValue()));

    final JPanel pAcompte = new JPanel();
    final DeviseField textAcompteHT = new DeviseField();
    pAcompte.add(new JLabel("Acompte HT"));
    pAcompte.add(textAcompteHT);

    pAcompte.add(new JLabel("soit"));
    final JTextField textAcompte = new JTextField(5);
    pAcompte.add(textAcompte);
    pAcompte.add(new JLabel("%"));
    c.gridx = 0;
    c.gridy++;
    c.anchor = GridBagConstraints.EAST;
    c.fill = GridBagConstraints.NONE;
    this.add(pAcompte, c);
    c.anchor = GridBagConstraints.WEST;
    this.addView(textAcompte, "POURCENT_ACOMPTE");

    pAcompte.setVisible(false);

    /*******************************************************************************************
     * * DETAILS
     ******************************************************************************************/
    this.tableFacture = new SaisieVenteFactureItemTable();

    final ElementComboBox boxTarif = new ElementComboBox();
    if (this.getTable().getFieldsName().contains("ID_TARIF")) {
        // TARIF
        c.gridy++;
        c.gridx = 0;
        c.weightx = 0;
        c.weighty = 0;
        c.gridwidth = 1;
        c.fill = GridBagConstraints.HORIZONTAL;
        this.add(new JLabel("Tarif  appliquer", SwingConstants.RIGHT), c);
        c.gridx++;
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.fill = GridBagConstraints.NONE;
        c.weightx = 1;
        DefaultGridBagConstraints.lockMinimumSize(boxTarif);
        this.add(boxTarif, c);
        this.addView(boxTarif, "ID_TARIF");
        boxTarif.addModelListener("wantedID", new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                SQLRow selectedRow = boxTarif.getRequest().getPrimaryTable().getRow(boxTarif.getWantedID());
                tableFacture.setTarif(selectedRow, false);
            }
        });
    }
    c.gridy++;
    c.gridx = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.BOTH;

    ITextArea infos = new ITextArea(4, 4);
    this.add(this.tableFacture, c);

    // FIXME
    this.addView(this.tableFacture.getRowValuesTable(), "");

    /*******************************************************************************************
     * * MODE DE REGLEMENT
     ******************************************************************************************/
    JPanel panelBottom = new JPanel(new GridBagLayout());
    GridBagConstraints cBottom = new DefaultGridBagConstraints();
    cBottom.weightx = 1;
    cBottom.anchor = GridBagConstraints.NORTHWEST;
    // Mode de rglement
    this.addView("ID_MODE_REGLEMENT", REQ + ";" + DEC + ";" + SEP);
    this.eltModeRegl = (ElementSQLObject) this.getView("ID_MODE_REGLEMENT");
    panelBottom.add(this.eltModeRegl, cBottom);

    /*******************************************************************************************
     * * FRAIS DE PORT ET REMISE
     ******************************************************************************************/
    JPanel panelFrais = new JPanel();
    panelFrais.setLayout(new GridBagLayout());

    final GridBagConstraints cFrais = new DefaultGridBagConstraints();

    this.textPortHT = new DeviseField(5);
    DefaultGridBagConstraints.lockMinimumSize(textPortHT);
    addSQLObject(this.textPortHT, "PORT_HT");
    this.textRemiseHT = new DeviseField(5);
    DefaultGridBagConstraints.lockMinimumSize(textRemiseHT);
    addSQLObject(this.textRemiseHT, "REMISE_HT");

    // Frais de port
    cFrais.gridheight = 1;
    cFrais.gridx = 1;
    SQLRequestComboBox boxTaxePort = new SQLRequestComboBox(false, 8);
    if (getTable().contains("ID_TAXE_PORT")) {

        JLabel labelPortHT = new JLabel(getLabelFor("PORT_HT"));
        labelPortHT.setHorizontalAlignment(SwingConstants.RIGHT);
        cFrais.gridy++;
        panelFrais.add(labelPortHT, cFrais);
        cFrais.gridx++;
        panelFrais.add(this.textPortHT, cFrais);

        JLabel labelTaxeHT = new JLabel(getLabelFor("ID_TAXE_PORT"));
        labelTaxeHT.setHorizontalAlignment(SwingConstants.RIGHT);
        cFrais.gridx = 1;
        cFrais.gridy++;
        panelFrais.add(labelTaxeHT, cFrais);
        cFrais.gridx++;
        panelFrais.add(boxTaxePort, cFrais);
        this.addView(boxTaxePort, "ID_TAXE_PORT", REQ);

        boxTaxePort.addValueListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                // TODO Raccord de mthode auto-gnr
                totalTTC.updateTotal();
            }
        });
    }

    // Remise
    JLabel labelRemiseHT = new JLabel(getLabelFor("REMISE_HT"));
    labelRemiseHT.setHorizontalAlignment(SwingConstants.RIGHT);
    cFrais.gridy++;
    cFrais.gridx = 1;
    panelFrais.add(labelRemiseHT, cFrais);
    cFrais.gridx++;
    panelFrais.add(this.textRemiseHT, cFrais);
    cFrais.gridy++;

    cBottom.gridx++;
    cBottom.weightx = 1;
    cBottom.anchor = GridBagConstraints.NORTHEAST;
    cBottom.fill = GridBagConstraints.NONE;
    panelBottom.add(panelFrais, cBottom);

    /*******************************************************************************************
     * * CALCUL DES TOTAUX
     ******************************************************************************************/
    DeviseField fieldHT = new DeviseField();
    final DeviseField fieldTVA = new DeviseField();
    DeviseField fieldService = new DeviseField();
    DeviseField fieldTHA = new DeviseField();

    DeviseField fieldDevise = null;
    if (getTable().getFieldsName().contains("T_DEVISE")) {
        fieldDevise = new DeviseField();
        addSQLObject(fieldDevise, "T_DEVISE");
    }
    // FIXME was required but not displayed for KD
    addSQLObject(fieldTHA, "T_HA");
    addRequiredSQLObject(fieldHT, "T_HT");
    addRequiredSQLObject(fieldTVA, "T_TVA");
    addRequiredSQLObject(this.fieldTTC, "T_TTC");
    addRequiredSQLObject(fieldService, "T_SERVICE");
    JTextField poids = new JTextField();
    addSQLObject(poids, "T_POIDS");

    totalTTC = new TotalPanel(this.tableFacture, fieldHT, fieldTVA, this.fieldTTC, this.textPortHT,
            this.textRemiseHT, fieldService, fieldTHA, fieldDevise, poids, null,
            (getTable().contains("ID_TAXE_PORT") ? boxTaxePort : null));
    DefaultGridBagConstraints.lockMinimumSize(totalTTC);
    cBottom.gridx++;
    cBottom.weightx = 1;
    cBottom.anchor = GridBagConstraints.EAST;
    cBottom.fill = GridBagConstraints.HORIZONTAL;
    panelBottom.add(totalTTC, cBottom);

    c.anchor = GridBagConstraints.WEST;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridx = 0;
    c.gridy++;
    c.weighty = 0;
    this.add(panelBottom, c);

    // Ligne : Avoir
    c.gridy++;
    c.gridx = 0;
    c.weightx = 1;
    c.weighty = 0;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.EAST;
    c.fill = GridBagConstraints.HORIZONTAL;
    this.add(createPanelAvoir(), c);

    // Infos
    c.gridy++;
    c.gridx = 0;
    c.gridwidth = 4;
    c.fill = GridBagConstraints.BOTH;
    this.add(new TitledSeparator(getLabelFor("INFOS")), c);

    c.gridy++;

    final JScrollPane comp = new JScrollPane(infos);
    infos.setBorder(null);
    DefaultGridBagConstraints.lockMinimumSize(comp);
    this.add(comp, c);

    this.panelOO = new PanelOOSQLComponent(this);
    c.gridy++;
    c.gridx = 0;
    c.weightx = 1;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.NORTHEAST;
    this.add(this.panelOO, c);

    this.addSQLObject(this.textAvoirTTC, "T_AVOIR_TTC");

    this.addRequiredSQLObject(dateSaisie, "DATE");
    this.addRequiredSQLObject(this.comboClient, "ID_CLIENT");
    this.addSQLObject(this.comboAdresse, "ID_ADRESSE");
    this.addRequiredSQLObject(this.textNumeroUnique, "NUMERO");
    this.addSQLObject(infos, "INFOS");
    this.addSQLObject(this.checkPrevisionnelle, "PREVISIONNELLE");
    this.addSQLObject(this.checkComplement, "COMPLEMENT");
    this.addSQLObject(this.selAvoir, "ID_AVOIR_CLIENT");
    this.addSQLObject(this.compteSelService, "ID_COMPTE_PCE_SERVICE");
    ModeDeReglementSQLComponent modeReglComp;

    modeReglComp = (ModeDeReglementSQLComponent) this.eltModeRegl.getSQLChild();
    this.selAvoir.getRequest().setWhere(new Where(this.tableAvoir.getField("SOLDE"), "=", Boolean.FALSE));
    this.selAvoir.fillCombo();

    // Selection du compte de service
    int idCompteVenteService = rowPrefsCompte.getInt("ID_COMPTE_PCE_VENTE_SERVICE");
    if (idCompteVenteService <= 1) {
        try {
            idCompteVenteService = ComptePCESQLElement.getIdComptePceDefault("VentesServices");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    this.compteSelService.setValue(idCompteVenteService);

    // Lock

    DefaultGridBagConstraints.lockMinimumSize(this.comboClient);
    DefaultGridBagConstraints.lockMinimumSize(this.comboCommercial);
    DefaultGridBagConstraints.lockMinimumSize(this.comboAdresse);

    // Listeners

    this.comboClient.addValueListener(this.listenerModeReglDefaut);
    this.fieldTTC.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent e) {
            refreshText();
        }

    });

    this.selAvoir.addValueListener(new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {
            refreshText();
        }

    });

    this.checkAcompte.addPropertyChangeListener(new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {

            pAcompte.setVisible(SaisieVenteFactureSQLComponent.this.checkAcompte.isSelected());
        }
    });

    this.changeClientListener = new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {

            if (SaisieVenteFactureSQLComponent.this.comboClient.getValue() != null) {
                final SQLRow row = SaisieVenteFactureSQLComponent.this.comboClient.getSelectedRow();
                final int id = row == null ? SQLRow.NONEXISTANT_ID : row.getID();

                SaisieVenteFactureSQLComponent.this.defaultContactRowValues.putForeignID("ID_CLIENT", row);
                if (row != null) {
                    if (SaisieVenteFactureSQLComponent.this.contact != null) {
                        Where w = new Where(
                                SaisieVenteFactureSQLComponent.this.eltContact.getTable().getField("ID_CLIENT"),
                                "=", SQLRow.NONEXISTANT_ID);
                        w = w.or(new Where(
                                SaisieVenteFactureSQLComponent.this.eltContact.getTable().getField("ID_CLIENT"),
                                "=", id));
                        SaisieVenteFactureSQLComponent.this.contact.getRequest().setWhere(w);
                    }
                    if (SaisieVenteFactureSQLComponent.this.comboAdresse != null) {

                        Where w = new Where(SaisieVenteFactureSQLComponent.TABLE_ADRESSE.getKey(), "=",
                                row.getInt("ID_ADRESSE"));

                        w = w.or(new Where(SaisieVenteFactureSQLComponent.TABLE_ADRESSE.getKey(), "=",
                                row.getInt("ID_ADRESSE_L")));
                        w = w.or(new Where(SaisieVenteFactureSQLComponent.TABLE_ADRESSE.getKey(), "=",
                                row.getInt("ID_ADRESSE_F")));

                        SQLRow rowCli = row;

                        w = w.or(new Where(SaisieVenteFactureSQLComponent.TABLE_ADRESSE.getField("ID_CLIENT"),
                                "=", rowCli.getID()));

                        SaisieVenteFactureSQLComponent.this.comboAdresse.getRequest().setWhere(w);
                    }
                } else {
                    if (SaisieVenteFactureSQLComponent.this.comboAdresse != null) {
                        SaisieVenteFactureSQLComponent.this.comboAdresse.getRequest().setWhere(null);
                    }
                }
                SaisieVenteFactureSQLComponent.this.previousClient = id;
            }

        }
    };

    this.changeCompteListener = new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            SQLSelect sel = new SQLSelect(getTable().getBase());
            sel.addSelect(SaisieVenteFactureSQLComponent.this.client.getTable().getKey());
            Where where = new Where(
                    SaisieVenteFactureSQLComponent.this.client.getTable().getField("ID_COMPTE_PCE"), "=",
                    SaisieVenteFactureSQLComponent.this.compteSel.getValue());
            sel.setWhere(where);

            String req = sel.asString();
            List l = getTable().getBase().getDataSource().execute(req);
            if (l != null) {
                if (l.size() == 1) {
                    Map<String, Object> m = (Map<String, Object>) l.get(0);
                    Object o = m.get(SaisieVenteFactureSQLComponent.this.client.getTable().getKey().getName());
                    System.err.println("Only one value match :: " + o);
                    if (o != null) {
                        SaisieVenteFactureSQLComponent.this.comboClient
                                .setValue(Integer.valueOf(((Number) o).intValue()));
                    }
                }
            }
        }
    };

    this.textPortHT.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent e) {
            totalTTC.updateTotal();
        }
    });

    this.textRemiseHT.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent e) {
            totalTTC.updateTotal();
        }
    });
    this.comboClient.addValueListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (SaisieVenteFactureSQLComponent.this.isFilling())
                return;
            final SQLRow row = ((SQLRequestComboBox) evt.getSource()).getSelectedRow();
            if (row != null) {
                SaisieVenteFactureSQLComponent.this.defaultContactRowValues.putForeignID("ID_CLIENT", row);
                if (SaisieVenteFactureSQLComponent.this.client.getTable().contains("ID_TARIF")) {
                    SQLRowAccessor foreignRow = row.getForeignRow("ID_TARIF");
                    if (foreignRow != null && !foreignRow.isUndefined()
                            && (boxTarif.getSelectedRow() == null
                                    || boxTarif.getSelectedId() != foreignRow.getID())
                            && JOptionPane.showConfirmDialog(null,
                                    "Appliquer les tarifs associs au client?") == JOptionPane.YES_OPTION) {
                        boxTarif.setValue(foreignRow.getID());
                        // SaisieVenteFactureSQLComponent.this.tableFacture.setTarif(foreignRow,
                        // true);
                    } else {
                        boxTarif.setValue(foreignRow);
                    }

                }

                int idCpt = row.getInt("ID_COMPTE_PCE");

                if (idCpt <= 1) {
                    // Select Compte client par defaut
                    idCpt = rowPrefsCompte.getInt("ID_COMPTE_PCE_CLIENT");
                    if (idCpt <= 1) {
                        try {
                            idCpt = ComptePCESQLElement.getIdComptePceDefault("Clients");
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
                if (SaisieVenteFactureSQLComponent.this.compteSel != null) {
                    Integer i = SaisieVenteFactureSQLComponent.this.compteSel.getValue();
                    if (i == null || i.intValue() != idCpt) {
                        SaisieVenteFactureSQLComponent.this.compteSel.setValue(idCpt);
                    }
                }
            }

        }
    });

}

From source file:org.revager.gui.findings_list.FindingsListFrame.java

private void createImpPanel() {
    JLabel impLbl = new JLabel(translate("General impression of the product:"));
    impLbl.setFont(UI.VERY_LARGE_FONT_BOLD);

    impTxtArea = new JTextArea();
    impTxtArea.setFont(UI.VERY_LARGE_FONT);

    impTxtArea.addKeyListener(updateListener);
    impTxtArea.addKeyListener(tabKeyListener);

    impTxtArea.setText(revMgmt.getImpression().trim());

    impScrllPn = GUITools.setIntoScrllPn(impTxtArea);
    GUITools.scrollToTop(impScrllPn);/*from  ww  w  .j a  va 2s  .com*/

    GUITools.addComponent(tabGenImp, gbl, impLbl, 0, 1, 2, 1, 0, 0, 20, 10, 0, 10, GridBagConstraints.NONE,
            GridBagConstraints.NORTHWEST);

    GUITools.addComponent(tabGenImp, gbl, impScrllPn, 0, 2, 2, 1, 1.0, 1.0, 5, 10, 0, 10,
            GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST);

    tabGenImp.setBorder(new EmptyBorder(0, 10, 20, 10));
}

From source file:org.dwfa.ace.classifier.CNFormsLabelPanel.java

public void setConcept(I_GetConceptData conceptIn, I_ConfigAceFrame config)
        throws IOException, TerminologyException {
    this.theCBean = conceptIn;
    this.config = config;

    commonJPanel.removeAll();/*from   w  w w.ja  v  a2 s . com*/
    deltaJPanel.removeAll();
    formsJPanel.removeAll(); // FORMS HAS SUBPANELS: STATED & COMPUTED

    if (conceptIn == null)
        return;

    // COMMON & DIFFERENT SECTION
    // COMMON PANEL
    commonLabels = getCommonLabels(showDetailCB.isSelected(), showStatusCB.isSelected(), config); // ####
    commonPartJPanel = new JPanel();
    setMinMaxSize(commonPartJPanel);
    commonPartJPanel.setLayout(new BoxLayout(commonPartJPanel, BoxLayout.Y_AXIS));
    for (I_ImplementActiveLabel l : commonLabels) {
        commonPartJPanel.add(l.getLabel());
    }

    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.gridheight = 1;
    c.gridwidth = 1;
    c.weightx = 0;
    c.weighty = 0;
    c.gridx = 0;
    c.gridy = 0;
    commonJPanel.add(commonPartJPanel, c);

    // DELTA (DIFFERENCES) PANEL
    Map<I_ConceptAttributeTuple, Color> conAttrColorMap = new HashMap<I_ConceptAttributeTuple, Color>();
    Map<I_DescriptionTuple, Color> desColorMap = new HashMap<I_DescriptionTuple, Color>();
    Map<I_RelTuple, Color> relColorMap = new HashMap<I_RelTuple, Color>();
    colors.reset();
    Collection<I_ImplementActiveLabel> deltaLabels = getDeltaLabels(showDetailCB.isSelected(),
            showStatusCB.isSelected(), config, colors, conAttrColorMap, desColorMap, relColorMap); // ####
    deltaPartJPanel = new JPanel();
    deltaPartJPanel.setLayout(new BoxLayout(deltaPartJPanel, BoxLayout.Y_AXIS));
    for (I_ImplementActiveLabel l : deltaLabels) {
        deltaPartJPanel.add(l.getLabel());
    }
    deltaJPanel.add(deltaPartJPanel);

    // FORM STATED PANEL
    c = new GridBagConstraints();
    c.fill = GridBagConstraints.VERTICAL;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.weightx = 0; // horizontal free space distribution weight
    c.weighty = 0; // vertical free space distribution weight
    c.gridx = 0;
    c.gridy = 0;

    JPanel tmpJPanel;
    tmpJPanel = newFormStatedJPanel("Stated Form:", config, conAttrColorMap, desColorMap, relColorMap); // ####
    setMinMaxSize(tmpJPanel);
    formsJPanel.add(tmpJPanel, c);

    // FORM DISTRIBUTION NORMAL PANEL
    if (showDistFormCB.isSelected()) {
        c.gridx++;
        if (c.gridx == 2) {
            c.gridx = 0;
            c.gridy++;
        }
        tmpJPanel = newFormDistJPanel("Distribution Normal Form:", config, conAttrColorMap, desColorMap,
                relColorMap); // ####
        setMinMaxSize(tmpJPanel);
        formsJPanel.add(tmpJPanel, c);
    }

    // AUTHORING NORMAL FORM PANEL
    if (showAuthFormCB.isSelected()) {
        c.gridx++;
        if (c.gridx == 2) {
            c.gridx = 0;
            c.gridy++;
        }
        tmpJPanel = newFormAuthJPanel("Authoring Normal Form:", config, conAttrColorMap, desColorMap,
                relColorMap); // ####
        setMinMaxSize(tmpJPanel);
        formsJPanel.add(tmpJPanel, c);
    }

    // LONG CANONICAL FORM PANEL
    if (showLongFormCB.isSelected()) {
        c.gridx++;
        if (c.gridx == 2) {
            c.gridx = 0;
            c.gridy++;
        }
        tmpJPanel = newFormLongJPanel("Long Canonical Form:", config, conAttrColorMap, desColorMap,
                relColorMap); // ####
        setMinMaxSize(tmpJPanel);
        formsJPanel.add(tmpJPanel, c);
    }

    // FORM SHORT CANONICAL PANEL
    if (showShortFormCB.isSelected()) {
        c.gridx++;
        if (c.gridx == 2) {
            c.gridx = 0;
            c.gridy++;
        }
        tmpJPanel = newFormShortJPanel("Short Canonical Form:", config, conAttrColorMap, desColorMap,
                relColorMap); // ####
        setMinMaxSize(tmpJPanel);
        formsJPanel.add(tmpJPanel, c);
    }
}

From source file:com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionContentPanel.java

private void addConfigurationLineItem() {
    JLabel jobConfigurationLabel = new JLabel("Job configurations");

    add(jobConfigurationLabel, new GridBagConstraints(0, ++displayLayoutCurrentRow, 1, 1, 1, 0,
            GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, 0), 0, 0));

    String[] columns = { "Key", "Value", "" };

    jobConfigurationTable = new JBTable();
    Dimension jobConfigurationTableSize = new Dimension(320, 100);
    jobConfigurationTable.setPreferredScrollableViewportSize(jobConfigurationTableSize);

    jobConfigurationTable.setSurrendersFocusOnKeystroke(true);
    jobConfigurationTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jobConfigurationTable.setColumnSelectionAllowed(true);
    JBScrollPane scrollPane = new JBScrollPane(jobConfigurationTable);
    jobConfigurationTable.setFillsViewportHeight(true);
    scrollPane.setMinimumSize(jobConfigurationTableSize);

    jobConfigurationTable.addPropertyChangeListener((evt) -> {
        if ((evt.getPropertyName().equals("tableCellEditor") || evt.getPropertyName().equals("model"))
                && jobConfigurationTable.getModel() instanceof SubmissionTableModel) {
            SubmissionTableModel model = (SubmissionTableModel) jobConfigurationTable.getModel();
            setVisibleForFixedErrorMessageLabel(ErrorMessageLabelTag.JobConfiguration.ordinal(), false);

            SparkSubmissionJobConfigCheckResult result = model.getFirstCheckResults();
            if (result != null) {
                setStatusForMessageLabel(ErrorMessageLabelTag.JobConfiguration.ordinal(), true,
                        result.getMessaqge(),
                        result.getStatus() == SparkSubmissionJobConfigCheckStatus.Warning);
            }//from  www. ja v a2  s. co  m
        }
    });

    add(scrollPane, new GridBagConstraints(1, displayLayoutCurrentRow, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, 0), 0, 0));

    JButton loadJobConfigurationButton = new JButton("...");
    loadJobConfigurationButton.setPreferredSize(selectedArtifactTextField.getButton().getPreferredSize());
    FixedSizeButton loadJobConfigurationFixedSizeButton = new FixedSizeButton(loadJobConfigurationButton);

    add(loadJobConfigurationFixedSizeButton,
            new GridBagConstraints(2, displayLayoutCurrentRow, 0, 1, 0, 0, GridBagConstraints.NORTHEAST,
                    GridBagConstraints.NONE, new Insets(margin, margin / 2, 0, margin), 0, 0));
    loadJobConfigurationFixedSizeButton.setToolTipText("Load Spark config from property file");

    loadJobConfigurationFixedSizeButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false,
                    false, false);

            fileChooserDescriptor.setTitle("Select Spark property file");

            VirtualFile chooseFile = FileChooser.chooseFile(fileChooserDescriptor, null, null);
            if (chooseFile != null) {
                submitModel.loadJobConfigMapFromPropertyFile(chooseFile.getCanonicalPath());
            }
        }
    });

    errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()] = new JLabel();
    errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()]
            .setForeground(DarkThemeManager.getInstance().getErrorMessageColor());
    errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()].setVisible(false);

    add(errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()],
            new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.NORTHWEST,
                    GridBagConstraints.HORIZONTAL, new Insets(0, margin, 0, margin), 0, 0));

}

From source file:ca.uhn.hl7v2.testpanel.ui.conn.Hl7ConnectionPanel.java

/**
 * Create the panel.//from  w  w  w  . ja v a2  s.  c  o  m
 */
public Hl7ConnectionPanel(Controller theController) {
    setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gridBagLayout = new GridBagLayout();
    gridBagLayout.columnWidths = new int[] { 150, 0 };
    gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
    gridBagLayout.columnWeights = new double[] { 0.0, 1.0 };
    gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE };
    setLayout(gridBagLayout);

    mySinglePortRadio = new JRadioButton("Single Port MLLP");
    mySinglePortRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updatePortsModel();
            updatePortsUi();
        }
    });
    myPortButtonGroup.add(mySinglePortRadio);
    GridBagConstraints gbc_SinglePortRadio = new GridBagConstraints();
    gbc_SinglePortRadio.anchor = GridBagConstraints.WEST;
    gbc_SinglePortRadio.insets = new Insets(0, 0, 5, 5);
    gbc_SinglePortRadio.gridx = 0;
    gbc_SinglePortRadio.gridy = 0;
    add(mySinglePortRadio, gbc_SinglePortRadio);

    JPanel panel_4 = new JPanel();
    panel_4.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel_4 = new GridBagConstraints();
    gbc_panel_4.fill = GridBagConstraints.BOTH;
    gbc_panel_4.insets = new Insets(0, 0, 5, 0);
    gbc_panel_4.gridx = 1;
    gbc_panel_4.gridy = 0;
    add(panel_4, gbc_panel_4);
    GridBagLayout gbl_panel_4 = new GridBagLayout();
    gbl_panel_4.columnWidths = new int[] { 0, 0, 0 };
    gbl_panel_4.rowHeights = new int[] { 0, 0 };
    gbl_panel_4.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_panel_4.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel_4.setLayout(gbl_panel_4);

    mySinglePortTextBox = new JTextField();
    mySinglePortTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = mySinglePortTextBox.getText();
            text = text.replaceAll("[^0-9]+", "");
            if (!StringUtils.equals(mySinglePortTextBox.getText(), text)) {
                final String newVal = text;
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        mySinglePortTextBox.setText(newVal);
                    }
                });
            }
            if (mySinglePortRadio.isSelected()) {
                if (text.length() > 0) {
                    myConnection.setIncomingOrSinglePort(Integer.parseInt(text));
                } else {
                    myConnection.setIncomingOrSinglePort(-1);
                }
            }
        }
    });

    mylabel = new JLabel("Port");
    mylabel.setHorizontalAlignment(SwingConstants.CENTER);
    mylabel.setPreferredSize(new Dimension(60, 16));
    mylabel.setMinimumSize(new Dimension(60, 16));
    mylabel.setMaximumSize(new Dimension(60, 16));
    GridBagConstraints gbc_label = new GridBagConstraints();
    gbc_label.anchor = GridBagConstraints.EAST;
    gbc_label.insets = new Insets(0, 0, 0, 5);
    gbc_label.gridx = 0;
    gbc_label.gridy = 0;
    panel_4.add(mylabel, gbc_label);
    GridBagConstraints gbc_SinglePortTextBox = new GridBagConstraints();
    gbc_SinglePortTextBox.insets = new Insets(0, 5, 0, 0);
    gbc_SinglePortTextBox.anchor = GridBagConstraints.WEST;
    gbc_SinglePortTextBox.gridx = 1;
    gbc_SinglePortTextBox.gridy = 0;
    panel_4.add(mySinglePortTextBox, gbc_SinglePortTextBox);
    mySinglePortTextBox.setMinimumSize(new Dimension(100, 28));
    mySinglePortTextBox.setMaximumSize(new Dimension(100, 2147483647));
    mySinglePortTextBox.setColumns(10);

    myDualPortRadio = new JRadioButton("Dual Port MLLP");
    myDualPortRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updatePortsModel();
            updatePortsUi();
        }
    });
    myPortButtonGroup.add(myDualPortRadio);
    GridBagConstraints gbc_DualPortRadio = new GridBagConstraints();
    gbc_DualPortRadio.anchor = GridBagConstraints.WEST;
    gbc_DualPortRadio.insets = new Insets(0, 0, 5, 5);
    gbc_DualPortRadio.gridx = 0;
    gbc_DualPortRadio.gridy = 1;
    add(myDualPortRadio, gbc_DualPortRadio);

    JPanel panel = new JPanel();
    panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_BottomPanel = new GridBagConstraints();
    gbc_BottomPanel.insets = new Insets(0, 0, 5, 0);
    gbc_BottomPanel.fill = GridBagConstraints.BOTH;
    gbc_BottomPanel.gridx = 1;
    gbc_BottomPanel.gridy = 1;
    add(panel, gbc_BottomPanel);
    GridBagLayout gbl_panel = new GridBagLayout();
    gbl_panel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0 };
    gbl_panel.rowHeights = new int[] { 0, 0 };
    gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
    gbl_panel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel.setLayout(gbl_panel);

    JLabel lblInbound = new JLabel("Inbound");
    lblInbound.setHorizontalAlignment(SwingConstants.CENTER);
    lblInbound.setPreferredSize(new Dimension(60, 16));
    lblInbound.setMinimumSize(new Dimension(60, 16));
    lblInbound.setMaximumSize(new Dimension(60, 16));
    GridBagConstraints gbc_lblInbound = new GridBagConstraints();
    gbc_lblInbound.insets = new Insets(0, 5, 0, 5);
    gbc_lblInbound.anchor = GridBagConstraints.EAST;
    gbc_lblInbound.gridx = 0;
    gbc_lblInbound.gridy = 0;
    panel.add(lblInbound, gbc_lblInbound);

    myDualIncomingTextBox = new JTextField();
    myDualIncomingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = myDualIncomingTextBox.getText();
            text = text.replaceAll("[^0-9]+", "");
            if (!StringUtils.equals(myDualIncomingTextBox.getText(), text)) {
                final String newVal = text;
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        myDualIncomingTextBox.setText(newVal);
                    }
                });
            }
            if (myDualPortRadio.isSelected()) {
                if (text.length() > 0) {
                    myConnection.setIncomingOrSinglePort(Integer.parseInt(text));
                } else {
                    myConnection.setIncomingOrSinglePort(-1);
                }
            }
        }
    });
    myDualIncomingTextBox.setMaximumSize(new Dimension(100, 2147483647));
    myDualIncomingTextBox.setMinimumSize(new Dimension(100, 28));
    GridBagConstraints gbc_DualIncomingTextBox = new GridBagConstraints();
    gbc_DualIncomingTextBox.anchor = GridBagConstraints.WEST;
    gbc_DualIncomingTextBox.insets = new Insets(0, 0, 0, 5);
    gbc_DualIncomingTextBox.gridx = 1;
    gbc_DualIncomingTextBox.gridy = 0;
    panel.add(myDualIncomingTextBox, gbc_DualIncomingTextBox);
    myDualIncomingTextBox.setColumns(10);

    JLabel lblOutbound = new JLabel("Outbound");
    GridBagConstraints gbc_lblOutbound = new GridBagConstraints();
    gbc_lblOutbound.anchor = GridBagConstraints.EAST;
    gbc_lblOutbound.insets = new Insets(0, 0, 0, 5);
    gbc_lblOutbound.gridx = 2;
    gbc_lblOutbound.gridy = 0;
    panel.add(lblOutbound, gbc_lblOutbound);

    myDualOutgoingTextBox = new JTextField();
    myDualOutgoingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = myDualOutgoingTextBox.getText();
            text = text.replaceAll("[^0-9]+", "");
            if (!StringUtils.equals(myDualOutgoingTextBox.getText(), text)) {
                final String newVal = text;
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        myDualOutgoingTextBox.setText(newVal);
                    }
                });
            }
            if (myDualPortRadio.isSelected()) {
                if (text.length() > 0) {
                    myConnection.setOutgoingPort(Integer.parseInt(text));
                } else {
                    myConnection.setOutgoingPort(-1);
                }
            }
        }
    });
    myDualOutgoingTextBox.setMinimumSize(new Dimension(100, 28));
    myDualOutgoingTextBox.setMaximumSize(new Dimension(100, 2147483647));
    GridBagConstraints gbc_DualOutgoingTextBox = new GridBagConstraints();
    gbc_DualOutgoingTextBox.insets = new Insets(0, 0, 0, 5);
    gbc_DualOutgoingTextBox.anchor = GridBagConstraints.WEST;
    gbc_DualOutgoingTextBox.gridx = 3;
    gbc_DualOutgoingTextBox.gridy = 0;
    panel.add(myDualOutgoingTextBox, gbc_DualOutgoingTextBox);
    myDualOutgoingTextBox.setColumns(10);

    myHl7OverHttpRadioButton = new JRadioButton("HL7 over HTTP");
    myHl7OverHttpRadioButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updatePortsModel();
            updatePortsUi();
        }
    });
    myPortButtonGroup.add(myHl7OverHttpRadioButton);
    GridBagConstraints gbc_Hl7OverHttpRadioButton = new GridBagConstraints();
    gbc_Hl7OverHttpRadioButton.anchor = GridBagConstraints.WEST;
    gbc_Hl7OverHttpRadioButton.insets = new Insets(0, 0, 5, 5);
    gbc_Hl7OverHttpRadioButton.gridx = 0;
    gbc_Hl7OverHttpRadioButton.gridy = 2;
    add(myHl7OverHttpRadioButton, gbc_Hl7OverHttpRadioButton);

    mypanel = new JPanel();
    mypanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel = new GridBagConstraints();
    gbc_panel.insets = new Insets(0, 0, 5, 0);
    gbc_panel.fill = GridBagConstraints.BOTH;
    gbc_panel.gridx = 1;
    gbc_panel.gridy = 2;
    add(mypanel, gbc_panel);
    GridBagLayout gbl_panel2 = new GridBagLayout();
    gbl_panel2.columnWidths = new int[] { 0, 0 };
    gbl_panel2.rowHeights = new int[] { 0, 0 };
    gbl_panel2.columnWeights = new double[] { 0.0, 1.0 };
    gbl_panel2.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    mypanel.setLayout(gbl_panel2);

    mylabel_1 = new JLabel("URL");
    mylabel_1.setHorizontalAlignment(SwingConstants.CENTER);
    mylabel_1.setPreferredSize(new Dimension(60, 16));
    mylabel_1.setMinimumSize(new Dimension(60, 16));
    mylabel_1.setMaximumSize(new Dimension(60, 16));
    GridBagConstraints gbc_label_1 = new GridBagConstraints();
    gbc_label_1.anchor = GridBagConstraints.EAST;
    gbc_label_1.insets = new Insets(0, 0, 0, 5);
    gbc_label_1.gridx = 0;
    gbc_label_1.gridy = 0;
    mypanel.add(mylabel_1, gbc_label_1);

    myHoHUrlTextField = new JTextField();
    myHoHUrlTextField.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            if (myHohUrlTextFieldUpdating) {
                return;
            }

            String value = myHoHUrlTextField.getText();
            try {
                URL url = new URL(value);
                boolean tls;
                if (url.getProtocol().equals("http")) {
                    tls = false;
                } else if (url.getProtocol().equals("https")) {
                    tls = true;
                } else {
                    ourLog.info("Unknown protocol: {}", url.getProtocol());
                    myHoHUrlTextField.setBackground(ERROR_BG);
                    return;
                }

                myConnection.setTls(tls);
                myConnection.setHost(url.getHost());
                myConnection
                        .setIncomingOrSinglePort(url.getPort() != -1 ? url.getPort() : url.getDefaultPort());
                myConnection.setHttpUriPath(url.getPath());

                myHohUrlTextFieldUpdating = true;
                updatePortsUi();
                myHohUrlTextFieldUpdating = false;

                myTlsCheckbox.setSelected(tls);
                myHohTlsCheckbox.setSelected(tls);

                myHoHUrlTextField.setBackground(Color.white);
            } catch (MalformedURLException e) {
                myHoHUrlTextField.setBackground(ERROR_BG);
            }

        }
    });
    GridBagConstraints gbc_HohUsernameTextbox = new GridBagConstraints();
    gbc_HohUsernameTextbox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohUsernameTextbox.gridx = 1;
    gbc_HohUsernameTextbox.gridy = 0;
    mypanel.add(myHoHUrlTextField, gbc_HohUsernameTextbox);
    myHoHUrlTextField.setColumns(10);

    JLabel lblEncoding = new JLabel("Encoding");
    GridBagConstraints gbc_lblEncoding = new GridBagConstraints();
    gbc_lblEncoding.insets = new Insets(0, 0, 5, 5);
    gbc_lblEncoding.gridx = 0;
    gbc_lblEncoding.gridy = 3;
    add(lblEncoding, gbc_lblEncoding);

    JPanel encodingPanel = new JPanel();
    GridBagConstraints gbc_encodingPanel = new GridBagConstraints();
    gbc_encodingPanel.fill = GridBagConstraints.HORIZONTAL;
    gbc_encodingPanel.insets = new Insets(0, 0, 5, 0);
    gbc_encodingPanel.gridx = 1;
    gbc_encodingPanel.gridy = 3;
    add(encodingPanel, gbc_encodingPanel);
    encodingPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gbl_encodingPanel = new GridBagLayout();
    gbl_encodingPanel.columnWidths = new int[] { 144, 58, 0 };
    gbl_encodingPanel.rowHeights = new int[] { 23, 0 };
    gbl_encodingPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    gbl_encodingPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    encodingPanel.setLayout(gbl_encodingPanel);

    myXmlRadio = new JRadioButton("XML");
    myXmlRadio.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent theE) {
            updateEncodingModel();
        }
    });

    myEr7Radio = new JRadioButton("ER7 (Pipe and hat)");
    myEr7Radio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateEncodingModel();
        }
    });
    encodingButtonGroup.add(myEr7Radio);
    GridBagConstraints gbc_Er7Radio = new GridBagConstraints();
    gbc_Er7Radio.anchor = GridBagConstraints.NORTHWEST;
    gbc_Er7Radio.insets = new Insets(0, 0, 0, 5);
    gbc_Er7Radio.gridx = 0;
    gbc_Er7Radio.gridy = 0;
    encodingPanel.add(myEr7Radio, gbc_Er7Radio);
    encodingButtonGroup.add(myXmlRadio);
    GridBagConstraints gbc_XmlRadio = new GridBagConstraints();
    gbc_XmlRadio.anchor = GridBagConstraints.NORTHWEST;
    gbc_XmlRadio.gridx = 1;
    gbc_XmlRadio.gridy = 0;
    encodingPanel.add(myXmlRadio, gbc_XmlRadio);

    JLabel lblCharset = new JLabel("Charset");
    GridBagConstraints gbc_lblCharset = new GridBagConstraints();
    gbc_lblCharset.insets = new Insets(0, 0, 5, 5);
    gbc_lblCharset.gridx = 0;
    gbc_lblCharset.gridy = 4;
    add(lblCharset, gbc_lblCharset);

    JPanel panel_2 = new JPanel();
    GridBagConstraints gbc_panel_2 = new GridBagConstraints();
    gbc_panel_2.fill = GridBagConstraints.HORIZONTAL;
    gbc_panel_2.insets = new Insets(0, 0, 5, 0);
    gbc_panel_2.gridx = 1;
    gbc_panel_2.gridy = 4;
    add(panel_2, gbc_panel_2);
    panel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gbl_panel_2 = new GridBagLayout();
    gbl_panel_2.columnWidths = new int[] { 28, 198, 0, 0 };
    gbl_panel_2.rowHeights = new int[] { 27, 0 };
    gbl_panel_2.columnWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    gbl_panel_2.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel_2.setLayout(gbl_panel_2);

    myCharsetSelectRadio = new JRadioButton("");
    myCharsetSelectRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCharsetModel();
        }
    });
    charsetButtonGroup.add(myCharsetSelectRadio);
    GridBagConstraints gbc_CharsetSelectRadio = new GridBagConstraints();
    gbc_CharsetSelectRadio.anchor = GridBagConstraints.WEST;
    gbc_CharsetSelectRadio.insets = new Insets(0, 0, 0, 5);
    gbc_CharsetSelectRadio.gridx = 0;
    gbc_CharsetSelectRadio.gridy = 0;
    panel_2.add(myCharsetSelectRadio, gbc_CharsetSelectRadio);

    myCharsetCombo = new JComboBox();
    myCharsetCombo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCharsetModel();
        }
    });
    GridBagConstraints gbc_CharsetCombo = new GridBagConstraints();
    gbc_CharsetCombo.anchor = GridBagConstraints.NORTHWEST;
    gbc_CharsetCombo.insets = new Insets(0, 0, 0, 5);
    gbc_CharsetCombo.gridx = 1;
    gbc_CharsetCombo.gridy = 0;
    panel_2.add(myCharsetCombo, gbc_CharsetCombo);

    myCharsetDetectRadio = new JRadioButton("Detect in Message (MSH-18)");
    myCharsetDetectRadio.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            updateCharsetModel();
        }
    });
    charsetButtonGroup.add(myCharsetDetectRadio);
    GridBagConstraints gbc_CharsetDetectRadio = new GridBagConstraints();
    gbc_CharsetDetectRadio.anchor = GridBagConstraints.NORTH;
    gbc_CharsetDetectRadio.gridwidth = 2;
    gbc_CharsetDetectRadio.gridx = 2;
    gbc_CharsetDetectRadio.gridy = 0;
    panel_2.add(myCharsetDetectRadio, gbc_CharsetDetectRadio);

    mylabel_5 = new JLabel("Debug");
    GridBagConstraints gbc_label_5 = new GridBagConstraints();
    gbc_label_5.insets = new Insets(0, 0, 5, 5);
    gbc_label_5.gridx = 0;
    gbc_label_5.gridy = 5;
    add(mylabel_5, gbc_label_5);

    mypanel_2 = new JPanel();
    mypanel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel_75 = new GridBagConstraints();
    gbc_panel_75.insets = new Insets(0, 0, 5, 0);
    gbc_panel_75.fill = GridBagConstraints.BOTH;
    gbc_panel_75.gridx = 1;
    gbc_panel_75.gridy = 5;
    add(mypanel_2, gbc_panel_75);
    GridBagLayout gbl_panel_74 = new GridBagLayout();
    gbl_panel_74.columnWidths = new int[] { 0, 0 };
    gbl_panel_74.rowHeights = new int[] { 0, 0 };
    gbl_panel_74.columnWeights = new double[] { 0.0, Double.MIN_VALUE };
    gbl_panel_74.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    mypanel_2.setLayout(gbl_panel_74);

    myCaptureByteStreamCheckbox = new JCheckBox("Capture Bytes");
    GridBagConstraints gbc_CaptureByteStreamCheckbox = new GridBagConstraints();
    gbc_CaptureByteStreamCheckbox.gridx = 0;
    gbc_CaptureByteStreamCheckbox.gridy = 0;
    mypanel_2.add(myCaptureByteStreamCheckbox, gbc_CaptureByteStreamCheckbox);
    myCaptureByteStreamCheckbox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myConnection.setCaptureBytes(myCaptureByteStreamCheckbox.isSelected());
        }
    });
    myCaptureByteStreamCheckbox.setToolTipText("Check this box to capture the transport level communication");

    myInterfaceTypeCardPanel = new JPanel();
    myInterfaceTypeCardPanel.setBorder(null);
    GridBagConstraints gbc_InterfaceTypeCardPanel = new GridBagConstraints();
    gbc_InterfaceTypeCardPanel.gridwidth = 2;
    gbc_InterfaceTypeCardPanel.fill = GridBagConstraints.BOTH;
    gbc_InterfaceTypeCardPanel.gridx = 0;
    gbc_InterfaceTypeCardPanel.gridy = 6;
    add(myInterfaceTypeCardPanel, gbc_InterfaceTypeCardPanel);
    myInterfaceTypeCardPanel.setLayout(new CardLayout(0, 0));

    myMllpCard = new JPanel();
    myMllpCard.setBorder(null);
    myInterfaceTypeCardPanel.add(myMllpCard, IFACE_TYPE_CARD_MLLP);
    GridBagLayout gbl_MllpCard = new GridBagLayout();
    gbl_MllpCard.columnWidths = new int[] { 150, 0, 0 };
    gbl_MllpCard.rowHeights = new int[] { 0, 0, 0, 0 };
    gbl_MllpCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_MllpCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    myMllpCard.setLayout(gbl_MllpCard);

    JLabel lblHost = new JLabel("Host");
    GridBagConstraints gbc_lblHost = new GridBagConstraints();
    gbc_lblHost.insets = new Insets(0, 0, 5, 5);
    gbc_lblHost.gridx = 0;
    gbc_lblHost.gridy = 0;
    myMllpCard.add(lblHost, gbc_lblHost);

    mypanel_1 = new JPanel();
    mypanel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel_1 = new GridBagConstraints();
    gbc_panel_1.insets = new Insets(0, 0, 5, 0);
    gbc_panel_1.fill = GridBagConstraints.BOTH;
    gbc_panel_1.gridx = 1;
    gbc_panel_1.gridy = 0;
    myMllpCard.add(mypanel_1, gbc_panel_1);
    GridBagLayout gbl_panel_1 = new GridBagLayout();
    gbl_panel_1.columnWidths = new int[] { 134, 0 };
    gbl_panel_1.rowHeights = new int[] { 28, 0 };
    gbl_panel_1.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gbl_panel_1.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    mypanel_1.setLayout(gbl_panel_1);

    myHostBox = new JTextField();
    GridBagConstraints gbc_HostBox = new GridBagConstraints();
    gbc_HostBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HostBox.anchor = GridBagConstraints.NORTH;
    gbc_HostBox.gridx = 0;
    gbc_HostBox.gridy = 0;
    mypanel_1.add(myHostBox, gbc_HostBox);
    myHostBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHost(myHostBox.getText());
        }
    });
    myHostBox.setColumns(10);

    JLabel lblTransport = new JLabel("Transport");
    GridBagConstraints gbc_lblTransport = new GridBagConstraints();
    gbc_lblTransport.insets = new Insets(0, 0, 5, 5);
    gbc_lblTransport.gridx = 0;
    gbc_lblTransport.gridy = 1;
    myMllpCard.add(lblTransport, gbc_lblTransport);

    JPanel panel_3 = new JPanel();
    GridBagConstraints gbc_hohAuthPanel = new GridBagConstraints();
    gbc_hohAuthPanel.fill = GridBagConstraints.HORIZONTAL;
    gbc_hohAuthPanel.insets = new Insets(0, 0, 5, 0);
    gbc_hohAuthPanel.gridx = 1;
    gbc_hohAuthPanel.gridy = 1;
    myMllpCard.add(panel_3, gbc_hohAuthPanel);
    panel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagLayout gbl_hohAuthPanel = new GridBagLayout();
    gbl_hohAuthPanel.columnWidths = new int[] { 0, 0, 0 };
    gbl_hohAuthPanel.rowHeights = new int[] { 0, 0 };
    gbl_hohAuthPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
    gbl_hohAuthPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel_3.setLayout(gbl_hohAuthPanel);

    myTlsCheckbox = new JCheckBox("Use TLS/SSL");
    myTlsCheckbox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myHohTlsCheckbox.setSelected(myTlsCheckbox.isSelected());
            myConnection.setTls(myTlsCheckbox.isSelected());
        }
    });
    GridBagConstraints gbc_TlsCheckbox = new GridBagConstraints();
    gbc_TlsCheckbox.insets = new Insets(0, 0, 0, 5);
    gbc_TlsCheckbox.anchor = GridBagConstraints.WEST;
    gbc_TlsCheckbox.gridx = 0;
    gbc_TlsCheckbox.gridy = 0;
    panel_3.add(myTlsCheckbox, gbc_TlsCheckbox);

    myHoHCard = new JPanel();
    myInterfaceTypeCardPanel.add(myHoHCard, IFACE_TYPE_CARD_HOH);
    GridBagLayout gbl_HoHCard = new GridBagLayout();
    gbl_HoHCard.columnWidths = new int[] { 150, 0, 0 };
    gbl_HoHCard.rowHeights = new int[] { 0, 0, 0, 0 };
    gbl_HoHCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_HoHCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    myHoHCard.setLayout(gbl_HoHCard);

    mylabel_6 = new JLabel("Authorization");
    GridBagConstraints gbc_label_6 = new GridBagConstraints();
    gbc_label_6.insets = new Insets(0, 0, 5, 5);
    gbc_label_6.gridx = 0;
    gbc_label_6.gridy = 0;
    myHoHCard.add(mylabel_6, gbc_label_6);

    hohAuthPanel = new JPanel();
    hohAuthPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_hohAuthPanel2 = new GridBagConstraints();
    gbc_hohAuthPanel2.insets = new Insets(0, 0, 5, 0);
    gbc_hohAuthPanel2.fill = GridBagConstraints.BOTH;
    gbc_hohAuthPanel2.gridx = 1;
    gbc_hohAuthPanel2.gridy = 0;
    myHoHCard.add(hohAuthPanel, gbc_hohAuthPanel2);
    GridBagLayout gbl_hohAuthPanel3 = new GridBagLayout();
    gbl_hohAuthPanel3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0 };
    gbl_hohAuthPanel3.rowHeights = new int[] { 0, 0 };
    gbl_hohAuthPanel3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE };
    gbl_hohAuthPanel3.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    hohAuthPanel.setLayout(gbl_hohAuthPanel3);

    myHohAuthEnabledCheckbox = new JCheckBox("Enabled");
    myHohAuthEnabledCheckbox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent theE) {
            myConnection.setHohAuthenticationEnabled(myHohAuthEnabledCheckbox.isSelected());
        }
    });
    GridBagConstraints gbc_HohAuthEnabledCheckbox = new GridBagConstraints();
    gbc_HohAuthEnabledCheckbox.insets = new Insets(0, 0, 0, 5);
    gbc_HohAuthEnabledCheckbox.gridx = 0;
    gbc_HohAuthEnabledCheckbox.gridy = 0;
    hohAuthPanel.add(myHohAuthEnabledCheckbox, gbc_HohAuthEnabledCheckbox);

    mylabel_7 = new JLabel("Username:");
    GridBagConstraints gbc_label_7 = new GridBagConstraints();
    gbc_label_7.insets = new Insets(0, 0, 0, 5);
    gbc_label_7.anchor = GridBagConstraints.EAST;
    gbc_label_7.gridx = 1;
    gbc_label_7.gridy = 0;
    hohAuthPanel.add(mylabel_7, gbc_label_7);

    myHohAuthUsernameTextbox = new JTextField();
    myHohAuthUsernameTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHohAuthenticationUsername(myHohAuthUsernameTextbox.getText());
        }
    });
    myHohAuthUsernameTextbox.setMaximumSize(new Dimension(200, 2147483647));
    myHohAuthUsernameTextbox.setMinimumSize(new Dimension(100, 28));
    myHohAuthUsernameTextbox.setPreferredSize(new Dimension(100, 28));
    GridBagConstraints gbc_HohUsernameTextbox2 = new GridBagConstraints();
    gbc_HohUsernameTextbox2.insets = new Insets(0, 0, 0, 5);
    gbc_HohUsernameTextbox2.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohUsernameTextbox2.gridx = 2;
    gbc_HohUsernameTextbox2.gridy = 0;
    hohAuthPanel.add(myHohAuthUsernameTextbox, gbc_HohUsernameTextbox2);
    myHohAuthUsernameTextbox.setColumns(10);

    mylabel_8 = new JLabel("Password:");
    GridBagConstraints gbc_label_8 = new GridBagConstraints();
    gbc_label_8.insets = new Insets(0, 0, 0, 5);
    gbc_label_8.anchor = GridBagConstraints.EAST;
    gbc_label_8.gridx = 3;
    gbc_label_8.gridy = 0;
    hohAuthPanel.add(mylabel_8, gbc_label_8);

    myHohAuthPasswordTextbox = new JTextField();
    myHohAuthPasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHohAuthenticationPassword(myHohAuthPasswordTextbox.getText());
        }
    });
    myHohAuthPasswordTextbox.setPreferredSize(new Dimension(100, 28));
    myHohAuthPasswordTextbox.setMaximumSize(new Dimension(200, 2147483647));
    myHohAuthPasswordTextbox.setMinimumSize(new Dimension(100, 28));
    GridBagConstraints gbc_HohSignatureKeystoreTextbox = new GridBagConstraints();
    gbc_HohSignatureKeystoreTextbox.insets = new Insets(0, 0, 0, 5);
    gbc_HohSignatureKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSignatureKeystoreTextbox.gridx = 4;
    gbc_HohSignatureKeystoreTextbox.gridy = 0;
    hohAuthPanel.add(myHohAuthPasswordTextbox, gbc_HohSignatureKeystoreTextbox);
    myHohAuthPasswordTextbox.setColumns(10);

    mylabel_2 = new JLabel("Security Profile");
    mylabel_2.setVerticalTextPosition(SwingConstants.TOP);
    mylabel_2.setVerticalAlignment(SwingConstants.TOP);
    GridBagConstraints gbc_label_2 = new GridBagConstraints();
    gbc_label_2.insets = new Insets(0, 0, 5, 5);
    gbc_label_2.gridx = 0;
    gbc_label_2.gridy = 1;
    myHoHCard.add(mylabel_2, gbc_label_2);

    // securityProfilePanel = new JPanel();
    GridBagConstraints gbc_securityProfilePanel = new GridBagConstraints();
    gbc_securityProfilePanel.insets = new Insets(0, 0, 5, 0);
    gbc_securityProfilePanel.fill = GridBagConstraints.BOTH;
    gbc_securityProfilePanel.gridx = 1;
    gbc_securityProfilePanel.gridy = 1;
    // myHoHCard.add(securityProfilePanel, gbc_securityProfilePanel);
    // securityProfilePanel.setLayout(new BorderLayout(0, 0));

    tlsKeystorePanel = new JPanel();
    tlsKeystorePanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    // securityProfilePanel.add(tlsKeystorePanel, BorderLayout.CENTER);
    myHoHCard.add(tlsKeystorePanel, gbc_securityProfilePanel);
    GridBagLayout gbl_tlsKeystorePanel = new GridBagLayout();
    gbl_tlsKeystorePanel.columnWidths = new int[] { 0, 58, 107, 77, 0, 0 };
    gbl_tlsKeystorePanel.rowHeights = new int[] { 28, 16, 0, 0 };
    gbl_tlsKeystorePanel.columnWeights = new double[] { 0.0, 0.0, 1.0, 1.0, 0.0, Double.MIN_VALUE };
    gbl_tlsKeystorePanel.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    tlsKeystorePanel.setLayout(gbl_tlsKeystorePanel);

    myHohTlsCheckbox = new JCheckBox("TLS Enabled");
    GridBagConstraints gbc_HohTlsCheckbox = new GridBagConstraints();
    gbc_HohTlsCheckbox.gridheight = 2;
    gbc_HohTlsCheckbox.insets = new Insets(0, 0, 5, 5);
    gbc_HohTlsCheckbox.gridx = 0;
    gbc_HohTlsCheckbox.gridy = 0;
    tlsKeystorePanel.add(myHohTlsCheckbox, gbc_HohTlsCheckbox);
    myHohTlsCheckbox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            myConnection.setTls(myHohTlsCheckbox.isSelected());
            myTlsCheckbox.setSelected(myHohTlsCheckbox.isSelected());
            updatePortsUi();
        }
    });

    mylabel_3 = new JLabel("Keystore:");
    GridBagConstraints gbc_label_3 = new GridBagConstraints();
    gbc_label_3.anchor = GridBagConstraints.WEST;
    gbc_label_3.fill = GridBagConstraints.VERTICAL;
    gbc_label_3.insets = new Insets(0, 0, 5, 5);
    gbc_label_3.gridx = 1;
    gbc_label_3.gridy = 0;
    tlsKeystorePanel.add(mylabel_3, gbc_label_3);

    myHohSecurityKeystoreTextbox = new JTextField();
    GridBagConstraints gbc_HohKeystoreTextbox = new GridBagConstraints();
    gbc_HohKeystoreTextbox.gridwidth = 2;
    gbc_HohKeystoreTextbox.anchor = GridBagConstraints.NORTH;
    gbc_HohKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohKeystoreTextbox.insets = new Insets(0, 0, 5, 5);
    gbc_HohKeystoreTextbox.gridx = 2;
    gbc_HohKeystoreTextbox.gridy = 0;
    tlsKeystorePanel.add(myHohSecurityKeystoreTextbox, gbc_HohKeystoreTextbox);
    myHohSecurityKeystoreTextbox.setColumns(10);
    myHohSecurityKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            String text = myHohSecurityKeystoreTextbox.getText();
            myHohSecurityKeyPwTextBox.setEnabled(isNotBlank(text));
            myConnection.setTlsKeystoreLocation(text);
        }
    });

    myHohSecurityKeystoreChooseBtn = new JButton("Choose");
    myHohSecurityKeystoreChooseBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            Hl7ConnectionPanel.chooseKeystore(Hl7ConnectionPanel.this, myHohSecurityKeystoreTextbox);
        }
    });
    myHohSecurityKeystoreChooseBtn.setIcon(
            new ImageIcon(Hl7ConnectionPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png")));
    GridBagConstraints gbc_HohSignatureKeystoreChooseButton = new GridBagConstraints();
    gbc_HohSignatureKeystoreChooseButton.insets = new Insets(0, 0, 5, 0);
    gbc_HohSignatureKeystoreChooseButton.gridx = 4;
    gbc_HohSignatureKeystoreChooseButton.gridy = 0;
    tlsKeystorePanel.add(myHohSecurityKeystoreChooseBtn, gbc_HohSignatureKeystoreChooseButton);

    mylabel_4 = new JLabel("Store Pass:");
    GridBagConstraints gbc_label_4 = new GridBagConstraints();
    gbc_label_4.insets = new Insets(0, 0, 0, 5);
    gbc_label_4.anchor = GridBagConstraints.EAST;
    gbc_label_4.gridx = 1;
    gbc_label_4.gridy = 1;
    tlsKeystorePanel.add(mylabel_4, gbc_label_4);

    myHohSecurityKeyPwTextBox = new JTextField();
    myHohSecurityKeyPwTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setTlsKeystorePassword(myHohSecurityKeyPwTextBox.getText());
        }
    });
    GridBagConstraints gbc_HohSecurityKeyPwTextBox = new GridBagConstraints();
    gbc_HohSecurityKeyPwTextBox.insets = new Insets(0, 0, 0, 5);
    gbc_HohSecurityKeyPwTextBox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSecurityKeyPwTextBox.gridx = 2;
    gbc_HohSecurityKeyPwTextBox.gridy = 1;
    tlsKeystorePanel.add(myHohSecurityKeyPwTextBox, gbc_HohSecurityKeyPwTextBox);
    myHohSecurityKeyPwTextBox.setColumns(10);

    myHohSecurityProfileKeystoreStatus = new JLabel("Value goes here");
    myHohSecurityProfileKeystoreStatus.setHorizontalAlignment(SwingConstants.CENTER);
    GridBagConstraints gbc_HohSecurityProfileKeystoreStatus = new GridBagConstraints();
    gbc_HohSecurityProfileKeystoreStatus.anchor = GridBagConstraints.NORTH;
    gbc_HohSecurityProfileKeystoreStatus.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSecurityProfileKeystoreStatus.gridwidth = 5;
    gbc_HohSecurityProfileKeystoreStatus.gridx = 0;
    gbc_HohSecurityProfileKeystoreStatus.gridy = 2;
    tlsKeystorePanel.add(myHohSecurityProfileKeystoreStatus, gbc_HohSecurityProfileKeystoreStatus);

    mylabel_9 = new JLabel("Signature Profile");
    GridBagConstraints gbc_label_9 = new GridBagConstraints();
    gbc_label_9.insets = new Insets(0, 0, 0, 5);
    gbc_label_9.gridx = 0;
    gbc_label_9.gridy = 2;
    myHoHCard.add(mylabel_9, gbc_label_9);

    mypanel_3 = new JPanel();
    mypanel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    GridBagConstraints gbc_panel_3 = new GridBagConstraints();
    gbc_panel_3.fill = GridBagConstraints.BOTH;
    gbc_panel_3.gridx = 1;
    gbc_panel_3.gridy = 2;
    myHoHCard.add(mypanel_3, gbc_panel_3);
    GridBagLayout gbl_panel_3 = new GridBagLayout();
    gbl_panel_3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 50, 0, 0 };
    gbl_panel_3.rowHeights = new int[] { 0, 0, 0, 0 };
    gbl_panel_3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
    gbl_panel_3.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    mypanel_3.setLayout(gbl_panel_3);

    myHohSignatureEnabled = new JCheckBox("Enabled");
    myHohSignatureEnabled.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent theE) {
            myConnection.setHohSignatureEnabled(myHohSignatureEnabled.isSelected());
        }
    });
    GridBagConstraints gbc_HohSignatureEnabled = new GridBagConstraints();
    gbc_HohSignatureEnabled.insets = new Insets(0, 0, 5, 5);
    gbc_HohSignatureEnabled.gridx = 0;
    gbc_HohSignatureEnabled.gridy = 0;
    mypanel_3.add(myHohSignatureEnabled, gbc_HohSignatureEnabled);

    mylabel_10 = new JLabel("Keystore:");
    GridBagConstraints gbc_label_10 = new GridBagConstraints();
    gbc_label_10.anchor = GridBagConstraints.EAST;
    gbc_label_10.insets = new Insets(0, 0, 5, 5);
    gbc_label_10.gridx = 1;
    gbc_label_10.gridy = 0;
    mypanel_3.add(mylabel_10, gbc_label_10);

    myHohSignatureKeystoreTextbox = new JTextField();
    myHohSignatureKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHohSignatureKeystore(myHohSignatureKeystoreTextbox.getText());
        }
    });
    GridBagConstraints gbc_HohSignatureKeystoreTextbox2 = new GridBagConstraints();
    gbc_HohSignatureKeystoreTextbox2.gridwidth = 5;
    gbc_HohSignatureKeystoreTextbox2.insets = new Insets(0, 0, 5, 5);
    gbc_HohSignatureKeystoreTextbox2.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSignatureKeystoreTextbox2.gridx = 2;
    gbc_HohSignatureKeystoreTextbox2.gridy = 0;
    mypanel_3.add(myHohSignatureKeystoreTextbox, gbc_HohSignatureKeystoreTextbox2);
    myHohSignatureKeystoreTextbox.setColumns(10);

    myHohSignatureKeystoreChooseButton = new JButton("Choose");
    myHohSignatureKeystoreChooseButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            Hl7ConnectionPanel.chooseKeystore(Hl7ConnectionPanel.this, myHohSignatureKeystoreTextbox);
        }
    });
    myHohSignatureKeystoreChooseButton.setIcon(
            new ImageIcon(Hl7ConnectionPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png")));
    GridBagConstraints gbc_HohSignatureKeystoreChooseButton2 = new GridBagConstraints();
    gbc_HohSignatureKeystoreChooseButton2.insets = new Insets(0, 0, 5, 0);
    gbc_HohSignatureKeystoreChooseButton2.gridx = 7;
    gbc_HohSignatureKeystoreChooseButton2.gridy = 0;
    mypanel_3.add(myHohSignatureKeystoreChooseButton, gbc_HohSignatureKeystoreChooseButton2);

    mylabel_11 = new JLabel("Store Pass:");
    GridBagConstraints gbc_label_11 = new GridBagConstraints();
    gbc_label_11.anchor = GridBagConstraints.EAST;
    gbc_label_11.insets = new Insets(0, 0, 5, 5);
    gbc_label_11.gridx = 1;
    gbc_label_11.gridy = 1;
    mypanel_3.add(mylabel_11, gbc_label_11);

    myHohSignatureKeystorePasswordTextbox = new JTextField();
    myHohSignatureKeystorePasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHohSignatureKeystorePassword(myHohSignatureKeystorePasswordTextbox.getText());
        }
    });
    myHohSignatureKeystorePasswordTextbox.setPreferredSize(new Dimension(100, 28));
    myHohSignatureKeystorePasswordTextbox.setMinimumSize(new Dimension(100, 28));
    myHohSignatureKeystorePasswordTextbox.setMaximumSize(new Dimension(200, 2147483647));
    GridBagConstraints gbc_HohSignatureKeystorePasswordTextbox = new GridBagConstraints();
    gbc_HohSignatureKeystorePasswordTextbox.insets = new Insets(0, 0, 5, 5);
    gbc_HohSignatureKeystorePasswordTextbox.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSignatureKeystorePasswordTextbox.gridx = 2;
    gbc_HohSignatureKeystorePasswordTextbox.gridy = 1;
    mypanel_3.add(myHohSignatureKeystorePasswordTextbox, gbc_HohSignatureKeystorePasswordTextbox);
    myHohSignatureKeystorePasswordTextbox.setColumns(10);

    mylabel_12 = new JLabel("Key:");
    GridBagConstraints gbc_label_12 = new GridBagConstraints();
    gbc_label_12.anchor = GridBagConstraints.EAST;
    gbc_label_12.insets = new Insets(0, 0, 5, 5);
    gbc_label_12.gridx = 3;
    gbc_label_12.gridy = 1;
    mypanel_3.add(mylabel_12, gbc_label_12);

    myHohSignatureKeyAliasCombo = new JComboBox();
    myHohSignatureKeyAliasCombo.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent theE) {
            if (myUpdatingHohSignatureKeyAliasCombo) {
                return;
            }
            String selection = (String) myHohSignatureKeyAliasCombo.getSelectedItem();
            if (selection == HOH_SIGNATURE_KEY_USE_ANY_AVAILABLE) {
                myConnection.setHohSignatureKey(null);
            } else {
                myConnection.setHohSignatureKey(selection.replaceAll(" .*", ""));
            }
        }
    });
    GridBagConstraints gbc_HohSignatureKeyAliasCombo = new GridBagConstraints();
    gbc_HohSignatureKeyAliasCombo.insets = new Insets(0, 0, 5, 5);
    gbc_HohSignatureKeyAliasCombo.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSignatureKeyAliasCombo.gridx = 4;
    gbc_HohSignatureKeyAliasCombo.gridy = 1;
    mypanel_3.add(myHohSignatureKeyAliasCombo, gbc_HohSignatureKeyAliasCombo);

    mylabel_13 = new JLabel("Key Pass:");
    GridBagConstraints gbc_label_13 = new GridBagConstraints();
    gbc_label_13.anchor = GridBagConstraints.EAST;
    gbc_label_13.insets = new Insets(0, 0, 5, 5);
    gbc_label_13.gridx = 5;
    gbc_label_13.gridy = 1;
    mypanel_3.add(mylabel_13, gbc_label_13);

    myHohSignatureKeyPass = new JTextField();
    myHohSignatureKeyPass.getDocument().addDocumentListener(new SimpleDocumentListener() {
        @Override
        public void update(DocumentEvent theE) {
            myConnection.setHohSignatureKeyPassword(myHohSignatureKeyPass.getText());
        }
    });
    myHohSignatureKeyPass.setMinimumSize(new Dimension(50, 28));
    myHohSignatureKeyPass.setMaximumSize(new Dimension(50, 2147483647));
    myHohSignatureKeyPass.setPreferredSize(new Dimension(50, 28));
    GridBagConstraints gbc_HohSignatureKeyPass = new GridBagConstraints();
    gbc_HohSignatureKeyPass.gridwidth = 2;
    gbc_HohSignatureKeyPass.insets = new Insets(0, 0, 5, 0);
    gbc_HohSignatureKeyPass.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSignatureKeyPass.gridx = 6;
    gbc_HohSignatureKeyPass.gridy = 1;
    mypanel_3.add(myHohSignatureKeyPass, gbc_HohSignatureKeyPass);
    myHohSignatureKeyPass.setColumns(10);

    myHohSignatureStatusLabel = new JLabel("New label");
    myHohSignatureStatusLabel.setHorizontalAlignment(SwingConstants.CENTER);
    GridBagConstraints gbc_HohSignatureStatusLabel = new GridBagConstraints();
    gbc_HohSignatureStatusLabel.fill = GridBagConstraints.HORIZONTAL;
    gbc_HohSignatureStatusLabel.gridwidth = 8;
    gbc_HohSignatureStatusLabel.insets = new Insets(0, 0, 0, 5);
    gbc_HohSignatureStatusLabel.gridx = 0;
    gbc_HohSignatureStatusLabel.gridy = 2;
    mypanel_3.add(myHohSignatureStatusLabel, gbc_HohSignatureStatusLabel);

    init();

}

From source file:org.zaproxy.zap.extension.customFire.CustomFireDialog.java

/**
 * // w  w  w  . j  a  va  2s  . c  o m
 * @return JPanel `
 */
private JPanel getCustomPanel() {

    customPanel = new JPanel(new GridBagLayout());

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setViewportView(getRequestField());

    JPanel buttonPanel = new JPanel(new GridBagLayout());

    getRequestField().addCaretListener(new CaretListener() {
        @Override
        public void caretUpdate(CaretEvent event) {
            setFieldStates();

        }
    });

    buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(0, 0, 1, 0.5)); // Spacer
    buttonPanel.add(getAddCustomButton(), LayoutHelper.getGBC(1, 0, 1, 1, 0.0D, 0.0D, GridBagConstraints.BOTH,
            GridBagConstraints.NORTHWEST, new Insets(5, 5, 5, 5)));

    buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(2, 0, 1, 0.5)); // Spacer

    buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(0, 1, 1, 0.5)); // Spacer
    buttonPanel.add(getRemoveCustomButton(), LayoutHelper.getGBC(1, 1, 1, 1, 0.0D, 0.0D,
            GridBagConstraints.BOTH, GridBagConstraints.NORTHWEST, new Insets(5, 5, 5, 5)));

    buttonPanel.add(new JLabel(""), LayoutHelper.getGBC(2, 1, 1, 0.5)); // Spacer

    JScrollPane scrollPane2 = new JScrollPane(getInjectionPointList());
    scrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);

    buttonPanel.add(new JLabel(Constant.messages.getString("customFire.custom.label.vectors")),
            LayoutHelper.getGBC(0, 2, 3, 0.0D, 0.0D));

    buttonPanel.add(scrollPane2, LayoutHelper.getGBC(0, 3, 3, 1.0D, 1.0D)); //gT

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scrollPane, buttonPanel);
    splitPane.setDividerLocation(550);

    customPanel.add(splitPane, LayoutHelper.getGBC(0, 0, 1, 1, 1.0D, 1.0D));
    customPanel.add(customPanelStatus, LayoutHelper.getGBC(0, 1, 1, 1, 1.0D, 0.0D));
    customPanel.add(getDisableNonCustomVectors(), LayoutHelper.getGBC(0, 2, 1, 1, 1.0D, 0.0D));
    //}

    return customPanel;
}

From source file:uk.ac.ucl.chem.ccs.clinicalgui.DisplayJobPanel.java

private void initGUI() {
    if (ajo == null) {
        try {/*www  . j a v a  2s . c o  m*/
            setPreferredSize(new Dimension(400, 300));
        } catch (Exception e) {
            e.printStackTrace();
        }
        //JLabel l = new JLabel("No simulation running");
        //this.add(l);
        //this.setEnabled(false);
        return;
    }
    System.out.println("I am not null: drawing the display job panel");
    try {
        TableLayout thisLayout = new TableLayout(new double[][] { { TableLayout.FILL }, { TableLayout.PREFERRED,
                TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL, TableLayout.FILL } });
        thisLayout.setHGap(5);
        thisLayout.setVGap(5);
        this.setLayout(thisLayout);

        {
            jPanel1 = new JPanel();
            TableLayout jPanel1Layout = new TableLayout(new double[][] {
                    { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED,
                            TableLayout.PREFERRED },
                    { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                            TableLayout.FILL } });

            jPanel1Layout.setHGap(5);
            jPanel1Layout.setVGap(5);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1.setLayout(jPanel1Layout);

            jPanel1.setBorder(BorderFactory.createEtchedBorder());
            this.add(jPanel1, "0, 0, 0, 2");
            jPanel1.setPreferredSize(new java.awt.Dimension(630, 305));
            jPanel1.setSize(630, 305);
            {
                dtails = new JPanel();
                GridLayout dtailsLayout = new GridLayout(1, 1);
                dtailsLayout.setColumns(1);
                dtailsLayout.setHgap(5);
                dtailsLayout.setVgap(5);
                dtails.setBorder(BorderFactory.createTitledBorder("Job Details"));
                jPanel1.add(dtails, "0,  0,  2,  4");
                dtails.setLayout(dtailsLayout);
                {
                    jobDetailsSP = new JScrollPane();
                    dtails.add(jobDetailsSP);
                    {
                        jPanel3 = new JPanel();
                        TableLayout jPanel3Layout = new TableLayout(
                                new double[][] { { TableLayout.PREFERRED, TableLayout.FILL },
                                        { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                                TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                                TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                                TableLayout.FILL, TableLayout.FILL, TableLayout.FILL } });
                        jPanel3Layout.setHGap(5);
                        jPanel3Layout.setVGap(5);
                        jPanel3.setLayout(jPanel3Layout);
                        jobDetailsSP.setViewportView(jPanel3);
                        jPanel3.setBackground(new java.awt.Color(156, 199, 219));
                        {
                            jLabel2 = new JLabel();
                            jPanel3.add(jLabel2, "0, 0");
                            jLabel2.setText("Job Start Time");
                        }
                        {
                            jLabel3 = new JLabel();
                            jPanel3.add(jLabel3, "0, 1");
                            jLabel3.setText("Resource ID");
                        }
                        {
                            jLabel4 = new JLabel();
                            jPanel3.add(jLabel4, "0, 2");
                            jLabel4.setText("Job Type");
                        }
                        {
                            jLabel5 = new JLabel();
                            jPanel3.add(jLabel5, "0, 3");
                            jLabel5.setText("Status");
                        }
                        {
                            jLabel6 = new JLabel();
                            jPanel3.add(jLabel6, "0, 4");
                            jLabel6.setText("Machine");
                        }
                        {
                            jLabel7 = new JLabel();
                            jPanel3.add(jLabel7, "0, 5");
                            jLabel7.setText("CPUs Requested");
                        }
                        {
                            jLabel8 = new JLabel();
                            jPanel3.add(jLabel8, "0, 6");
                            jLabel8.setText("Configuration File");
                        }
                        {
                            jLabel9 = new JLabel();
                            jPanel3.add(jLabel9, "0, 7");
                            jLabel9.setText("Job Arguments");
                        }
                        {
                            jLabel10 = new JLabel();
                            jPanel3.add(jLabel10, "0, 8");
                            jLabel10.setText("Job Stdout");
                        }
                        {
                            jLabel11 = new JLabel();
                            jPanel3.add(jLabel11, "0, 9");
                            jLabel11.setText("Job Stderr");
                        }
                        {
                            jLabel12 = new JLabel();
                            jPanel3.add(jLabel12, "0, 10");
                            jLabel12.setText("Job Stdin");
                        }
                        {
                            jLabel13 = new JLabel();
                            jPanel3.add(jLabel13, "0, 11");
                            jLabel13.setText("Resource Endpoint");
                        }
                        {
                            jobName = new JTextField();
                            jPanel3.add(jobName, "1, 0");
                            jobName.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobName.setOpaque(true);
                            jobName.setBackground(new java.awt.Color(255, 255, 255));
                            jobName.setEditable(false);

                        }
                        {
                            resourceID = new JTextField();
                            jPanel3.add(resourceID, "1, 1");
                            resourceID.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            resourceID.setOpaque(true);
                            resourceID.setBackground(new java.awt.Color(255, 255, 255));
                            resourceID.setEditable(false);

                        }
                        {
                            jobType = new JTextField();
                            jPanel3.add(jobType, "1, 2");
                            jobType.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobType.setBackground(new java.awt.Color(255, 255, 255));
                            jobType.setOpaque(true);
                            jobType.setEditable(false);

                        }
                        {
                            jobStatus = new JLabel();
                            jPanel3.add(jobStatus, "1, 3");
                            jobStatus.setOpaque(true);
                            jobStatus.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobStatus.setBackground(new java.awt.Color(255, 255, 255));
                        }
                        {
                            rm = new JTextField();
                            jPanel3.add(rm, "1, 4");
                            rm.setBackground(new java.awt.Color(255, 255, 255));
                            rm.setOpaque(true);
                            rm.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            rm.setEditable(false);

                        }
                        {
                            jobCpus = new JTextField();
                            jPanel3.add(jobCpus, "1, 5");
                            jobCpus.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobCpus.setOpaque(true);
                            jobCpus.setBackground(new java.awt.Color(255, 255, 255));
                            jobCpus.setEditable(false);

                        }
                        {
                            jobConf = new JTextField();
                            jPanel3.add(jobConf, "1, 6");
                            jobConf.setBackground(new java.awt.Color(255, 255, 255));
                            jobConf.setOpaque(true);
                            jobConf.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobConf.setEditable(false);

                        }
                        {
                            jobArgs = new JTextField();
                            jPanel3.add(jobArgs, "1, 7");
                            jobArgs.setBackground(new java.awt.Color(255, 255, 255));
                            jobArgs.setOpaque(true);
                            jobArgs.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobArgs.setEditable(false);

                        }
                        {
                            jobSdtout = new JTextField();
                            jPanel3.add(jobSdtout, "1, 8");
                            jobSdtout.setBackground(new java.awt.Color(255, 255, 255));
                            jobSdtout.setOpaque(true);
                            jobSdtout.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobSdtout.setEditable(false);

                        }
                        {
                            jobStderr = new JTextField();
                            jPanel3.add(jobStderr, "1, 9");
                            jobStderr.setBackground(new java.awt.Color(255, 255, 255));
                            jobStderr.setOpaque(true);
                            jobStderr.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobStderr.setEditable(false);

                        }
                        {
                            jobStdin = new JTextField();
                            jPanel3.add(jobStdin, "1, 10");
                            jobStdin.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobStdin.setBackground(new java.awt.Color(255, 255, 255));
                            jobStdin.setOpaque(true);
                            jobStdin.setEditable(false);

                        }
                        {
                            jobEPR = new JTextField();
                            jPanel3.add(jobEPR, "1, 11");
                            jobEPR.setOpaque(true);
                            jobEPR.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobEPR.setBackground(new java.awt.Color(255, 255, 255));
                            jobEPR.setEditable(false);

                        }
                    }

                }
            }
            {
                controls = new JPanel();
                TableLayout controlsLayout = new TableLayout(new double[][] { { TableLayout.FILL },
                        { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL } });
                controlsLayout.setHGap(5);
                controlsLayout.setVGap(5);
                controls.setLayout(controlsLayout);
                controls.setBorder(BorderFactory.createTitledBorder("Operations"));
                jPanel1.add(controls, "3,  0,  4,  2");
                {
                    updateStatus = new JButton();
                    controls.add(updateStatus, "0, 0");
                    updateStatus.setText("Update Job Status");
                    updateStatus.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            if (updateStatus.getText().equals("Start Job")) {
                                StartCall sc = new StartCall(ajo,
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-lifetime"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-port"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-dn"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-server"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-pw"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-un"));
                                ajo = sc.makeCall();
                                updatePanel();
                            } else {
                                pollJobState();
                            }
                        }
                    });
                }
                {
                    teminateJob = new JButton();
                    controls.add(teminateJob, "0, 1");
                    teminateJob.setText("Terminate Job");
                    teminateJob.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            TerminateSimCall tsc = new TerminateSimCall(ajo.getEndPoint());
                            DisplayJobPanel.this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
                            boolean tcsstatus = tsc.makeCall();
                            DisplayJobPanel.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                            if (tcsstatus) {
                                ajo.setState(AHEJobObject.GRIDSAM_TERMINATING);
                                updateState();
                            } else {
                                ErrorMessage em = new ErrorMessage(DisplayJobPanel.this,
                                        "Error terminating job. Check log for details");
                                ;
                            }
                        }
                    });
                }
                {
                    vizButton = new JButton();
                    controls.add(vizButton, "0, 2");
                    vizButton.setText("Visualize");

                    vizButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            String h = "localhost";
                            int p = 65250;
                            int w = 1024 * 1024;

                            VizSteererWindow vs = new VizSteererWindow(h, p, w,
                                    (JFrame) DisplayJobPanel.this.getTopLevelAncestor());
                        }
                    });
                }

                {
                    deleteFiles = new JCheckBox();
                    controls.add(deleteFiles, "0, 3");
                    deleteFiles.setText("Delete staged files when destroying job");
                    deleteFiles.setFont(new java.awt.Font("Sansserif", 0, 11));
                    deleteFiles.setSelected(true);
                }
            }
            {
                polling = new JPanel();
                GridBagLayout pollingLayout = new GridBagLayout();
                pollingLayout.rowWeights = new double[] { 0.1, 0.1, 0.1, 0.1 };
                pollingLayout.rowHeights = new int[] { 7, 7, 7, 7 };
                pollingLayout.columnWeights = new double[] { 0.0, 0.1 };
                pollingLayout.columnWidths = new int[] { 109, 7 };
                polling.setBorder(BorderFactory.createTitledBorder("Status Polling"));
                jPanel1.add(polling, "3,  3,  4,  4");
                polling.setLayout(pollingLayout);
                {
                    jLabel1 = new JLabel();
                    polling.add(jLabel1,
                            new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST,
                                    GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    jLabel1.setText("Set the polling interval ");
                    jLabel1.setFont(new java.awt.Font("Sansserif", 0, 11));
                }
                {
                    jSlider1 = new JSlider();
                    polling.add(jSlider1,
                            new GridBagConstraints(0, 1, 2, 2, 0.0, 0.0, GridBagConstraints.NORTHWEST,
                                    GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
                    jSlider1.setMaximum(60);
                    jSlider1.setValue(0);
                    //jSlider1.setMinorTickSpacing(1);
                    //jSlider1.createStandardLabels(5);
                    Hashtable lab = new Hashtable();
                    lab.put(new Integer(0), new JLabel("0"));
                    lab.put(new Integer(20), new JLabel("10"));
                    lab.put(new Integer(40), new JLabel("20"));
                    lab.put(new Integer(60), new JLabel("30"));
                    jSlider1.setLabelTable(lab);

                    jSlider1.setPaintTicks(true);
                    jSlider1.setPaintLabels(true);
                    jSlider1.setSnapToTicks(false);
                    jSlider1.setMajorTickSpacing(2);
                    jSlider1.setFont(new java.awt.Font("Sansserif", 0, 11));
                    jSlider1.addChangeListener(new ChangeListener() {
                        public void stateChanged(ChangeEvent e) {
                            if (jSlider1.getValue() != 0) {
                                Integer i = new Integer(jSlider1.getValue());
                                time1.setText(Float.toString(i.floatValue() / 2));
                                if (pollingButton.getText().equals("Stop Polling")) {
                                    pollTimer.stop();

                                    pollTimer.setInitialDelay(jSlider1.getValue() * 30000);
                                    pollTimer.setDelay(jSlider1.getValue() * 30000);
                                    pollTimer.start();
                                }
                            } else {
                                if (pollingButton.getText().equals("Stop Polling")) {
                                    pollTimer.stop();
                                    pollingButton.setText("Start Polling");
                                }
                                time1.setText("0.0");
                            }
                        }
                    });
                }
                {
                    pollingButton = new JButton();
                    polling.add(pollingButton,
                            new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTHEAST,
                                    GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    pollingButton.setText("Start Polling");
                    pollingButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            if (jSlider1.getValue() > 0) {
                                if (pollingButton.getText().equals("Start Polling")) {
                                    pollTimer = new Timer(jSlider1.getValue() * 30000, new ActionListener() {
                                        public void actionPerformed(ActionEvent evt) {
                                            pollJobState();
                                        }
                                    });
                                    pollTimer.setInitialDelay(1);
                                    pollTimer.start();
                                    pollingButton.setText("Stop Polling");
                                } else {
                                    pollTimer.stop();
                                    pollingButton.setText("Start Polling");
                                }
                            }
                        }
                    });

                }
                {
                    time = new JLabel();
                    polling.add(time, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
                            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    time.setBackground(new java.awt.Color(255, 255, 255));
                    time.setText("Every");
                }
                {
                    jLabel14 = new JLabel();
                    polling.add(jLabel14, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    jLabel14.setText("mins");
                }
                {
                    time1 = new JLabel();
                    polling.add(time1, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    time1.setText("0.0");
                    ;
                }
            }
        }
        {
            jPanel2 = new JPanel();
            GridLayout jPanel2Layout = new GridLayout(1, 1);
            jPanel2Layout.setColumns(1);
            jPanel2Layout.setHgap(5);
            jPanel2Layout.setVgap(5);
            jPanel2.setLayout(jPanel2Layout);
            TitledBorder title2;
            title2 = BorderFactory.createTitledBorder("Job Output");
            jPanel2.setBorder(title2);
            this.add(jPanel2, "0, 3, 0, 4");
            jPanel2.setPreferredSize(new java.awt.Dimension(630, 254));
            {
                jTabbedPane1 = new JTabbedPane();
                jPanel2.add(jTabbedPane1);

                {
                    gridsamStatus = new JPanel();
                    GridLayout gridsamStatusLayout = new GridLayout(1, 1);
                    gridsamStatusLayout.setColumns(1);
                    gridsamStatusLayout.setHgap(5);
                    gridsamStatusLayout.setVgap(5);
                    gridsamStatus.setLayout(gridsamStatusLayout);
                    jTabbedPane1.addTab("AHE Job Status", null, gridsamStatus, null);
                    {
                        jScrollPane1 = new JScrollPane();
                        gridsamStatus.add(jScrollPane1);
                        {
                            gridsamStatusResults = new JTextArea();
                            jScrollPane1.setViewportView(gridsamStatusResults);
                            gridsamStatusResults.setFont(new java.awt.Font("Monospaced", 0, 12));
                        }
                    }
                }
                {
                    stagedFiles = new JPanel();
                    TableLayout stagedFilesLayout = new TableLayout(new double[][] {
                            { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                    TableLayout.PREFERRED, TableLayout.PREFERRED },
                            { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                    TableLayout.FILL, TableLayout.PREFERRED } });
                    stagedFilesLayout.setHGap(5);
                    stagedFilesLayout.setVGap(5);
                    stagedFiles.setLayout(stagedFilesLayout);
                    jTabbedPane1.addTab("Staged Files", null, stagedFiles, null);
                    {
                        filesScrollPane = new JScrollPane();
                        stagedFiles.add(filesScrollPane, "0, 0, 5, 4");
                        {

                            outputFilesTable = new JTable();

                            int col1 = 0, col2 = 0;
                            int fsize = outputFilesTable.getFont().getSize() - 5;
                            Object data[][] = new Object[ajo.getOutfiles().size() + ajo.getInfiles().size()][3];

                            int i = 0;
                            if (ajo.getOutfiles() != null) {
                                Iterator it = ajo.getOutfiles().iterator();
                                while (it.hasNext()) {
                                    JobFileElement je = (JobFileElement) it.next();
                                    data[i][0] = new Boolean(true);
                                    data[i][1] = je.getName();
                                    if (je.getName().length() > col1) {
                                        col1 = je.getName().length();
                                    }
                                    String url = Tools.getUrlNoUP(je.getRemotepath());
                                    data[i][2] = url;
                                    if (url.length() > col2) {
                                        col2 = url.length();
                                    }
                                    i++;
                                }
                            }

                            if (ajo.getInfiles() != null) {
                                Iterator it = ajo.getInfiles().iterator();
                                while (it.hasNext()) {
                                    JobFileElement je = (JobFileElement) it.next();
                                    data[i][0] = new Boolean(false);
                                    data[i][1] = je.getName();
                                    if (je.getName().length() > col1) {
                                        col1 = je.getName().length();
                                    }
                                    String url = Tools.getUrlNoUP(je.getRemotepath());
                                    data[i][2] = url;
                                    if (url.length() > col2) {
                                        col2 = url.length();
                                    }
                                    i++;
                                }
                            }

                            String colNames[] = { "Download", "File Name", "File Location" };

                            TableModel outputFilesTableModel = new MyTableModel(data, colNames);
                            outputFilesTable.setIntercellSpacing(new Dimension(3, 3));
                            outputFilesTable.setModel(outputFilesTableModel);
                            outputFilesTable.getColumnModel().getColumn(0).setPreferredWidth(70);
                            outputFilesTable.getColumnModel().getColumn(1).setPreferredWidth(col1 * fsize);
                            outputFilesTable.getColumnModel().getColumn(2).setPreferredWidth(col2 * fsize);
                            outputFilesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                            filesScrollPane.setViewportView(outputFilesTable);
                            this.addComponentListener(new ComponentAdapter() {
                                public void componentResized(ComponentEvent e) {
                                    if (outputFilesTable.getWidth() < filesScrollPane.getWidth()) {
                                        outputFilesTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
                                    } else {
                                        outputFilesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                                    }
                                }
                            });

                        }

                    }
                    {
                        downloadButton = new JButton();
                        stagedFiles.add(downloadButton, "5, 5");
                        downloadButton.setText("Download");
                        downloadButton.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                int outFileSize = ajo.getOutfiles().size();
                                for (int row = 0; row < outputFilesTable.getRowCount(); row++) {
                                    if (((Boolean) outputFilesTable.getValueAt(row, 0))
                                            .booleanValue() == true) {

                                        if (row < outFileSize) {
                                            JobFileElement je = (JobFileElement) ajo.getOutfiles()
                                                    .elementAt(row);

                                            if (fileLocation != null) {
                                                je.setLocalpath(Tools.checkURL(fileLocation) + je.getName());
                                            }

                                            downloadFiles.add(je);
                                        } else {
                                            JobFileElement je = (JobFileElement) ajo.getInfiles()
                                                    .elementAt(row - outFileSize);

                                            if (fileLocation != null) {
                                                je.setLocalpath(Tools.checkURL(fileLocation) + je.getName());
                                            }

                                            downloadFiles.add(je);
                                        }
                                    }

                                }

                                StageFilesIn task = new StageFilesIn(
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.ahedavserver"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.ahedavuser"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.ahedavpasswd"));
                                task.init(downloadFiles);

                                ProgressMonitor progressMonitor = new ProgressMonitor(DisplayJobPanel.this,
                                        "Downloading Files", null, 0, task.getLength());
                                //progressMonitor.setMillisToDecideToPopup(1);
                                progressMonitor.setMillisToPopup(100);
                                //jProgressBar1.setMaximum(task.getLength());
                                //jProgressBar1.setValue(0);

                                while (task.filesToStage()) {
                                    if (task.stageNext()) {
                                        progressMonitor.setProgress(task.getCurrent());
                                    } else {
                                        cat.error(task.getError());

                                    }

                                }

                            }
                        });

                    }
                    {
                        changeLocationButton = new JButton();
                        stagedFiles.add(changeLocationButton, "4, 5");
                        changeLocationButton.setText("Local Dir");
                        changeLocationButton.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                JFileChooser fc = new JFileChooser();
                                fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                                int returnVal = fc.showOpenDialog(DisplayJobPanel.this);

                                if (returnVal == JFileChooser.APPROVE_OPTION) {
                                    File file = fc.getSelectedFile();
                                    fileLocation = file.getAbsolutePath();
                                    //System.out.println(fileLocation);
                                }
                            }
                        });

                    }
                }
                {
                    if (ajo.getReGSWSEPR() != null) {

                        regSteering = new JPanel();

                        TableLayout steerLayout = new TableLayout(
                                new double[][] { { TableLayout.FILL }, { TableLayout.FILL, TableLayout.FILL,
                                        TableLayout.FILL, TableLayout.FILL, TableLayout.FILL } });
                        regSteering.setLayout(steerLayout);
                        steeredApp = true;
                        jTabbedPane1.addTab("ReG Steering", null, regSteering, null);
                        {
                            JLabel look = new JLabel("Steering address");
                            steerERP = new JTextField();
                            steer = new JButton("Start Steerer");
                            steer.setEnabled(false);
                            steer.addActionListener(new ActionListener() {
                                public void actionPerformed(ActionEvent evt) {
                                    vs = new VizSteererWindow(h, p, w,
                                            DisplayJobPanel.this.getTopLevelAncestor());
                                }
                            });

                            regSteering.add(look, "0,1");
                            regSteering.add(steerERP, "0,2");
                            regSteering.add(steer, "0,3");

                        }

                    }
                }

            }
        }
        updatePanel();
        this.setPreferredSize(new java.awt.Dimension(630, 605));
        this.setSize(630, 605);
        this.setOpaque(false);

    } catch (Exception e) {
        e.printStackTrace();
    }
}