use of javax.swing.JTable in project jmeter by apache.
the class SimpleConfigGui method createTablePanel.
/**
* Create a GUI panel containing the table of configuration parameters.
*
* @return a GUI panel containing the parameter table
*/
private Component createTablePanel() {
tableModel = new PowerTableModel(new String[] { COLUMN_NAMES_0, COLUMN_NAMES_1 }, new Class[] { String.class, String.class });
table = new JTable(tableModel);
JMeterUtils.applyHiDPI(table);
table.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
return makeScrollPane(table);
}
use of javax.swing.JTable in project jmeter by apache.
the class StatGraphVisualizer method init.
/**
* Main visualizer setup.
*/
private void init() {
// WARNING: called from ctor so must not be overridden (i.e. must be private or final)
this.setLayout(new BorderLayout());
// MAIN PANEL
JPanel mainPanel = new JPanel();
Border margin = new EmptyBorder(10, 10, 5, 10);
Border margin2 = new EmptyBorder(10, 10, 5, 10);
mainPanel.setBorder(margin);
mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
mainPanel.add(makeTitlePanel());
myJTable = new JTable(model);
myJTable.setRowSorter(new ObjectTableSorter(model).fixLastRow());
JMeterUtils.applyHiDPI(myJTable);
// Fix centering of titles
HeaderAsPropertyRendererWrapper.setupDefaultRenderer(myJTable, getColumnsMsgParameters());
myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70));
RendererUtils.applyRenderers(myJTable, getRenderers());
myScrollPane = new JScrollPane(myJTable);
settingsPane = new VerticalPanel();
settingsPane.setBorder(margin2);
graphPanel = new AxisGraph();
graphPanel.setPreferredSize(new Dimension(defaultWidth, defaultHeight));
settingsPane.add(createGraphActionsPane());
settingsPane.add(createGraphColumnPane());
settingsPane.add(createGraphTitlePane());
settingsPane.add(createGraphDimensionPane());
JPanel axisPane = new JPanel(new BorderLayout());
axisPane.add(createGraphXAxisPane(), BorderLayout.WEST);
axisPane.add(createGraphYAxisPane(), BorderLayout.CENTER);
settingsPane.add(axisPane);
settingsPane.add(createLegendPane());
//$NON-NLS-1$
tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_settings"), settingsPane);
//$NON-NLS-1$
tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_graph"), graphPanel);
// If clic on the Graph tab, make the graph (without apply interval or filter)
tabbedGraph.addChangeListener(changeEvent -> {
JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource();
int index = srcTab.getSelectedIndex();
if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) {
actionMakeGraph();
}
});
spane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
spane.setOneTouchExpandable(true);
spane.setLeftComponent(myScrollPane);
spane.setRightComponent(tabbedGraph);
spane.setResizeWeight(.2);
// see bug jdk 4131528
spane.setBorder(null);
spane.setContinuousLayout(true);
this.add(mainPanel, BorderLayout.NORTH);
this.add(spane, BorderLayout.CENTER);
new Timer(REFRESH_PERIOD, e -> {
synchronized (lock) {
while (!newRows.isEmpty()) {
model.insertRow(newRows.pop(), model.getRowCount() - 1);
}
}
model.fireTableDataChanged();
}).start();
}
use of javax.swing.JTable in project jmeter by apache.
the class CookiePanel method createCookieTablePanel.
public JPanel createCookieTablePanel() {
// create the JTable that holds one cookie per row
cookieTable = new JTable(tableModel);
JMeterUtils.applyHiDPI(cookieTable);
cookieTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
cookieTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
cookieTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
JPanel buttonPanel = createButtonPanel();
JPanel panel = new JPanel(new BorderLayout(0, 5));
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString(//$NON-NLS-1$
"cookies_stored")));
panel.add(new JScrollPane(cookieTable), BorderLayout.CENTER);
panel.add(buttonPanel, BorderLayout.SOUTH);
return panel;
}
use of javax.swing.JTable in project jmeter by apache.
the class AssertionGui method createStringPanel.
/**
* Create a panel allowing the user to supply a list of string patterns to
* test against.
*
* @return a new panel for adding string patterns
*/
private JPanel createStringPanel() {
tableModel = new PowerTableModel(new String[] { COL_RESOURCE_NAME }, new Class[] { String.class });
stringTable = new JTable(tableModel);
stringTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
stringTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
JMeterUtils.applyHiDPI(stringTable);
TextAreaCellRenderer renderer = new TextAreaCellRenderer();
stringTable.setRowHeight(renderer.getPreferredHeight());
stringTable.setDefaultRenderer(String.class, renderer);
stringTable.setDefaultEditor(String.class, new TextAreaTableCellEditor());
stringTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
//$NON-NLS-1$
panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("assertion_patterns_to_test")));
panel.add(new JScrollPane(stringTable), BorderLayout.CENTER);
panel.add(createButtonPanel(), BorderLayout.SOUTH);
return panel;
}
use of javax.swing.JTable in project jmeter by apache.
the class UserParametersGui method makeParameterPanel.
private JPanel makeParameterPanel() {
// $NON-NLS-1$
JLabel tableLabel = new JLabel(JMeterUtils.getResString("user_parameters_table"));
initTableModel();
paramTable = new JTable(tableModel);
paramTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
paramTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
JMeterUtils.applyHiDPI(paramTable);
paramPanel = new JPanel(new BorderLayout());
paramPanel.add(tableLabel, BorderLayout.NORTH);
JScrollPane scroll = new JScrollPane(paramTable);
scroll.setPreferredSize(scroll.getMinimumSize());
paramPanel.add(scroll, BorderLayout.CENTER);
paramPanel.add(makeButtonPanel(), BorderLayout.SOUTH);
return paramPanel;
}
Aggregations