Search in sources :

Example 1 with PrintProperties

use of quick.dbtable.PrintProperties in project mafscaling by vimsh.

the class LogView method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    if (e.getSource() == loadButton)
        selectLogFile();
    else if (e.getSource() == printButton)
        logDataTable.print(new PrintProperties());
    else if (e.getSource() == previewButton)
        logDataTable.printPreview(new PrintProperties());
    else if (e.getSource() == findButton) {
        if (findWindow != null)
            findWindow.dispose();
        findWindow = new DBTFindFrame(SwingUtilities.windowForComponent(this), logDataTable, true);
    } else if (e.getSource() == replaceButton) {
        if (findWindow != null)
            findWindow.dispose();
        findWindow = new DBTFindFrame(SwingUtilities.windowForComponent(this), logDataTable, false);
    } else if (e.getSource() == filterButton) {
        String filterString = filterText.getText();
        if (filterString != null && !"".equals(filterString) && !compareCombo.getSelectedItem().toString().isEmpty()) {
            try {
                CompareFilter filter = new CompareFilter();
                filter.setCondition(CompareFilter.Condition.EQUAL);
                if (compareCombo.getSelectedItem().toString().equals(greater))
                    filter.setCondition(CompareFilter.Condition.GREATER);
                if (compareCombo.getSelectedItem().toString().equals(greaterEqual))
                    filter.setCondition(CompareFilter.Condition.GREATER_EQUAL);
                else if (compareCombo.getSelectedItem().toString().equals(less))
                    filter.setCondition(CompareFilter.Condition.LESS);
                else if (compareCombo.getSelectedItem().toString().equals(lessEqual))
                    filter.setCondition(CompareFilter.Condition.LESS_EQUAL);
                filter.setFilter(filterText.getText());
                filter.setColumn(logDataTable.getColumnByHeaderName((String) selectionCombo.getSelectedItem()).getModelIndex());
                logDataTable.filter(filter);
                updateChart();
            } catch (NumberFormatException ex) {
                JOptionPane.showMessageDialog(null, "Invalid numeric value: " + filterText.getText(), "Invalid value", JOptionPane.ERROR_MESSAGE);
            }
        } else {
            filterText.setText("");
            compareCombo.setSelectedItem("");
            logDataTable.filter(null);
            updateChart();
        }
    } else if (e.getSource() == viewButton) {
        GridBagLayout gbl = (GridBagLayout) logViewPanel.getLayout();
        if (viewButton.getText().startsWith("Headers")) {
            Dimension d = viewButton.getSize();
            viewButton.setMinimumSize(d);
            viewButton.setPreferredSize(d);
            viewButton.setMaximumSize(d);
            gbl.rowWeights = new double[] { 0.0, 1.0 };
            logDataTable.setVisible(false);
            headerScrollPane.setVisible(true);
            viewButton.setText("Grid View");
        } else {
            gbl.rowWeights = new double[] { 1.0, 0.0 };
            logDataTable.setVisible(true);
            headerScrollPane.setVisible(false);
            viewButton.setText("Headers View");
        }
    } else if (e.getSource() == logPlayButton) {
        if (logDataTable.getRowCount() > 1) {
            if (logPlayWindow != null)
                disposeLogView();
            logPlayWindow = new LogPlay(this);
            logPlayButton.setEnabled(false);
        }
    } else if ("showpts".equals(e.getActionCommand())) {
        showWotCurvePoints = ((JCheckBox) e.getSource()).isSelected();
        for (int i = 0; i < wotPlot.getRendererCount(); ++i) {
            XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) wotPlot.getRenderer(i);
            XYSeriesCollection dataset = (XYSeriesCollection) wotPlot.getDataset(i);
            if (lineRenderer == null || dataset == null)
                continue;
            lineRenderer.setBaseShapesVisible(showWotCurvePoints);
        }
    } else if ("linkyaxis".equals(e.getActionCommand())) {
        WotPullsGroups grpSel = new WotPullsGroups();
        grpSel.getGroups(wotPlotsColumn, wotYAxisGroups);
    } else if ("export".equals(e.getActionCommand()))
        exportSelectedWotPulls();
    else if ("view".equals(e.getActionCommand()))
        view3dPlots();
    else if ("viewWot".equals(e.getActionCommand())) {
        Enumeration<AbstractButton> buttons = wotRbGroup.getElements();
        if (((JRadioButton) buttons.nextElement()).isSelected()) {
            viewWotPlotsByRpm(false);
            wotPlot.getDomainAxis(0).setLabel(rpmAxisName);
        } else if (((JRadioButton) buttons.nextElement()).isSelected()) {
            viewWotPlotsByRpm(true);
            wotPlot.getDomainAxis(0).setLabel(rpmAxisName);
        } else {
            viewWotPlotsByTime();
            wotPlot.getDomainAxis(0).setLabel(timeAxisName);
        }
    } else if ("loadWot".equals(e.getActionCommand()))
        selectWotLogFiles();
}
Also used : AbstractButton(javax.swing.AbstractButton) JRadioButton(javax.swing.JRadioButton) GridBagLayout(java.awt.GridBagLayout) XYLineAndShapeRenderer(org.jfree.chart.renderer.xy.XYLineAndShapeRenderer) PrintProperties(quick.dbtable.PrintProperties) Dimension(java.awt.Dimension) Paint(java.awt.Paint) XYSeriesCollection(org.jfree.data.xy.XYSeriesCollection)

Aggregations

Dimension (java.awt.Dimension)1 GridBagLayout (java.awt.GridBagLayout)1 Paint (java.awt.Paint)1 AbstractButton (javax.swing.AbstractButton)1 JRadioButton (javax.swing.JRadioButton)1 XYLineAndShapeRenderer (org.jfree.chart.renderer.xy.XYLineAndShapeRenderer)1 XYSeriesCollection (org.jfree.data.xy.XYSeriesCollection)1 PrintProperties (quick.dbtable.PrintProperties)1