Example usage for com.lowagie.text Rectangle getHeight

List of usage examples for com.lowagie.text Rectangle getHeight

Introduction

In this page you can find the example usage for com.lowagie.text Rectangle getHeight.

Prototype

public float getHeight() 

Source Link

Document

Returns the height of the rectangle.

Usage

From source file:tracer.application.TracerFrame.java

License:Open Source License

private void refreshTraceList() {

    final int[] statsSelRows = statisticTable.getSelectedRows();

    Rectangle rect = statisticTable.getVisibleRect();
    int firstRow = statisticTable.rowAtPoint(rect.getLocation());
    double numberOfRows = rect.getHeight() / statisticTable.getRowHeight();
    int lastRow = firstRow + (int) Math.floor(numberOfRows);

    statisticTableModel.setFirstVisibleRow(firstRow);
    statisticTableModel.setLastVisibleRow(lastRow);

    LogFileTraces[] tls = removeTraceList();
    if (tls.length > 0) {
        final LogFileTraces[] newTls = new LogFileTraces[tls.length];

        for (int i = 0; i < tls.length; i++) {
            newTls[i] = new LogFileTraces(tls[i].getName(), tls[i].getFile());
        }/*  w ww.j a  va2s . co  m*/

        SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
            @Override
            protected Void doInBackground() throws Exception {
                processTraces(newTls);
                return null;
            }

            @Override
            protected void done() {
                updateCombinedTraces();
                statisticTableModel.fireTableDataChanged();
                statisticTable.getSelectionModel().clearSelection();
                for (int row : statsSelRows) {
                    statisticTable.getSelectionModel().addSelectionInterval(row, row);
                }
                traceTableSelectionChanged();
                statisticTableSelectionChanged();
            }
        };
        worker.execute();

        //            updateCombinedTraces();
        //
        //            statisticTableModel.fireTableDataChanged();
        //            statisticTable.getSelectionModel().clearSelection();
        //            for (int row : statsSelRows) {
        //                statisticTable.getSelectionModel().addSelectionInterval(row, row);
        //            }

        //            traceTableSelectionChanged();
        //            statisticTableSelectionChanged();
    }

}