use of javax.swing.border.Border 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.border.Border in project jmeter by apache.
the class GraphVisualizer method init.
/**
* Initialize the GUI.
*/
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
Border margin = new EmptyBorder(10, 10, 5, 10);
this.setBorder(margin);
// Set up the graph with header, footer, Y axis and graph display
JPanel graphPanel = new JPanel(new BorderLayout());
graphPanel.add(createYAxis(), BorderLayout.WEST);
graphPanel.add(createChoosePanel(), BorderLayout.NORTH);
graphPanel.add(createGraphPanel(), BorderLayout.CENTER);
graphPanel.add(createGraphInfoPanel(), BorderLayout.SOUTH);
// Add the main panel and the graph
this.add(makeTitlePanel(), BorderLayout.NORTH);
this.add(graphPanel, BorderLayout.CENTER);
new Timer(REFRESH_PERIOD, e -> collectSamplesFromQueue()).start();
}
use of javax.swing.border.Border in project jmeter by apache.
the class RespTimeGraphVisualizer method init.
/**
* Initialize the GUI.
*/
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());
JPanel settingsPane = new VerticalPanel();
settingsPane.setBorder(margin2);
graphPanel = new RespTimeGraphChart();
graphPanel.setPreferredSize(new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGTH));
settingsPane.add(createGraphActionsPane());
settingsPane.add(createGraphSettingsPane());
settingsPane.add(createGraphTitlePane());
settingsPane.add(createLinePane());
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)
ChangeListener changeListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent changeEvent) {
JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource();
int index = srcTab.getSelectedIndex();
if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) {
//$NON-NLS-1$
actionMakeGraph();
}
}
};
tabbedGraph.addChangeListener(changeListener);
this.add(mainPanel, BorderLayout.NORTH);
this.add(tabbedGraph, BorderLayout.CENTER);
}
use of javax.swing.border.Border in project jmeter by apache.
the class RenderAsCssJQuery method createCssJqueryTasksPanel.
/**
* Create the CssJquery task pane
*
* @return CssJquery task pane
*/
private JPanel createCssJqueryTasksPanel() {
GridBagLayout g = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
JPanel cssJqueryActionPanel = new JPanel();
cssJqueryActionPanel.setLayout(g);
Border margin = new EmptyBorder(5, 5, 0, 5);
cssJqueryActionPanel.setBorder(margin);
// $NON-NLS-1$
cssJqueryField = new JLabeledTextField(JMeterUtils.getResString("cssjquery_tester_field"));
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
cssJqueryActionPanel.add(cssJqueryField, c);
cssJqueryLabeledChoice = new JLabeledChoice(// $NON-NLS-1$
JMeterUtils.getResString("cssjquery_impl"), getImplementations());
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 0;
cssJqueryActionPanel.add(cssJqueryLabeledChoice, c);
// $NON-NLS-1$
attributeField = new JLabeledTextField(JMeterUtils.getResString("cssjquery_attribute"));
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 1;
cssJqueryActionPanel.add(attributeField, c);
// $NON-NLS-1$
JButton cssJqueryTester = new JButton(JMeterUtils.getResString("cssjquery_tester_button_test"));
cssJqueryTester.setActionCommand(CSSJQUEY_TESTER_COMMAND);
cssJqueryTester.addActionListener(this);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 1;
cssJqueryActionPanel.add(cssJqueryTester, c);
cssJqueryResultField = new JTextArea();
cssJqueryResultField.setEditable(false);
cssJqueryResultField.setLineWrap(true);
cssJqueryResultField.setWrapStyleWord(true);
JPanel cssJqueryTasksPanel = new JPanel(new BorderLayout(0, 5));
cssJqueryTasksPanel.add(cssJqueryActionPanel, BorderLayout.NORTH);
cssJqueryTasksPanel.add(GuiUtils.makeScrollPane(cssJqueryResultField), BorderLayout.CENTER);
return cssJqueryTasksPanel;
}
use of javax.swing.border.Border in project jmeter by apache.
the class RenderAsXPath method createXpathExtractorTasksPanel.
/**
* Create the XPath task pane
*
* @return XPath task pane
*/
private JPanel createXpathExtractorTasksPanel() {
Box xpathActionPanel = Box.createVerticalBox();
Box selectorAndButton = Box.createHorizontalBox();
Border margin = new EmptyBorder(5, 5, 0, 5);
xpathActionPanel.setBorder(margin);
// $NON-NLS-1$
xpathExpressionField = new JLabeledTextField(JMeterUtils.getResString("xpath_tester_field"));
// $NON-NLS-1$
JButton xpathTester = new JButton(JMeterUtils.getResString("xpath_tester_button_test"));
xpathTester.setActionCommand(XPATH_TESTER_COMMAND);
xpathTester.addActionListener(this);
selectorAndButton.add(xpathExpressionField);
selectorAndButton.add(xpathTester);
xpathActionPanel.add(selectorAndButton);
xpathActionPanel.add(xmlConfPanel);
xpathActionPanel.add(getFragment);
xpathResultField = new JTextArea();
xpathResultField.setEditable(false);
xpathResultField.setLineWrap(true);
xpathResultField.setWrapStyleWord(true);
JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5));
xpathTasksPanel.add(xpathActionPanel, BorderLayout.NORTH);
xpathTasksPanel.add(GuiUtils.makeScrollPane(xpathResultField), BorderLayout.CENTER);
return xpathTasksPanel;
}
Aggregations