use of java.awt.FlowLayout in project jmeter by apache.
the class TextBoxDialoger method createDialogBox.
private void createDialogBox() {
JFrame mainFrame = GuiPackage.getInstance().getMainFrame();
String title = //$NON-NLS-1$
editable ? //$NON-NLS-1$
JMeterUtils.getResString("textbox_title_edit") : //$NON-NLS-1$
JMeterUtils.getResString("textbox_title_view");
// modal dialog box
dialog = new JDialog(mainFrame, title, true);
// Close action dialog box when tapping Escape key
JPanel content = (JPanel) dialog.getContentPane();
content.registerKeyboardAction(this, KeyStrokes.ESC, JComponent.WHEN_IN_FOCUSED_WINDOW);
textBox = new JEditorPane();
textBox.setEditable(editable);
JScrollPane textBoxScrollPane = GuiUtils.makeScrollPane(textBox);
JPanel btnBar = new JPanel();
btnBar.setLayout(new FlowLayout(FlowLayout.RIGHT));
if (editable) {
//$NON-NLS-1$
JButton cancelBtn = new JButton(JMeterUtils.getResString("textbox_cancel"));
cancelBtn.setActionCommand(CANCEL_COMMAND);
cancelBtn.addActionListener(this);
//$NON-NLS-1$
JButton saveBtn = new JButton(JMeterUtils.getResString("textbox_save_close"));
saveBtn.setActionCommand(SAVE_CLOSE_COMMAND);
saveBtn.addActionListener(this);
btnBar.add(cancelBtn);
btnBar.add(saveBtn);
} else {
//$NON-NLS-1$
JButton closeBtn = new JButton(JMeterUtils.getResString("textbox_close"));
closeBtn.setActionCommand(CLOSE_COMMAND);
closeBtn.addActionListener(this);
btnBar.add(closeBtn);
}
// Prepare dialog box
Container panel = dialog.getContentPane();
dialog.setMinimumSize(new Dimension(400, 250));
panel.add(textBoxScrollPane, BorderLayout.CENTER);
panel.add(btnBar, BorderLayout.SOUTH);
// determine location on screen
Point p = mainFrame.getLocationOnScreen();
Dimension d1 = mainFrame.getSize();
Dimension d2 = dialog.getSize();
dialog.setLocation(p.x + (d1.width - d2.width) / 2, p.y + (d1.height - d2.height) / 2);
dialog.pack();
}
use of java.awt.FlowLayout in project jmeter by apache.
the class SearchTreePanel method init.
private void init() {
// WARNING: called from ctor so must not be overridden (i.e. must be private or final)
setLayout(new BorderLayout(10, 10));
//$NON-NLS-1$
searchTF = new JTextField(20);
InputMap im = searchTF.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
im.put(KeyStrokes.ENTER, SEARCH_TEXT_COMMAND);
ActionMap am = searchTF.getActionMap();
am.put(SEARCH_TEXT_COMMAND, new EnterAction());
//$NON-NLS-1$
isRegexpCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_regexp"), false);
//$NON-NLS-1$
isCaseSensitiveCB = new JCheckBox(JMeterUtils.getResString("search_text_chkbox_case"), false);
isRegexpCB.setFont(FONT_SMALL);
isCaseSensitiveCB.setFont(FONT_SMALL);
//$NON-NLS-1$
searchButton = new JButton(JMeterUtils.getResString("search"));
searchButton.addActionListener(this);
//$NON-NLS-1$
resetButton = new JButton(JMeterUtils.getResString("reset"));
resetButton.addActionListener(this);
JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
searchPanel.add(new JLabel(JMeterUtils.getResString("search_text_field")));
searchPanel.add(searchTF);
searchPanel.add(isCaseSensitiveCB);
searchPanel.add(isRegexpCB);
searchPanel.add(searchButton);
searchPanel.add(resetButton);
add(searchPanel);
}
use of java.awt.FlowLayout in project jmeter by apache.
the class GraphVisualizer method createChoosePanel.
/**
* Creates a panel which allows the user to choose which graphs to display.
* This panel consists of a check box for each type of graph (current
* sample, average, deviation, and throughput).
*
* @return a panel allowing the user to choose which graphs to display
*/
private JPanel createChoosePanel() {
JPanel chooseGraphsPanel = new JPanel();
chooseGraphsPanel.setLayout(new FlowLayout());
//$NON-NLS-1$
JLabel selectGraphsLabel = new JLabel(JMeterUtils.getResString("graph_choose_graphs"));
// $NON-NLS-1$
data = createChooseCheckBox("graph_results_data", Color.black);
// $NON-NLS-1$
average = createChooseCheckBox("graph_results_average", Color.blue);
// $NON-NLS-1$
deviation = createChooseCheckBox("graph_results_deviation", Color.red);
// $NON-NLS-1$
throughput = createChooseCheckBox("graph_results_throughput", JMeterColor.DARK_GREEN);
// $NON-NLS-1$
median = createChooseCheckBox("graph_results_median", JMeterColor.PURPLE);
chooseGraphsPanel.add(selectGraphsLabel);
chooseGraphsPanel.add(data);
chooseGraphsPanel.add(average);
chooseGraphsPanel.add(median);
chooseGraphsPanel.add(deviation);
chooseGraphsPanel.add(throughput);
return chooseGraphsPanel;
}
use of java.awt.FlowLayout in project jmeter by apache.
the class RespTimeGraphVisualizer method createLegendPane.
/**
* Create pane for legend settings
* @return Legend pane
*/
private JPanel createLegendPane() {
JPanel legendPanel = new JPanel();
legendPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
legendPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_legend")));
legendPanel.add(//$NON-NLS-1$
GuiUtils.createLabelCombo(//$NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_legend_placement"), legendPlacementList));
legendPlacementList.setSelectedIndex(DEFAULT_LEGEND_PLACEMENT);
legendPanel.add(//$NON-NLS-1$
GuiUtils.createLabelCombo(//$NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_font"), fontNameList));
fontNameList.setSelectedIndex(DEFAULT_LEGEND_FONT);
legendPanel.add(//$NON-NLS-1$
GuiUtils.createLabelCombo(//$NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_size"), fontSizeList));
fontSizeList.setSelectedItem(StatGraphProperties.getFontSize()[DEFAULT_LEGEND_SIZE]);
legendPanel.add(//$NON-NLS-1$
GuiUtils.createLabelCombo(//$NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_style"), fontStyleList));
fontStyleList.setSelectedIndex(DEFAULT_LEGEND_STYLE);
return legendPanel;
}
use of java.awt.FlowLayout in project jmeter by apache.
the class RespTimeGraphVisualizer method createGraphTitlePane.
private JPanel createGraphTitlePane() {
JPanel titleNamePane = new JPanel(new BorderLayout());
syncWithName.setFont(FONT_SMALL);
titleNamePane.add(graphTitle, BorderLayout.CENTER);
titleNamePane.add(syncWithName, BorderLayout.EAST);
JPanel titleStylePane = new JPanel();
titleStylePane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 5));
titleStylePane.add(//$NON-NLS-1$
GuiUtils.createLabelCombo(//$NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_font"), titleFontNameList));
titleFontNameList.setSelectedIndex(DEFAULT_TITLE_FONT_NAME);
titleStylePane.add(//$NON-NLS-1$
GuiUtils.createLabelCombo(//$NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_size"), titleFontSizeList));
titleFontSizeList.setSelectedItem(StatGraphProperties.getFontSize()[DEFAULT_TITLE_FONT_SIZE]);
titleStylePane.add(//$NON-NLS-1$
GuiUtils.createLabelCombo(//$NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_style"), titleFontStyleList));
titleFontStyleList.setSelectedIndex(DEFAULT_TITLE_FONT_STYLE);
JPanel titlePane = new JPanel(new BorderLayout());
titlePane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
JMeterUtils.getResString("aggregate_graph_title_group")));
titlePane.add(titleNamePane, BorderLayout.NORTH);
titlePane.add(titleStylePane, BorderLayout.SOUTH);
return titlePane;
}
Aggregations