/** Clears this visualizer and its model, and forces a repaint of the table. */ @Override public void clearData() { synchronized (lock) { model.clearData(); tableRows.clear(); tableRows.put(TOTAL_ROW_LABEL, new SamplingStatCalculator(TOTAL_ROW_LABEL)); model.addRow(tableRows.get(TOTAL_ROW_LABEL)); } }
/** Clears this visualizer and its model, and forces a repaint of the table. */ @Override public void clearData() { // Synch is needed because a clear can occur while add occurs synchronized (lock) { model.clearData(); tableRows.clear(); tableRows.put(TOTAL_ROW_LABEL, new Calculator(TOTAL_ROW_LABEL)); model.addRow(tableRows.get(TOTAL_ROW_LABEL)); } }
public String[] getAxisLabels() { if (model.getRowCount() > 1) { int count = model.getRowCount() - 1; String[] labels = new String[count]; for (int idx = 0; idx < count; idx++) { labels[idx] = (String) model.getValueAt(idx, 0); } return labels; } // API expects null, not empty array return null; }
/** * We use this method to get the data, since we are using ObjectTableModel, so the calling * getDataVector doesn't work as expected. * * @return the data from the model */ public List<List<Object>> getAllTableData() { List<List<Object>> data = new ArrayList<List<Object>>(); if (model.getRowCount() > 0) { for (int rw = 0; rw < model.getRowCount(); rw++) { int cols = model.getColumnCount(); List<Object> column = new ArrayList<Object>(); data.add(column); for (int idx = 0; idx < cols; idx++) { Object val = model.getValueAt(rw, idx); column.add(val); } } } return data; }
/** * We use this method to get the data, since we are using ObjectTableModel, so the calling * getDataVector doesn't work as expected. * * @param model {@link ObjectTableModel} * @param formats Array of {@link Format} array can contain null formatters in this case value is * added as is * @return the data from the model */ public static List<List<Object>> getAllTableData(ObjectTableModel model, Format[] formats) { List<List<Object>> data = new ArrayList<List<Object>>(); if (model.getRowCount() > 0) { for (int rw = 0; rw < model.getRowCount(); rw++) { int cols = model.getColumnCount(); List<Object> column = new ArrayList<Object>(); data.add(column); for (int idx = 0; idx < cols; idx++) { Object val = model.getValueAt(rw, idx); if (formats[idx] != null) { column.add(formats[idx].format(val)); } else { column.add(val); } } } } return data; }
private void actionMakeGraph() { if (model.getRowCount() > 1) { makeGraph(); tabbedGraph.setSelectedIndex(1); } else { JOptionPane.showMessageDialog( null, JMeterUtils.getResString("aggregate_graph_no_values_to_graph"), // $NON-NLS-1$ JMeterUtils.getResString("aggregate_graph_no_values_to_graph"), // $NON-NLS-1$ JOptionPane.WARNING_MESSAGE); } }
public double[][] getData() { if (model.getRowCount() > 1) { int count = model.getRowCount() - 1; int size = nbColToGraph; double[][] data = new double[size][count]; int s = 0; int cpt = 0; for (BarGraph bar : eltList) { if (bar.getChkBox().isSelected()) { int col = model.findColumn((String) columnsList.getItemAt(cpt)); for (int idx = 0; idx < count; idx++) { data[s][idx] = ((Number) model.getValueAt(idx, col)).doubleValue(); } s++; } cpt++; } return data; } // API expects null, not empty array return null; }