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