Search in sources :

Example 26 with JSplitPane

use of javax.swing.JSplitPane in project jmeter by apache.

the class ViewResultsFullVisualizer method init.

/**
     * Initialize this visualizer
     */
private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    log.debug("init() - pass");
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());
    leftSide = createLeftPanel();
    // Prepare the common tab
    rightSide = new JTabbedPane();
    // Create the split pane
    mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftSide, rightSide);
    mainSplit.setOneTouchExpandable(true);
    JSplitPane searchAndMainSP = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new SearchTreePanel(root), mainSplit);
    searchAndMainSP.setOneTouchExpandable(true);
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, makeTitlePanel(), searchAndMainSP);
    splitPane.setOneTouchExpandable(true);
    add(splitPane);
    // init right side with first render
    resultsRender.setRightSide(rightSide);
    resultsRender.init();
}
Also used : BorderLayout(java.awt.BorderLayout) JTabbedPane(javax.swing.JTabbedPane) JSplitPane(javax.swing.JSplitPane)

Example 27 with JSplitPane

use of javax.swing.JSplitPane in project jmeter by apache.

the class HttpTestSampleGui method init.

private void init() {
    // called from ctor, so must not be overridable
    setLayout(new BorderLayout(0, 5));
    setBorder(makeBorder());
    // URL CONFIG
    urlConfigGui = new UrlConfigGui(true, true, true);
    // HTTP request options
    JPanel httpOptions = new HorizontalPanel();
    httpOptions.add(getImplementationPanel());
    httpOptions.add(getTimeOutPanel());
    // AdvancedPanel (embedded resources, source address and optional tasks)
    JPanel advancedPanel = new VerticalPanel();
    if (!isAJP) {
        advancedPanel.add(httpOptions);
    }
    advancedPanel.add(createEmbeddedRsrcPanel());
    if (!isAJP) {
        advancedPanel.add(createSourceAddrPanel());
        advancedPanel.add(getProxyServerPanel());
    }
    advancedPanel.add(createOptionalTasksPanel());
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.add(JMeterUtils.getResString("web_testing_basic"), urlConfigGui);
    tabbedPane.add(JMeterUtils.getResString("web_testing_advanced"), advancedPanel);
    JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, makeTitlePanel(), tabbedPane);
    splitPane.setOneTouchExpandable(true);
    add(splitPane);
}
Also used : JPanel(javax.swing.JPanel) VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) BorderLayout(java.awt.BorderLayout) UrlConfigGui(org.apache.jmeter.protocol.http.config.gui.UrlConfigGui) JTabbedPane(javax.swing.JTabbedPane) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JSplitPane(javax.swing.JSplitPane)

Example 28 with JSplitPane

use of javax.swing.JSplitPane in project jmeter by apache.

the class RenderAsJsonRenderer method createJSonPathExtractorPanel.

/**
     * @return JSON PATH Tester panel
     */
private JPanel createJSonPathExtractorPanel() {
    jsonDataField = new JTextArea();
    jsonDataField.setEditable(false);
    jsonDataField.setLineWrap(true);
    jsonDataField.setWrapStyleWord(true);
    this.jsonDataPane = GuiUtils.makeScrollPane(jsonDataField);
    jsonDataPane.setPreferredSize(new Dimension(100, 200));
    JPanel panel = new JPanel(new BorderLayout(0, 5));
    JSplitPane mainSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, jsonDataPane, createJSonPathExtractorTasksPanel());
    mainSplit.setDividerLocation(0.6d);
    mainSplit.setOneTouchExpandable(true);
    panel.add(mainSplit, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) JTextArea(javax.swing.JTextArea) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) JSplitPane(javax.swing.JSplitPane)

Example 29 with JSplitPane

use of javax.swing.JSplitPane in project jmeter by apache.

the class SamplerResultTab method createResponseMetadataPanel.

private Component createResponseMetadataPanel() {
    stats = new JTextPane();
    stats.setEditable(false);
    stats.setBackground(backGround);
    // Add styles to use for different types of status messages
    StyledDocument doc = (StyledDocument) stats.getDocument();
    Style style = doc.addStyle(STYLE_REDIRECT, null);
    StyleConstants.setForeground(style, REDIRECT_COLOR);
    style = doc.addStyle(STYLE_CLIENT_ERROR, null);
    StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);
    style = doc.addStyle(STYLE_SERVER_ERROR, null);
    StyleConstants.setForeground(style, SERVER_ERROR_COLOR);
    paneRaw = GuiUtils.makeScrollPane(stats);
    paneRaw.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    // Set up the 1st table Result with empty headers
    tableResult = new JTable(resultModel);
    JMeterUtils.applyHiDPI(tableResult);
    // $NON-NLS-1$
    tableResult.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableResult.addMouseListener(new TextBoxDoubleClick(tableResult));
    setFirstColumnPreferredSize(tableResult);
    RendererUtils.applyRenderers(tableResult, RENDERERS_RESULT);
    // Set up the 2nd table 
    tableResHeaders = new JTable(resHeadersModel);
    JMeterUtils.applyHiDPI(tableResHeaders);
    // $NON-NLS-1$
    tableResHeaders.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableResHeaders.addMouseListener(new TextBoxDoubleClick(tableResHeaders));
    setFirstColumnPreferredSize(tableResHeaders);
    tableResHeaders.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableResHeaders, RENDERERS_HEADERS);
    // Set up the 3rd table 
    tableResFields = new JTable(resFieldsModel);
    JMeterUtils.applyHiDPI(tableResFields);
    // $NON-NLS-1$
    tableResFields.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableResFields.addMouseListener(new TextBoxDoubleClick(tableResFields));
    setFirstColumnPreferredSize(tableResFields);
    tableResFields.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableResFields, RENDERERS_FIELDS);
    // Prepare the Results tabbed pane
    tabbedResult = new JTabbedPane(SwingConstants.BOTTOM);
    // Create the split pane
    JSplitPane topSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableResHeaders), GuiUtils.makeScrollPane(tableResFields));
    topSplit.setOneTouchExpandable(true);
    // set split ratio
    topSplit.setResizeWeight(0.80);
    // see bug jdk 4131528
    topSplit.setBorder(null);
    paneParsed = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableResult), topSplit);
    paneParsed.setOneTouchExpandable(true);
    // set split ratio
    paneParsed.setResizeWeight(0.40);
    // see bug jdk 4131528
    paneParsed.setBorder(null);
    // setup bottom tabs, first Raw, second Parsed
    //$NON-NLS-1$
    tabbedResult.addTab(JMeterUtils.getResString("view_results_table_result_tab_raw"), paneRaw);
    //$NON-NLS-1$
    tabbedResult.addTab(JMeterUtils.getResString("view_results_table_result_tab_parsed"), paneParsed);
    // Hint to background color on bottom tabs (grey, not blue)
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(tabbedResult);
    return panel;
}
Also used : JTextPane(javax.swing.JTextPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) JTabbedPane(javax.swing.JTabbedPane) StyledDocument(javax.swing.text.StyledDocument) Style(javax.swing.text.Style) TextBoxDoubleClick(org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick) JSplitPane(javax.swing.JSplitPane)

Example 30 with JSplitPane

use of javax.swing.JSplitPane in project jadx by skylot.

the class MainWindow method initUI.

private void initUI() {
    mainPanel = new JPanel(new BorderLayout());
    JSplitPane splitPane = new JSplitPane();
    splitPane.setResizeWeight(SPLIT_PANE_RESIZE_WEIGHT);
    mainPanel.add(splitPane);
    DefaultMutableTreeNode treeRoot = new DefaultMutableTreeNode(NLS.str("msg.open_file"));
    treeModel = new DefaultTreeModel(treeRoot);
    tree = new JTree(treeModel);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            treeClickAction();
        }
    });
    tree.addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                treeClickAction();
            }
        }
    });
    tree.setCellRenderer(new DefaultTreeCellRenderer() {

        @Override
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean isLeaf, int row, boolean focused) {
            Component c = super.getTreeCellRendererComponent(tree, value, selected, expanded, isLeaf, row, focused);
            if (value instanceof JNode) {
                setIcon(((JNode) value).getIcon());
            }
            return c;
        }
    });
    tree.addTreeWillExpandListener(new TreeWillExpandListener() {

        @Override
        public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
            TreePath path = event.getPath();
            Object node = path.getLastPathComponent();
            if (node instanceof JClass) {
                JClass cls = (JClass) node;
                cls.getRootClass().load();
            }
        }

        @Override
        public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
        }
    });
    progressPane = new ProgressPanel(this, true);
    JPanel leftPane = new JPanel(new BorderLayout());
    leftPane.add(new JScrollPane(tree), BorderLayout.CENTER);
    leftPane.add(progressPane, BorderLayout.PAGE_END);
    splitPane.setLeftComponent(leftPane);
    tabbedPane = new TabbedPane(this);
    splitPane.setRightComponent(tabbedPane);
    dropTarget = new DropTarget(this, DnDConstants.ACTION_COPY, new MainDropTarget(this));
    setContentPane(mainPanel);
    setTitle(DEFAULT_TITLE);
}
Also used : JPanel(javax.swing.JPanel) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) KeyAdapter(java.awt.event.KeyAdapter) DefaultTreeCellRenderer(javax.swing.tree.DefaultTreeCellRenderer) ExpandVetoException(javax.swing.tree.ExpandVetoException) KeyEvent(java.awt.event.KeyEvent) BorderLayout(java.awt.BorderLayout) JNode(jadx.gui.treemodel.JNode) Component(java.awt.Component) TreeExpansionEvent(javax.swing.event.TreeExpansionEvent) TreeWillExpandListener(javax.swing.event.TreeWillExpandListener) JScrollPane(javax.swing.JScrollPane) MouseEvent(java.awt.event.MouseEvent) JClass(jadx.gui.treemodel.JClass) MouseAdapter(java.awt.event.MouseAdapter) DefaultTreeModel(javax.swing.tree.DefaultTreeModel) JTree(javax.swing.JTree) TreePath(javax.swing.tree.TreePath) CacheObject(jadx.gui.utils.CacheObject) DropTarget(java.awt.dnd.DropTarget) JSplitPane(javax.swing.JSplitPane)

Aggregations

JSplitPane (javax.swing.JSplitPane)109 BorderLayout (java.awt.BorderLayout)69 JPanel (javax.swing.JPanel)64 JScrollPane (javax.swing.JScrollPane)54 Dimension (java.awt.Dimension)40 JLabel (javax.swing.JLabel)31 JButton (javax.swing.JButton)17 JTextArea (javax.swing.JTextArea)16 FlowLayout (java.awt.FlowLayout)15 Insets (java.awt.Insets)15 GridBagLayout (java.awt.GridBagLayout)14 GridBagConstraints (java.awt.GridBagConstraints)13 JTable (javax.swing.JTable)13 Container (java.awt.Container)10 GridLayout (java.awt.GridLayout)10 ArrayList (java.util.ArrayList)10 BoxLayout (javax.swing.BoxLayout)10 JComponent (javax.swing.JComponent)10 JTabbedPane (javax.swing.JTabbedPane)10 EmptyBorder (javax.swing.border.EmptyBorder)10