Search in sources :

Example 21 with JSplitPane

use of javax.swing.JSplitPane in project adempiere by adempiere.

the class CAbstractBOMTree method preInit.

private void preInit() {
    northPanel = new CPanel();
    southPanel = new CPanel();
    contentPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    nodeDescription = new JEditorPane("text/html", "");
    nodeDescription.setOpaque(false);
    nodeDescription.setEditable(false);
    String columnName = null;
    int columnId = -1;
    if (BOMWrapper.BOM_TYPE_PRODUCT.equals(type())) {
        columnName = MProduct.Table_Name + "_ID";
        columnId = MColumn.getColumn_ID(MProduct.Table_Name, columnName);
    } else if (BOMWrapper.BOM_TYPE_ORDER.equals(type())) {
        columnName = MPPOrder.Table_Name + "_ID";
        columnId = MColumn.getColumn_ID(MPPOrder.Table_Name, columnName);
    }
    MLookup lm = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, columnId, DisplayType.Search);
    lookup = new VLookup(columnName, false, false, true, lm) {

        public void setValue(Object obj) {
            super.setValue(obj);
            dispatchPropertyChange();
        }

        ;
    };
}
Also used : MLookup(org.compiere.model.MLookup) CPanel(org.compiere.swing.CPanel) JEditorPane(javax.swing.JEditorPane) VLookup(org.compiere.grid.ed.VLookup) JSplitPane(javax.swing.JSplitPane)

Example 22 with JSplitPane

use of javax.swing.JSplitPane in project adempiere by adempiere.

the class AChat method staticInit.

/**
	 * 	Static Init.
	 *	@throws Exception
	 */
private void staticInit() throws Exception {
    this.getContentPane().add(mainPanel);
    //
    historyText.setPreferredSize(new Dimension(350, 300));
    historyText.setReadWrite(false);
    historyText.setMargin(new Insets(2, 2, 2, 2));
    newText.setPreferredSize(new Dimension(350, 200));
    newText.setMargin(new Insets(2, 2, 2, 2));
    //
    JSplitPane textPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, historyText, newText);
    mainPanel.add(textPane, BorderLayout.CENTER);
    //TODO 	Confidentiality
    //	South
    mainPanel.add(confirmPanel, BorderLayout.SOUTH);
    confirmPanel.addActionListener(this);
}
Also used : Insets(java.awt.Insets) Dimension(java.awt.Dimension) JSplitPane(javax.swing.JSplitPane)

Example 23 with JSplitPane

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

the class RequestViewHTTP method createRequestPane.

/**
     * Create a pane with three tables (request, params, headers)
     * 
     * @return Pane to display request data
     */
private Component createRequestPane() {
    // Set up the 1st table Result with empty headers
    tableRequest = new JTable(requestModel);
    JMeterUtils.applyHiDPI(tableRequest);
    // $NON-NLS-1$
    tableRequest.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableRequest.addMouseListener(new TextBoxDoubleClick(tableRequest));
    setFirstColumnPreferredAndMaxWidth(tableRequest);
    RendererUtils.applyRenderers(tableRequest, RENDERERS_REQUEST);
    // Set up the 2nd table 
    tableParams = new JTable(paramsModel);
    JMeterUtils.applyHiDPI(tableParams);
    // $NON-NLS-1$
    tableParams.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableParams.addMouseListener(new TextBoxDoubleClick(tableParams));
    TableColumn column = tableParams.getColumnModel().getColumn(0);
    column.setPreferredWidth(160);
    tableParams.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableParams, RENDERERS_PARAMS);
    // Set up the 3rd table 
    tableHeaders = new JTable(headersModel);
    JMeterUtils.applyHiDPI(tableHeaders);
    // $NON-NLS-1$
    tableHeaders.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
    tableHeaders.addMouseListener(new TextBoxDoubleClick(tableHeaders));
    setFirstColumnPreferredAndMaxWidth(tableHeaders);
    tableHeaders.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
    RendererUtils.applyRenderers(tableHeaders, RENDERERS_HEADERS);
    // Create the split pane
    JSplitPane topSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableParams), GuiUtils.makeScrollPane(tableHeaders));
    topSplit.setOneTouchExpandable(true);
    // set split ratio
    topSplit.setResizeWeight(0.50);
    // see bug jdk 4131528
    topSplit.setBorder(null);
    JSplitPane paneParsed = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableRequest), topSplit);
    paneParsed.setOneTouchExpandable(true);
    // set split ratio (only 5 lines to display)
    paneParsed.setResizeWeight(0.25);
    // see bug jdk 4131528
    paneParsed.setBorder(null);
    // Hint to background color on bottom tabs (grey, not blue)
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(paneParsed);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable) HeaderAsPropertyRenderer(org.apache.jmeter.gui.util.HeaderAsPropertyRenderer) TextBoxDoubleClick(org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick) JSplitPane(javax.swing.JSplitPane) TableColumn(javax.swing.table.TableColumn)

Example 24 with JSplitPane

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

the class LoggerPanelEnableDisable method doAction.

/**
     * This method performs the actual command processing.
     *
     * @param e the generic UI action event
     */
@Override
public void doAction(ActionEvent e) {
    if (ActionNames.LOGGER_PANEL_ENABLE_DISABLE.equals(e.getActionCommand())) {
        GuiPackage guiInstance = GuiPackage.getInstance();
        JSplitPane splitPane = (JSplitPane) guiInstance.getLoggerPanel().getParent();
        if (!guiInstance.getLoggerPanel().isVisible()) {
            splitPane.setDividerSize(UIManager.getInt("SplitPane.dividerSize"));
            guiInstance.getLoggerPanel().setVisible(true);
            splitPane.setDividerLocation(0.8);
            guiInstance.getMenuItemLoggerPanel().getModel().setSelected(true);
        } else {
            guiInstance.getLoggerPanel().clear();
            guiInstance.getLoggerPanel().setVisible(false);
            splitPane.setDividerSize(0);
            guiInstance.getMenuItemLoggerPanel().getModel().setSelected(false);
        }
    }
}
Also used : GuiPackage(org.apache.jmeter.gui.GuiPackage) JSplitPane(javax.swing.JSplitPane)

Example 25 with JSplitPane

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

the class StatGraphVisualizer method init.

/**
     * Main visualizer setup.
     */
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);
    Border margin2 = new EmptyBorder(10, 10, 5, 10);
    mainPanel.setBorder(margin);
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.add(makeTitlePanel());
    myJTable = new JTable(model);
    myJTable.setRowSorter(new ObjectTableSorter(model).fixLastRow());
    JMeterUtils.applyHiDPI(myJTable);
    // Fix centering of titles
    HeaderAsPropertyRendererWrapper.setupDefaultRenderer(myJTable, getColumnsMsgParameters());
    myJTable.setPreferredScrollableViewportSize(new Dimension(500, 70));
    RendererUtils.applyRenderers(myJTable, getRenderers());
    myScrollPane = new JScrollPane(myJTable);
    settingsPane = new VerticalPanel();
    settingsPane.setBorder(margin2);
    graphPanel = new AxisGraph();
    graphPanel.setPreferredSize(new Dimension(defaultWidth, defaultHeight));
    settingsPane.add(createGraphActionsPane());
    settingsPane.add(createGraphColumnPane());
    settingsPane.add(createGraphTitlePane());
    settingsPane.add(createGraphDimensionPane());
    JPanel axisPane = new JPanel(new BorderLayout());
    axisPane.add(createGraphXAxisPane(), BorderLayout.WEST);
    axisPane.add(createGraphYAxisPane(), BorderLayout.CENTER);
    settingsPane.add(axisPane);
    settingsPane.add(createLegendPane());
    //$NON-NLS-1$
    tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_settings"), settingsPane);
    //$NON-NLS-1$
    tabbedGraph.addTab(JMeterUtils.getResString("aggregate_graph_tab_graph"), graphPanel);
    // If clic on the Graph tab, make the graph (without apply interval or filter)
    tabbedGraph.addChangeListener(changeEvent -> {
        JTabbedPane srcTab = (JTabbedPane) changeEvent.getSource();
        int index = srcTab.getSelectedIndex();
        if (srcTab.getTitleAt(index).equals(JMeterUtils.getResString("aggregate_graph_tab_graph"))) {
            actionMakeGraph();
        }
    });
    spane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    spane.setOneTouchExpandable(true);
    spane.setLeftComponent(myScrollPane);
    spane.setRightComponent(tabbedGraph);
    spane.setResizeWeight(.2);
    // see bug jdk 4131528
    spane.setBorder(null);
    spane.setContinuousLayout(true);
    this.add(mainPanel, BorderLayout.NORTH);
    this.add(spane, BorderLayout.CENTER);
    new Timer(REFRESH_PERIOD, e -> {
        synchronized (lock) {
            while (!newRows.isEmpty()) {
                model.insertRow(newRows.pop(), model.getRowCount() - 1);
            }
        }
        model.fireTableDataChanged();
    }).start();
}
Also used : JScrollPane(javax.swing.JScrollPane) Color(java.awt.Color) VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) UIManager(javax.swing.UIManager) Format(java.text.Format) NumberRenderer(org.apache.jorphan.gui.NumberRenderer) LoggerFactory(org.slf4j.LoggerFactory) SampleResult(org.apache.jmeter.samplers.SampleResult) TableCellRenderer(javax.swing.table.TableCellRenderer) ActionRouter(org.apache.jmeter.gui.action.ActionRouter) Border(javax.swing.border.Border) Matcher(java.util.regex.Matcher) GuiUtils(org.apache.jorphan.gui.GuiUtils) Map(java.util.Map) JFileChooser(javax.swing.JFileChooser) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) Timer(javax.swing.Timer) PatternSyntaxException(java.util.regex.PatternSyntaxException) Font(java.awt.Font) ObjectTableSorter(org.apache.jorphan.gui.ObjectTableSorter) RendererUtils(org.apache.jorphan.gui.RendererUtils) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CSVSaveService(org.apache.jmeter.save.CSVSaveService) BorderFactory(javax.swing.BorderFactory) Box(javax.swing.Box) ActionNames(org.apache.jmeter.gui.action.ActionNames) FilePanel(org.apache.jmeter.gui.util.FilePanel) Dimension(java.awt.Dimension) List(java.util.List) AbstractVisualizer(org.apache.jmeter.visualizers.gui.AbstractVisualizer) JCheckBox(javax.swing.JCheckBox) JTable(javax.swing.JTable) EmptyBorder(javax.swing.border.EmptyBorder) Pattern(java.util.regex.Pattern) JPanel(javax.swing.JPanel) JColorChooser(javax.swing.JColorChooser) JMeterUtils(org.apache.jmeter.util.JMeterUtils) ActionListener(java.awt.event.ActionListener) JSplitPane(javax.swing.JSplitPane) JTextField(javax.swing.JTextField) FileDialoger(org.apache.jmeter.gui.util.FileDialoger) ArrayUtils(org.apache.commons.lang3.ArrayUtils) Deque(java.util.Deque) SwingConstants(javax.swing.SwingConstants) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) SaveGraphics(org.apache.jmeter.gui.action.SaveGraphics) RateRenderer(org.apache.jorphan.gui.RateRenderer) Charset(java.nio.charset.Charset) JTabbedPane(javax.swing.JTabbedPane) JLabeledTextField(org.apache.jorphan.gui.JLabeledTextField) OutputStreamWriter(java.io.OutputStreamWriter) HeaderAsPropertyRendererWrapper(org.apache.jmeter.gui.util.HeaderAsPropertyRendererWrapper) BoxLayout(javax.swing.BoxLayout) JComponent(javax.swing.JComponent) FlowLayout(java.awt.FlowLayout) Clearable(org.apache.jmeter.samplers.Clearable) JButton(javax.swing.JButton) Functor(org.apache.jorphan.reflect.Functor) Logger(org.slf4j.Logger) DecimalFormat(java.text.DecimalFormat) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) JOptionPane(javax.swing.JOptionPane) ActionEvent(java.awt.event.ActionEvent) ConcurrentLinkedDeque(java.util.concurrent.ConcurrentLinkedDeque) JScrollPane(javax.swing.JScrollPane) JLabel(javax.swing.JLabel) ObjectTableModel(org.apache.jorphan.gui.ObjectTableModel) JPanel(javax.swing.JPanel) BoxLayout(javax.swing.BoxLayout) JTabbedPane(javax.swing.JTabbedPane) Dimension(java.awt.Dimension) VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) BorderLayout(java.awt.BorderLayout) Timer(javax.swing.Timer) JTable(javax.swing.JTable) ObjectTableSorter(org.apache.jorphan.gui.ObjectTableSorter) EmptyBorder(javax.swing.border.EmptyBorder) JSplitPane(javax.swing.JSplitPane) Border(javax.swing.border.Border) EmptyBorder(javax.swing.border.EmptyBorder)

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