private int getNbColumns() { int i = 0; for (BarGraph bar : eltList) { if (bar.getChkBox().isSelected()) { i++; } } return i; }
private String[] getLegendLabels() { String[] legends = new String[nbColToGraph]; int i = 0; for (BarGraph bar : eltList) { if (bar.getChkBox().isSelected()) { legends[i] = bar.getLabel(); i++; } } return legends; }
private Color[] getBackColors() { Color[] backColors = new Color[nbColToGraph]; int i = 0; for (BarGraph bar : eltList) { if (bar.getChkBox().isSelected()) { backColors[i] = bar.getBackColor(); i++; } } return backColors; }
private JPanel createGraphColumnPane() { JPanel colPanel = new JPanel(); colPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); JLabel label = new JLabel(JMeterUtils.getResString("aggregate_graph_columns_to_display")); // $NON-NLS-1$ colPanel.add(label); for (BarGraph bar : eltList) { colPanel.add(bar.getChkBox()); colPanel.add(createColorBarButton(bar, eltList.indexOf(bar))); } colPanel.add(Box.createRigidArea(new Dimension(5, 0))); chooseForeColor.setFont(FONT_SMALL); colPanel.add(chooseForeColor); chooseForeColor.addActionListener(this); JPanel optionsPanel = new JPanel(); optionsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); optionsPanel.add(createGraphFontValuePane()); optionsPanel.add(drawOutlinesBar); optionsPanel.add(numberShowGrouping); optionsPanel.add(valueLabelsVertical); JPanel barPane = new JPanel(new BorderLayout()); barPane.add(colPanel, BorderLayout.NORTH); barPane.add(Box.createRigidArea(new Dimension(0, 3)), BorderLayout.CENTER); barPane.add(optionsPanel, BorderLayout.SOUTH); JPanel columnPane = new JPanel(new BorderLayout()); columnPane.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), JMeterUtils.getResString("aggregate_graph_column_settings"))); // $NON-NLS-1$ columnPane.add(barPane, BorderLayout.NORTH); columnPane.add(Box.createRigidArea(new Dimension(0, 3)), BorderLayout.CENTER); columnPane.add(createGraphSelectionSubPane(), BorderLayout.SOUTH); return columnPane; }
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; }