Example usage for javax.swing JTable AUTO_RESIZE_OFF

List of usage examples for javax.swing JTable AUTO_RESIZE_OFF

Introduction

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

Prototype

int AUTO_RESIZE_OFF

To view the source code for javax.swing JTable AUTO_RESIZE_OFF.

Click Source Link

Document

Do not adjust column widths automatically; use a horizontal scrollbar instead.

Usage

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingVoicemailConfPickerJPanel.java

public CFAstSwingVoicemailConfPickerJPanel(ICFAstSwingSchema argSchema, ICFAstVoicemailConfObj argFocus,
        ICFAstHostNodeObj argContainer, Collection<ICFAstVoicemailConfObj> argDataCollection,
        ICFAstSwingVoicemailConfChosen whenChosen) {
    super();//from   w w w .  jav  a 2  s.c  o m
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 5,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    swingFocus = argFocus;
    swingContainer = argContainer;
    setSwingDataCollection(argDataCollection);
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    actionCancel = new ActionCancel();
    buttonCancel = new JButton(actionCancel);
    actionChooseNone = new ActionChooseNone();
    buttonChooseNone = new JButton(actionChooseNone);
    actionChooseSelected = new ActionChooseSelectedVoicemailConf();
    buttonChooseSelected = new JButton(actionChooseSelected);
    // Do initial layout
    setSize(1024, 480);
    add(buttonChooseNone);
    add(buttonChooseSelected);
    add(buttonCancel);
    add(dataScrollPane);
    dataScrollPane.setBounds(0, 35, 1024, 455);
    doLayout();
    setSwingFocusAsVoicemailConf(argFocus);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstSwing.CFAstSwingExtensionsConfPickerJPanel.java

public CFAstSwingExtensionsConfPickerJPanel(ICFAstSwingSchema argSchema, ICFAstExtensionsConfObj argFocus,
        ICFAstHostNodeObj argContainer, Collection<ICFAstExtensionsConfObj> argDataCollection,
        ICFAstSwingExtensionsConfChosen whenChosen) {
    super();/*from  w  w w  .j a v  a 2 s.  c om*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 5,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    swingFocus = argFocus;
    swingContainer = argContainer;
    setSwingDataCollection(argDataCollection);
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    actionCancel = new ActionCancel();
    buttonCancel = new JButton(actionCancel);
    actionChooseNone = new ActionChooseNone();
    buttonChooseNone = new JButton(actionChooseNone);
    actionChooseSelected = new ActionChooseSelectedExtensionsConf();
    buttonChooseSelected = new JButton(actionChooseSelected);
    // Do initial layout
    setSize(1024, 480);
    add(buttonChooseNone);
    add(buttonChooseSelected);
    add(buttonCancel);
    add(dataScrollPane);
    dataScrollPane.setBounds(0, 35, 1024, 455);
    doLayout();
    setSwingFocusAsExtensionsConf(argFocus);
}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmSwing.CFCrmSwingURLProtocolPickerJPanel.java

public CFCrmSwingURLProtocolPickerJPanel(ICFCrmSwingSchema argSchema, ICFCrmURLProtocolObj argFocus,
        ICFLibAnyObj2 argContainer, Collection<ICFCrmURLProtocolObj> argDataCollection,
        ICFCrmSwingURLProtocolChosen whenChosen) {
    super();/*w  ww .j av a2  s .com*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 5,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    swingFocus = argFocus;
    swingContainer = argContainer;
    setSwingDataCollection(argDataCollection);
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    actionCancel = new ActionCancel();
    buttonCancel = new JButton(actionCancel);
    actionChooseNone = new ActionChooseNone();
    buttonChooseNone = new JButton(actionChooseNone);
    actionChooseSelected = new ActionChooseSelectedURLProtocol();
    buttonChooseSelected = new JButton(actionChooseSelected);
    // Do initial layout
    setSize(1024, 480);
    add(buttonChooseNone);
    add(buttonChooseSelected);
    add(buttonCancel);
    add(dataScrollPane);
    dataScrollPane.setBounds(0, 35, 1024, 455);
    doLayout();
    setSwingFocusAsURLProtocol(argFocus);
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingISOCurrencyFinderJPanel.java

public CFInternetSwingISOCurrencyFinderJPanel(ICFInternetSwingSchema argSchema) {
    super();/*from w w w  .  ja va2 s  .  c  o  m*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingISOLanguagePickerJPanel.java

public CFInternetSwingISOLanguagePickerJPanel(ICFInternetSwingSchema argSchema,
        ICFInternetISOLanguageObj argFocus, ICFLibAnyObj2 argContainer,
        Collection<ICFInternetISOLanguageObj> argDataCollection, ICFInternetSwingISOLanguageChosen whenChosen) {
    super();//from ww  w.  j  a  v a  2s .  c om
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 5,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    swingFocus = argFocus;
    swingContainer = argContainer;
    setSwingDataCollection(argDataCollection);
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    actionCancel = new ActionCancel();
    buttonCancel = new JButton(actionCancel);
    actionChooseNone = new ActionChooseNone();
    buttonChooseNone = new JButton(actionChooseNone);
    actionChooseSelected = new ActionChooseSelectedISOLanguage();
    buttonChooseSelected = new JButton(actionChooseSelected);
    // Do initial layout
    setSize(1024, 480);
    add(buttonChooseNone);
    add(buttonChooseSelected);
    add(buttonCancel);
    add(dataScrollPane);
    dataScrollPane.setBounds(0, 35, 1024, 455);
    doLayout();
    setSwingFocusAsISOLanguage(argFocus);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingISOCurrencyFinderJPanel.java

public CFAsteriskSwingISOCurrencyFinderJPanel(ICFAsteriskSwingSchema argSchema) {
    super();/*  ww  w  .j  av a 2s. c o m*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingISOLanguagePickerJPanel.java

public CFAsteriskSwingISOLanguagePickerJPanel(ICFAsteriskSwingSchema argSchema,
        ICFSecurityISOLanguageObj argFocus, ICFLibAnyObj argContainer,
        Collection<ICFSecurityISOLanguageObj> argDataCollection, ICFAsteriskSwingISOLanguageChosen whenChosen) {
    super();/*  w  ww  .  j a  va  2  s  . c  o m*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 5,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    swingFocus = argFocus;
    swingContainer = argContainer;
    setSwingDataCollection(argDataCollection);
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    actionCancel = new ActionCancel();
    buttonCancel = new JButton(actionCancel);
    actionChooseNone = new ActionChooseNone();
    buttonChooseNone = new JButton(actionChooseNone);
    actionChooseSelected = new ActionChooseSelectedISOLanguage();
    buttonChooseSelected = new JButton(actionChooseSelected);
    // Do initial layout
    setSize(1024, 480);
    add(buttonChooseNone);
    add(buttonChooseSelected);
    add(buttonCancel);
    add(dataScrollPane);
    dataScrollPane.setBounds(0, 35, 1024, 455);
    doLayout();
    setSwingFocusAsISOLanguage(argFocus);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingURLProtocolPickerJPanel.java

public CFAsteriskSwingURLProtocolPickerJPanel(ICFAsteriskSwingSchema argSchema,
        ICFInternetURLProtocolObj argFocus, ICFLibAnyObj argContainer,
        Collection<ICFInternetURLProtocolObj> argDataCollection, ICFAsteriskSwingURLProtocolChosen whenChosen) {
    super();//ww  w.jav a  2 s  .c  om
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    if (whenChosen == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 5,
                "whenChosen");
    }
    invokeWhenChosen = whenChosen;
    // argFocus is optional; focus may be set later during execution as
    // conditions of the runtime change.
    swingSchema = argSchema;
    swingFocus = argFocus;
    swingContainer = argContainer;
    setSwingDataCollection(argDataCollection);
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    actionCancel = new ActionCancel();
    buttonCancel = new JButton(actionCancel);
    actionChooseNone = new ActionChooseNone();
    buttonChooseNone = new JButton(actionChooseNone);
    actionChooseSelected = new ActionChooseSelectedURLProtocol();
    buttonChooseSelected = new JButton(actionChooseSelected);
    // Do initial layout
    setSize(1024, 480);
    add(buttonChooseNone);
    add(buttonChooseSelected);
    add(buttonCancel);
    add(dataScrollPane);
    dataScrollPane.setBounds(0, 35, 1024, 455);
    doLayout();
    setSwingFocusAsURLProtocol(argFocus);
}

From source file:coolmap.application.widget.impl.WidgetUserGroup.java

private void init() {

    table.getTableHeader().setReorderingAllowed(false);
    table.setAutoCreateRowSorter(true);//from  w  ww .j  a  va  2s  .  co m
    table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    table.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row,
                    column);
            if (isSelected) {
                return label;
            }

            if (column == 1) {
                try {
                    label.setBackground(
                            nodeColor.get(table.getModel().getValueAt(table.convertRowIndexToModel(row), 0)));
                } catch (Exception e) {

                }
            } else {
                label.setBackground(UI.colorWhite);
            }

            return label;
        }

    });
    //Need a search box as well.

    //
    getContentPane().setLayout(new BorderLayout());

    //
    getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
    JToolBar t = new JToolBar();
    getContentPane().add(t, BorderLayout.NORTH);
    t.setFloatable(false);

    try {
        //also add an action to add group nodes
        JMenuItem item = new JMenuItem("selected row nodes");
        item.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {

                CoolMapObject o = CoolMapMaster.getActiveCoolMapObject();
                if (o == null) {
                    return;
                }

                ArrayList<Range<Integer>> selected = o.getCoolMapView().getSelectedRows();
                ArrayList<VNode> selectedNodes = new ArrayList<>();

                for (Range<Integer> r : selected) {
                    for (int i = r.lowerEndpoint(); i < r.upperEndpoint(); i++) {
                        selectedNodes.add(o.getViewNodeRow(i));
                    }
                }

                createNewGroup(selectedNodes);

                //create a group
            }
        });
        WidgetMaster.getViewport().addPopupMenuItem("Create group", item, false);

        item = new JMenuItem("selected column nodes");
        item.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {

                CoolMapObject o = CoolMapMaster.getActiveCoolMapObject();
                if (o == null) {
                    return;
                }

                ArrayList<Range<Integer>> selected = o.getCoolMapView().getSelectedColumns();
                ArrayList<VNode> selectedNodes = new ArrayList<>();

                for (Range<Integer> r : selected) {
                    for (int i = r.lowerEndpoint(); i < r.upperEndpoint(); i++) {
                        selectedNodes.add(o.getViewNodeColumn(i));
                    }
                }

                createNewGroup(selectedNodes);

            }
        });
        WidgetMaster.getViewport().addPopupMenuItem("Create group", item, false);
    } catch (Exception e) {
        //
        //Error handling.
    }

}

From source file:org.fhcrc.cpl.viewer.gui.MRMDialog.java

private void peaksDataInitializations() {
    String classElements[] = _ecurveclass.getName().split("\\.");
    elutionTableLabel.setText("<html><body><center>Elution Data<br><font size='-1'>("
            + classElements[classElements.length - 1] + ")</font></center></body></html>");
    elutionTableLabel.setHorizontalAlignment(JLabel.CENTER);
    elutionTableLabel.setHorizontalTextPosition(JLabel.CENTER);

    if (transDefHeader == null || transDefHeader.getAQUApairs() == null
            || transDefHeader.getAQUApairs().size() == 0) {
        buttonFindMate.setVisible(false);
    } else {/*from   w ww  . j ava  2  s.c  o  m*/
        buttonFindMate.setVisible(true);
    }
    peaksScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    peaksScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    peaksTable = new JTable(new PeaksTableModel());
    //peaksTable.setPreferredScrollableViewportSize(new Dimension(500, 700));
    peaksTable.setSelectionModel(new peaksTableSelectionModel());
    peaksTable.setAutoscrolls(true);
    peaksTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);

    int totalTableRows = 1;
    for (MRMTransition curTrans : _mrmTransitions)
        totalTableRows += (1 + curTrans.getDaughters().size());
    ((PeaksTableModel) (peaksTable.getModel())).data = new Object[totalTableRows
            - 1][peaksData.values().length];
    for (peaksData pd : EnumSet.allOf(peaksData.class)) {
        peaksTable.getColumnModel().getColumn(pd.colno).setPreferredWidth(pd.colWidth);
    }
    peaksTable.doLayout();
    ((DefaultCellEditor) peaksTable.getDefaultEditor(peaksData.Accept.colClass)).setClickCountToStart(1);
    int i = 0;
    for (MRMTransition curTrans : _mrmTransitions) {
        curTrans.setGraphData(makeParentSeries(curTrans));
        int curPrecursorIndex = i;
        curTrans.setTableRow(curPrecursorIndex);
        for (peaksData pd : EnumSet.allOf(peaksData.class)) {
            ((PeaksTableModel) (peaksTable.getModel())).data[i][pd.colno] = null;
            pd.makeVisible(true);
        }

        ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Accept.colno] = null;
        ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Precursor.colno] = curTrans;
        for (MRMDaughter d : curTrans.getDaughters().values()) {
            i++;
            d.setGraphData(d.makeDaughterSeries());
            d.setContinDaughterData(d.makeDaughterSeries(d, true));
            d.setElutionDataTableRow(i);
            ElutionCurveStrategy bes = ElutionCurveStrategy.getInstance(curTrans, d, _ecurveclass);
            bes.calculateParentElutionCurves(null);
            bes.calculateDaughterElutionCurves(null);
            bes.calculateBestCurves();
            d.calculateQuality();
            curTrans.getElutionCurves().put(d, bes);

            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Accept.colno] = new Boolean(
                    !Utils.allYsAre0(d));
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Peptide.colno] = "";
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Precursor.colno] = curTrans;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Daughter.colno] = d;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.CoStart.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.CoEnd.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.CoDelta.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.AUC.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.MaxPeak.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.MidTime.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Quality.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Label.colno] = "";
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Code.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.LHRatio.colno] = null;
            ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Comment.colno] = "";
            if (transDefHeader != null && transDefHeader.getDToTD() != null
                    && transDefHeader.getDToTD().get(d) != null) {
                TransitionDefinition td = transDefHeader.getDToTD().get(d);
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Peptide.colno] = td.getPeptide();
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.Peptide.colno] = td.getPeptide();
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Code.colno] = new Integer(
                        td.getAQUAcode());
            }
            ElutionCurve bestPrecursorCurve = bes.getBestParentCurve();
            if (bestPrecursorCurve == null || bestPrecursorCurve.getMinElutionTimeSecs() <= 0.0) {
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.AUC.colno] = new Float(-1);
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.MaxPeak.colno] = new Float(-1);
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.Quality.colno] = new Float(-1);
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.MidTime.colno] = new Float(-1);

            } else {
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.AUC.colno] = new Float(
                                bestPrecursorCurve.getAUC());
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.MaxPeak.colno] = new Float(
                                bestPrecursorCurve.getHighestPointY());
                ((PeaksTableModel) (peaksTable
                        .getModel())).data[curPrecursorIndex][peaksData.Quality.colno] = new Float(
                                curTrans.getQuality());
            }

            ElutionCurve bestDaughterCurve = bes.getBestDaughterCurve();
            if (bestDaughterCurve == null || bestDaughterCurve.getMinElutionTimeSecs() <= 0.0) {
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Accept.colno] = new Boolean(
                        false);
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.AUC.colno] = new Float(-1);
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.MaxPeak.colno] = new Float(-1);
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Quality.colno] = new Float(-1);
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.MidTime.colno] = new Float(-1);

            } else {
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.AUC.colno] = new Float(
                        bestDaughterCurve.getAUC());
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.MaxPeak.colno] = new Float(
                        bestDaughterCurve.getHighestPointY());
                d.setBestElutionCurve(bestDaughterCurve);
                ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Quality.colno] = new Float(
                        d.getQuality());
                if (_minPeakCutoff > 0 && bestDaughterCurve.getHighestPointY() < _minPeakCutoff)
                    ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Accept.colno] = new Boolean(
                            false);
                if (_minAreaCutoff > 0 && bestDaughterCurve.getAUC() < _minAreaCutoff)
                    ((PeaksTableModel) (peaksTable.getModel())).data[i][peaksData.Accept.colno] = new Boolean(
                            false);
            }
        }
        curTrans.setElutionRegionStart(curTrans.calculateMinOfAllBestDaughterCurves());
        curTrans.setElutionRegionEnd(curTrans.calculateMaxOfAllBestDaughterCurves());
        curTrans.calcMaxYofAllDaughters();
        for (int j = curPrecursorIndex; j <= i; j++) {
            ((PeaksTableModel) (peaksTable.getModel())).data[j][peaksData.CoStart.colno] = new Float(
                    curTrans.getElutionRegionStart());
            ((PeaksTableModel) (peaksTable.getModel())).data[j][peaksData.CoEnd.colno] = new Float(
                    curTrans.getElutionRegionEnd());
            ((PeaksTableModel) (peaksTable.getModel())).data[j][peaksData.CoDelta.colno] = new Float(
                    curTrans.getElutionRegionEnd() - curTrans.getElutionRegionStart());
            ((PeaksTableModel) (peaksTable.getModel())).data[j][peaksData.MidTime.colno] = new Float(
                    curTrans.getCalcXatMaxYAllDaughters());
        }
        i++;
    }

    peaksTable.setDefaultRenderer(MRMTransition.class, new MRMTransitionTableRenderer(false));
    peaksTable.setDefaultRenderer(MRMDaughter.class, new MRMDaughterTableRenderer(false));
    peaksTable.setDefaultRenderer(Number.class, new MRMNumberTableRenderer());
    peaksTable.setDefaultRenderer(Integer.class, new MRMNumberTableRenderer());
    peaksTable.setDefaultRenderer(Boolean.class, new MRMBooleanRenderer());
    peaksTable.getColumnModel().getColumn(peaksData.CoStart.colno).setCellEditor(new NumberTableCellEditor());
    peaksTable.getColumnModel().getColumn(peaksData.CoEnd.colno).setCellEditor(new NumberTableCellEditor());
    peaksTable.getColumnModel().getColumn(peaksData.Code.colno).setCellEditor(new NumberTableCellEditor());
    peaksTable.getColumnModel().getColumn(peaksData.LHRatio.colno).setCellEditor(new NumberTableCellEditor());

    peaksScrollPane.getViewport().setView(peaksTable);

    if (transDefHeader == null) {
        peaksData.Peptide.makeVisible(false);
        peaksData.Label.makeVisible(false);
        peaksData.LHRatio.makeVisible(false);
        peaksData.Code.makeVisible(false);
    } else {
        if (transDefHeader.getAQUApairs() == null || transDefHeader.getAQUApairs().isEmpty()) {
            peaksData.Label.makeVisible(false);
            peaksData.LHRatio.makeVisible(false);
            peaksData.Code.makeVisible(false);
        }
    }

    //  "Quality" column, currently unused, is invisible unless one or more of its
    //  values is not -1          
    peaksData.Quality.makeVisible(!Utils.qualColIsEmpty());

    peaksScrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
        public void adjustmentValueChanged(AdjustmentEvent ae) {
            if (!ae.getValueIsAdjusting()) {
                peaksTable.repaint();
            }
        }
    });
    peaksTable.getModel().addTableModelListener(new peaksTableListener());
    _ptmlsl = new PeaksTableListSelectionListener();
    peaksTable.getSelectionModel().addListSelectionListener(_ptmlsl);

}