Search in sources :

Example 16 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class ConstantTimerGui method init.

/**
     * Initialize this component.
     */
private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    setBorder(makeBorder());
    add(makeTitlePanel());
    Box delayPanel = Box.createHorizontalBox();
    //$NON-NLS-1$
    JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));
    delayPanel.add(delayLabel);
    delayField = new JTextField(6);
    delayField.setText(DEFAULT_DELAY);
    delayField.setName(DELAY_FIELD);
    delayPanel.add(delayField);
    add(delayPanel);
}
Also used : VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) Box(javax.swing.Box) JTextField(javax.swing.JTextField)

Example 17 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class SampleTimeoutGui method init.

/**
     * Initialize this component.
     */
private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    setBorder(makeBorder());
    add(makeTitlePanel());
    Box timeoutPanel = Box.createHorizontalBox();
    //$NON-NLS-1$
    JLabel timeoutLabel = new JLabel(JMeterUtils.getResString("sample_timeout_timeout"));
    timeoutPanel.add(timeoutLabel);
    timeoutField = new JTextField(6);
    timeoutField.setText(DEFAULT_TIMEOUT);
    timeoutPanel.add(timeoutField);
    add(timeoutPanel);
}
Also used : VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) Box(javax.swing.Box) JTextField(javax.swing.JTextField)

Example 18 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class TableVisualizer method init.

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);
    mainPanel.setBorder(margin);
    mainPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
    // NAME
    mainPanel.add(makeTitlePanel());
    // Set up the table itself
    table = new JTable(model);
    table.setRowSorter(new ObjectTableSorter(model).setValueComparator(5, Comparator.nullsFirst((ImageIcon o1, ImageIcon o2) -> {
        if (o1 == o2) {
            return 0;
        }
        if (o1 == imageSuccess) {
            return -1;
        }
        if (o1 == imageFailure) {
            return 1;
        }
        throw new IllegalArgumentException("Only success and failure images can be compared");
    })));
    JMeterUtils.applyHiDPI(table);
    HeaderAsPropertyRendererWrapper.setupDefaultRenderer(table);
    RendererUtils.applyRenderers(table, RENDERERS);
    tableScrollPanel = new JScrollPane(table);
    tableScrollPanel.setViewportBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    //$NON-NLS-1$
    autoscroll = new JCheckBox(JMeterUtils.getResString("view_results_autoscroll"));
    //$NON-NLS-1$
    childSamples = new JCheckBox(JMeterUtils.getResString("view_results_childsamples"));
    // Set up footer of table which displays numerics of the graphs
    JPanel dataPanel = new JPanel();
    // $NON-NLS-1$
    JLabel dataLabel = new JLabel(JMeterUtils.getResString("graph_results_latest_sample"));
    dataLabel.setForeground(Color.black);
    dataField = new JTextField(5);
    dataField.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    dataField.setEditable(false);
    dataField.setForeground(Color.black);
    dataField.setBackground(getBackground());
    dataPanel.add(dataLabel);
    dataPanel.add(dataField);
    JPanel averagePanel = new JPanel();
    // $NON-NLS-1$
    JLabel averageLabel = new JLabel(JMeterUtils.getResString("graph_results_average"));
    averageLabel.setForeground(Color.blue);
    averageField = new JTextField(5);
    averageField.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    averageField.setEditable(false);
    averageField.setForeground(Color.blue);
    averageField.setBackground(getBackground());
    averagePanel.add(averageLabel);
    averagePanel.add(averageField);
    JPanel deviationPanel = new JPanel();
    // $NON-NLS-1$
    JLabel deviationLabel = new JLabel(JMeterUtils.getResString("graph_results_deviation"));
    deviationLabel.setForeground(Color.red);
    deviationField = new JTextField(5);
    deviationField.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    deviationField.setEditable(false);
    deviationField.setForeground(Color.red);
    deviationField.setBackground(getBackground());
    deviationPanel.add(deviationLabel);
    deviationPanel.add(deviationField);
    JPanel noSamplesPanel = new JPanel();
    // $NON-NLS-1$
    JLabel noSamplesLabel = new JLabel(JMeterUtils.getResString("graph_results_no_samples"));
    noSamplesField = new JTextField(8);
    noSamplesField.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    noSamplesField.setEditable(false);
    noSamplesField.setForeground(Color.black);
    noSamplesField.setBackground(getBackground());
    noSamplesPanel.add(noSamplesLabel);
    noSamplesPanel.add(noSamplesField);
    JPanel tableInfoPanel = new JPanel();
    tableInfoPanel.setLayout(new FlowLayout());
    tableInfoPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    tableInfoPanel.add(noSamplesPanel);
    tableInfoPanel.add(dataPanel);
    tableInfoPanel.add(averagePanel);
    tableInfoPanel.add(deviationPanel);
    JPanel tableControlsPanel = new JPanel(new BorderLayout());
    tableControlsPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    JPanel jp = new HorizontalPanel();
    jp.add(autoscroll);
    jp.add(childSamples);
    tableControlsPanel.add(jp, BorderLayout.WEST);
    tableControlsPanel.add(tableInfoPanel, BorderLayout.CENTER);
    // Set up the table with footer
    JPanel tablePanel = new JPanel();
    tablePanel.setLayout(new BorderLayout());
    tablePanel.add(tableScrollPanel, BorderLayout.CENTER);
    tablePanel.add(tableControlsPanel, BorderLayout.SOUTH);
    // Add the main panel and the graph
    this.add(mainPanel, BorderLayout.NORTH);
    this.add(tablePanel, BorderLayout.CENTER);
    new Timer(REFRESH_PERIOD, e -> collectNewSamples()).start();
}
Also used : JScrollPane(javax.swing.JScrollPane) Color(java.awt.Color) JMeterUtils(org.apache.jmeter.util.JMeterUtils) Format(java.text.Format) JTextField(javax.swing.JTextField) Calculator(org.apache.jmeter.util.Calculator) SimpleDateFormat(java.text.SimpleDateFormat) SampleResult(org.apache.jmeter.samplers.SampleResult) Deque(java.util.Deque) TableCellRenderer(javax.swing.table.TableCellRenderer) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) Border(javax.swing.border.Border) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) ImageIcon(javax.swing.ImageIcon) BorderLayout(java.awt.BorderLayout) HeaderAsPropertyRendererWrapper(org.apache.jmeter.gui.util.HeaderAsPropertyRendererWrapper) Timer(javax.swing.Timer) FlowLayout(java.awt.FlowLayout) Clearable(org.apache.jmeter.samplers.Clearable) Functor(org.apache.jorphan.reflect.Functor) ObjectTableSorter(org.apache.jorphan.gui.ObjectTableSorter) RendererUtils(org.apache.jorphan.gui.RendererUtils) BorderFactory(javax.swing.BorderFactory) ConcurrentLinkedDeque(java.util.concurrent.ConcurrentLinkedDeque) JScrollPane(javax.swing.JScrollPane) JMeter(org.apache.jmeter.JMeter) AbstractVisualizer(org.apache.jmeter.visualizers.gui.AbstractVisualizer) JLabel(javax.swing.JLabel) JCheckBox(javax.swing.JCheckBox) JTable(javax.swing.JTable) EmptyBorder(javax.swing.border.EmptyBorder) ObjectTableModel(org.apache.jorphan.gui.ObjectTableModel) RightAlignRenderer(org.apache.jorphan.gui.RightAlignRenderer) Comparator(java.util.Comparator) JPanel(javax.swing.JPanel) JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) FlowLayout(java.awt.FlowLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) JCheckBox(javax.swing.JCheckBox) BorderLayout(java.awt.BorderLayout) Timer(javax.swing.Timer) JTable(javax.swing.JTable) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) ObjectTableSorter(org.apache.jorphan.gui.ObjectTableSorter) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) EmptyBorder(javax.swing.border.EmptyBorder)

Example 19 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class CacheManagerGui method init.

/**
     * Initialize the components and layout of this component.
     */
private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());
    // $NON-NLS-1$
    clearEachIteration = new JCheckBox(JMeterUtils.getResString("clear_cache_per_iter"), false);
    // $NON-NLS-1$
    useExpires = new JCheckBox(JMeterUtils.getResString("use_expires"), false);
    JPanel northPanel = new JPanel();
    northPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
    northPanel.add(makeTitlePanel());
    northPanel.add(clearEachIteration);
    northPanel.add(useExpires);
    //$NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("cache_manager_size"));
    maxCacheSize = new JTextField(20);
    maxCacheSize.setName(CacheManager.MAX_SIZE);
    label.setLabelFor(maxCacheSize);
    JPanel maxCacheSizePanel = new JPanel(new BorderLayout(5, 0));
    maxCacheSizePanel.add(label, BorderLayout.WEST);
    maxCacheSizePanel.add(maxCacheSize, BorderLayout.CENTER);
    northPanel.add(maxCacheSizePanel);
    add(northPanel, BorderLayout.NORTH);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 20 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class DNSCachePanel method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    dnsServersTableModel = new PowerTableModel(COLUMN_RESOURCE_NAMES, columnClasses);
    dnsHostsTableModel = new PowerTableModel(HOSTS_COLUMN_RESOURCE_NAMES, HOSTS_COLUMN_CLASSES);
    //$NON-NLS-1$
    clearEachIteration = new JCheckBox(JMeterUtils.getResString("clear_cache_each_iteration"), true);
    setLayout(new BorderLayout());
    setBorder(makeBorder());
    JPanel northPanel = new JPanel();
    northPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
    northPanel.add(makeTitlePanel());
    JPanel optionsPane = new JPanel();
    // $NON-NLS-1$
    optionsPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), OPTIONS));
    optionsPane.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
    optionsPane.add(clearEachIteration, BorderLayout.WEST);
    optionsPane.add(createChooseResPanel(), BorderLayout.SOUTH);
    northPanel.add(optionsPane);
    add(northPanel, BorderLayout.NORTH);
    JPanel tables = new JPanel();
    tables.setLayout(new VerticalLayout(2, VerticalLayout.BOTH));
    dnsServersPanel = createDnsServersTablePanel();
    dnsHostsPanel = createDnsHostsTablePanel();
    tables.add(dnsServersPanel);
    tables.add(dnsHostsPanel);
    add(tables, BorderLayout.CENTER);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) PowerTableModel(org.apache.jmeter.gui.util.PowerTableModel) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout)

Aggregations

VerticalLayout (org.apache.jorphan.gui.layout.VerticalLayout)21 JCheckBox (javax.swing.JCheckBox)12 JLabel (javax.swing.JLabel)11 JPanel (javax.swing.JPanel)11 JTextField (javax.swing.JTextField)8 BorderLayout (java.awt.BorderLayout)6 FlowLayout (java.awt.FlowLayout)4 Box (javax.swing.Box)4 Dimension (java.awt.Dimension)3 BoxLayout (javax.swing.BoxLayout)2 ButtonGroup (javax.swing.ButtonGroup)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 JButton (javax.swing.JButton)2 HorizontalPanel (org.apache.jmeter.gui.util.HorizontalPanel)2 PowerTableModel (org.apache.jmeter.gui.util.PowerTableModel)2 JLabeledTextField (org.apache.jorphan.gui.JLabeledTextField)2 Color (java.awt.Color)1 Format (java.text.Format)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Comparator (java.util.Comparator)1