use of javax.swing.border.TitledBorder in project adempiere by adempiere.
the class BeanShellEditor method jbInit.
/**
* Static Layout
* @throws Exception
*/
void jbInit() throws Exception {
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), Msg.getMsg(Env.getCtx(), "ScriptVariables"));
titledBorder2 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), Msg.getMsg(Env.getCtx(), "ScriptEditor"));
mainPanel.setLayout(borderLayout1);
editor.setLineWrap(true);
editor.setTabSize(4);
editor.setWrapStyleWord(true);
bOK.addActionListener(this);
bCancel.addActionListener(this);
bHelp.addActionListener(this);
bProcess.addActionListener(this);
bValidate.addActionListener(this);
variables.setBackground(Color.lightGray);
variables.setEditable(false);
variables.setContentType("text/html");
variablesPane.setBorder(titledBorder1);
editorPane.setBorder(titledBorder2);
centerPane.setPreferredSize(new Dimension(500, 500));
centerPane.setLeftComponent(editorPane);
centerPane.setRightComponent(variablesPane);
southPanel.setLayout(southLayout);
resultPanel.setLayout(resultLayout);
lResult.setText(Msg.getMsg(Env.getCtx(), "ScriptResult"));
fResult.setBackground(Color.lightGray);
fResult.setEditable(false);
fResult.setText("");
northPanel.setLayout(northLayout);
lResultVariable.setText(Msg.getMsg(Env.getCtx(), "ScriptResultVariable"));
fResultVariable.setBackground(Color.lightGray);
fResultVariable.setEditable(false);
resultVariablePanel.setLayout(resultVariableLayout);
okPanel.setLayout(okLayout);
northPanel.add(resultVariablePanel, BorderLayout.CENTER);
getContentPane().add(mainPanel);
editorPane.getViewport().add(editor, null);
variablesPane.getViewport().add(variables, null);
mainPanel.add(northPanel, BorderLayout.NORTH);
mainPanel.add(southPanel, BorderLayout.SOUTH);
southPanel.add(okPanel, BorderLayout.EAST);
okPanel.add(bCancel, null);
okPanel.add(bOK, null);
southPanel.add(resultPanel, BorderLayout.CENTER);
resultPanel.add(bValidate, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
resultPanel.add(bProcess, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
resultPanel.add(lResult, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
resultPanel.add(fResult, new GridBagConstraints(3, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
mainPanel.add(centerPane, BorderLayout.CENTER);
resultVariablePanel.add(lResultVariable, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
resultVariablePanel.add(fResultVariable, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
northPanel.add(helpPanel, BorderLayout.EAST);
helpPanel.add(bHelp, null);
centerPane.setDividerLocation(350);
}
use of javax.swing.border.TitledBorder in project adempiere by adempiere.
the class VAccountDialog method jbInit.
/**
* Static component init.
* <pre>
* - panel
* - northPanel
* - parameterPanel
* - toolBar
* - gridController
* - confirmPanel
* - statusBar
* </pre>
* @throws Exception
*/
void jbInit() throws Exception {
// [ 1707303 ] Account Combination Form(VAccountDialog) translation issue
titledBorder = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(134, 134, 134)), Msg.getMsg(Env.getCtx(), "Parameter"));
//
panelLayout.setHgap(5);
panelLayout.setVgap(5);
northLayout.setHgap(5);
northLayout.setVgap(5);
//
parameterPanel.setLayout(parameterLayout);
parameterPanel.setBorder(titledBorder);
northPanel.setLayout(northLayout);
toolBar.setOrientation(JToolBar.VERTICAL);
toolBar.setBorder(null);
toolBar.setRequestFocusEnabled(false);
toolBar.setBorderPainted(false);
toolBar.setMargin(new Insets(5, 5, 5, 5));
bSave.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Save24.gif")));
bSave.setMargin(new Insets(2, 2, 2, 2));
bSave.setToolTipText(Msg.getMsg(Env.getCtx(), "AccountNewUpdate"));
bSave.addActionListener(this);
bRefresh.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Refresh24.gif")));
bRefresh.setMargin(new Insets(2, 2, 2, 2));
bRefresh.setToolTipText(Msg.getMsg(Env.getCtx(), "Refresh"));
bRefresh.addActionListener(this);
bIgnore.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Ignore24.gif")));
bIgnore.setMargin(new Insets(2, 2, 2, 2));
bIgnore.setToolTipText(Msg.getMsg(Env.getCtx(), "Ignore"));
bIgnore.addActionListener(this);
//
toolBar.addSeparator();
toolBar.add(bRefresh, null);
toolBar.add(bIgnore, null);
toolBar.add(bSave, null);
//
getContentPane().add(panel);
panel.setLayout(panelLayout);
panel.add(confirmPanel, BorderLayout.SOUTH);
panel.add(northPanel, BorderLayout.NORTH);
northPanel.add(parameterPanel, BorderLayout.CENTER);
northPanel.add(toolBar, BorderLayout.EAST);
//
this.getContentPane().add(statusBar, BorderLayout.SOUTH);
confirmPanel.addActionListener(this);
}
use of javax.swing.border.TitledBorder in project adempiere by adempiere.
the class POSInfoProduct method init.
@Override
protected void init() {
// Set Layout
setLayout(new GridBagLayout());
// Set Border
TitledBorder border = BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "InfoProduct"));
border.setTitleFont(posPanel.getFont());
border.setTitleColor(AdempierePLAF.getTextColor_Label());
setBorder(border);
//
FontMetrics metrics = getFontMetrics(posPanel.getPlainFont());
// Instance Panels
rightPanel = new CPanel(new GridBagLayout());
// For Name
labelName = new CLabel(Msg.getElement(Env.getCtx(), "ProductName"));
labelName.setFont(posPanel.getBigFont());
labelName.setHorizontalAlignment(CLabel.LEFT);
// Add
rightPanel.add(labelName, new GridBagConstraints(0, 0, 1, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 0), 0, 0));
labelPriceName = new CLabel(Msg.parseTranslation(ctx, "@PriceStd@ , @PriceList@ ") + posPanel.getCurSymbol());
labelPriceName.setFont(posPanel.getBigFont());
labelPriceName.setHorizontalAlignment(CLabel.LEFT);
labelPriceName.setHorizontalTextPosition(CLabel.LEFT);
// Add
rightPanel.add(labelPriceName, new GridBagConstraints(0, 1, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));
/*labelPriceLimit = new CLabel (posPanel.getNumberFormat().format(Env.ZERO));
labelPriceLimit.setFont(posPanel.getBigFont());
labelPriceLimit.setHorizontalAlignment(CLabel.RIGHT);
labelPriceLimit.setHorizontalTextPosition(CLabel.RIGHT);
labelPriceLimit.setPreferredSize(new Dimension(100, metrics.getHeight()));
labelPriceLimit.setMinimumSize(new Dimension(150, metrics.getHeight()));
// Add
rightPanel.add(labelPriceLimit, new GridBagConstraints(1, 1, 1, 1, 1, 1
,GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));*/
// For Price
labelPrice = new CLabel(posPanel.getNumberFormat().format(Env.ZERO));
labelPrice.setFont(posPanel.getBigFont());
labelPrice.setHorizontalAlignment(CLabel.RIGHT);
labelPrice.setHorizontalTextPosition(CLabel.RIGHT);
labelPrice.setPreferredSize(new Dimension(100, metrics.getHeight()));
labelPrice.setMinimumSize(new Dimension(150, metrics.getHeight()));
// Add
rightPanel.add(labelPrice, new GridBagConstraints(2, 1, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));
labelPriceList = new CLabel(posPanel.getNumberFormat().format(Env.ZERO));
labelPriceList.setFont(posPanel.getBigFont());
labelPriceList.setHorizontalAlignment(CLabel.RIGHT);
labelPriceList.setHorizontalTextPosition(CLabel.RIGHT);
labelPriceList.setPreferredSize(new Dimension(100, metrics.getHeight()));
labelPriceList.setMinimumSize(new Dimension(150, metrics.getHeight()));
// Add
rightPanel.add(labelPriceList, new GridBagConstraints(3, 1, 1, 1, 1, 1, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0));
// For Value
labelValue = new CLabel(Msg.getElement(Env.getCtx(), "ProductValue"));
labelValue.setFont(posPanel.getPlainFont());
labelValue.setHorizontalAlignment(CLabel.LEFT);
labelValue.setHorizontalTextPosition(CLabel.LEFT);
// Add
rightPanel.add(labelValue, new GridBagConstraints(0, 2, 1, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For UOM
labelUOMSymbol = new CLabel(Msg.getElement(Env.getCtx(), "C_UOM_ID"));
labelUOMSymbol.setFont(posPanel.getPlainFont());
labelUOMSymbol.setHorizontalAlignment(CLabel.LEFT);
labelUOMSymbol.setHorizontalTextPosition(CLabel.LEFT);
// Add
rightPanel.add(labelUOMSymbol, new GridBagConstraints(0, 3, 1, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For Category
labelProductCategory = new CLabel(Msg.getElement(Env.getCtx(), "M_Product_Category_ID"));
labelProductCategory.setFont(posPanel.getPlainFont());
labelProductCategory.setHorizontalAlignment(CLabel.LEFT);
// Add
rightPanel.add(labelProductCategory, new GridBagConstraints(0, 4, 2, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For Category
labelProductTax = new CLabel(Msg.getElement(Env.getCtx(), "C_TaxCategory_ID"));
labelProductTax.setFont(posPanel.getPlainFont());
labelProductTax.setHorizontalAlignment(CLabel.LEFT);
// Add
rightPanel.add(labelProductTax, new GridBagConstraints(0, 5, 2, 1, 1, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// For Description
labelDescription = new CLabel(Msg.getElement(Env.getCtx(), "Description"));
labelDescription.setFont(posPanel.getPlainFont());
labelDescription.setHorizontalAlignment(CLabel.LEFT);
labelDescription.setPreferredSize(new Dimension(20, metrics.getHeight()));
labelDescription.setMaximumSize(new Dimension(20, metrics.getHeight()));
// Add
rightPanel.add(labelDescription, new GridBagConstraints(0, 6, 2, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
// For Image
buttonImage = new CButton();
buttonImage.setFont(posPanel.getFont());
buttonImage.setPreferredSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
buttonImage.setMinimumSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
buttonImage.setFocusable(false);
buttonImage.setVerticalTextPosition(SwingConstants.BOTTOM);
buttonImage.setHorizontalTextPosition(SwingConstants.CENTER);
// Add to panel
// Add Doc Info
add(buttonImage, new GridBagConstraints(0, 0, 1, 1, 0.1, 1, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
// Add to Header
add(rightPanel, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0));
}
use of javax.swing.border.TitledBorder in project adempiere by adempiere.
the class VProductConfigurationBOM method createSelectionPanel.
/**************************************************************************
* Create Selection Panel
* @param order
* @param invoice
* @param project
*/
private void createSelectionPanel(boolean order, boolean invoice, boolean project) {
int row = 0;
selectionPanel.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "Selection")));
productField = new CComboBox(getProducts());
CLabel label = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID"));
label.setLabelFor(productField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(productField);
productField.addActionListener(this);
// Qty
label = new CLabel(productQty.getTitle());
label.setLabelFor(productQty);
selectionPanel.add(label);
selectionPanel.add(productQty);
productQty.setValue(Env.ONE);
productQty.addActionListener(this);
if (order) {
orderField = new CComboBox(getOrders());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Order_ID"));
label.setLabelFor(orderField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(orderField);
orderField.addActionListener(this);
}
if (invoice) {
invoiceField = new CComboBox(getInvoices());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Invoice_ID"));
label.setLabelFor(invoiceField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(invoiceField);
invoiceField.addActionListener(this);
}
if (project) {
projectField = new CComboBox(getProjects());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Project_ID"));
label.setLabelFor(projectField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(projectField);
projectField.addActionListener(this);
}
// Enabled in ActionPerformed
confirmPanel.getOKButton().setEnabled(false);
// Size
Dimension size = selectionPanel.getPreferredSize();
size.width = WINDOW_WIDTH;
selectionPanel.setPreferredSize(size);
}
use of javax.swing.border.TitledBorder in project adempiere by adempiere.
the class VProductConfigurationBOM method createMainPanel.
// getInvoices
/**************************************************************************
* Create Main Panel.
* Called when changing Product
*/
private void createMainPanel() {
log.config(": " + m_product);
this.removeAll();
this.setPreferredSize(null);
this.invalidate();
this.setBorder(null);
//
m_selectionList.clear();
m_productList.clear();
m_bomLineIDList.clear();
m_qtyList.clear();
m_buttonGroups.clear();
//
this.setLayout(new ALayout());
String title = Msg.getMsg(Env.getCtx(), "SelectProduct");
if (m_product != null && m_product.get_ID() > 0) {
title = m_product.getName();
if (m_product.getDescription() != null && m_product.getDescription().length() > 0)
this.setToolTipText(m_product.getDescription());
m_bomLine = 0;
m_tree = new CheckboxTree(this.m_RadioButtonTreeCellRenderer.action_loadBOM(m_product, true));
m_tree.getCheckingModel().setCheckingMode(it.cnr.imaa.essi.lablib.gui.checkboxtree.TreeCheckingModel.CheckingMode.SIMPLE);
m_tree.getCheckingModel().clearChecking();
m_tree.setCellRenderer(this.m_RadioButtonTreeCellRenderer);
m_tree.setScrollsOnExpand(true);
JScrollPane treeView = new JScrollPane(m_tree);
this.add(treeView);
} else {
DefaultMutableTreeNode nodeHolder = new DefaultMutableTreeNode(Msg.translate(Env.getCtx(), "No Product Chosen"));
m_tree = new CheckboxTree(nodeHolder);
JScrollPane treeView = new JScrollPane(m_tree);
this.add(treeView);
}
this.setBorder(new TitledBorder(title));
}
Aggregations