Example usage for java.awt BorderLayout WEST

List of usage examples for java.awt BorderLayout WEST

Introduction

In this page you can find the example usage for java.awt BorderLayout WEST.

Prototype

String WEST

To view the source code for java.awt BorderLayout WEST.

Click Source Link

Document

The west layout constraint (left side of container).

Usage

From source file:op.controlling.PnlControlling.java

private JPanel createContentPanel4Orga() {
    JPanel pnlContent = new JPanel(new VerticalLayout());

    /***//from  w w  w .jav  a 2s. c om
     *      ______     ___        _   _       _ _   _
     *     | __ ) \   / / \   ___| |_(_)_   _(_) |_(_) ___  ___
     *     |  _ \\ \ / / _ \ / __| __| \ \ / / | __| |/ _ \/ __|
     *     | |_) |\ V / ___ \ (__| |_| |\ V /| | |_| |  __/\__ \
     *     |____/  \_/_/   \_\___|\__|_| \_/ |_|\__|_|\___||___/
     *
     */
    JPanel pnlBV = new JPanel(new BorderLayout());
    final JButton btnBVActivities = GUITools.createHyperlinkButton("opde.controlling.orga.bvactivities", null,
            null);
    int bvWeeksBack;
    try {
        bvWeeksBack = Integer.parseInt(OPDE.getProps().getProperty("opde.controlling::bvactivitiesWeeksBack"));
    } catch (NumberFormatException nfe) {
        bvWeeksBack = 7;
    }
    final JTextField txtBVWeeksBack = GUITools.createIntegerTextField(1, 52, bvWeeksBack);
    txtBVWeeksBack.setToolTipText(SYSTools.xx("misc.msg.weeksback"));
    btnBVActivities.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {

            OPDE.getMainframe().setBlocked(true);
            SwingWorker worker = new SwingWorker() {
                @Override
                protected Object doInBackground() throws Exception {
                    SYSPropsTools.storeProp("opde.controlling::bvactivitiesWeeksBack", txtBVWeeksBack.getText(),
                            OPDE.getLogin().getUser());
                    SYSFilesTools.print(NReportTools.getBVActivites(
                            new LocalDate().minusWeeks(Integer.parseInt(txtBVWeeksBack.getText())),
                            progressClosure), false);
                    return null;
                }

                @Override
                protected void done() {
                    OPDE.getDisplayManager().setProgressBarMessage(null);
                    OPDE.getMainframe().setBlocked(false);
                }
            };
            worker.execute();
        }
    });
    pnlBV.add(btnBVActivities, BorderLayout.WEST);
    pnlBV.add(txtBVWeeksBack, BorderLayout.EAST);
    pnlContent.add(pnlBV);

    /***
     *                                _       _       _
     *       ___ ___  _ __ ___  _ __ | | __ _(_)_ __ | |_ ___
     *      / __/ _ \| '_ ` _ \| '_ \| |/ _` | | '_ \| __/ __|
     *     | (_| (_) | | | | | | |_) | | (_| | | | | | |_\__ \
     *      \___\___/|_| |_| |_| .__/|_|\__,_|_|_| |_|\__|___/
     *                         |_|
     */
    JPanel pnlComplaints = new JPanel(new BorderLayout());
    final JButton btnComplaints = GUITools.createHyperlinkButton("opde.controlling.orga.complaints", null,
            null);
    int complaintsMonthBack;
    try {
        complaintsMonthBack = Integer
                .parseInt(OPDE.getProps().getProperty("opde.controlling::complaintsMonthBack"));
    } catch (NumberFormatException nfe) {
        complaintsMonthBack = 7;
    }
    final JTextField txtComplaintsMonthsBack = GUITools.createIntegerTextField(1, 12, complaintsMonthBack);
    txtComplaintsMonthsBack.setToolTipText(SYSTools.xx("misc.msg.monthsback"));

    btnComplaints.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            OPDE.getMainframe().setBlocked(true);
            SwingWorker worker = new SwingWorker() {
                @Override
                protected Object doInBackground() throws Exception {
                    SYSPropsTools.storeProp("opde.controlling::complaintsMonthBack",
                            txtComplaintsMonthsBack.getText(), OPDE.getLogin().getUser());

                    int monthsback = Integer.parseInt(txtComplaintsMonthsBack.getText());

                    String content = QProcessTools.getComplaintsAnalysis(monthsback, progressClosure);
                    content += NReportTools.getComplaints(
                            new LocalDate().minusMonths(monthsback).dayOfMonth().withMinimumValue(),
                            progressClosure);

                    SYSFilesTools.print(content, false);
                    return null;
                }

                @Override
                protected void done() {
                    OPDE.getDisplayManager().setProgressBarMessage(null);
                    OPDE.getMainframe().setBlocked(false);
                }
            };
            worker.execute();
        }
    });
    pnlComplaints.add(btnComplaints, BorderLayout.WEST);
    pnlComplaints.add(txtComplaintsMonthsBack, BorderLayout.EAST);
    pnlContent.add(pnlComplaints);

    // ResInfoTypeTools.TYPE_NURSING_INSURANCE
    JPanel pnlInsuranceGrade = new JPanel(new BorderLayout());
    final JButton btnIG = GUITools.createHyperlinkButton("misc.msg.InsuranceGrades", null, null);

    btnIG.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            OPDE.getMainframe().setBlocked(true);
            SwingWorker worker = new SwingWorker() {
                @Override
                protected Object doInBackground() throws Exception {
                    String content = SYSConst.html_h1("misc.msg.InsuranceGrades");

                    String ul = "";
                    for (Resident resident : ResidentTools.getAllActive()) {
                        if (resident.getAdminonly() == ResidentTools.NORMAL) {

                            ul += SYSConst.html_li(SYSConst.html_bold(ResidentTools.getLabelText(resident)));

                            ResInfo insurance = ResInfoTools.getLastResinfo(resident,
                                    ResInfoTypeTools.TYPE_NURSING_INSURANCE);

                            String ins = "";
                            if (insurance == null) {
                                ins = SYSTools.xx("misc.msg.noentryyet");
                            } else {
                                Properties props = load(insurance.getProperties());
                                String grade = SYSTools.xx("ninsurance.grade." + props.getProperty("grade"));
                                ins = grade + (props.getProperty("grade").equals("assigned")
                                        ? ": " + props.getProperty("result")
                                        : "");
                            }

                            ul += SYSConst.html_ul(SYSConst.html_li(ins));
                        }
                    }

                    content += SYSConst.html_ul(ul);

                    SYSFilesTools.print(content, false);
                    return null;
                }

                @Override
                protected void done() {
                    OPDE.getDisplayManager().setProgressBarMessage(null);
                    OPDE.getMainframe().setBlocked(false);
                }
            };
            worker.execute();
        }
    });
    pnlInsuranceGrade.add(btnIG, BorderLayout.WEST);
    pnlContent.add(pnlInsuranceGrade);

    return pnlContent;
}

From source file:org.apache.jmeter.visualizers.RespTimeGraphVisualizer.java

private JPanel createGraphActionsPane() {
    JPanel buttonPanel = new JPanel(new BorderLayout());
    JPanel displayPane = new JPanel();
    displayPane.add(displayButton);//from w w w  . j  a  v  a2s  . c o  m
    displayButton.addActionListener(this);
    buttonPanel.add(displayPane, BorderLayout.WEST);

    JPanel savePane = new JPanel();
    savePane.add(saveGraph);
    saveGraph.addActionListener(this);
    syncWithName.addActionListener(this);
    buttonPanel.add(savePane, BorderLayout.EAST);

    return buttonPanel;
}

From source file:org.pentaho.reporting.ui.datasources.mondrian.MondrianDataSourceEditor.java

protected Component createContentPane() {

    // Create the connection panel
    final JPanel queryContentPanel = new JPanel(new BorderLayout());
    queryContentPanel.add(BorderLayout.NORTH, createQueryListPanel());
    queryContentPanel.add(BorderLayout.CENTER, createQueryDetailsPanel());

    final JdbcConnectionPanel connectionPanel = new JdbcConnectionPanel(dialogModel, context);
    connectionPanel.setSecurityConfigurationAvailable(false);

    // Create the content panel
    final JPanel dialogContent = new JPanel(new BorderLayout());
    dialogContent.add(BorderLayout.NORTH, createConnectionTopPanel());
    dialogContent.add(BorderLayout.WEST, connectionPanel);
    dialogContent.add(BorderLayout.CENTER, queryContentPanel);

    final JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab(Messages.getString("MondrianDataSourceEditor.DataSource"), dialogContent);
    tabbedPane.addTab(Messages.getString("MondrianDataSourceEditor.GlobalScripting"), createGlobalScriptTab());

    final JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.add(BorderLayout.SOUTH, createPreviewButtonsPanel());
    contentPane.add(BorderLayout.CENTER, tabbedPane);
    contentPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
    return contentPane;
}

From source file:org.jab.docsearch.DocSearch.java

/**
 * Constructor//  w  ww .j a  v a2 s. co m
 */
public DocSearch() {
    super(I18n.getString("ds.windowtitle"));

    // get logger
    logger = Logger.getLogger(getClass().getName());

    //
    File testCDFi = new File(cdRomDefaultHome);
    Properties sys = new Properties(System.getProperties());
    if (testCDFi.exists()) {
        sys.setProperty("disableLuceneLocks", "true");
        logger.info("DocSearch() Disabling Lucene Locks for CDROM indexes");
    } else {
        sys.setProperty("disableLuceneLocks", "false");
    }

    //
    checkCDROMDir();
    defaultHndlr = getBrowserFile();
    loadSettings();

    //
    pPanel = new ProgressPanel("", 100L);
    pPanel.init();

    phrase = new JRadioButton(I18n.getString("label.phrase"));
    searchField = new JComboBox();
    searchIn = new JComboBox(searchOptsLabels);
    JLabel searchTypeLabel = new JLabel(I18n.getString("label.search_type"));
    JLabel searchInLabel = new JLabel(I18n.getString("label.search_in"));
    keywords = new JRadioButton(I18n.getString("label.keyword"));
    //
    searchLabel = new JLabel(I18n.getString("label.search_for"));
    searchButton = new JButton(I18n.getString("button.search"));
    searchButton.setActionCommand("ac_search");
    searchButton.setMnemonic(KeyEvent.VK_A);
    // TODO alt text to resource
    htmlTag = "<img src=\"" + fEnv.getIconURL(FileType.HTML.getIcon())
            + "\" border=\"0\" alt=\"Web Page Document\">";
    wordTag = "<img src=\"" + fEnv.getIconURL(FileType.MS_WORD.getIcon())
            + "\" border=\"0\" alt=\"MS Word Document\">";
    excelTag = "<img src=\"" + fEnv.getIconURL(FileType.MS_EXCEL.getIcon())
            + "\" border=\"0\" alt=\"MS Excel Document\">";
    pdfTag = "<img src=\"" + fEnv.getIconURL(FileType.PDF.getIcon()) + "\" border=\"0\" alt=\"PDF Document\">";
    textTag = "<img src=\"" + fEnv.getIconURL(FileType.TEXT.getIcon())
            + "\" border=\"0\" alt=\"Text Document\">";
    rtfTag = "<img src=\"" + fEnv.getIconURL(FileType.RTF.getIcon()) + "\" border=\"0\" alt=\"RTF Document\">";
    ooImpressTag = "<img src=\"" + fEnv.getIconURL(FileType.OO_IMPRESS.getIcon())
            + "\" border=\"0\" alt=\"OpenOffice Impress Document\">";
    ooWriterTag = "<img src=\"" + fEnv.getIconURL(FileType.OO_WRITER.getIcon())
            + "\" border=\"0\" alt=\"OpenOffice Writer Document\">";
    ooCalcTag = "<img src=\"" + fEnv.getIconURL(FileType.OO_CALC.getIcon())
            + "\" border=\"0\" alt=\"OpenOffice Calc Document\">";
    ooDrawTag = "<img src=\"" + fEnv.getIconURL(FileType.OO_DRAW.getIcon())
            + "\" border=\"0\" alt=\"OpenOffice Draw Document\">";
    openDocumentTextTag = "<img src=\"" + fEnv.getIconURL(FileType.OPENDOCUMENT_TEXT.getIcon())
            + "\" border=\"0\" alt=\"OpenDocument Text Document\">";
    //
    idx = new Index(this);
    colors = new String[2];
    colors[0] = "ffeffa";
    colors[1] = "fdffda";
    if (env.isWebStart()) {
        startPageString = getClass().getResource("/" + FileEnvironment.FILENAME_START_PAGE_WS).toString();
        helpPageString = getClass().getResource("/" + FileEnvironment.FILENAME_HELP_PAGE_WS).toString();
        if (startPageString != null) {
            logger.debug("DocSearch() Start Page is: " + startPageString);
            hasStartPage = true;
        } else {
            logger.error("DocSearch() Start Page NOT FOUND where expected: " + startPageString);
        }
    } else {
        startPageString = FileUtils.addFolder(fEnv.getStartDirectory(), FileEnvironment.FILENAME_START_PAGE);
        helpPageString = FileUtils.addFolder(fEnv.getStartDirectory(), FileEnvironment.FILENAME_HELP_PAGE);
        File startPageFile = new File(startPageString);
        if (startPageFile.exists()) {
            logger.debug("DocSearch() Start Page is: " + startPageString);
            hasStartPage = true;
        } else {
            logger.error("DocSearch() Start Page NOT FOUND where expected: " + startPageString);
        }
    }

    defaultSaveFolder = FileUtils.addFolder(fEnv.getWorkingDirectory(), "saved_searches");
    searchField.setEditable(true);
    searchField.addItem("");

    bg = new ButtonGroup();
    bg.add(phrase);
    bg.add(keywords);
    keywords.setSelected(true);

    keywords.setToolTipText(I18n.getString("tooltip.keyword"));
    phrase.setToolTipText(I18n.getString("tooltip.phrase"));

    int iconInt = 2;
    searchField.setPreferredSize(new Dimension(370, 22));

    // application icon
    Image iconImage = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/ds.gif"));
    this.setIconImage(iconImage);

    // menu bar
    JMenuBar menuBar = createMenuBar();
    // add menu to frame
    setJMenuBar(menuBar);

    // tool bar
    JToolBar toolbar = createToolBar();

    editorPane = new JEditorPane("text/html", lastSearch);
    editorPane.setEditable(false);
    editorPane.addHyperlinkListener(new Hyperactive());
    if (hasStartPage) {
        try {
            editorPane.setContentType("text/html");
            if (setPage("home")) {
                logger.info("DocSearch() loaded start page: " + startPageString);
            }
        } catch (Exception e) {
            editorPane.setText(lastSearch);
        }
    } else {
        logger.warn("DocSearch() no start page loaded");
    }

    scrollPane = new JScrollPane(editorPane);
    scrollPane.setPreferredSize(new Dimension(1024, 720));
    scrollPane.setMinimumSize(new Dimension(900, 670));
    scrollPane.setMaximumSize(new Dimension(1980, 1980));

    // create panels
    // add printing stuff
    vista = new JComponentVista(editorPane, new PageFormat());

    JPanel topPanel = new JPanel();
    topPanel.add(searchLabel);
    topPanel.add(searchField);
    topPanel.add(searchButton);

    JPanel bottomPanel = new JPanel();
    bottomPanel.add(searchTypeLabel);
    bottomPanel.add(keywords);
    bottomPanel.add(phrase);
    bottomPanel.add(searchInLabel);
    bottomPanel.add(searchIn);

    // GUI items for advanced searching
    useDate = new JCheckBox(I18n.getString("label.use_date_property"));
    fromField = new JTextField(11);
    JLabel fromLabel = new JLabel(I18n.getString("label.from"));
    JLabel toLabel = new JLabel(I18n.getString("label.to"));
    toField = new JTextField(11);
    cbl = new CheckBoxListener();
    authorPanel = new JPanel();
    useAuthor = new JCheckBox(I18n.getString("label.use_auth_property"));
    authorField = new JTextField(31);
    JLabel authorLabel = new JLabel(I18n.getString("label.author"));
    authorPanel.add(useAuthor);
    authorPanel.add(authorLabel);
    authorPanel.add(authorField);

    // combine stuff
    JPanel datePanel = new JPanel();
    datePanel.add(useDate);
    datePanel.add(fromLabel);
    datePanel.add(fromField);
    datePanel.add(toLabel);
    datePanel.add(toField);

    JPanel metaPanel = new JPanel();
    metaPanel.setLayout(new BorderLayout());
    metaPanel.setBorder(new TitledBorder(I18n.getString("label.date_and_author")));
    metaPanel.add(datePanel, BorderLayout.NORTH);
    metaPanel.add(authorPanel, BorderLayout.SOUTH);

    useDate.addActionListener(cbl);
    useAuthor.addActionListener(cbl);

    fromField.setText(DateTimeUtils.getLastYear());
    toField.setText(DateTimeUtils.getToday());
    authorField.setText(System.getProperty("user.name"));

    JPanel[] panels = new JPanel[numPanels];
    for (int i = 0; i < numPanels; i++) {
        panels[i] = new JPanel();
    }

    // add giu to panels
    panels[0].setLayout(new BorderLayout());
    panels[0].add(topPanel, BorderLayout.NORTH);
    panels[0].add(bottomPanel, BorderLayout.SOUTH);
    panels[0].setBorder(new TitledBorder(I18n.getString("label.search_critera")));
    searchButton.addActionListener(this);

    JPanel fileTypePanel = new JPanel();
    useType = new JCheckBox(I18n.getString("label.use_filetype_property"));
    useType.addActionListener(cbl);
    fileType = new JComboBox(fileTypesToFindLabel);
    JLabel fileTypeLabel = new JLabel(I18n.getString("label.find_only_these_filetypes"));
    fileTypePanel.add(useType);
    fileTypePanel.add(fileTypeLabel);
    fileTypePanel.add(fileType);

    JPanel sizePanel = new JPanel();
    useSize = new JCheckBox(I18n.getString("label.use_filesize_property"));
    useSize.addActionListener(cbl);
    // TODO l18n kbytes
    JLabel sizeFromLabel = new JLabel(I18n.getString("label.from") + " KByte");
    JLabel sizeToLabel = new JLabel(I18n.getString("label.to") + " KByte");
    sizeFromField = new JTextField(10);
    sizeFromField.setText("0");
    sizeToField = new JTextField(10);
    sizeToField.setText("100");
    sizePanel.add(useSize);
    sizePanel.add(sizeFromLabel);
    sizePanel.add(sizeFromField);
    sizePanel.add(sizeToLabel);
    sizePanel.add(sizeToField);

    JPanel sizeAndTypePanel = new JPanel();
    sizeAndTypePanel.setLayout(new BorderLayout());
    sizeAndTypePanel.setBorder(new TitledBorder(I18n.getString("label.filetype_and_size")));
    sizeAndTypePanel.add(fileTypePanel, BorderLayout.NORTH);
    sizeAndTypePanel.add(sizePanel, BorderLayout.SOUTH);

    // set up the tabbed pane
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab(I18n.getString("label.general"), null, panels[0],
            I18n.getString("tooltip.general_search_criteria"));
    tabbedPane.addTab(I18n.getString("label.date_and_author"), null, metaPanel,
            I18n.getString("tooltip.date_auth_options"));
    tabbedPane.addTab(I18n.getString("label.filetype_and_size"), null, sizeAndTypePanel,
            I18n.getString("tooltip.filetype_and_size_options"));

    // gridbag
    getContentPane().setLayout(new GridLayout(1, numPanels + iconInt + 1));
    GridBagLayout gridbaglayout = new GridBagLayout();
    GridBagConstraints gridbagconstraints = new GridBagConstraints();
    getContentPane().setLayout(gridbaglayout);

    gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
    gridbagconstraints.insets = new Insets(1, 1, 1, 1);
    gridbagconstraints.gridx = 0;
    gridbagconstraints.gridy = 0;
    gridbagconstraints.gridwidth = 1;
    gridbagconstraints.gridheight = 1;
    gridbagconstraints.weightx = 1.0D;
    gridbagconstraints.weighty = 0.0D;
    gridbaglayout.setConstraints(toolbar, gridbagconstraints);
    getContentPane().add(toolbar);

    int start = 1;
    for (int i = 0; i < numPanels; i++) {
        if (i == 0) {
            gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
            gridbagconstraints.insets = new Insets(1, 1, 1, 1);
            gridbagconstraints.gridx = 0;
            gridbagconstraints.gridy = i + start;
            gridbagconstraints.gridwidth = 1;
            gridbagconstraints.gridheight = 1;
            gridbagconstraints.weightx = 1.0D;
            gridbagconstraints.weighty = 0.0D;
            gridbaglayout.setConstraints(tabbedPane, gridbagconstraints);
            getContentPane().add(tabbedPane);
        } else {
            gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
            gridbagconstraints.insets = new Insets(1, 1, 1, 1);
            gridbagconstraints.gridx = 0;
            gridbagconstraints.gridy = i + start;
            gridbagconstraints.gridwidth = 1;
            gridbagconstraints.gridheight = 1;
            gridbagconstraints.weightx = 1.0D;
            gridbagconstraints.weighty = 0.0D;
            gridbaglayout.setConstraints(panels[i], gridbagconstraints);
            getContentPane().add(panels[i]);
        }
    }

    // now add the results area
    gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
    gridbagconstraints.insets = new Insets(1, 1, 1, 1);
    gridbagconstraints.gridx = 0;
    gridbagconstraints.gridy = iconInt;
    gridbagconstraints.gridwidth = 1;
    gridbagconstraints.gridheight = 1;
    gridbagconstraints.weightx = 1.0D;
    gridbagconstraints.weighty = 1.0D;
    gridbaglayout.setConstraints(scrollPane, gridbagconstraints);
    getContentPane().add(scrollPane);
    JPanel statusP = new JPanel();
    statusP.setLayout(new BorderLayout());
    statusP.add(dirLabel, BorderLayout.WEST);
    statusP.add(pPanel, BorderLayout.EAST);

    // now add the status label
    gridbagconstraints.fill = GridBagConstraints.HORIZONTAL;
    gridbagconstraints.insets = new Insets(1, 1, 1, 1);
    gridbagconstraints.gridx = 0;
    gridbagconstraints.gridy = numPanels + iconInt;
    gridbagconstraints.gridwidth = 1;
    gridbagconstraints.gridheight = 1;
    gridbagconstraints.weightx = 1.0D;
    gridbagconstraints.weighty = 0.0D;
    gridbaglayout.setConstraints(statusP, gridbagconstraints);
    getContentPane().add(statusP);

    //
    File testArchDir = new File(fEnv.getArchiveDirectory());
    if (!testArchDir.exists()) {
        boolean madeDir = testArchDir.mkdir();
        if (!madeDir) {
            logger.warn("DocSearch() Error creating directory: " + fEnv.getArchiveDirectory());
        } else {
            logger.info("DocSearch() Directory created: " + fEnv.getArchiveDirectory());
        }
    }
    loadIndexes();

    // DocTypeHandler
    String handlersFiName;
    if (!isCDSearchTool) {
        handlersFiName = FileUtils.addFolder(fEnv.getWorkingDirectory(), DocTypeHandlerUtils.HANDLER_FILE);
    } else {
        handlersFiName = FileUtils.addFolder(cdRomDefaultHome, DocTypeHandlerUtils.HANDLER_FILE);
    }
    DocTypeHandlerUtils dthUtils = new DocTypeHandlerUtils();
    if (!FileUtils.fileExists(handlersFiName)) {
        logger.warn("DocSearch() Handlers file not found at: " + handlersFiName);
        handlerList = dthUtils.getInitialHandler(env);
    } else {
        handlerList = dthUtils.loadHandler(handlersFiName);
    }
}

From source file:org.pentaho.reporting.tools.configeditor.ConfigDescriptionEditor.java

/**
 * Creates the statusbar for this frame. Use setStatus() to display text on the status bar.
 *
 * @return the status bar.// w w w. j ava  2  s  . co m
 */
protected JPanel createStatusBar() {
    final JPanel statusPane = new JPanel();
    statusPane.setLayout(new BorderLayout());
    statusPane.setBorder(BorderFactory.createLineBorder(UIManager.getDefaults().getColor("controlShadow"))); //$NON-NLS-1$
    statusHolder = new JLabel(" "); //$NON-NLS-1$
    statusPane.setMinimumSize(statusHolder.getPreferredSize());
    statusPane.add(statusHolder, BorderLayout.WEST);

    return statusPane;
}

From source file:edu.ku.brc.specify.tasks.subpane.qb.QueryBldrPane.java

/**
 * create the query builder UI.//from   ww w  .j av a 2s . c  o  m
 */
protected void createUI() {
    removeAll();

    JMenuItem saveItem = new JMenuItem(UIRegistry.getResourceString("QB_SAVE"));
    Action saveActionListener = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            if (saveQuery(false)) {
                try {
                    String selId = null;
                    if (selectedQFP != null && selectedQFP.getQueryField() != null) {
                        selId = selectedQFP.getQueryField().getStringId();
                    }
                    final String selectedFldId = selId;
                    setupUI(true);
                    SwingUtilities.invokeLater(new Runnable() {

                        /* (non-Javadoc)
                         * @see java.lang.Runnable#run()
                         */
                        @Override
                        public void run() {
                            if (selectedFldId != null) {
                                for (QueryFieldPanel qfp : queryFieldItems) {
                                    if (qfp.getQueryField() != null
                                            && selectedFldId.equals(qfp.getQueryField().getStringId())) {
                                        selectQFP(qfp);
                                        return;
                                    }
                                }
                                selectQFP(queryFieldItems.get(0));
                            }
                        }

                    });
                } catch (Exception ex) {

                }
                setSaveBtnEnabled(false);
            }
        }
    };
    saveItem.addActionListener(saveActionListener);

    JMenuItem saveAsItem = new JMenuItem(UIRegistry.getResourceString("QB_SAVE_AS"));
    Action saveAsActionListener = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            if (saveQuery(true)) {
                setSaveBtnEnabled(false);
            }
        }
    };
    saveAsItem.addActionListener(saveAsActionListener);
    JComponent[] itemSample = { saveItem, saveAsItem };
    saveBtn = new DropDownButton(UIRegistry.getResourceString("QB_SAVE"), null, 1,
            java.util.Arrays.asList(itemSample));
    saveBtn.addActionListener(saveActionListener);
    String ACTION_KEY = "SAVE";
    KeyStroke ctrlS = KeyStroke.getKeyStroke(KeyEvent.VK_S,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
    InputMap inputMap = saveBtn.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    inputMap.put(ctrlS, ACTION_KEY);
    ActionMap actionMap = saveBtn.getActionMap();
    actionMap.put(ACTION_KEY, saveActionListener);
    ACTION_KEY = "SAVE_AS";
    KeyStroke ctrlA = KeyStroke.getKeyStroke(KeyEvent.VK_A,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
    inputMap.put(ctrlA, ACTION_KEY);
    actionMap.put(ACTION_KEY, saveAsActionListener);
    saveBtn.setActionMap(actionMap);

    UIHelper.setControlSize(saveBtn);
    //saveBtn.setOverrideBorder(true, BasicBorders.getButtonBorder());

    listBoxPanel = new JPanel(new HorzLayoutManager(2, 2));

    Vector<TableQRI> list = new Vector<TableQRI>();
    for (int k = 0; k < tableTree.getKids(); k++) {
        list.add(tableTree.getKid(k).getTableQRI());
    }

    Collections.sort(list);
    DefaultListModel model = new DefaultListModel();
    for (TableQRI qri : list) {
        model.addElement(qri);
    }

    tableList = new JList(model);
    QryListRenderer qr = new QryListRenderer(IconManager.IconSize.Std16);
    qr.setDisplayKidIndicator(false);
    tableList.setCellRenderer(qr);

    JScrollPane spt = new JScrollPane(tableList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    Dimension pSize = spt.getPreferredSize();
    pSize.height = 200;
    spt.setPreferredSize(pSize);

    JPanel topPanel = new JPanel(new BorderLayout());

    scrollPane = new JScrollPane(listBoxPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    tableList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                int inx = tableList.getSelectedIndex();
                if (inx > -1) {
                    fillNextList(tableList);
                } else {
                    listBoxPanel.removeAll();
                }
            }
        }
    });

    addBtn = new JButton(IconManager.getImage("PlusSign", IconManager.IconSize.Std16));
    addBtn.setEnabled(false);
    addBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            BaseQRI qri = (BaseQRI) listBoxList.get(currentInx).getSelectedValue();
            if (qri.isInUse) {
                return;
            }

            try {
                FieldQRI fieldQRI = buildFieldQRI(qri);
                if (fieldQRI == null) {
                    throw new Exception("null FieldQRI");
                }
                SpQueryField qf = new SpQueryField();
                qf.initialize();
                qf.setFieldName(fieldQRI.getFieldName());
                qf.setStringId(fieldQRI.getStringId());
                query.addReference(qf, "fields");

                if (!isExportMapping) {
                    addQueryFieldItem(fieldQRI, qf, false);
                } else {
                    addNewMapping(fieldQRI, qf, null, false);
                }
            } catch (Exception ex) {
                log.error(ex);
                UsageTracker.incrHandledUsageCount();
                edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(QueryBldrPane.class, ex);
                return;
            }
        }
    });

    contextPanel = new JPanel(new BorderLayout());
    contextPanel.add(createLabel("Search Context", SwingConstants.CENTER), BorderLayout.NORTH); // I18N
    contextPanel.add(spt, BorderLayout.CENTER);
    contextPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));

    JPanel schemaPanel = new JPanel(new BorderLayout());
    schemaPanel.add(scrollPane, BorderLayout.CENTER);

    topPanel.add(contextPanel, BorderLayout.WEST);
    topPanel.add(schemaPanel, BorderLayout.CENTER);
    add(topPanel, BorderLayout.NORTH);

    queryFieldsPanel = new JPanel();
    queryFieldsPanel.setLayout(new NavBoxLayoutManager(0, 2));
    queryFieldsScroll = new JScrollPane(queryFieldsPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    queryFieldsScroll.setBorder(null);
    add(queryFieldsScroll);

    //if (!isExportMapping)
    //{
    final JPanel mover = buildMoverPanel(false);
    add(mover, BorderLayout.EAST);
    // }

    String searchLbl = schemaMapping == null ? getResourceString("QB_SEARCH")
            : getResourceString("QB_EXPORT_PREVIEW");
    searchBtn = createButton(searchLbl);
    searchBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            //               int m = ae.getModifiers();
            //               boolean ors = (m & ActionEvent.ALT_MASK) > 0 && (m & ActionEvent.CTRL_MASK) > 0 && (m & ActionEvent.SHIFT_MASK) > 0;
            //               if (ors)
            //               {
            //                  System.out.println("Disjunctional conjoinment desire gesture detected");
            //               }
            //               doSearch(ors);
            doSearch(false);
        }
    });
    distinctChk = createCheckBox(UIRegistry.getResourceString("QB_DISTINCT"));
    distinctChk.setVisible(schemaMapping == null);
    if (schemaMapping == null) {
        distinctChk.setSelected(false);
        distinctChk.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                new SwingWorker() {

                    /* (non-Javadoc)
                     * @see edu.ku.brc.helpers.SwingWorker#construct()
                     */
                    @Override
                    public Object construct() {
                        if (distinctChk.isSelected()) {
                            UsageTracker.incrUsageCount("QB.DistinctOn");
                        } else {
                            UsageTracker.incrUsageCount("QB.DistinctOff");
                        }
                        if ((isTreeLevelSelected() || isAggFieldSelected()) && countOnly
                                && distinctChk.isSelected()) {
                            countOnlyChk.setSelected(false);
                            countOnly = false;
                        }
                        query.setCountOnly(countOnly);
                        query.setSelectDistinct(distinctChk.isSelected());
                        setSaveBtnEnabled(thereAreItems());
                        return null;
                    }
                }.start();
            }
        });
    }
    countOnlyChk = createCheckBox(UIRegistry.getResourceString("QB_COUNT_ONLY"));
    countOnlyChk.setSelected(false);
    countOnlyChk.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            new SwingWorker() {

                /* (non-Javadoc)
                 * @see edu.ku.brc.helpers.SwingWorker#construct()
                 */
                @Override
                public Object construct() {
                    //Don't allow change while query is running.
                    if (runningResults.get() == null) {
                        countOnly = !countOnly;
                        if (countOnly) {
                            UsageTracker.incrUsageCount("QB.CountOnlyOn");
                        } else {
                            UsageTracker.incrUsageCount("QB.CountOnlyOff");
                        }
                        if ((isTreeLevelSelected() || isAggFieldSelected()) && countOnly
                                && (distinctChk.isSelected() || searchSynonymyChk.isSelected())) {
                            distinctChk.setSelected(false);
                            searchSynonymyChk.setSelected(false);
                        }
                    } else {
                        //This might be awkward and/or klunky...
                        countOnlyChk.setSelected(countOnly);
                    }
                    query.setCountOnly(countOnly);
                    query.setSelectDistinct(distinctChk.isSelected());
                    setSaveBtnEnabled(thereAreItems());
                    return null;
                }
            }.start();
        }
    });

    searchSynonymyChk = createCheckBox(UIRegistry.getResourceString("QB_SRCH_SYNONYMS"));
    searchSynonymyChk.setSelected(searchSynonymy);
    searchSynonymyChk.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            new SwingWorker() {

                /* (non-Javadoc)
                 * @see edu.ku.brc.helpers.SwingWorker#construct()
                 */
                @Override
                public Object construct() {
                    searchSynonymy = !searchSynonymy;
                    if (!searchSynonymy) {
                        UsageTracker.incrUsageCount("QB.SearchSynonymyOff");
                    } else {
                        UsageTracker.incrUsageCount("QB.SearchSynonymyOn");
                    }
                    if (isTreeLevelSelected() && countOnly && searchSynonymyChk.isSelected()) {
                        countOnlyChk.setSelected(false);
                        countOnly = false;
                    }
                    query.setSearchSynonymy(searchSynonymy);
                    setSaveBtnEnabled(thereAreItems());
                    return null;
                }
            }.start();
        }
    });

    smushedChk = createCheckBox(UIRegistry.getResourceString("QB_SMUSH_RESULTS"));
    smushedChk.setVisible(isSmushableContext());
    if (isSmushableContext()) {
        smushedChk.setSelected(smushed);
        smushedChk.setToolTipText(
                String.format(UIRegistry.getResourceString("QB_SMUSH_RESULTS_HINT"), getCatalogNumberTitle()));
        smushedChk.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                new SwingWorker() {

                    /*
                     * (non-Javadoc)
                     * 
                     * @see edu.ku.brc.helpers.SwingWorker#construct()
                     */
                    @Override
                    public Object construct() {
                        smushed = !smushed;
                        if (!smushed) {
                            UsageTracker.incrUsageCount("QB.SmushedOff");
                        } else {
                            UsageTracker.incrUsageCount("QB.SmushedOn");
                        }
                        query.setSmushed(smushed);
                        setSaveBtnEnabled(thereAreItems());
                        return null;
                    }
                }.start();
            }
        });
    }

    PanelBuilder outer = new PanelBuilder(
            new FormLayout("p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p, 6dlu, p", "p"));

    CellConstraints cc = new CellConstraints();
    outer.add(smushedChk, cc.xy(1, 1));
    outer.add(searchSynonymyChk, cc.xy(3, 1));
    outer.add(distinctChk, cc.xy(5, 1));
    outer.add(countOnlyChk, cc.xy(7, 1));
    outer.add(searchBtn, cc.xy(9, 1));
    outer.add(saveBtn, cc.xy(11, 1));

    JPanel bottom = new JPanel(new BorderLayout());
    bottom.add(outer.getPanel(), BorderLayout.EAST);

    JButton helpBtn = UIHelper.createHelpIconButton(getHelpBtnContext());
    bottom.add(helpBtn, BorderLayout.WEST);
    add(bottom, BorderLayout.SOUTH);

    setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
}

From source file:org.pentaho.reporting.ui.datasources.mondrian.MondrianDataSourceEditor.java

private JPanel createQueryListPanel() {
    // Create the query list panel
    final RemoveQueryAction queryRemoveAction = new RemoveQueryAction();
    dialogModel.addPropertyChangeListener(queryRemoveAction);

    final JPanel theQueryButtonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 5));
    theQueryButtonsPanel.add(new BorderlessButton(new AddQueryAction()));
    theQueryButtonsPanel.add(new BorderlessButton(queryRemoveAction));

    final JPanel theQueryControlsPanel = new JPanel(new BorderLayout());
    theQueryControlsPanel.add(new JLabel(Messages.getString("MondrianDataSourceEditor.AvailableQueriesLabel")),
            BorderLayout.WEST);
    theQueryControlsPanel.add(theQueryButtonsPanel, BorderLayout.EAST);

    final JPanel queryListPanel = new JPanel(new BorderLayout());
    queryListPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
    queryListPanel.add(BorderLayout.NORTH, theQueryControlsPanel);
    queryListPanel.add(BorderLayout.CENTER, new JScrollPane(queryNameList));
    return queryListPanel;
}

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

/**
 * Create the panel.//from  w  w w  . j  av  a 2 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:org.pentaho.reporting.ui.datasources.mondrian.MondrianDataSourceEditor.java

private JPanel createQueryDetailsPanel() {
    final JPanel queryNamePanel = new JPanel(new BorderLayout());
    queryNamePanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
    queryNamePanel.add(new JLabel(Messages.getString("MondrianDataSourceEditor.QueryNameLabel")),
            BorderLayout.NORTH);/* w  w w.jav  a 2s. c o m*/
    queryNamePanel.add(queryNameTextField, BorderLayout.SOUTH);

    final JPanel queryControlPanel = new JPanel(new BorderLayout());
    queryControlPanel.add(new JLabel(Messages.getString("MondrianDataSourceEditor.QueryLabel")),
            BorderLayout.WEST);

    final JPanel queryPanel = new JPanel(new BorderLayout());
    queryPanel.add(queryControlPanel, BorderLayout.NORTH);
    queryPanel.add(new JScrollPane(queryTextArea), BorderLayout.CENTER);
    queryPanel.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));

    final JTabbedPane queryScriptTabPane = new JTabbedPane();
    queryScriptTabPane.addTab(Messages.getString("MondrianDataSourceEditor.StaticQuery"), queryPanel);
    queryScriptTabPane.addTab(Messages.getString("MondrianDataSourceEditor.QueryScripting"),
            createQueryScriptTab());

    // Create the query details panel
    final JPanel queryDetailsPanel = new JPanel(new BorderLayout());
    queryDetailsPanel.add(BorderLayout.NORTH, queryNamePanel);
    queryDetailsPanel.add(BorderLayout.CENTER, queryScriptTabPane);
    return queryDetailsPanel;
}

From source file:edu.ucla.stat.SOCR.analyses.gui.Survival.java

protected void setMappingPanel() {
    //////////////System.out.println("Survival mappingPanel = " + mappingPanel);
    listIndex = new int[dataTable.getColumnCount()];
    for (int j = 0; j < listIndex.length; j++)
        listIndex[j] = 1;/* w  w  w.  jav  a  2 s  .  c  o m*/
    bPanel = new JPanel(new BorderLayout());
    mappingInnerPanel = new JPanel(new GridLayout(1, 3));
    mappingPanel.add(mappingInnerPanel, BorderLayout.CENTER);
    mappingInnerPanel.setBackground(Color.WHITE);

    addButton1.addActionListener(this);
    addButton2.addActionListener(this);
    addButton3.addActionListener(this);
    removeButton1.addActionListener(this);
    removeButton2.addActionListener(this);
    removeButton3.addActionListener(this);
    ////////////////System.out.println("Survival mappingPanel = " + mappingPanel);

    lModel1 = new DefaultListModel();
    lModel2 = new DefaultListModel();
    lModel3 = new DefaultListModel();
    lModel4 = new DefaultListModel();

    int cellWidth = 10;

    listAdded = new JList(lModel1);
    listAdded.setSelectedIndex(0);
    listTime = new JList(lModel2);
    listCensor = new JList(lModel3);
    listGroupNames = new JList(lModel4);

    paintTable(listIndex);
    listAdded.setFixedCellWidth(cellWidth);
    listTime.setFixedCellWidth(cellWidth);
    listCensor.setFixedCellWidth(cellWidth);
    listGroupNames.setFixedCellWidth(cellWidth);

    //tools1.setBackground(Color.RED);
    //tools2.setBackground(Color.GREEN);
    //tools3.setBackground(Color.BLUE);

    listAdded.setBackground(Color.WHITE);
    listTime.setBackground(Color.WHITE);
    listCensor.setBackground(Color.WHITE);
    listGroupNames.setBackground(Color.WHITE);

    tools1.add(timeLabel);
    tools2.add(censorLabel);
    tools3.add(groupNameLabel);

    tools1.add(addButton1);
    tools1.add(removeButton1);

    tools2.add(addButton2);
    tools2.add(removeButton2);

    tools3.add(addButton3);
    tools3.add(removeButton3);

    JPanel panelLeft = new JPanel(new GridLayout(3, 1, 50, 50));
    JPanel panelCenter = new JPanel(new GridLayout(3, 1, 50, 50));
    JPanel panelRight = new JPanel(new GridLayout(3, 1, 50, 50));
    //JPanel dummyPanelLeft1 = null;//new JPanel();
    //JPanel dummyPanelBottom = null;//new JPanel();
    //dummyPanelMiddle.setVisible(false);
    //dummyPanelBottom.setVisible(false);

    mappingInnerPanel.add(panelLeft, BorderLayout.WEST);
    mappingInnerPanel.add(panelCenter, BorderLayout.CENTER);
    mappingInnerPanel.add(panelRight, BorderLayout.EAST);

    panelLeft.add(new JScrollPane(listAdded)); // var cadidates.

    panelCenter.add(tools1);
    panelRight.add(new JScrollPane(listTime));

    panelCenter.add(tools2);
    panelRight.add(new JScrollPane(listCensor));

    panelCenter.add(tools3);
    panelRight.add(new JScrollPane(listGroupNames));
}