Example usage for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS

List of usage examples for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS

Introduction

In this page you can find the example usage for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS.

Prototype

int HORIZONTAL_SCROLLBAR_ALWAYS

To view the source code for javax.swing ScrollPaneConstants HORIZONTAL_SCROLLBAR_ALWAYS.

Click Source Link

Document

Used to set the horizontal scroll bar policy so that horizontal scrollbars are always displayed.

Usage

From source file:MainClass.java

public static JScrollPane createPagingScrollPaneForTable(JTable jt) {
    JScrollPane jsp = new JScrollPane(jt);
    TableModel tmodel = jt.getModel();
    if (!(tmodel instanceof PagingModel)) {
        return jsp;
    }// www. j  a  va2  s . c om

    final PagingModel model = (PagingModel) tmodel;
    final JButton upButton = new JButton("UP");
    upButton.setEnabled(false);
    final JButton downButton = new JButton("DOWN");
    if (model.getPageCount() <= 1) {
        downButton.setEnabled(false);
    }

    upButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            model.pageUp();

            if (model.getPageOffset() == 0) {
                upButton.setEnabled(false);
            }
            downButton.setEnabled(true);
        }
    });

    downButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            model.pageDown();
            if (model.getPageOffset() == (model.getPageCount() - 1)) {
                downButton.setEnabled(false);
            }
            upButton.setEnabled(true);
        }
    });

    jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    jsp.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, upButton);
    jsp.setCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER, downButton);

    return jsp;
}

From source file:edu.ku.brc.specify.config.SpecifyExceptionTracker.java

@Override
protected FeedBackSenderItem getFeedBackSenderItem(final Class<?> cls, final Exception exception) {
    CellConstraints cc = new CellConstraints();
    PanelBuilder pb = new PanelBuilder(new FormLayout("p,2px,p,f:p:g", "p,8px,p,2px, p,4px,p,2px,f:p:g"));

    Vector<Taskable> taskItems = new Vector<Taskable>(TaskMgr.getInstance().getAllTasks());
    Collections.sort(taskItems, new Comparator<Taskable>() {
        @Override/*  w ww.j  a  v  a  2s.c om*/
        public int compare(Taskable o1, Taskable o2) {
            return o1.getName().compareTo(o2.getName());
        }
    });

    final JTextArea commentsTA = createTextArea(3, 60);
    final JTextArea stackTraceTA = createTextArea(15, 60);
    final JCheckBox moreBtn;

    commentsTA.setWrapStyleWord(true);
    commentsTA.setLineWrap(true);

    //JLabel desc = createI18NLabel("UNHDL_EXCP", SwingConstants.LEFT);
    JEditorPane desc = new JEditorPane("text/html", getResourceString("UNHDL_EXCP"));
    desc.setEditable(false);
    desc.setOpaque(false);
    //desc.setFont(new Font(Font.SANS_SERIF, Font.BOLD, (new JLabel("X")).getFont().getSize()));

    JScrollPane sp = new JScrollPane(stackTraceTA, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    int y = 1;
    pb.add(desc, cc.xyw(1, y, 4));
    y += 2;
    pb.add(createI18NFormLabel("UNHDL_EXCP_CMM"), cc.xy(1, y));
    y += 2;
    pb.add(createScrollPane(commentsTA, true), cc.xyw(1, y, 4));
    y += 2;

    forwardImgIcon = IconManager.getIcon("Forward"); //$NON-NLS-1$
    downImgIcon = IconManager.getIcon("Down"); //$NON-NLS-1$
    moreBtn = new JCheckBox(getResourceString("LOGIN_DLG_MORE"), forwardImgIcon); //$NON-NLS-1$
    setControlSize(moreBtn);
    JButton copyBtn = createI18NButton("UNHDL_EXCP_COPY");

    PanelBuilder innerPB = new PanelBuilder(new FormLayout("p,2px,f:p:g", "p,2px,p:g,2px,p"));
    innerPB.add(createI18NLabel("UNHDL_EXCP_STK"), cc.xy(1, 1));
    innerPB.add(sp, cc.xyw(1, 3, 3));
    innerPB.add(copyBtn, cc.xy(1, 5));
    stackTracePanel = innerPB.getPanel();
    stackTracePanel.setVisible(false);

    pb.add(moreBtn, cc.xyw(1, y, 4));
    y += 2;
    pb.add(stackTracePanel, cc.xyw(1, y, 4));
    y += 2;

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    exception.printStackTrace(new PrintStream(baos));

    stackTraceTA.setText(baos.toString());

    moreBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (stackTracePanel.isVisible()) {
                stackTracePanel.setVisible(false);
                moreBtn.setIcon(forwardImgIcon);
            } else {
                stackTracePanel.setVisible(true);
                moreBtn.setIcon(downImgIcon);
            }
            if (dlg != null) {
                dlg.pack();
            }
        }
    });

    copyBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String taskName = getTaskName();
            FeedBackSenderItem item = new FeedBackSenderItem(taskName, "", "", commentsTA.getText(),
                    stackTraceTA.getText(), cls.getName());
            NameValuePair[] pairs = createPostParameters(item);

            StringBuilder sb = new StringBuilder();
            for (NameValuePair pair : pairs) {
                if (!pair.getName().equals("bug")) {
                    sb.append(pair.getName());
                    sb.append(": ");
                    if (pair.getName().equals("comments") || pair.getName().equals("stack_trace")) {
                        sb.append("\n");
                    }
                    sb.append(pair.getValue());
                    sb.append("\n");
                }
            }

            // Copy to Clipboard
            UIHelper.setTextToClipboard(sb.toString());
        }
    });

    pb.setDefaultDialogBorder();
    dlg = new CustomDialog((Frame) null, getResourceString("UnhandledExceptionTitle"), true,
            CustomDialog.OK_BTN, pb.getPanel());
    dlg.setOkLabel(getResourceString("UNHDL_EXCP_SEND"));

    dlg.createUI();
    stackTracePanel.setVisible(false);

    centerAndShow(dlg);

    String taskName = getTaskName();
    FeedBackSenderItem item = new FeedBackSenderItem(taskName, "", "", commentsTA.getText(),
            stackTraceTA.getText(), cls.getName());
    return item;
}

From source file:components.SharedModelDemo.java

public SharedModelDemo() {
    super(new BorderLayout());

    Vector data = new Vector(7);
    String[] columnNames = { "French", "Spanish", "Italian" };
    String[] oneData = { "un", "uno", "uno" };
    String[] twoData = { "deux", "dos", "due" };
    String[] threeData = { "trois", "tres", "tre" };
    String[] fourData = { "quatre", "cuatro", "quattro" };
    String[] fiveData = { "cinq", "cinco", "cinque" };
    String[] sixData = { "six", "seis", "sei" };
    String[] sevenData = { "sept", "siete", "sette" };

    //Build the model.
    SharedDataModel dataModel = new SharedDataModel(columnNames);
    dataModel.addElement(oneData);/*w w w .  j  a  va 2  s .  c o m*/
    dataModel.addElement(twoData);
    dataModel.addElement(threeData);
    dataModel.addElement(fourData);
    dataModel.addElement(fiveData);
    dataModel.addElement(sixData);
    dataModel.addElement(sevenData);

    list = new JList(dataModel);
    list.setCellRenderer(new DefaultListCellRenderer() {
        public Component getListCellRendererComponent(JList l, Object value, int i, boolean s, boolean f) {
            String[] array = (String[]) value;
            return super.getListCellRendererComponent(l, array[0], i, s, f);
        }
    });

    listSelectionModel = list.getSelectionModel();
    listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
    JScrollPane listPane = new JScrollPane(list);

    table = new JTable(dataModel);
    table.setSelectionModel(listSelectionModel);
    JScrollPane tablePane = new JScrollPane(table);

    //Build control area (use default FlowLayout).
    JPanel controlPane = new JPanel();
    String[] modes = { "SINGLE_SELECTION", "SINGLE_INTERVAL_SELECTION", "MULTIPLE_INTERVAL_SELECTION" };

    final JComboBox comboBox = new JComboBox(modes);
    comboBox.setSelectedIndex(2);
    comboBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String newMode = (String) comboBox.getSelectedItem();
            if (newMode.equals("SINGLE_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            } else if (newMode.equals("SINGLE_INTERVAL_SELECTION")) {
                listSelectionModel.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            } else {
                listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            }
            output.append("----------" + "Mode: " + newMode + "----------" + newline);
        }
    });
    controlPane.add(new JLabel("Selection mode:"));
    controlPane.add(comboBox);

    //Build output area.
    output = new JTextArea(10, 40);
    output.setEditable(false);
    JScrollPane outputPane = new JScrollPane(output, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    //Do the layout.
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    add(splitPane, BorderLayout.CENTER);

    JPanel topHalf = new JPanel();
    topHalf.setLayout(new BoxLayout(topHalf, BoxLayout.X_AXIS));
    JPanel listContainer = new JPanel(new GridLayout(1, 1));
    listContainer.setBorder(BorderFactory.createTitledBorder("List"));
    listContainer.add(listPane);
    JPanel tableContainer = new JPanel(new GridLayout(1, 1));
    tableContainer.setBorder(BorderFactory.createTitledBorder("Table"));
    tableContainer.add(tablePane);
    tablePane.setPreferredSize(new Dimension(300, 100));
    topHalf.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 5));
    topHalf.add(listContainer);
    topHalf.add(tableContainer);

    topHalf.setMinimumSize(new Dimension(400, 50));
    topHalf.setPreferredSize(new Dimension(400, 110));
    splitPane.add(topHalf);

    JPanel bottomHalf = new JPanel(new BorderLayout());
    bottomHalf.add(controlPane, BorderLayout.NORTH);
    bottomHalf.add(outputPane, BorderLayout.CENTER);
    //XXX: next line needed if bottomHalf is a scroll pane:
    //bottomHalf.setMinimumSize(new Dimension(400, 50));
    bottomHalf.setPreferredSize(new Dimension(450, 135));
    splitPane.add(bottomHalf);
}

From source file:PagingTester.java

public static JScrollPane createPagingScrollPaneForTable(JTable jt) {
    JScrollPane jsp = new JScrollPane(jt);
    TableModel tmodel = jt.getModel();

    // Don't choke if this is called on a regular table . . .
    if (!(tmodel instanceof PagingModel)) {
        return jsp;
    }/*from  ww  w.  j av  a 2  s .c o m*/

    // Okay, go ahead and build the real scrollpane
    final PagingModel model = (PagingModel) tmodel;
    final JButton upButton = new JButton(new ArrowIcon(ArrowIcon.UP));
    upButton.setEnabled(false); // starts off at 0, so can't go up
    final JButton downButton = new JButton(new ArrowIcon(ArrowIcon.DOWN));
    if (model.getPageCount() <= 1) {
        downButton.setEnabled(false); // One page...can't scroll down
    }

    upButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            model.pageUp();

            // If we hit the top of the data, disable the up button.
            if (model.getPageOffset() == 0) {
                upButton.setEnabled(false);
            }
            downButton.setEnabled(true);
        }
    });

    downButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            model.pageDown();

            // If we hit the bottom of the data, disable the down button.
            if (model.getPageOffset() == (model.getPageCount() - 1)) {
                downButton.setEnabled(false);
            }
            upButton.setEnabled(true);
        }
    });

    // Turn on the scrollbars; otherwise we won't get our corners.
    jsp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);

    // Add in the corners (page up/down).
    jsp.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, upButton);
    jsp.setCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER, downButton);

    return jsp;
}

From source file:is.iclt.jcorpald.CorpaldView.java

public void createAndShowGUI() {
    CorpaldSettings settings = CorpaldSettings.getInstance();

    //Create and set up the window.
    JFrame frame = new JFrame(settings.getProperty("corpus.acronym") + " "
            + settings.getProperty("corpus.version") + " - " + settings.getProperty("corpus.longname"));
    frame.setIconImage((new ImageIcon("icons/corpald.png")).getImage());

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // frame.setBounds(50, 50, 700, 450);
    frame.setPreferredSize(new Dimension(750, 720));

    // Create the panel that has the query and the result        
    JPanel panMainArea = new JPanel(new BorderLayout());
    JPanel panQuery = new JPanel(new BorderLayout());

    txtQuery = new JHighlightPane();
    txtQuery.addKeyListener(this);

    txtQuery.setFont(new Font("Monospaced", Font.BOLD, 16));
    this.updateHighlighting();
    txtQuery.setPreferredSize(new Dimension(700, 150));

    panQuery.add(labQuery, BorderLayout.NORTH);
    panQuery.add(new JScrollPane(txtQuery, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS), BorderLayout.CENTER);
    panQuery.setBorder(new EmptyBorder(0, 10, 10, 10));

    String welcomeMessage = "";
    try {/*from  w ww . ja  va 2 s .com*/
        welcomeMessage = FileUtils.readFileToString(new File(settings.getProperty("corpus.welcome")), "utf-8");
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    JPanel panResult = new JPanel(new BorderLayout());
    txtResult = new JTextArea(welcomeMessage);

    txtResult.setEditable(false);
    txtResult.setFont(new Font("Monospaced", Font.BOLD, 14));

    JScrollPane scrResult = new JScrollPane(txtResult, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    scrResult.setPreferredSize(new Dimension(700, 400));
    panResult.add(new JLabel("Result:"), BorderLayout.NORTH);
    panResult.add(scrResult, BorderLayout.CENTER);
    panResult.setBorder(new EmptyBorder(0, 10, 0, 10));

    panMainArea.add(panQuery, BorderLayout.NORTH);
    panMainArea.add(panResult, BorderLayout.CENTER);

    // Create panel at top with buttons
    JPanel panToolbar = new JPanel(new FlowLayout(FlowLayout.CENTER));

    // New, Open, Save
    // New
    ImageIcon icoNewQuery = new ImageIcon("icons/page_white.png");
    butNewQuery = new JButton(icoNewQuery);
    butNewQuery.addActionListener(this);
    butNewQuery.setPreferredSize(new Dimension(26, 26));
    butNewQuery.setToolTipText("Create a new empty query");
    panToolbar.add(butNewQuery);
    // Open
    ImageIcon icoOpenQuery = new ImageIcon("icons/folder.png");
    butOpenQuery = new JButton(icoOpenQuery);
    butOpenQuery.addActionListener(this);
    butOpenQuery.setPreferredSize(new Dimension(26, 26));
    butOpenQuery.setToolTipText("Open a query file");
    panToolbar.add(butOpenQuery);
    // Save
    ImageIcon icoSaveQuery = new ImageIcon("icons/page_save.png");
    butSaveQuery = new JButton(icoSaveQuery);
    butSaveQuery.addActionListener(this);
    butSaveQuery.setPreferredSize(new Dimension(26, 26));
    butSaveQuery.setToolTipText("Save current query");
    panToolbar.add(butSaveQuery);
    // Save as
    ImageIcon icoSaveQueryAs = new ImageIcon("icons/page_save_as.png");
    butSaveQueryAs = new JButton(icoSaveQueryAs);
    butSaveQueryAs.addActionListener(this);
    butSaveQueryAs.setPreferredSize(new Dimension(26, 26));
    butSaveQueryAs.setToolTipText("Save current query under a new file name");
    panToolbar.add(butSaveQueryAs);

    // Open definitions file
    ImageIcon icoOpenDef = new ImageIcon("icons/folder_table.png");
    butOpenDef = new JButton(icoOpenDef);
    butOpenDef.addActionListener(this);
    butOpenDef.setPreferredSize(new Dimension(26, 26));
    butOpenDef.setToolTipText("Select a new definitions file");
    panToolbar.add(butOpenDef);

    // Run Query button
    ImageIcon icoRunQuery = new ImageIcon("icons/control_play_blue.png");
    butRunQuery = new JButton("Run Query", icoRunQuery);
    butRunQuery.setPreferredSize(new Dimension(130, 26));
    butRunQuery.addActionListener(this);
    butRunQuery.setToolTipText("Run the current query using CorpusSearch");
    panToolbar.add(butRunQuery);

    // TextField for root node label
    JLabel labRootNode = new JLabel("Root:");
    panToolbar.add(labRootNode);
    txtRootNode = new JTextField("", 12);
    txtRootNode.setPreferredSize(new Dimension(50, 26));
    txtRootNode.addKeyListener(this);
    txtRootNode.setMargin(new Insets(3, 3, 3, 3));
    txtRootNode.setToolTipText("<html>Search within instances of a particular type of node,<br/>"
            + "such as IP-*, IP-SUB, NP-*, etc. $ROOT matches<br/>"
            + "the root node of every tree in the corpus.</html>");
    panToolbar.add(txtRootNode);

    chkNodesOnly = new JCheckBox("Nodes only");
    chkNodesOnly.addItemListener(this);
    chkNodesOnly.setToolTipText("<html>If checked, CorpusSearch prints out only the nodes that<br/>"
            + "contain the structure described in \"Query\". If not checked,<br/>"
            + "CorpusSearch prints out the entire sentence that contains the<br/>"
            + "structure described in \"Query\".</html>");
    panToolbar.add(chkNodesOnly);

    chkRemoveNodes = new JCheckBox("Remove nodes");
    chkRemoveNodes.addItemListener(this);
    chkRemoveNodes.setToolTipText("<html>Remove subtrees whose root is of the same syntactic category<br/>"
            + "as the node boundary embedded within a instance of that node<br/>"
            + "boundary. \"Remove nodes\" thus removes recursive structure.</html>");
    panToolbar.add(chkRemoveNodes);

    // Create panel at top with buttons
    JPanel panBottombar = new JPanel(new FlowLayout(FlowLayout.CENTER));
    // panBottombar.setBorder(new EmptyBorder(0, 0, 10, 5));
    ImageIcon icoOpenFolder = new ImageIcon("icons/folder.png");
    butOpenFolder = new JButton("Show result in folder", icoOpenFolder);
    butOpenFolder.setEnabled(false);
    butOpenFolder.addActionListener(this);
    panBottombar.add(butOpenFolder);

    ImageIcon icoTextEditor = new ImageIcon("icons/page_white_go.png");
    butTextEditor = new JButton("Open result in text editor", icoTextEditor);
    butTextEditor.setEnabled(false);
    butTextEditor.addActionListener(this);
    panBottombar.add(butTextEditor);

    ImageIcon icoCopyResults = new ImageIcon("icons/page_copy.png");
    butCopyResults = new JButton("Copy result to clipboard", icoCopyResults);
    butCopyResults.setEnabled(false);
    butCopyResults.addActionListener(this);
    panBottombar.add(butCopyResults);

    // Add stuff to top level content pane                
    frame.getContentPane().setLayout(new BorderLayout());
    frame.getContentPane().add(panToolbar, BorderLayout.NORTH);
    frame.getContentPane().add(panMainArea, BorderLayout.CENTER);
    frame.getContentPane().add(panBottombar, BorderLayout.SOUTH);

    this.configureFileFilters();

    //Display the window.
    frame.pack();
    frame.setVisible(true);
}

From source file:net.sf.keystore_explorer.gui.dialogs.DViewCertCsrPem.java

private void initComponents() throws CryptoException {
    jbOK = new JButton(res.getString("DViewCertCsrPem.jbOK.text"));

    jbOK.addActionListener(new ActionListener() {
        @Override//from   w  w  w  . ja  v a 2 s .c  o  m
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });

    jbCopy = new JButton(res.getString("DViewCertCsrPem.jbCopy.text"));
    PlatformUtil.setMnemonic(jbCopy, res.getString("DViewCertCsrPem.jbCopy.mnemonic").charAt(0));
    if (cert != null) {
        jbCopy.setToolTipText(res.getString("DViewCertCsrPem.jbCertCopy.tooltip"));
    } else {
        jbCopy.setToolTipText(res.getString("DViewCertCsrPem.jbCsrCopy.tooltip"));
    }

    jbCopy.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            try {
                CursorUtil.setCursorBusy(DViewCertCsrPem.this);
                copyPressed();
            } finally {
                CursorUtil.setCursorFree(DViewCertCsrPem.this);
            }
        }
    });

    jbExport = new JButton(res.getString("DViewCertCsrPem.jbExport.text"));
    PlatformUtil.setMnemonic(jbExport, res.getString("DViewCertCsrPem.jbExport.mnemonic").charAt(0));
    if (cert != null) {
        jbExport.setToolTipText(res.getString("DViewCertCsrPem.jbCertExport.tooltip"));
    } else {
        jbExport.setToolTipText(res.getString("DViewCertCsrPem.jbCsrExport.tooltip"));
    }
    jbExport.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            try {
                CursorUtil.setCursorBusy(DViewCertCsrPem.this);
                exportPressed();
            } finally {
                CursorUtil.setCursorFree(DViewCertCsrPem.this);
            }
        }
    });

    jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, null, new JButton[] { jbCopy, jbExport }, true);

    jpPem = new JPanel(new BorderLayout());
    jpPem.setBorder(new EmptyBorder(5, 5, 5, 5));

    if (cert != null) {
        jtaPem = new JTextArea(X509CertUtil.getCertEncodedX509Pem(cert));
    } else {
        jtaPem = new JTextArea(Pkcs10Util.getCsrEncodedDerPem(pkcs10Csr));
    }
    jtaPem.setCaretPosition(0);
    jtaPem.setEditable(false);
    jtaPem.setFont(new Font(Font.MONOSPACED, Font.PLAIN, LnfUtil.getDefaultFontSize()));
    // JGoodies - keep uneditable color same as editable
    jtaPem.putClientProperty("JTextArea.infoBackground", Boolean.TRUE);

    jspPem = PlatformUtil.createScrollPane(jtaPem, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jspPem.setPreferredSize(new Dimension(500, 300));
    jpPem.add(jspPem, BorderLayout.CENTER);

    getContentPane().add(jpPem, BorderLayout.CENTER);
    getContentPane().add(jpButtons, BorderLayout.SOUTH);

    setResizable(true);

    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent evt) {
            closeDialog();
        }
    });

    getRootPane().setDefaultButton(jbOK);

    pack();

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            jbOK.requestFocus();
        }
    });
}

From source file:edu.harvard.i2b2.query.ui.QueryTopPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 */// ww w .j a va  2s .c o m
private void initComponents() {
    jNameLabel = new javax.swing.JLabel();
    jSetSizeLabel = new javax.swing.JLabel();
    jNameTextField = new javax.swing.JTextField();
    jSetSizeFiled = new javax.swing.JLabel();
    jDeleteButton = new javax.swing.JButton();
    jScrollPane1 = new QueryConceptTreePanel("Group 1", this);
    jRunQueryButton = new javax.swing.JButton();
    jCancelButton = new javax.swing.JButton();
    jClearGroupsButton = new javax.swing.JButton();
    jScrollPane2 = new QueryConceptTreePanel("Group 2", this);
    jScrollPane3 = new QueryConceptTreePanel("Group 3", this);
    jScrollPane4 = new javax.swing.JScrollPane();
    jPanel1 = new javax.swing.JPanel();
    // jVisitComboBox = new javax.swing.JComboBox();
    jAndOrLabel1 = new javax.swing.JLabel();
    jAndOrLabel2 = new javax.swing.JLabel();
    jMorePanelsButton = new javax.swing.JButton();
    jWorkflowToolBar = new javax.swing.JToolBar();
    jTimelineToggleButton = new javax.swing.JToggleButton();
    jPatientCountToggleButton = new javax.swing.JToggleButton();
    jPatientSetToggleButton = new javax.swing.JToggleButton();
    jToolbarPanel = new javax.swing.JPanel();
    jQueryNamePanel = new javax.swing.JPanel();

    jOptionsScrollPane = new javax.swing.JScrollPane();
    jOptionsPanel = new javax.swing.JPanel();
    jShowTimelineCheckBox = new javax.swing.JCheckBox();
    jGetPatientCountCheckBox = new javax.swing.JCheckBox();
    jGetPatientSetCheckBox = new javax.swing.JCheckBox();

    setLayout(null);

    // jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
    // ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jPanel1.setLayout(null);

    jPanel1.add(jScrollPane1);
    jScrollPane1.setBounds(0, 0, 180, 200);

    jPanel1.add(jScrollPane2);
    jScrollPane2.setBounds(185, 0, 180, 200);

    jPanel1.add(jScrollPane3);
    jScrollPane3.setBounds(370, 0, 180, 200);

    //jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    jAndOrLabel1.setText("and");
    //jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel1);
    // jAndOrLabel1.setBounds(190, 90, 30, 18);

    //jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    // jAndOrLabel2.setText("and");
    //jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel2);
    // jAndOrLabel2.setBounds(410, 90, 30, 18);

    jQueryNamePanel.setLayout(null);
    jQueryNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jNameLabel.setText(" Query Name: ");
    jNameLabel.setToolTipText("You may drag this item to workplace to save the query definition");
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jNameLabel.setBounds(2, 2, 70, 23);
    add(jNameLabel);
    // jQueryNamePanel.add(jNameLabel);
    jNameLabel.setTransferHandler(new NameLabelTextHandler());
    jNameLabel.addMouseListener(new DragMouseAdapter());
    jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jNameLabelMouseMoved(evt);
        }
    });
    jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseExited(java.awt.event.MouseEvent evt) {
            jNameLabelMouseExited(evt);
        }
    });

    jNameTextField.setText("");
    jNameTextField.setBounds(95, 10, 400, 20);
    jNameTextField.setEditable(false);
    jNameTextField.setDragEnabled(true);
    jNameTextField.setTransferHandler(new TransferHandler("Text"));
    // jQueryNamePanel.add(jNameTextField);
    // add(jNameTextField);
    // add(jQueryNamePanel);
    // jQueryNamePanel.setBounds(5, 5, 400, 50);

    jClearGroupsButton.setText("Reset Groups");
    jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jClearGroupsButtonActionPerformed(evt);
        }
    });
    jClearGroupsButton.setBounds(600, 10, 115, 20);
    add(jClearGroupsButton);

    jPanel1.setPreferredSize(new Dimension(700, 150));
    jScrollPane4.setViewportView(jPanel1);
    add(jScrollPane4);
    jScrollPane4.setBounds(20, 35, 635, 220);
    jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

    jCancelButton.setText("Cancel");
    jCancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCancelButtonActionPerformed(evt);
        }
    });
    // add(jCancelButton);
    // jCancelButton.setBounds(20, 255, 90, 23);
    // jCancelButton.setFont(new Font("Tahoma", Font.PLAIN, 10));

    jRunQueryButton.setText("Run Query");
    jRunQueryButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRunQueryButtonActionPerformed(evt);
        }
    });
    add(jRunQueryButton);
    jRunQueryButton.setBounds(100, 255, 625, 23);

    jSetSizeLabel.setText(" Patient(s) returned:");
    add(jSetSizeLabel);
    jSetSizeLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jSetSizeLabel.setBounds(20, 275, 70, 23);

    // jSetSizeFiled.setText(" subjects");
    // jSetSizeFiled.setEditable(false);
    // jSetSizeFiled.setHorizontalAlignment(SwingConstants.LEFT);
    // add(jSetSizeFiled);
    // jSetSizeLabel.setBounds(20, 275, 70, 23);

    jToolbarPanel.setLayout(new java.awt.BorderLayout());

    // jWorkflowToolBar.setRollover(true);
    // jWorkflowToolBar.setInheritsPopupMenu(true);
    jTimelineToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jTimelineToggleButton.setText("Show TimeLine");
    jTimelineToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jTimelineToggleButton);

    jPatientCountToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jPatientCountToggleButton.setText("Get Patient Count");
    jPatientCountToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jPatientCountToggleButton);

    jPatientSetToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jPatientSetToggleButton.setText("Get Patient Set");
    jPatientSetToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jPatientSetToggleButton);
    jWorkflowToolBar.setPreferredSize(new Dimension(380, 40));

    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.PAGE_START);
    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.CENTER);

    // add(jToolbarPanel);
    jToolbarPanel.setBounds(20, 130, 240, 23);

    jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group");
    jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMorePanelsButtonActionPerformed(evt);
        }
    });
    // add(jMorePanelsButton);
    // jMorePanelsButton.setBounds(655, 35, 60, 220);

    jPanel1.add(jMorePanelsButton);
    jMorePanelsButton.setBounds(550, 0, 60, 200);

    jOptionsPanel.setLayout(null);
    jOptionsScrollPane.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jOptionsPanel.setPreferredSize(new java.awt.Dimension(100, 100));
    jShowTimelineCheckBox.setText("Timeline");
    jShowTimelineCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jShowTimelineCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jShowTimelineCheckBox.setToolTipText("Get the patient set and display it in timeline view");
    jOptionsPanel.add(jShowTimelineCheckBox);
    jShowTimelineCheckBox.setBounds(5, 20, 110, 15);

    jGetPatientCountCheckBox.setText("Patient Count");
    jGetPatientCountCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jGetPatientCountCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jGetPatientCountCheckBox.setToolTipText("Get the patient count XML");
    jOptionsPanel.add(jGetPatientCountCheckBox);
    jGetPatientCountCheckBox.setBounds(5, 50, 110, 15);

    jGetPatientSetCheckBox.setText("Patient Set");
    jGetPatientSetCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jGetPatientSetCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jOptionsPanel.add(jGetPatientSetCheckBox);
    // jGetPatientSetCheckBox.setBounds(10, 80, 80, 15);

    jOptionsScrollPane.setViewportView(jOptionsPanel);

    add(jOptionsScrollPane);
    jOptionsScrollPane.setBounds(500, 30, 120, 190);

    /*
     * jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new
     * java.awt.event.ActionListener() { public void
     * actionPerformed(java.awt.event.ActionEvent evt) {
     * jDeleteButtonActionPerformed(evt); } });
     * 
     * jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new
     * String[] { "Groups don't have to occur in the same visit", "Groups
     * must all occur in the same visit" })); add(jVisitComboBox);
     * jVisitComboBox.setBounds(20, 40, 240, 22);
     * 
     * //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23);
     * 
     * add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320);
     * 
     * jRunQueryButton.setText("Run Query");
     * jRunQueryButton.addActionListener(new java.awt.event.ActionListener()
     * { public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRunQueryButtonActionPerformed(evt); } });
     * 
     * add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23);
     * 
     * jCancelButton.setText("Remove All");
     * jCancelButton.addActionListener(new java.awt.event.ActionListener() {
     * public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRemoveAllButtonActionPerformed(evt); } });
     * 
     * add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23);
     * 
     * //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
     * ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
     * jPanel1.setLayout(null);
     * jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20);
     * //jPanel1.setVisible(false);
     * 
     * //jScrollPane1.setToolTipText("scrollpane 1");
     * jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350);
     * 
     * jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350);
     */

    jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255));
    jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel1.setText("and");
    jAndOrLabel1.setToolTipText("Click to change the relationship");
    jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel1MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel1);

    jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel2.setText("and");
    jAndOrLabel2.setToolTipText("Click to change the relationship");
    jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel2MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel2);

    /*
     * jPanel1.add(jScrollPane3); jScrollPane3.setBounds(420, 0, 170, 350);
     * 
     * jScrollPane4.setViewportView(jPanel1);
     * 
     * add(jScrollPane4); jScrollPane4.setBounds(20, 70, 594, 370);
     * 
     * jMorePanelsButton.setText("Add Panel");
     * jMorePanelsButton.addActionListener(new
     * java.awt.event.ActionListener() { public void
     * actionPerformed(java.awt.event.ActionEvent evt) {
     * jMorePanelsButtonActionPerformed(evt); } });
     * 
     * add(jMorePanelsButton); jMorePanelsButton.setBounds(215, 10, 90, 23);
     */

    // jTree1.addTreeWillExpandListener(this);
    // jTree1.addTreeExpansionListener(this);
    // jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1"));
    // jScrollPane1.setToolTipText("Double click on a folder to view the
    // items inside");
    // jTree2.addTreeExpansionListener(this);
    // jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2"));
    // jTree3.addTreeExpansionListener(this);
    // treepanel = new QueryConceptTreePanel("", this);
    // jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3"));
    // jSlider1.setMajorTickSpacing(20);
    /*
     * jSlider1.setPaintTicks(true); jSlider1.setValue(0);
     * jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on
     * left is more Sensitive Query, " + "on right is more Specific");
     * add(jSlider1); jSlider1.setBounds(380, 40, 140, 18);
     * 
     * //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
     * jLabel1.setText("Sensitivity <"); add(jLabel1);
     * jLabel1.setBounds(290, 40, 80, 20);
     * 
     * //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel2.setText("> Specificity"); add(jLabel2);
     * jLabel2.setBounds(525, 40, 70, 20);
     */

    dataModel.addPanel(jScrollPane1, null, 0);
    dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0);
    dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555);
}

From source file:com.vgi.mafscaling.MafCompare.java

/**
 * Initialize the contents of the frame.
 *//* ww w.j av a 2s  . co m*/
private void initialize() {
    try {
        ImageIcon tableImage = new ImageIcon(getClass().getResource("/table.jpg"));
        setTitle(Title);
        setIconImage(tableImage.getImage());
        setBounds(100, 100, 621, 372);
        setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
        setSize(Config.getCompWindowSize());
        setLocation(Config.getCompWindowLocation());
        setLocationRelativeTo(null);
        setVisible(false);
        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                Utils.clearTable(origMafTable);
                Utils.clearTable(newMafTable);
                Utils.clearTable(compMafTable);
                Config.setCompWindowSize(getSize());
                Config.setCompWindowLocation(getLocation());
                origMafData.clear();
                newMafData.clear();
            }
        });

        JPanel dataPanel = new JPanel();
        GridBagLayout gbl_dataPanel = new GridBagLayout();
        gbl_dataPanel.columnWidths = new int[] { 0, 0, 0 };
        gbl_dataPanel.rowHeights = new int[] { RowHeight, RowHeight, RowHeight, RowHeight, RowHeight, 0 };
        gbl_dataPanel.columnWeights = new double[] { 0.0, 0.0, 0.0 };
        gbl_dataPanel.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 };
        dataPanel.setLayout(gbl_dataPanel);
        getContentPane().add(dataPanel);

        JLabel origLabel = new JLabel(origMaf);
        GridBagConstraints gbc_origLabel = new GridBagConstraints();
        gbc_origLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_origLabel.insets = new Insets(1, 1, 1, 5);
        gbc_origLabel.weightx = 0;
        gbc_origLabel.weighty = 0;
        gbc_origLabel.gridx = 0;
        gbc_origLabel.gridy = 0;
        gbc_origLabel.gridheight = 2;
        dataPanel.add(origLabel, gbc_origLabel);

        JLabel newLabel = new JLabel(newMaf);
        GridBagConstraints gbc_newLabel = new GridBagConstraints();
        gbc_newLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_newLabel.insets = new Insets(1, 1, 1, 5);
        gbc_newLabel.weightx = 0;
        gbc_newLabel.weighty = 0;
        gbc_newLabel.gridx = 0;
        gbc_newLabel.gridy = 2;
        gbc_newLabel.gridheight = 2;
        dataPanel.add(newLabel, gbc_newLabel);

        JLabel compLabel = new JLabel("Change");
        GridBagConstraints gbc_compLabel = new GridBagConstraints();
        gbc_compLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_compLabel.insets = new Insets(1, 1, 1, 5);
        gbc_compLabel.weightx = 0;
        gbc_compLabel.weighty = 0;
        gbc_compLabel.gridx = 0;
        gbc_compLabel.gridy = 4;
        dataPanel.add(compLabel, gbc_compLabel);

        JLabel origVoltLabel = new JLabel("volt");
        GridBagConstraints gbc_origVoltLabel = new GridBagConstraints();
        gbc_origVoltLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_origVoltLabel.insets = new Insets(1, 1, 1, 5);
        gbc_origVoltLabel.weightx = 0;
        gbc_origVoltLabel.weighty = 0;
        gbc_origVoltLabel.gridx = 1;
        gbc_origVoltLabel.gridy = 0;
        dataPanel.add(origVoltLabel, gbc_origVoltLabel);

        JLabel origGsLabel = new JLabel(" g/s");
        GridBagConstraints gbc_origGsLabel = new GridBagConstraints();
        gbc_origGsLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_origGsLabel.insets = new Insets(1, 1, 1, 5);
        gbc_origGsLabel.weightx = 0;
        gbc_origGsLabel.weighty = 0;
        gbc_origGsLabel.gridx = 1;
        gbc_origGsLabel.gridy = 1;
        dataPanel.add(origGsLabel, gbc_origGsLabel);

        JLabel newVoltLabel = new JLabel("volt");
        GridBagConstraints gbc_newVoltLabel = new GridBagConstraints();
        gbc_newVoltLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_newVoltLabel.insets = new Insets(1, 1, 1, 5);
        gbc_newVoltLabel.weightx = 0;
        gbc_newVoltLabel.weighty = 0;
        gbc_newVoltLabel.gridx = 1;
        gbc_newVoltLabel.gridy = 2;
        dataPanel.add(newVoltLabel, gbc_newVoltLabel);

        JLabel newGsLabel = new JLabel(" g/s");
        GridBagConstraints gbc_newGsLabel = new GridBagConstraints();
        gbc_newGsLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_newGsLabel.insets = new Insets(1, 1, 1, 5);
        gbc_newGsLabel.weightx = 0;
        gbc_newGsLabel.weighty = 0;
        gbc_newGsLabel.gridx = 1;
        gbc_newGsLabel.gridy = 3;
        dataPanel.add(newGsLabel, gbc_newGsLabel);

        JLabel compPctLabel = new JLabel(" %  ");
        GridBagConstraints gbc_compPctLabel = new GridBagConstraints();
        gbc_compPctLabel.anchor = GridBagConstraints.PAGE_START;
        gbc_compPctLabel.insets = new Insets(1, 1, 1, 5);
        gbc_compPctLabel.weightx = 0;
        gbc_compPctLabel.weighty = 0;
        gbc_compPctLabel.gridx = 1;
        gbc_compPctLabel.gridy = 4;
        dataPanel.add(compPctLabel, gbc_compPctLabel);

        JPanel tablesPanel = new JPanel();
        GridBagLayout gbl_tablesPanel = new GridBagLayout();
        gbl_tablesPanel.columnWidths = new int[] { 0 };
        gbl_tablesPanel.rowHeights = new int[] { 0, 0, 0 };
        gbl_tablesPanel.columnWeights = new double[] { 0.0 };
        gbl_tablesPanel.rowWeights = new double[] { 0.0, 0.0, 1.0 };
        tablesPanel.setLayout(gbl_tablesPanel);

        JScrollPane mafScrollPane = new JScrollPane(tablesPanel);
        mafScrollPane.setMinimumSize(new Dimension(1600, 107));
        mafScrollPane.getHorizontalScrollBar().setMaximumSize(new Dimension(20, 20));
        mafScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
        mafScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
        GridBagConstraints gbc_mafScrollPane = new GridBagConstraints();
        gbc_mafScrollPane.weightx = 1.0;
        gbc_mafScrollPane.anchor = GridBagConstraints.PAGE_START;
        gbc_mafScrollPane.fill = GridBagConstraints.HORIZONTAL;
        gbc_mafScrollPane.gridx = 2;
        gbc_mafScrollPane.gridy = 0;
        gbc_mafScrollPane.gridheight = 5;
        dataPanel.add(mafScrollPane, gbc_mafScrollPane);

        origMafTable = new JTable();
        origMafTable.setColumnSelectionAllowed(true);
        origMafTable.setCellSelectionEnabled(true);
        origMafTable.setBorder(new LineBorder(new Color(0, 0, 0)));
        origMafTable.setRowHeight(RowHeight);
        origMafTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        origMafTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        origMafTable.setModel(new DefaultTableModel(2, MafTableColumnCount));
        origMafTable.setTableHeader(null);
        Utils.initializeTable(origMafTable, ColumnWidth);
        GridBagConstraints gbc_origMafTable = new GridBagConstraints();
        gbc_origMafTable.anchor = GridBagConstraints.PAGE_START;
        gbc_origMafTable.insets = new Insets(0, 0, 0, 0);
        gbc_origMafTable.fill = GridBagConstraints.HORIZONTAL;
        gbc_origMafTable.weightx = 1.0;
        gbc_origMafTable.weighty = 0;
        gbc_origMafTable.gridx = 0;
        gbc_origMafTable.gridy = 0;
        tablesPanel.add(origMafTable, gbc_origMafTable);
        excelAdapter.addTable(origMafTable, false, false, false, false, true, false, true, false, true);

        newMafTable = new JTable();
        newMafTable.setColumnSelectionAllowed(true);
        newMafTable.setCellSelectionEnabled(true);
        newMafTable.setBorder(new LineBorder(new Color(0, 0, 0)));
        newMafTable.setRowHeight(RowHeight);
        newMafTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        newMafTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        newMafTable.setModel(new DefaultTableModel(2, MafTableColumnCount));
        newMafTable.setTableHeader(null);
        Utils.initializeTable(newMafTable, ColumnWidth);
        GridBagConstraints gbc_newMafTable = new GridBagConstraints();
        gbc_newMafTable.anchor = GridBagConstraints.PAGE_START;
        gbc_newMafTable.insets = new Insets(0, 0, 0, 0);
        gbc_newMafTable.fill = GridBagConstraints.HORIZONTAL;
        gbc_newMafTable.weightx = 1.0;
        gbc_newMafTable.weighty = 0;
        gbc_newMafTable.gridx = 0;
        gbc_newMafTable.gridy = 1;
        tablesPanel.add(newMafTable, gbc_newMafTable);
        excelAdapter.addTable(newMafTable, false, false, false, false, false, false, false, false, true);

        compMafTable = new JTable();
        compMafTable.setColumnSelectionAllowed(true);
        compMafTable.setCellSelectionEnabled(true);
        compMafTable.setBorder(new LineBorder(new Color(0, 0, 0)));
        compMafTable.setRowHeight(RowHeight);
        compMafTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        compMafTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        compMafTable.setModel(new DefaultTableModel(1, MafTableColumnCount));
        compMafTable.setTableHeader(null);
        Utils.initializeTable(compMafTable, ColumnWidth);
        NumberFormatRenderer numericRenderer = new NumberFormatRenderer();
        numericRenderer.setFormatter(new DecimalFormat("0.000"));
        compMafTable.setDefaultRenderer(Object.class, numericRenderer);
        GridBagConstraints gbc_compMafTable = new GridBagConstraints();
        gbc_compMafTable.anchor = GridBagConstraints.PAGE_START;
        gbc_compMafTable.insets = new Insets(0, 0, 0, 0);
        gbc_compMafTable.fill = GridBagConstraints.HORIZONTAL;
        gbc_compMafTable.weightx = 1.0;
        gbc_compMafTable.weighty = 0;
        gbc_compMafTable.gridx = 0;
        gbc_compMafTable.gridy = 2;
        tablesPanel.add(compMafTable, gbc_compMafTable);
        compExcelAdapter.addTable(compMafTable, false, true, false, false, false, true, true, false, true);

        TableModelListener origTableListener = new TableModelListener() {
            public void tableChanged(TableModelEvent tme) {
                if (tme.getType() == TableModelEvent.UPDATE) {
                    int colCount = origMafTable.getColumnCount();
                    Utils.ensureColumnCount(colCount, newMafTable);
                    Utils.ensureColumnCount(colCount, compMafTable);
                    origMafData.clear();
                    String origY, origX, newY;
                    for (int i = 0; i < colCount; ++i) {
                        origY = origMafTable.getValueAt(1, i).toString();
                        if (Pattern.matches(Utils.fpRegex, origY)) {
                            origX = origMafTable.getValueAt(0, i).toString();
                            if (Pattern.matches(Utils.fpRegex, origX))
                                origMafData.add(Double.valueOf(origX), Double.valueOf(origY), false);
                            newY = newMafTable.getValueAt(1, i).toString();
                            if (Pattern.matches(Utils.fpRegex, newY))
                                compMafTable.setValueAt(
                                        ((Double.valueOf(newY) / Double.valueOf(origY)) - 1.0) * 100.0, 0, i);
                        } else
                            break;
                    }
                    origMafData.fireSeriesChanged();
                }
            }
        };

        TableModelListener newTableListener = new TableModelListener() {
            public void tableChanged(TableModelEvent tme) {
                if (tme.getType() == TableModelEvent.UPDATE) {
                    int colCount = newMafTable.getColumnCount();
                    Utils.ensureColumnCount(colCount, origMafTable);
                    Utils.ensureColumnCount(colCount, compMafTable);
                    newMafData.clear();
                    String newY, newX, origY;
                    for (int i = 0; i < colCount; ++i) {
                        newY = newMafTable.getValueAt(1, i).toString();
                        if (Pattern.matches(Utils.fpRegex, newY)) {
                            newX = newMafTable.getValueAt(0, i).toString();
                            if (Pattern.matches(Utils.fpRegex, newX))
                                newMafData.add(Double.valueOf(newX), Double.valueOf(newY), false);
                            origY = origMafTable.getValueAt(1, i).toString();
                            if (Pattern.matches(Utils.fpRegex, origY))
                                compMafTable.setValueAt(
                                        ((Double.valueOf(newY) / Double.valueOf(origY)) - 1.0) * 100.0, 0, i);
                        } else
                            break;
                    }
                    newMafData.fireSeriesChanged();
                }
            }
        };

        origMafTable.getModel().addTableModelListener(origTableListener);
        newMafTable.getModel().addTableModelListener(newTableListener);

        Action action = new AbstractAction() {
            private static final long serialVersionUID = 8148393537657380215L;

            public void actionPerformed(ActionEvent e) {
                TableCellListener tcl = (TableCellListener) e.getSource();
                if (Pattern.matches(Utils.fpRegex, compMafTable.getValueAt(0, tcl.getColumn()).toString())) {
                    if (Pattern.matches(Utils.fpRegex,
                            origMafTable.getValueAt(1, tcl.getColumn()).toString())) {
                        double corr = Double.valueOf(compMafTable.getValueAt(0, tcl.getColumn()).toString())
                                / 100.0 + 1.0;
                        newMafTable.setValueAt(
                                Double.valueOf(origMafTable.getValueAt(1, tcl.getColumn()).toString()) * corr,
                                1, tcl.getColumn());
                    }
                } else
                    compMafTable.setValueAt(tcl.getOldValue(), 0, tcl.getColumn());
            }
        };

        setCompMafCellListener(new TableCellListener(compMafTable, action));

        // CHART

        JFreeChart chart = ChartFactory.createXYLineChart(null, null, null, null, PlotOrientation.VERTICAL,
                false, true, false);
        chart.setBorderVisible(true);
        chartPanel = new ChartPanel(chart, true, true, true, true, true);
        chartPanel.setAutoscrolls(true);

        GridBagConstraints gbl_chartPanel = new GridBagConstraints();
        gbl_chartPanel.anchor = GridBagConstraints.PAGE_START;
        gbl_chartPanel.fill = GridBagConstraints.BOTH;
        gbl_chartPanel.insets = new Insets(1, 1, 1, 1);
        gbl_chartPanel.weightx = 1.0;
        gbl_chartPanel.weighty = 1.0;
        gbl_chartPanel.gridx = 0;
        gbl_chartPanel.gridy = 5;
        gbl_chartPanel.gridheight = 1;
        gbl_chartPanel.gridwidth = 3;
        dataPanel.add(chartPanel, gbl_chartPanel);

        XYSplineRenderer lineRenderer = new XYSplineRenderer(3);
        lineRenderer.setUseFillPaint(true);
        lineRenderer.setBaseToolTipGenerator(
                new StandardXYToolTipGenerator(StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
                        new DecimalFormat("0.00"), new DecimalFormat("0.00")));

        Stroke stroke = new BasicStroke(2.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, null, 0.0f);
        lineRenderer.setSeriesStroke(0, stroke);
        lineRenderer.setSeriesStroke(1, stroke);
        lineRenderer.setSeriesPaint(0, new Color(201, 0, 0));
        lineRenderer.setSeriesPaint(1, new Color(0, 0, 255));
        lineRenderer.setSeriesShape(0, ShapeUtilities.createDiamond((float) 2.5));
        lineRenderer.setSeriesShape(1, ShapeUtilities.createDownTriangle((float) 2.5));
        lineRenderer.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator() {
            private static final long serialVersionUID = -4045338273187150888L;

            public String generateLabel(XYDataset dataset, int series) {
                XYSeries xys = ((XYSeriesCollection) dataset).getSeries(series);
                return xys.getDescription();
            }
        });

        NumberAxis mafvDomain = new NumberAxis(XAxisName);
        mafvDomain.setAutoRangeIncludesZero(false);
        mafvDomain.setAutoRange(true);
        mafvDomain.setAutoRangeStickyZero(false);
        NumberAxis mafgsRange = new NumberAxis(YAxisName);
        mafgsRange.setAutoRangeIncludesZero(false);
        mafgsRange.setAutoRange(true);
        mafgsRange.setAutoRangeStickyZero(false);

        XYSeriesCollection lineDataset = new XYSeriesCollection();
        origMafData.setDescription(origMaf);
        newMafData.setDescription(newMaf);
        lineDataset.addSeries(origMafData);
        lineDataset.addSeries(newMafData);

        XYPlot plot = chart.getXYPlot();
        plot.setRangePannable(true);
        plot.setDomainPannable(true);
        plot.setDomainGridlinePaint(Color.DARK_GRAY);
        plot.setRangeGridlinePaint(Color.DARK_GRAY);
        plot.setBackgroundPaint(new Color(224, 224, 224));

        plot.setDataset(0, lineDataset);
        plot.setRenderer(0, lineRenderer);
        plot.setDomainAxis(0, mafvDomain);
        plot.setRangeAxis(0, mafgsRange);
        plot.mapDatasetToDomainAxis(0, 0);
        plot.mapDatasetToRangeAxis(0, 0);

        LegendTitle legend = new LegendTitle(plot.getRenderer());
        legend.setItemFont(new Font("Arial", 0, 10));
        legend.setPosition(RectangleEdge.TOP);
        chart.addLegend(legend);

    } catch (Exception e) {
        logger.error(e);
    }
}

From source file:com.vgi.mafscaling.Rescale.java

private void createMafScalesScrollPane(JPanel dataPanel) {
    JPanel mafPanel = new JPanel();
    GridBagLayout gbl_mafPanelLayout = new GridBagLayout();
    gbl_mafPanelLayout.columnWidths = new int[] { 0 };
    gbl_mafPanelLayout.rowHeights = new int[] { 0, 0 };
    gbl_mafPanelLayout.columnWeights = new double[] { 0.0, 1.0 };
    gbl_mafPanelLayout.rowWeights = new double[] { 0.0, 1.0 };
    mafPanel.setLayout(gbl_mafPanelLayout);

    JScrollPane mafScrollPane = new JScrollPane(mafPanel);
    mafScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    mafScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    GridBagConstraints gbl_mafScrollPane = new GridBagConstraints();
    gbl_mafScrollPane.anchor = GridBagConstraints.PAGE_START;
    gbl_mafScrollPane.fill = GridBagConstraints.HORIZONTAL;
    gbl_mafScrollPane.insets = insets0;//  w w w.  j a  va  2 s .  c  om
    gbl_mafScrollPane.weightx = 1.0;
    gbl_mafScrollPane.gridx = 0;
    gbl_mafScrollPane.gridy = 1;
    gbl_mafScrollPane.ipady = 120;
    dataPanel.add(mafScrollPane, gbl_mafScrollPane);

    GridBagConstraints gbc_mafScrollPane = new GridBagConstraints();
    gbc_mafScrollPane.anchor = GridBagConstraints.PAGE_START;
    gbc_mafScrollPane.weightx = 1.0;
    gbc_mafScrollPane.weighty = 1.0;
    gbc_mafScrollPane.insets = insets0;
    gbc_mafScrollPane.fill = GridBagConstraints.HORIZONTAL;
    gbc_mafScrollPane.gridx = 0;
    gbc_mafScrollPane.gridy = 0;

    MafTablePane origMafScrollPane = new MafTablePane(ColumnWidth, OrigMafTableName, false, false);
    origMafScrollPane.setBorder(null);
    origMafScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    origMafTable = origMafScrollPane.getJTable();
    excelAdapter.addTable(origMafTable, false, false, false, false, false, false, false, false, true);
    mafPanel.add(origMafScrollPane, gbc_mafScrollPane);

    MafTablePane newMafScrollPane = new MafTablePane(ColumnWidth, NewMafTableName, false, true);
    newMafScrollPane.setBorder(null);
    newMafScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    newMafTable = newMafScrollPane.getJTable();
    newMafExcelAdapter.addTable(newMafTable, false, false, false, false, false, false, false, false, true);
    gbc_mafScrollPane.gridy++;
    mafPanel.add(newMafScrollPane, gbc_mafScrollPane);

    Action action = new AbstractAction() {
        private static final long serialVersionUID = 1L;

        public void actionPerformed(ActionEvent e) {
            recalculateNewGs();
        }
    };

    setNewMafTableCellListenerListener(new TableCellListener(newMafTable, action));
}

From source file:edu.harvard.i2b2.query.ui.TopPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 *//*from ww w.j av  a 2 s .  c  o m*/
private void initComponents() {
    jAnalysisLabel = new javax.swing.JLabel();
    jNameLabel = new javax.swing.JLabel();
    jSetSizeLabel = new javax.swing.JLabel();
    jNameTextField = new javax.swing.JTextField();
    jSetSizeFiled = new javax.swing.JLabel();
    jDeleteButton = new javax.swing.JButton();
    jScrollPane1 = new ConceptTreePanel("Group 1", this);
    jRunQueryButton = new javax.swing.JButton();
    jCancelButton = new javax.swing.JButton();
    jClearGroupsButton = new javax.swing.JButton();
    jScrollPane2 = new ConceptTreePanel("Group 2", this);
    jScrollPane3 = new ConceptTreePanel("Group 3", this);
    jScrollPane4 = new javax.swing.JScrollPane();
    jPanel1 = new javax.swing.JPanel();
    // jVisitComboBox = new javax.swing.JComboBox();
    jAndOrLabel1 = new javax.swing.JLabel();
    jAndOrLabel2 = new javax.swing.JLabel();
    jMorePanelsButton = new javax.swing.JButton();
    jWorkflowToolBar = new javax.swing.JToolBar();
    // jTimelineToggleButton = new javax.swing.JToggleButton();
    jPatientCountToggleButton = new javax.swing.JToggleButton();
    // jPatientSetToggleButton = new javax.swing.JToggleButton();
    jToolbarPanel = new javax.swing.JPanel();
    jQueryNamePanel = new javax.swing.JPanel();

    // jOptionsScrollPane = new javax.swing.JScrollPane();
    jOptionsPanel = new AnalysisPanel();
    jShowTimelineCheckBox = new javax.swing.JCheckBox();
    jGetAllPatientsCheckBox = new javax.swing.JCheckBox();
    // jGetPatientCountCheckBox = new javax.swing.JCheckBox();
    // jGetPatientSetCheckBox = new javax.swing.JCheckBox();

    setLayout(null);

    // jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
    // ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jPanel1.setLayout(null);

    jPanel1.add(jScrollPane1);
    jScrollPane1.setBounds(0, 0, 180, 200);

    jPanel1.add(jScrollPane2);
    jScrollPane2.setBounds(185, 0, 180, 200);

    jPanel1.add(jScrollPane3);
    jScrollPane3.setBounds(370, 0, 180, 200);

    // jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    jAndOrLabel1.setText("and");
    // jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel1);
    // jAndOrLabel1.setBounds(190, 90, 30, 18);

    // jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    // jAndOrLabel2.setText("and");
    // jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel2);
    // jAndOrLabel2.setBounds(410, 90, 30, 18);

    jQueryNamePanel.setLayout(null);
    jQueryNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jNameLabel.setText(" Query Name: ");
    jNameLabel.setToolTipText("You may drag this item to workplace to save the query definition");
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jNameLabel.setBounds(2, 2, 70, 23);
    add(jNameLabel);
    // jQueryNamePanel.add(jNameLabel);
    jNameLabel.setTransferHandler(new NameLabelTextHandler());
    jNameLabel.addMouseListener(new DragMouseAdapter());
    jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jNameLabelMouseMoved(evt);
        }
    });
    jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseExited(java.awt.event.MouseEvent evt) {
            jNameLabelMouseExited(evt);
        }
    });

    jNameTextField.setText("");
    jNameTextField.setBounds(95, 10, 370, 20);
    jNameTextField.setEditable(false);
    jNameTextField.setDragEnabled(true);
    jNameTextField.setTransferHandler(new TransferHandler("Text"));
    // jQueryNamePanel.add(jNameTextField);
    // add(jNameTextField);
    // add(jQueryNamePanel);
    // jQueryNamePanel.setBounds(5, 5, 400, 50);

    jClearGroupsButton.setFont(new java.awt.Font("Tahoma", 1, 10));
    jClearGroupsButton.setText("X");
    jClearGroupsButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    jClearGroupsButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jClearGroupsButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    jClearGroupsButton.setToolTipText("Reset all panels");
    if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
        jClearGroupsButton.setMargin(new java.awt.Insets(-10, -15, -10, -20));
    }
    jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jClearGroupsButtonActionPerformed(evt);
        }
    });
    jClearGroupsButton.setBounds(600, 10, 30, 20);
    add(jClearGroupsButton);

    jAnalysisLabel.setText("Analysis Types");
    // jAnalysisLabel.setBackground(Color.WHITE);
    // jAnalysisLabel.setOpaque(true);
    jAnalysisLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jAnalysisLabel.setBounds(2, 2, 70, 23);
    jAnalysisLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAnalysisLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    add(jAnalysisLabel);

    jPanel1.setPreferredSize(new Dimension(700, 150));
    jScrollPane4.setViewportView(jPanel1);
    add(jScrollPane4);
    jScrollPane4.setBounds(20, 35, 635, 220);
    jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    // jScrollPane4.setBorder(javax.swing.BorderFactory
    // .createLineBorder(new java.awt.Color(0, 0, 0)));
    jCancelButton.setText("Cancel");
    jCancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCancelButtonActionPerformed(evt);
        }
    });
    // add(jCancelButton);
    // jCancelButton.setBounds(20, 255, 90, 23);
    // jCancelButton.setFont(new Font("Tahoma", Font.PLAIN, 10));

    jGetAllPatientsCheckBox.setText("Get Everyone");
    jGetAllPatientsCheckBox.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    // jGetAllPatientsCheckBox
    // .setBorder(new javax.swing.border.SoftBevelBorder(
    // javax.swing.border.BevelBorder.RAISED));
    jGetAllPatientsCheckBox.setBorderPainted(true);
    jGetAllPatientsCheckBox.setContentAreaFilled(false);
    jGetAllPatientsCheckBox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jGetAllPatientsCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
    jGetAllPatientsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jGetAllPatientsCheckBox.setToolTipText("Get all the patients in datamart");
    add(jGetAllPatientsCheckBox);
    jGetAllPatientsCheckBox.setBounds(5, 255, 110, 15);
    jGetAllPatientsCheckBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jGetAllPatientsCheckBoxActionPerformed(evt);
        }
    });

    jRunQueryButton.setText("Run Query Above");
    jRunQueryButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRunQueryButtonActionPerformed(evt);
        }
    });
    add(jRunQueryButton);
    jRunQueryButton.setBounds(100, 255, 625, 23);

    jSetSizeLabel.setText(" Patient(s) returned:");
    add(jSetSizeLabel);
    jSetSizeLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jSetSizeLabel.setBounds(20, 275, 70, 23);

    // jSetSizeFiled.setText(" subjects");
    // jSetSizeFiled.setEditable(false);
    // jSetSizeFiled.setHorizontalAlignment(SwingConstants.LEFT);
    // add(jSetSizeFiled);
    // jSetSizeLabel.setBounds(20, 275, 70, 23);

    jToolbarPanel.setLayout(new java.awt.BorderLayout());

    // jWorkflowToolBar.setRollover(true);
    // jWorkflowToolBar.setInheritsPopupMenu(true);
    // jTimelineToggleButton
    // .setIcon(new javax.swing.ImageIcon(
    // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    // /jTimelineToggleButton.setText("Show TimeLine");
    // jTimelineToggleButton.setFocusPainted(false);
    // jWorkflowToolBar.add(jTimelineToggleButton);

    jPatientCountToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jPatientCountToggleButton.setText("Get Patient Count");
    jPatientCountToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jPatientCountToggleButton);

    // jPatientSetToggleButton
    // .setIcon(new javax.swing.ImageIcon(
    // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    // jPatientSetToggleButton.setText("Get Patient Set");
    // jPatientSetToggleButton.setFocusPainted(false);
    // jWorkflowToolBar.add(jPatientSetToggleButton);
    jWorkflowToolBar.setPreferredSize(new Dimension(380, 40));

    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.PAGE_START);
    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.CENTER);

    // add(jToolbarPanel);
    jToolbarPanel.setBounds(20, 130, 240, 23);

    jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group");
    jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMorePanelsButtonActionPerformed(evt);
        }
    });
    // add(jMorePanelsButton);
    // jMorePanelsButton.setBounds(655, 35, 60, 220);

    jPanel1.add(jMorePanelsButton);
    jMorePanelsButton.setBounds(550, 0, 60, 200);

    // jOptionsPanel.setLayout(null);
    // jOptionsScrollPane.setBorder(javax.swing.BorderFactory
    // .createEtchedBorder());

    // jOptionsPanel.setPreferredSize(new java.awt.Dimension(100, 100));
    jShowTimelineCheckBox.setText("Timeline");
    jShowTimelineCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jShowTimelineCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jShowTimelineCheckBox.setToolTipText("Get the patient set and display it in timeline view");
    // jOptionsPanel.add(jShowTimelineCheckBox);
    jShowTimelineCheckBox.setBounds(5, 20, 110, 15);

    // jGetPatientCountCheckBox.setText("Patient Count");
    // jGetPatientCountCheckBox.setBorder(javax.swing.BorderFactory
    // .createEmptyBorder(0, 0, 0, 0));
    // jGetPatientCountCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jGetPatientCountCheckBox.setToolTipText("Get the patient count XML");
    // jOptionsPanel.add(jGetPatientCountCheckBox);
    // jGetPatientCountCheckBox.setBounds(5, 50, 110, 15);

    // jGetPatientSetCheckBox.setText("Patient Set");
    // jGetPatientSetCheckBox.setBorder(javax.swing.BorderFactory
    // .createEmptyBorder(0, 0, 0, 0));
    // jGetPatientSetCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jOptionsPanel.add(jGetPatientSetCheckBox);
    // jGetPatientSetCheckBox.setBounds(10, 80, 80, 15);

    // jOptionsScrollPane.setViewportView(jOptionsPanel);

    add(jOptionsPanel);
    jOptionsPanel.setBounds(500, 30, 120, 190);

    /*
     * jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new
     * java.awt.event.ActionListener() { public void
     * actionPerformed(java.awt.event.ActionEvent evt) {
     * jDeleteButtonActionPerformed(evt); } });
     * 
     * jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new
     * String[] { "Groups don't have to occur in the same visit", "Groups
     * must all occur in the same visit" })); add(jVisitComboBox);
     * jVisitComboBox.setBounds(20, 40, 240, 22);
     * 
     * //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23);
     * 
     * add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320);
     * 
     * jRunQueryButton.setText("Run Query");
     * jRunQueryButton.addActionListener(new java.awt.event.ActionListener()
     * { public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRunQueryButtonActionPerformed(evt); } });
     * 
     * add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23);
     * 
     * jCancelButton.setText("Remove All");
     * jCancelButton.addActionListener(new java.awt.event.ActionListener() {
     * public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRemoveAllButtonActionPerformed(evt); } });
     * 
     * add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23);
     * 
     * //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
     * ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
     * jPanel1.setLayout(null);
     * jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20);
     * //jPanel1.setVisible(false);
     * 
     * //jScrollPane1.setToolTipText("scrollpane 1");
     * jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350);
     * 
     * jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350);
     */

    jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255));
    jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel1.setText("and");
    jAndOrLabel1.setToolTipText("Click to change the relationship");
    jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel1MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel1);

    jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel2.setText("and");
    jAndOrLabel2.setToolTipText("Click to change the relationship");
    jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel2MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel2);
    // jTree1.addTreeWillExpandListener(this);
    // jTree1.addTreeExpansionListener(this);
    // jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1"));
    // jScrollPane1.setToolTipText("Double click on a folder to view the
    // items inside");
    // jTree2.addTreeExpansionListener(this);
    // jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2"));
    // jTree3.addTreeExpansionListener(this);
    // treepanel = new QueryConceptTreePanel("", this);
    // jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3"));
    // jSlider1.setMajorTickSpacing(20);
    /*
     * jSlider1.setPaintTicks(true); jSlider1.setValue(0);
     * jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on
     * left is more Sensitive Query, " + "on right is more Specific");
     * add(jSlider1); jSlider1.setBounds(380, 40, 140, 18);
     * 
     * //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
     * jLabel1.setText("Sensitivity <"); add(jLabel1);
     * jLabel1.setBounds(290, 40, 80, 20);
     * 
     * //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel2.setText("> Specificity"); add(jLabel2);
     * jLabel2.setBounds(525, 40, 70, 20);
     */

    dataModel.addPanel(jScrollPane1, null, 0);
    dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0);
    dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555);
}