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();
}
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);
}
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;
}
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;
}
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);
}
Aggregations