use of org.compiere.swing.CPanel in project adempiere by adempiere.
the class VBrowser method initComponents.
/**
* Init View componets
*/
private void initComponents() {
toolsBar = new javax.swing.JToolBar();
tabsPanel = new javax.swing.JTabbedPane();
searchTab = new CPanel();
topPanel = new CPanel();
// FR [ 344 ]
searchPanel = new VBrowserSearch(getWindowNo(), getAD_Browse_ID(), BrowserSearch.COLUMNS_2);
searchPanel.init();
//
buttonSearchPanel = new CPanel();
centerPanel = new javax.swing.JScrollPane();
detail = new VBrowserTable(this);
detail.setRowSelectionAllowed(true);
detail.getSelectionModel().addListSelectionListener(this);
footPanel = new CPanel();
footButtonPanel = new CPanel(new FlowLayout(FlowLayout.CENTER));
processPanel = new CPanel();
graphPanel = new CPanel();
setupToolBar();
toolsBar.setRollover(true);
bSelectAll.setText(Msg.getMsg(Env.getCtx(), "SelectAll").replaceAll("[&]", ""));
bSelectAll.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bSelectAll.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
bSelectAll.setEnabled(false);
toolsBar.add(bSelectAll);
bZoom.setText(Msg.getMsg(Env.getCtx(), "Zoom").replaceAll("[&]", ""));
bZoom.setFocusable(false);
bZoom.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bZoom.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
bZoom.setEnabled(false);
if (AD_Window_ID > 0)
toolsBar.add(bZoom);
bExport.setText(Msg.getMsg(Env.getCtx(), ("Export")));
bExport.setFocusable(false);
bExport.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bExport.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
bExport.setEnabled(false);
toolsBar.add(bExport);
bDelete.setText(Msg.getMsg(Env.getCtx(), "Delete").replaceAll("[&]", ""));
bDelete.setFocusable(false);
bDelete.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bDelete.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
bDelete.setEnabled(false);
if (isDeleteable())
toolsBar.add(bDelete);
m_frame.getContentPane().add(toolsBar, java.awt.BorderLayout.PAGE_START);
searchTab.setLayout(new java.awt.BorderLayout());
topPanel.setLayout(new java.awt.BorderLayout());
collapsibleSearch = new CollapsiblePanel(Msg.getMsg(Env.getCtx(), ("SearchCriteria")));
collapsibleSearch.add(searchPanel.getPanel());
topPanel.add(collapsibleSearch, java.awt.BorderLayout.NORTH);
bSearch.setText(Msg.getMsg(Env.getCtx(), "StartSearch"));
buttonSearchPanel.add(bSearch);
collapsibleSearch.add(buttonSearchPanel);
searchTab.add(topPanel, java.awt.BorderLayout.NORTH);
centerPanel.setViewportView(detail);
searchTab.add(centerPanel, java.awt.BorderLayout.CENTER);
footPanel.setLayout(new java.awt.BorderLayout());
footButtonPanel.add(bCancel);
footButtonPanel.add(bOk);
footPanel.add(footButtonPanel, java.awt.BorderLayout.SOUTH);
processPanel.setLayout(new java.awt.BorderLayout());
footPanel.add(processPanel, java.awt.BorderLayout.CENTER);
searchTab.add(footPanel, java.awt.BorderLayout.SOUTH);
tabsPanel.addTab(Msg.getMsg(Env.getCtx(), "Search"), searchTab);
graphPanel.setLayout(new java.awt.BorderLayout());
m_frame.getContentPane().add(tabsPanel, java.awt.BorderLayout.CENTER);
}
use of org.compiere.swing.CPanel in project adempiere by adempiere.
the class VBrowserSearch method initComponents.
/**
* Initialize components
*/
@Override
public void initComponents() {
if (mainPanel != null)
return;
//
mainLayout = new BorderLayout();
centerPanel = new CPanel();
mainPanel = new CPanel();
m_separators = new ArrayList<CLabel>();
//
mainPanel.setLayout(mainLayout);
mainPanel.add(centerPanel, BorderLayout.CENTER);
//
centerLayout = new ALayout();
centerPanel.setLayout(centerLayout);
}
use of org.compiere.swing.CPanel in project adempiere by adempiere.
the class VCollectDetail method loadCreditPanel.
/**
* Load for Credit Card
* @return void
*/
private void loadCreditPanel() {
creditPanel = new CPanel(layout);
// For Credit Card
//C_Payment_v.CreditCardType
int columnId = 8374;
MLookup cardlookup = MLookupFactory.get(Env.getCtx(), 0, 0, columnId, DisplayType.List);
fieldCreditCardType = new VLookup("CreditCardType", true, false, true, cardlookup);
// For Credit Card Type
((VComboBox) fieldCreditCardType.getCombo()).setRenderer(new POSLookupListCellRenderer(font));
fieldCreditCardType.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
((VComboBox) fieldCreditCardType.getCombo()).setFont(font);
fieldCreditCardType.addVetoableChangeListener(this);
// For Months
// For Card No
String creditCardNumber = Msg.translate(ctx, "CreditCardNumber");
fieldCreditCardNumber = new POSTextField(creditCardNumber, parentCollect.getKeyboard());
fieldCreditCardNumber.setPlaceholder(creditCardNumber);
fieldCreditCardNumber.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
fieldCreditCardNumber.setFont(font);
fieldCreditCardNumber.addKeyListener(this);
fieldCreditCardNumber.addActionListener(this);
// For Card Name
String name = Msg.translate(ctx, "A_Name");
fieldName = new POSTextField(name, parentCollect.getKeyboard());
fieldName.setPlaceholder(name);
fieldName.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
fieldName.setFont(font);
fieldName.addKeyListener(this);
fieldName.addActionListener(this);
// For Card Month
fieldCreditCardExpMM = new VComboBox(getCCMonths());
fieldCreditCardExpMM.setName("CreditCardExpMM");
fieldCreditCardExpMM.setValue(-1);
fieldCreditCardExpMM.setMandatory(true);
fieldCreditCardExpMM.setPreferredSize(new Dimension(FIELD_WIDTH / 2, FIELD_HEIGHT));
fieldCreditCardExpMM.setRenderer(new POSLookupListCellRenderer(font));
fieldCreditCardExpMM.setFont(font);
fieldCreditCardExpMM.addActionListener(this);
// For Card Year
fieldCreditCardExpYY = new VComboBox(getCCYears());
fieldCreditCardExpYY.setName("CreditCardExpYY");
fieldCreditCardExpYY.setValue(-1);
fieldCreditCardExpYY.setMandatory(true);
fieldCreditCardExpYY.setPreferredSize(new Dimension(FIELD_WIDTH / 2, FIELD_HEIGHT));
fieldCreditCardExpYY.setRenderer(new POSLookupListCellRenderer(font));
fieldCreditCardExpYY.setFont(font);
fieldCreditCardExpYY.addActionListener(this);
// For Card VV
String creditCardVV = Msg.translate(ctx, "CreditCardVV");
fieldCreditCardVV = new POSTextField(creditCardVV, parentCollect.getKeyboard());
fieldCreditCardVV.setPlaceholder(creditCardVV);
fieldCreditCardVV.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
fieldCreditCardVV.setFont(font);
fieldCreditCardVV.addKeyListener(this);
fieldCreditCardVV.addActionListener(this);
// Add to Panel
creditPanel.add(fieldCreditCardType, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
creditPanel.add(fieldName, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
creditPanel.add(fieldCreditCardNumber, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
creditPanel.add(fieldCreditCardVV, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
creditPanel.add(fieldCreditCardExpMM, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
creditPanel.add(fieldCreditCardExpYY, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
// Default visible false
creditPanel.setVisible(false);
}
use of org.compiere.swing.CPanel in project adempiere by adempiere.
the class VCollectDetail method loadCheckPanel.
/**
* Load Check Panel
* @return void
*/
private void loadCheckPanel() {
// Instance Panel
checkPanel = new CPanel(layout);
// For Check No
String m_CheckNo = Msg.translate(ctx, "CheckNo");
fieldCheckNo = new POSTextField(m_CheckNo, keyboard);
fieldCheckNo.setPlaceholder(m_CheckNo);
fieldCheckNo.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
fieldCheckNo.setFont(font);
fieldCheckNo.addKeyListener(this);
fieldCheckNo.addActionListener(this);
// For Check Route No
String m_RoutingNo = Msg.translate(ctx, "RoutingNo");
fieldCheckRoutingNo = new POSTextField(m_RoutingNo, keyboard);
fieldCheckRoutingNo.setPlaceholder(m_RoutingNo);
fieldCheckRoutingNo.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
fieldCheckRoutingNo.setFont(font);
fieldCheckRoutingNo.addKeyListener(this);
fieldCheckRoutingNo.addActionListener(this);
// For Check Date
String languageName = Env.getAD_Language(ctx);
Language language = Language.getLanguage(languageName);
Language.setLoginLanguage(language);
// Locale
Locale locale = language.getLocale();
Locale.setDefault(locale);
fieldCheckDate = new VDate(DisplayType.Date);
fieldCheckDate.setFormat();
fieldCheckDate.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
fieldCheckDate.setFont(font);
fieldCheckDate.addActionListener(this);
// Add To Panel
checkPanel.add(fieldCheckRoutingNo, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
checkPanel.add(fieldCheckNo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
checkPanel.add(fieldCheckDate, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
// Default visible false
checkPanel.setVisible(false);
}
use of org.compiere.swing.CPanel in project adempiere by adempiere.
the class VPOS method dynInit.
/**************************************************************************
* Dynamic Init.
* PosPanel has a GridBagLayout.
* The Sub Panels return their position
*/
private boolean dynInit() {
frame.setTitle("Adempiere POS: " + getPOSName());
// Create Sub Panels
leftPanel = new CPanel(new GridBagLayout());
actionPanel = new POSActionPanel(this);
infoProductPanel = new POSInfoProduct(this);
quantityPanel = new POSQuantityPanel(this);
leftPanel.add(actionPanel, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
leftPanel.add(infoProductPanel, new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
leftPanel.add(quantityPanel, new GridBagConstraints(0, 2, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 10, 0), 0, 0));
//
orderLinePanel = new POSOrderLinePanel(this);
leftPanel.add(orderLinePanel, new GridBagConstraints(0, 4, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
documentPanel = new POSDocumentPanel(this);
dividerPane.add(leftPanel, JSplitPane.LEFT);
dividerPane.add(documentPanel, JSplitPane.RIGHT);
statusBar.setInfo("");
// Seek to last
if (hasRecord())
lastRecord();
refreshPanel();
return true;
}
Aggregations