use of org.compiere.apps.AppsAction in project adempiere by adempiere.
the class VCollect method jbInit.
// init
/**
* Instance Frame and fill fields
* @throws Exception
* @return void
*/
private void jbInit() throws Exception {
screenSize = pos.getSize();
widthSize = (screenSize.width * 40) / 100;
heightSize = (screenSize.height * 50) / 100;
// Instance Dialog
//dialog = new CDialog(Env.getWindow(pos.getWindowNo()), Msg.translate(ctx, "Payment"), true);
dialog = new CPanel();
dialog.setName(Msg.translate(ctx, "Payment"));
//
mainLayout = new BorderLayout();
parameterLayout = new GridBagLayout();
mainPanel = new CPanel();
parameterPanel = new CPanel();
centerPanel = new CPanel();
scrollPane = new JScrollPane();
scrollPane.setPreferredSize(new Dimension(widthSize, heightSize));
mainPanel.setLayout(mainLayout);
parameterPanel.setLayout(parameterLayout);
centerPanel.setLayout(parameterLayout);
mainPanel.add(scrollPane);
scrollPane.getViewport().add(centerPanel);
// Add Payment Amount
labelPayAmt = new CLabel(Msg.translate(ctx, "PayAmt") + ":");
labelPayAmt.setFont(pos.getBigFont());
//
fieldPayAmt = new CLabel();
fieldPayAmt.setFont(pos.getBigFont());
// Add Payment Amount
labelOpenAmt = new CLabel(Msg.translate(ctx, "OpenAmt") + ":");
labelOpenAmt.setFont(pos.getBigFont());
//
fieldOpenAmt = new CLabel();
fieldOpenAmt.setFont(pos.getBigFont());
// For Returned Amount
labelReturnAmt = new CLabel(Msg.translate(ctx, "AmountReturned") + ":");
labelReturnAmt.setFont(pos.getBigFont());
//
fieldReturnAmt = new CLabel();
fieldReturnAmt.setFont(pos.getBigFont());
labelPaidAmt = new CLabel(Msg.translate(ctx, "PaidAmt") + ":");
labelPaidAmt.setFont(pos.getBigFont());
labelPaidAmt.setVisible(false);
fieldPaidAmt = new CLabel();
fieldPaidAmt.setFont(pos.getBigFont());
fieldPaidAmt.setVisible(false);
// Add Plus Button
AppsAction action = new AppsAction("Plus", KeyStroke.getKeyStroke(KeyEvent.VK_F2, Event.F2), false);
action.setDelegate(this);
buttonPlus = (CButton) action.getButton();
buttonPlus.setPreferredSize(new Dimension(pos.getButtonSize(), pos.getButtonSize()));
buttonPlus.setFocusable(false);
// For Confirm Panel Button
buttonCancel = ConfirmPanel.createCancelButton(true);
buttonCancel.setPreferredSize(new Dimension(pos.getButtonSize(), pos.getButtonSize()));
buttonOk = ConfirmPanel.createOKButton(true);
buttonOk.setPreferredSize(new Dimension(pos.getButtonSize(), pos.getButtonSize()));
parameterPanel.add(labelPayAmt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(fieldPayAmt, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(labelOpenAmt, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(fieldOpenAmt, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(labelReturnAmt, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(fieldReturnAmt, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(labelPaidAmt, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(fieldPaidAmt, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(buttonPlus, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(buttonCancel, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
parameterPanel.add(buttonOk, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
// Add Fields to Main Panel
mainPanel.add(parameterPanel, BorderLayout.NORTH);
buttonOk.addActionListener(this);
buttonCancel.addActionListener(this);
// Add to Dialog
dialog.add(mainPanel, BorderLayout.CENTER);
}
use of org.compiere.apps.AppsAction in project adempiere by adempiere.
the class VCollectDetail method loadStandardPanel.
/**
* Load Standard Fields for Collect
* @return void
*/
private void loadStandardPanel() {
standardPanel = new CPanel(layout);
// For Tender Type
// C_Payment_v.TenderType
int columnId = 8416;
MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, columnId, DisplayType.List);
fieldTenderType = new VLookup("TenderType", true, false, true, lookup);
((VComboBox) fieldTenderType.getCombo()).setRenderer(new POSLookupListCellRenderer(font));
fieldTenderType.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
((VComboBox) fieldTenderType.getCombo()).setFont(font);
fieldTenderType.addVetoableChangeListener(this);
// For Amount
fieldPayAmt = new VNumber("PayAmt", true, false, true, DisplayType.Amount, "");
fieldPayAmt.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
fieldPayAmt.setFont(font);
fieldPayAmt.setValue(Env.ZERO);
fieldPayAmt.addVetoableChangeListener(this);
fieldPayAmt.addKeyListener(this);
// Button
AppsAction action = new AppsAction("Minus", KeyStroke.getKeyStroke(KeyEvent.VK_F2, Event.F2), false);
action.setDelegate(this);
buttonMinus = (CButton) action.getButton();
buttonMinus.setPreferredSize(new Dimension(FIELD_HEIGHT, FIELD_HEIGHT));
buttonMinus.setFocusable(false);
// Add Tender Type
standardPanel.add(fieldTenderType, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
standardPanel.add(fieldPayAmt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
}
use of org.compiere.apps.AppsAction in project adempiere by adempiere.
the class POSScalesPanel method dynInit.
private boolean dynInit() {
labelWeight = new CLabel("0.000", CLabel.CENTER);
labelWeight.setFont(new Font("Arial", Font.BOLD, 50));
centerPanel.setLayout(parameterLayout);
centerPanel.add(labelWeight);
AppsAction action = new AppsAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), false);
action.setDelegate(pos.getScalesListener());
buttonCaptureWeight = (CButton) action.getButton();
buttonCaptureWeight.setPreferredSize(new Dimension(pos.getButtonSize(), pos.getButtonSize()));
buttonCaptureWeight.setFocusable(true);
buttonCaptureWeight.addKeyListener(pos.getScalesListener());
parameterPanel.add(buttonCaptureWeight, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
mainPanel.add(parameterPanel, BorderLayout.SOUTH);
return true;
}
use of org.compiere.apps.AppsAction in project adempiere by adempiere.
the class POSLogin method init.
private void init() {
CPanel panel = new CPanel();
panel.setLayout(new MigLayout());
getContentPane().add(panel);
panel.add(new CLabel(Msg.translate(posPanel.getCtx(), "SalesRep_ID")));
username = new POSTextField(Msg.translate(posPanel.getCtx(), "SalesRep_ID"), posPanel.getKeyboard());
panel.add(username, "wrap");
panel.add(new CLabel(Msg.translate(posPanel.getCtx(), "UserPIN")));
pin = new POSTextField(Msg.translate(posPanel.getCtx(), "UserPIN"), posPanel.getKeyboard());
panel.add(pin, "");
AppsAction act = new AppsAction("Ok", KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), false);
act.setDelegate(this);
bProcess = (CButton) act.getButton();
bProcess.setFocusable(false);
panel.add(bProcess, "h 50!, w 50!");
pack();
}
use of org.compiere.apps.AppsAction in project adempiere by adempiere.
the class Info method jbInit.
/**
* Static Init
* @throws Exception
*/
protected void jbInit() throws Exception {
this.getContentPane().add(parameterPanel, BorderLayout.NORTH);
this.getContentPane().add(scrollPane, BorderLayout.CENTER);
this.getContentPane().add(southPanel, BorderLayout.SOUTH);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//
AppsAction aa = new AppsAction(ConfirmPanel.A_RESET, null, "reset");
bReset = (CButton) aa.getButton();
bReset.setMargin(ConfirmPanel.s_insets);
bReset.setSize(bReset.getHeight(), bReset.getHeight());
Dimension bSize = bReset.getSize();
bSize.height = bReset.getHeight();
bSize.width = bReset.getHeight();
// Make it square
bReset.setMaximumSize(bSize);
bReset.addActionListener(this);
//
buttonPanel = new CPanel(new FlowLayout(FlowLayout.LEFT));
buttonPanel.add(bReset, FlowLayout.LEFT);
//
// p_criteriaGrid is filled by the subordinate class
p_criteriaGrid.setLayout(new ALayout());
//
parameterPanel.setLayout(new BorderLayout());
parameterPanel.add(buttonPanel, BorderLayout.WEST);
parameterPanel.add(p_criteriaGrid, BorderLayout.CENTER);
//
// Setup the detail panel if used
p_detailTaskPane.setVisible(false);
p_detailTaskPane.setCollapsed(true);
p_detailTaskPane.setLayout(new BorderLayout());
p_detailTaskPane.setUI(new AdempiereTaskPaneUI());
p_detailTaskPane.getContentPane().setBackground(new ColorUIResource(251, 248, 241));
p_detailTaskPane.getContentPane().setForeground(new ColorUIResource(251, 0, 0));
addonPanel.setLayout(new BorderLayout());
// Allow auto resizing of the panel
addonPanel.add(p_detailTaskPane, BorderLayout.CENTER);
southPanel.setLayout(southLayout);
southPanel.add(addonPanel, BorderLayout.NORTH);
southPanel.add(confirmPanel, BorderLayout.CENTER);
southPanel.add(statusBar, BorderLayout.SOUTH);
scrollPane.getViewport().add(p_table, null);
//
confirmPanel.addActionListener(this);
confirmPanel.getResetButton().setVisible(hasReset());
confirmPanel.getCustomizeButton().setVisible(hasCustomize());
confirmPanel.getHistoryButton().setVisible(hasHistory());
confirmPanel.getZoomButton().setVisible(hasZoom());
// Only show the OK button if we intend to save
confirmPanel.setOKVisible(p_saveResults);
//
JButton print = ConfirmPanel.createPrintButton(true);
print.addActionListener(this);
confirmPanel.addButton(print);
//
checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setName("AutoQuery");
checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
checkAutoQuery.addActionListener(this);
// Index 0 is OK-Cancel on the right
CPanel leftButtons = (CPanel) confirmPanel.getComponent(1);
// Add the check box on the very left before the refresh icon
leftButtons.add(checkAutoQuery, 0);
//
popup.add(zoomMenu);
zoomMenu.setText(Msg.getMsg(Env.getCtx(), "Zoom"));
zoomMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Zoom16.gif")));
zoomMenu.addActionListener(this);
//
popup.add(calcMenu);
calcMenu.setText(Msg.getMsg(Env.getCtx(), "Calculator"));
calcMenu.setIcon(new ImageIcon(org.compiere.Adempiere.class.getResource("images/Calculator16.gif")));
calcMenu.addActionListener(this);
//
// Table Selection (Invoked before setting column class so that row selection is enabled)
p_table.setKeyColumnIndex(-1);
p_table.setCellSelectionEnabled(false);
p_table.setColumnSelectionAllowed(false);
p_table.setRowSelectionAllowed(true);
// Override the Enter key input and action map
if (p_saveResults) {
p_table.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "doDispose");
} else {
p_table.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), "doNothing");
}
p_table.getActionMap().put("doDispose", doDispose);
// To enable buttons
((ListSelectionModel) p_table.getSelectionModel()).addListSelectionListener(this);
p_table.addMouseListener(this);
// Listen to changes in the table
p_table.addPropertyChangeListener("p_table_update", this);
((ListSelectionModel) p_table.getSelectionModel()).addListSelectionListener(this);
//
// Set default location where focus will go. See property change listener.
m_parentPanel = p_criteriaGrid;
//
enableButtons();
}
Aggregations