Example usage for javax.swing JTable rowAtPoint

List of usage examples for javax.swing JTable rowAtPoint

Introduction

In this page you can find the example usage for javax.swing JTable rowAtPoint.

Prototype

public int rowAtPoint(Point point) 

Source Link

Document

Returns the index of the row that point lies in, or -1 if the result is not in the range [0, getRowCount()-1].

Usage

From source file:com.github.lindenb.jvarkit.tools.bamviewgui.BamFileRef.java

private static JTable createTable(TableModel m) {
    JTable t = new JTable(m) {
        @Override//w  w  w. ja  v  a 2 s . com
        public String getToolTipText(MouseEvent event) {
            JTable t = (JTable) event.getSource();
            int x = t.rowAtPoint(event.getPoint());
            if (x == -1)
                return null;
            int y = t.columnAtPoint(event.getPoint());
            if (y == -1)
                return null;
            Object o = t.getValueAt(x, y);
            if (o == null)
                return null;
            return String.valueOf(o);
        }

    };
    t.setToolTipText("");
    t.setShowVerticalLines(false);
    DefaultTableCellRenderer render = new DefaultTableCellRenderer() {
        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            if (!isSelected && !hasFocus)
                this.setBackground(row % 2 == 0 ? color1 : color2);
            if (value != null && value instanceof Boolean) {
                if (Boolean.TRUE.equals(value))
                    this.setText("\u2612");
                else if (Boolean.FALSE.equals(value))
                    this.setText("");
            }
            return c;
        }
    };
    render.setOpaque(true);
    for (int i = 0; i < t.getColumnModel().getColumnCount(); ++i) {
        t.getColumnModel().getColumn(i).setCellRenderer(render);
    }
    return t;
}

From source file:latexstudio.editor.DropboxRevisionsTopComponent.java

private void jTable1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MousePressed
    if (evt.getClickCount() == 2) {
        // Resolving which row has been double-clicked
        Point point = evt.getPoint();
        JTable table = (JTable) evt.getSource();
        int row = table.rowAtPoint(point);
        // Finding revision using information from the clicked row
        Object revisionNumber = table.getValueAt(row, REVISION_COLUMN);
        if (revisionNumber != null) {
            loadRevision(revisionNumber.toString());
        }/*  ww  w.j a  v a  2  s .  c o  m*/
    }
}

From source file:com.choicemaker.cm.modelmaker.gui.panels.HoldVsAccuracyPlotPanel.java

private void buildPanel() {
    XYSeriesCollection dataset = new XYSeriesCollection();
    String title = ChoiceMakerCoreMessages.m.formatMessage("train.gui.modelmaker.panel.holdvsacc.title");
    data = new XYSeries(title);
    dataset.addSeries(data);/*from w w w  . j a  va2s.  c  o m*/
    final PlotOrientation orientation = PlotOrientation.VERTICAL;
    chart = ChartFactory.createXYLineChart(title,
            ChoiceMakerCoreMessages.m.formatMessage("train.gui.modelmaker.panel.holdvsacc.cm.accuracy"),
            ChoiceMakerCoreMessages.m.formatMessage("train.gui.modelmaker.panel.holdvsacc.holdpercentage"),
            dataset, orientation, true, true, true);
    MouseListener tableMouseListener = new MouseAdapter() {
        public void mousePressed(MouseEvent e) {
            Point origin = e.getPoint();
            JTable src = (JTable) e.getSource();
            int row = src.rowAtPoint(origin);
            int col = src.columnAtPoint(origin);
            ModelMaker mm = parent.getModelMaker();
            if (src == accuracyTable) {
                if (col < 2) {
                    if (!Float.isNaN(accuracyData[row][2]) && !Float.isNaN(accuracyData[row][3]))
                        mm.setThresholds(new Thresholds(accuracyData[row][2], accuracyData[row][3]));
                } else if (col == 2) {
                    if (!Float.isNaN(accuracyData[row][2]))
                        mm.setDifferThreshold(accuracyData[row][2]);
                } else {
                    if (!Float.isNaN(accuracyData[row][3]))
                        mm.setMatchThreshold(accuracyData[row][3]);
                }
            } else {
                if (col < 2) {
                    if (!Float.isNaN(hrData[row][2]) && !Float.isNaN(hrData[row][3]))
                        mm.setThresholds(new Thresholds(hrData[row][2], hrData[row][3]));
                } else if (col == 2) {
                    if (!Float.isNaN(hrData[row][2]))
                        mm.setDifferThreshold(hrData[row][2]);
                } else {
                    if (!Float.isNaN(hrData[row][3]))
                        mm.setMatchThreshold(hrData[row][3]);
                }
            }
        }
    };
    chart.setBackgroundPaint(getBackground());
    accuracyTable = new AccuracyTable(true, accuracies);
    accuracyTable.addMouseListener(tableMouseListener);
    accuracyPanel = getPanel(accuracyTable,
            ChoiceMakerCoreMessages.m.formatMessage("train.gui.modelmaker.panel.holdvsacc.table.hrvsacc"));

    hrTable = new AccuracyTable(false, hrs);
    hrTable.addMouseListener(tableMouseListener);
    hrPanel = getPanel(hrTable,
            ChoiceMakerCoreMessages.m.formatMessage("train.gui.modelmaker.panel.holdvsacc.table.accvshr"));

    accuracyTable.setEnabled(false);
    hrTable.setEnabled(false);
}

From source file:org.zaproxy.zap.extension.multiFuzz.impl.http.HttpFuzzResultDialog.java

@Override
public JXTreeTable getTable() {
    if (table == null) {
        if (model == null) {
            model = new HttpFuzzTableModel();
        }//from   w w  w. j av  a  2 s  .  c o  m
        table = new JXTreeTable(model);
        table.setDoubleBuffered(true);
        table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
        table.setName("HttpFuzzResultTable");
        table.setFont(new java.awt.Font("Default", java.awt.Font.PLAIN, 12));
        table.setDefaultRenderer(Pair.class, new IconTableCellRenderer());

        int[] widths = { 10, 25, 550, 30, 85, 55, 40, 70 };
        for (int i = 0, count = widths.length; i < count; i++) {
            TableColumn column = table.getColumnModel().getColumn(i);
            column.setPreferredWidth(widths[i]);
        }
        table.addMouseListener(new java.awt.event.MouseAdapter() {
            @Override
            public void mousePressed(java.awt.event.MouseEvent e) {
                showPopupMenuIfTriggered(e);
            }

            @Override
            public void mouseReleased(java.awt.event.MouseEvent e) {
                showPopupMenuIfTriggered(e);
            }

            private void showPopupMenuIfTriggered(java.awt.event.MouseEvent e) {
                if (e.isPopupTrigger()) {
                    if (e.isPopupTrigger()) {
                        // Select list item on right click
                        JTable table = (JTable) e.getSource();
                        int row = table.rowAtPoint(e.getPoint());

                        if (!table.isRowSelected(row)) {
                            table.changeSelection(row, 0, false, false);
                        }
                        View.getSingleton().getPopupMenu().show(e.getComponent(), e.getX(), e.getY());
                    }
                }
            }

        });
        table.getSelectionModel().addListSelectionListener(new javax.swing.event.ListSelectionListener() {

            @Override
            public void valueChanged(javax.swing.event.ListSelectionEvent e) {
                if (!e.getValueIsAdjusting()) {
                    if (table.getSelectedRowCount() == 0) {
                        return;
                    }
                    final int row = table.getSelectedRow();
                    if (getEntry(row) instanceof HttpFuzzRequestRecord) {
                        final HistoryReference historyReference = ((HttpFuzzRequestRecord) getEntry(row))
                                .getHistory();
                        try {
                            getMessageInspection().setMessage(historyReference.getHttpMessage());
                        } catch (HttpMalformedHeaderException | SQLException ex) {
                            logger.error(ex.getMessage(), ex);
                        }
                    }
                    updateValues();
                    redrawDiagrams();
                }
            }
        });
    }
    table.getTableHeader().addMouseListener(new MouseListener() {
        int sortedOn = -1;

        @Override
        public void mouseReleased(MouseEvent arg0) {
        }

        @Override
        public void mousePressed(MouseEvent arg0) {
        }

        @Override
        public void mouseExited(MouseEvent arg0) {
        }

        @Override
        public void mouseEntered(MouseEvent arg0) {
        }

        @Override
        public void mouseClicked(MouseEvent e) {
            int index = table.columnAtPoint(e.getPoint());
            List<HttpFuzzRecord> list = model.getEntries();
            if (list.size() == 0) {
                return;
            }
            HttpFuzzRecordComparator comp = new HttpFuzzRecordComparator();
            comp.setFeature(index);
            if (index == sortedOn) {
                Collections.sort(list, comp);
                Collections.reverse(list);
                sortedOn = -1;
            } else {
                Collections.sort(list, comp);
                sortedOn = index;
            }
            table.updateUI();
        }
    });
    table.setRootVisible(false);
    table.setVisible(true);
    return table;
}

From source file:org.drugis.addis.gui.builder.NetworkMetaAnalysisView.java

private MouseAdapter treatmentCategorizationListener(final NetworkRelativeEffectTableCellRenderer renderer) {
    return new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() > 1) {
                JTable table = (JTable) e.getComponent();
                int row = table.convertRowIndexToModel(table.rowAtPoint(e.getPoint()));
                int col = table.convertColumnIndexToModel(table.columnAtPoint(e.getPoint()));
                if (col == row) {
                    Treatment treatment = renderer.getTreatment(table.getModel(), col);
                    TreatmentDefinition treatmentDefinition = d_pm.getTreatmentDefinition(treatment);
                    Category category = treatmentDefinition.getContents().first();
                    if (category != null && !category.isTrivial()) {
                        d_mainWindow.leftTreeFocus(category.getCategorization());
                    }//w  w w.j  a v a2 s.co m
                }
            }
        }
    };
}

From source file:com.openbravo.pos.sales.JTicketLines.java

/** Creates new form JLinesTicket */
public JTicketLines(AppView app, String propertyRowHeight, String propertyFontsize, String ticketline) {
    this.m_App = app;
    initComponents();//from ww w  .ja  v  a 2s.c  o m

    m_jTicketTable.m_App = app;
    m_jTicketTable.propertyRowHeight = propertyRowHeight;

    ColumnTicket[] acolumns = new ColumnTicket[0];

    if (ticketline != null) {
        try {
            if (m_sp == null) {
                SAXParserFactory spf = SAXParserFactory.newInstance();
                m_sp = spf.newSAXParser();
            }
            ColumnsHandler columnshandler = new ColumnsHandler();
            m_sp.parse(new InputSource(new StringReader(ticketline)), columnshandler);
            acolumns = columnshandler.getColumns();

        } catch (ParserConfigurationException ePC) {
            logger.log(Level.WARNING, LocalRes.getIntString("exception.parserconfig"), ePC);
        } catch (SAXException eSAX) {
            logger.log(Level.WARNING, LocalRes.getIntString("exception.xmlfile"), eSAX);
        } catch (IOException eIO) {
            logger.log(Level.WARNING, LocalRes.getIntString("exception.iofile"), eIO);
        }
    }

    Map<String, Integer> widths = PropertyUtil.getTicketLineWidths(m_App);
    for (ColumnTicket acolumn : acolumns) {
        Integer width = widths.get(acolumn.name);
        if (width == null) {
            continue;
        }
        acolumn.width = width;
    }

    m_jTableModel = new TicketTableModel(acolumns);
    m_jTicketTable.setModel(m_jTableModel);

    m_jTicketTable.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
    TableColumnModel jColumns = m_jTicketTable.getColumnModel();
    for (int i = 0; i < acolumns.length; i++) {
        jColumns.getColumn(i).setPreferredWidth(acolumns[i].width);
        jColumns.getColumn(i).setResizable(true);
    }

    PropertyUtil.ScaleScrollbar(m_App, m_jScrollTableTicket);

    m_jTicketTable.getTableHeader().setReorderingAllowed(false);
    // m_jTicketTable.setDefaultRenderer(Object.class, new
    // TicketCellRenderer(app, acolumns, propertyFontsize));
    m_jTicketTable.setDefaultRenderer(Object.class,
            new RowHeightCellRenderer(app, acolumns, propertyFontsize, propertyRowHeight));

    PropertyUtil.ScaleTableColumnFontsize(m_App, m_jTicketTable, "sales-tablecolumn-fontsize", "14");

    m_jTicketTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    m_jTicketTable.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent me) {
            JTable table = (JTable) me.getSource();
            Point p = me.getPoint();
            int row = table.rowAtPoint(p);
            if (me.getClickCount() == 2) {
                // your valueChanged overridden method
                listDoubleClickListener.valueChanged(new ListSelectionEvent(m_jTicketTable, row, row, false));
            }
        }
    });
    // reseteo la tabla...
    m_jTableModel.clear();
}

From source file:canreg.client.gui.analysis.FrequenciesByYearInternalFrame.java

/**
 *
 * @param offset/*from  w  ww.ja  v  a 2  s . c  o m*/
 * @param evt
 */
public void showPopUpMenu(int offset, java.awt.event.MouseEvent evt) {
    JTable target = (JTable) evt.getSource();
    int rowNumber = target.rowAtPoint(new Point(evt.getX(), evt.getY()));
    rowNumber = target.convertRowIndexToModel(rowNumber);

    JPopupMenu jpm = new JPopupMenu();
    jpm.add(java.util.ResourceBundle
            .getBundle("canreg/client/gui/analysis/resources/FrequenciesByYearInternalFrame")
            .getString("SHOW_IN_BROWSER"));
    TableModel tableModel = target.getModel();
    // resultTable.get
    // jpm.add("Column " + rowNumber +" " + tableColumnModel.getColumn(tableColumnModel.getColumnIndexAtX(evt.getX())).getHeaderValue());
    int year = Integer.parseInt((String) tableModel.getValueAt(rowNumber, 0));

    String filterString = "INCID >= '" + year * 10000 + "' AND INCID <'" + (year + 1) * 10000 + "'";

    for (DatabaseVariablesListElement dvle : chosenVariables) {
        int columnNumber = tableColumnModel
                .getColumnIndex(canreg.common.Tools.toUpperCaseStandardized(dvle.getDatabaseVariableName()));
        String value = tableModel.getValueAt(rowNumber, columnNumber).toString();
        filterString += " AND " + canreg.common.Tools.toUpperCaseStandardized(dvle.getDatabaseVariableName())
                + " = " + dvle.getSQLqueryFormat(value);
    }
    DatabaseFilter filter = new DatabaseFilter();
    filter.setFilterString(filterString);
    Logger.getLogger(FrequenciesByYearInternalFrame.class.getName()).log(Level.INFO, "FilterString: {0}",
            filterString);
    try {
        tableDatadescriptionPopUp = canreg.client.CanRegClientApp.getApplication()
                .getDistributedTableDescription(filter, rangeFilterPanel.getSelectedTable());
        Object[][] rows = canreg.client.CanRegClientApp.getApplication().retrieveRows(
                tableDatadescriptionPopUp.getResultSetID(), 0, MAX_ENTRIES_DISPLAYED_ON_RIGHT_CLICK);
        String[] variableNames = tableDatadescriptionPopUp.getColumnNames();
        for (Object[] row : rows) {
            String line = "";
            int i = 0;
            for (Object obj : row) {
                if (obj != null) {
                    line += variableNames[i] + ": " + obj.toString() + ", ";
                }
                i++;
            }
            jpm.add(line);
        }
    } catch (SQLException ex) {
        Logger.getLogger(FrequenciesByYearInternalFrame.class.getName()).log(Level.SEVERE, null, ex);
    } catch (RemoteException ex) {
        Logger.getLogger(FrequenciesByYearInternalFrame.class.getName()).log(Level.SEVERE, null, ex);
    } catch (SecurityException ex) {
        Logger.getLogger(FrequenciesByYearInternalFrame.class.getName()).log(Level.SEVERE, null, ex);
    } catch (DistributedTableDescriptionException ex) {
        Logger.getLogger(FrequenciesByYearInternalFrame.class.getName()).log(Level.SEVERE, null, ex);
    } catch (UnknownTableException ex) {
        Logger.getLogger(FrequenciesByYearInternalFrame.class.getName()).log(Level.SEVERE, null, ex);
    }

    int cases = (Integer) tableModel.getValueAt(rowNumber, tableColumnModel.getColumnIndex("CASES"));
    if (MAX_ENTRIES_DISPLAYED_ON_RIGHT_CLICK < cases) {
        jpm.add("...");
    }
    MenuItem menuItem = new MenuItem();

    jpm.show(target, evt.getX(), evt.getY());
}

From source file:me.mayo.telnetkek.MainPanel.java

public final void setupTablePopup() {
    this.tblPlayers.addMouseListener(new MouseAdapter() {
        @Override/*from  w  w w  . j a  v  a2s  .c om*/
        public void mouseReleased(final MouseEvent mouseEvent) {
            final JTable table = MainPanel.this.tblPlayers;

            final int r = table.rowAtPoint(mouseEvent.getPoint());
            if (r >= 0 && r < table.getRowCount()) {
                table.setRowSelectionInterval(r, r);
            } else {
                table.clearSelection();
            }

            final int rowindex = table.getSelectedRow();
            if (rowindex < 0) {
                return;
            }

            if ((SwingUtilities.isRightMouseButton(mouseEvent) || mouseEvent.isControlDown())
                    && mouseEvent.getComponent() instanceof JTable) {
                final PlayerInfo player = getSelectedPlayer();
                if (player != null) {
                    final JPopupMenu popup = new JPopupMenu(player.getName());

                    final JMenuItem header = new JMenuItem("Apply action to " + player.getName() + ":");
                    header.setEnabled(false);
                    popup.add(header);

                    popup.addSeparator();

                    final ActionListener popupAction = (ActionEvent actionEvent) -> {
                        Object _source = actionEvent.getSource();
                        if (_source instanceof PlayerListPopupItem_Command) {
                            final PlayerListPopupItem_Command source = (PlayerListPopupItem_Command) _source;
                            final String output = source.getCommand().buildOutput(source.getPlayer(), true);
                            MainPanel.this.getConnectionManager().sendDelayedCommand(output, true, 100);
                        } else if (_source instanceof PlayerListPopupItem) {
                            final PlayerListPopupItem source = (PlayerListPopupItem) _source;

                            final PlayerInfo _player = source.getPlayer();

                            switch (actionEvent.getActionCommand()) {
                            case "Copy IP": {
                                copyToClipboard(_player.getIp());
                                MainPanel.this.writeToConsole(
                                        new ConsoleMessage("Copied IP to clipboard: " + _player.getIp()));
                                break;
                            }
                            case "Copy Name": {
                                copyToClipboard(_player.getName());
                                MainPanel.this.writeToConsole(
                                        new ConsoleMessage("Copied name to clipboard: " + _player.getName()));
                                break;
                            }
                            case "Copy UUID": {
                                copyToClipboard(_player.getUuid());
                                MainPanel.this.writeToConsole(
                                        new ConsoleMessage("Copied UUID to clipboard: " + _player.getUuid()));
                                break;
                            }
                            }
                        }
                    };

                    TelnetKek.config.getCommands().stream().map(
                            (command) -> new PlayerListPopupItem_Command(command.getName(), player, command))
                            .map((item) -> {
                                item.addActionListener(popupAction);
                                return item;
                            }).forEach((item) -> {
                                popup.add(item);
                            });

                    popup.addSeparator();

                    JMenuItem item;

                    item = new PlayerListPopupItem("Copy Name", player);
                    item.addActionListener(popupAction);
                    popup.add(item);

                    item = new PlayerListPopupItem("Copy IP", player);
                    item.addActionListener(popupAction);
                    popup.add(item);

                    item = new PlayerListPopupItem("Copy UUID", player);
                    item.addActionListener(popupAction);
                    popup.add(item);

                    popup.show(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY());
                }
            }
        }
    });
}

From source file:com.univocity.app.swing.DataAnalysisWindow.java

private void addPopupMenuToTable(DaoTable daoTable, boolean isSourceTable) {
    String engineName = isSourceTable ? config.getSourceEngineName() : config.getDestinationEngineName();

    if (engineName == null) {
        return;//  ww  w . j  a  v a  2  s  .  c o  m
    }

    final JTable table = daoTable.getDataTable();
    final JPopupMenu menu = new JPopupMenu();
    menu.add(newJMenuItem("Disable updates", daoTable, engineName, false, false));
    menu.add(newJMenuItem("Enable updates", daoTable, engineName, true, false));
    menu.add(new JSeparator());
    menu.add(newJMenuItem("Disable updates on all rows", daoTable, engineName, false, true));
    menu.add(newJMenuItem("Enable updates on all rows", daoTable, engineName, true, true));

    table.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            if (e.getButton() == MouseEvent.BUTTON3) {
                int rowNumber = table.rowAtPoint(e.getPoint());
                if (rowNumber != -1) {
                    table.getSelectionModel().setSelectionInterval(rowNumber, rowNumber);
                    menu.show(table, e.getX(), e.getY());
                }
            }
        };
    });
}

From source file:com.github.dougkelly88.FLIMPlateReaderGUI.FLIMClasses.GUIComponents.FLIMPanel.java

private void setControlDefaults() {

    String[] colName = { "Delays (ps)" };
    int max = 16666;
    try {/*from  w ww . ja va2  s  .  co m*/
        max = Integer.parseInt(core_.getProperty("Laser", "Frequency"));
    } catch (Exception e) {
    }

    tableModel_ = new DelayTableModel(colName, (sap_.getDelaysArray()).get(0), 0, max, 25);
    tableModel_.addTableModelListener(new TableModelListener() {
        @Override
        public void tableChanged(TableModelEvent e) {
            sap_.setDelaysArray(0, tableModel_.getData());
            fm_.setGatingData((sap_.getDelaysArray()).get(0));
            var_.delays = tableModel_.getData();
        }
    });
    delayTable_ = new JTable() {
        @Override
        public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
            Component comp = super.prepareRenderer(renderer, row, column);
            int modelRow = convertRowIndexToModel(row);
            int modelColumn = convertColumnIndexToModel(column);
            if (modelColumn != 0 && modelRow != 0) {
                comp.setBackground(Color.GREEN);
            }

            return comp;
        }
    };
    delayTable_.setModel(tableModel_);
    delayTable_.setSurrendersFocusOnKeystroke(true);
    delayTable_.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);

    JScrollPane scroller = new javax.swing.JScrollPane(delayTable_);
    delayTable_.setPreferredScrollableViewportSize(new java.awt.Dimension(60, 100));
    delayTablePanel.setLayout(new BorderLayout());
    delayTablePanel.add(scroller, BorderLayout.CENTER);

    final JPopupMenu popupMenu = new JPopupMenu();
    JMenuItem deleteItem = new JMenuItem("Delete delay");
    deleteItem.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            int r = delayTable_.getSelectedRow();
            tableModel_.removeRow(r);
        }
    });
    JMenuItem addItem = new JMenuItem("Add delay");
    addItem.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            int r = delayTable_.getSelectedRow();
            tableModel_.insertRow(r + 1, 0);
        }
    });
    popupMenu.add(addItem);
    popupMenu.add(deleteItem);
    delayTable_.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent e) {
            //                System.out.println("pressed");
        }

        public void mouseReleased(MouseEvent e) {
            if (e.isPopupTrigger()) {
                JTable source = (JTable) e.getSource();
                int row = source.rowAtPoint(e.getPoint());
                int column = source.columnAtPoint(e.getPoint());

                if (!source.isRowSelected(row))
                    source.changeSelection(row, column, false, false);

                popupMenu.show(e.getComponent(), e.getX(), e.getY());
            }
        }
    });

    // Set up slider controls
    mcpSlider_ = new SliderControl("MCP voltage (V)", 300, 850, 750);
    mcpVoltagePanel.setLayout(new BorderLayout());
    mcpVoltagePanel.add(mcpSlider_, BorderLayout.SOUTH);
    mcpSlider_.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

        @Override
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            mcpSliderPropertyChange(evt);
        }
    });

    gatewidthSlider_ = new SliderControl("Gate width (ps)", 200, 7000, 3000);
    gatewidthPanel.setLayout(new BorderLayout());
    gatewidthPanel.add(gatewidthSlider_, BorderLayout.SOUTH);
    gatewidthSlider_.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

        @Override
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            gatewidthSliderPropertyChange(evt);
        }
    });

    HRIControlsPanel.revalidate();
    HRIControlsPanel.repaint();

    slowDelaySlider_ = new SliderControl("Current delay setting (ps)", 0, 20000, 0);
    slowCurrentDelayPanel.setLayout(new BorderLayout());
    slowCurrentDelayPanel.add(slowDelaySlider_, BorderLayout.SOUTH);
    slowDelaySlider_.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

        @Override
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            slowDelaySlider_.setValue(tableModel_.validateData(slowDelaySlider_.getValue().intValue()));
            slowDelaySliderPropertyChange(evt);
        }
    });

    fastDelaySlider_ = new SliderControl("Current delay setting (ps)", 0, 20000, 0);
    fastCurrentDelayPanel.setLayout(new BorderLayout());
    fastCurrentDelayPanel.add(fastDelaySlider_, BorderLayout.SOUTH);
    fastDelaySlider_.addPropertyChangeListener(new java.beans.PropertyChangeListener() {

        @Override
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            fastDelaySlider_.setValue(tableModel_.validateData(fastDelaySlider_.getValue().intValue()));
            fastDelaySliderPropertyChange(evt);
        }
    });

    delayBoxTabbedPane.revalidate();
    delayBoxTabbedPane.repaint();

    fm_ = new FindMaxpoint();
    maxpointGraphPanel.setLayout(new BorderLayout());
    chartPanel_ = new ChartPanel(fm_.getChart());
    maxpointGraphPanel.add(chartPanel_, BorderLayout.NORTH);
    // for some reason maxpointGraphPanel's height and width are returned 0
    // so hardcode for now...
    chartPanel_.setMaximumDrawWidth(500);
    chartPanel_.setMaximumDrawHeight(200);
    chartPanel_.setPreferredSize(new Dimension(500, 200));

    // Set values for other controls based on underlying data to ensure
    // that all controls are in a consistent state. 
    scanDelCheck.setSelected(sap_.getUseScanFLIM());

}