Search in sources :

Example 76 with FlowLayout

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();
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) Container(java.awt.Container) FlowLayout(java.awt.FlowLayout) JFrame(javax.swing.JFrame) JEditorPane(javax.swing.JEditorPane) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) Point(java.awt.Point) JDialog(javax.swing.JDialog)

Example 77 with FlowLayout

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);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) ActionMap(javax.swing.ActionMap) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) InputMap(javax.swing.InputMap) JTextField(javax.swing.JTextField)

Example 78 with FlowLayout

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;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel)

Example 79 with FlowLayout

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;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout)

Example 80 with FlowLayout

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;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout)

Aggregations

FlowLayout (java.awt.FlowLayout)400 JPanel (javax.swing.JPanel)338 JLabel (javax.swing.JLabel)189 JButton (javax.swing.JButton)161 ActionEvent (java.awt.event.ActionEvent)134 BoxLayout (javax.swing.BoxLayout)129 BorderLayout (java.awt.BorderLayout)118 ActionListener (java.awt.event.ActionListener)113 Dimension (java.awt.Dimension)95 JScrollPane (javax.swing.JScrollPane)94 Container (java.awt.Container)49 GridBagLayout (java.awt.GridBagLayout)42 JTextField (javax.swing.JTextField)41 Insets (java.awt.Insets)39 GridBagConstraints (java.awt.GridBagConstraints)38 ButtonGroup (javax.swing.ButtonGroup)38 JCheckBox (javax.swing.JCheckBox)35 JTable (javax.swing.JTable)32 JmriJFrame (jmri.util.JmriJFrame)30 JSeparator (javax.swing.JSeparator)24