use of org.compiere.swing.CPanel in project adempiere by adempiere.
the class DeleteSelection method initComponents.
/**
* Init Components
*/
private void initComponents() {
mainPanel = new CPanel(new BorderLayout(0, 0));
confirmPanel = new ConfirmPanel(true);
mainDialog.getContentPane().add(mainPanel);
// Add Components
list = new JList<String>();
CScrollPane scrollPane = new CScrollPane(list);
// FR [ 2877111 ]
list.setListData(getData());
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
JEditorPane message = new JEditorPane();
// Description
message.setContentType("text/html");
message.setEditable(false);
message.setBackground(Color.white);
message.setFocusable(true);
message.setBackground(mainPanel.getBackground());
message.setText(Msg.getMsg(Env.getCtx(), "DeleteSelectionDescription"));
// Add to main panel
mainPanel.add(message, BorderLayout.NORTH);
mainPanel.add(scrollPane, BorderLayout.CENTER);
mainPanel.add(confirmPanel, BorderLayout.SOUTH);
confirmPanel.addActionListener(this);
// Default Selected
if (isDefaultSelected() && getSelection() != null) {
list.setSelectedIndices(getSelection());
}
}
use of org.compiere.swing.CPanel in project adempiere by adempiere.
the class VTreePanel method jbInit.
/**
* Static Component initialization.
* <pre>
* - centerSplitPane
* - treePane
* - tree
* - bar
* - southPanel
* </pre>
*/
private void jbInit() {
this.setLayout(mainLayout);
mainLayout.setVgap(5);
//
// only one node to be selected
treeSelect.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setSelectionModel(treeSelect);
//
// allows to change the text
tree.setEditable(false);
tree.addMouseListener(mouseListener);
tree.addKeyListener(keyListener);
tree.setCellRenderer(new VTreeCellRenderer());
treePane.getViewport().add(tree, null);
treePane.setBorder(new ShadowBorder());
tree.setBorder(BorderFactory.createEmptyBorder());
CPanel treePart = new CPanel();
treePart.setLayout(new BorderLayout());
treePart.add(treePane, BorderLayout.CENTER);
treePart.setBorder(BorderFactory.createEmptyBorder());
//
treeExpand.setText(Msg.getMsg(Env.getCtx(), "ExpandTree"));
treeExpand.setActionCommand("Expand");
treeExpand.addMouseListener(mouseListener);
treeExpand.addActionListener(this);
//
treeSearchLabel.setText(Msg.getMsg(Env.getCtx(), "TreeSearch") + " ");
treeSearchLabel.setLabelFor(treeSearch);
treeSearchLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "TreeSearchText"));
treeSearch.setBackground(AdempierePLAF.getInfoBackground());
treeSearch.addKeyListener(keyListener);
southPanel.setLayout(southLayout);
southPanel.add(treeExpand, BorderLayout.WEST);
southPanel.add(treeSearchLabel, BorderLayout.CENTER);
southPanel.add(treeSearch, BorderLayout.EAST);
treePart.add(southPanel, BorderLayout.SOUTH);
//
centerSplitPane.setOpaque(false);
barScrollPane = new JScrollPane();
barScrollPane.getViewport().add(bar);
//hengsin, jxtaskpane
centerSplitPane.add(barScrollPane, JSplitPane.LEFT);
centerSplitPane.add(treePart, JSplitPane.RIGHT);
centerSplitPane.setBorder(BorderFactory.createEmptyBorder());
removeSplitPaneBorder();
this.add(centerSplitPane, BorderLayout.CENTER);
//
mFrom.setText(Msg.getMsg(Env.getCtx(), "ItemMove"));
mFrom.setActionCommand((String) TransferHandler.getCutAction().getValue(Action.NAME));
mFrom.addActionListener(this);
mFrom.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));
mTo.setText(Msg.getMsg(Env.getCtx(), "ItemInsert"));
mTo.setActionCommand((String) TransferHandler.getPasteAction().getValue(Action.NAME));
mTo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK));
mTo.setMnemonic(KeyEvent.VK_V);
mTo.addActionListener(this);
mBarAdd.setText(Msg.getMsg(Env.getCtx(), "BarAdd"));
mBarAdd.setActionCommand("BarAdd");
mBarAdd.addActionListener(this);
mBarRemove.setText(Msg.getMsg(Env.getCtx(), "BarRemove"));
mBarRemove.setActionCommand("BarRemove");
mBarRemove.addActionListener(this);
//
popMenuTree.setLightWeightPopupEnabled(false);
popMenuTree.add(mBarAdd);
popMenuTree.add(mFrom);
if (!m_hasBar) {
popMenuTree.addSeparator();
}
popMenuTree.add(mTo);
popMenuBar.setLightWeightPopupEnabled(false);
popMenuBar.add(mBarRemove);
}
use of org.compiere.swing.CPanel in project lar_361 by comitsrl.
the class CashSubFunctions method init.
/**
* Set up Panel
*/
protected void init() {
CPanel main = new CPanel();
main.setLayout(new BorderLayout(2, 6));
main.setPreferredSize(new Dimension(400, 600));
getContentPane().add(main);
// North
panel = new CPanel(new GridBagLayout());
main.add(panel, BorderLayout.CENTER);
panel.setBorder(new TitledBorder(Msg.getMsg(p_ctx, "Cash Functions")));
GridBagConstraints gbc = new GridBagConstraints();
//
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.CENTER;
gbc.weightx = .3;
gbc.weighty = 0.05;
// ******************** Main buttons **********************************
f_initialChange = createButtonAction("InitialChange", null);
f_initialChange.setMaximumSize(new Dimension(160, 35));
f_initialChange.setMinimumSize(new Dimension(160, 35));
f_initialChange.setPreferredSize(new Dimension(160, 35));
panel.add(f_initialChange, gbc);
//
f_closingCash = createButtonAction("CashClosing", null);
f_closingCash.setPreferredSize(new Dimension(160, 35));
f_closingCash.setMaximumSize(new Dimension(160, 35));
f_closingCash.setMinimumSize(new Dimension(160, 35));
gbc.gridy = 1;
panel.add(f_closingCash, gbc);
//
f_cashScrutiny = createButtonAction("CashScrutiny", null);
f_cashScrutiny.setPreferredSize(new Dimension(160, 35));
f_cashScrutiny.setMaximumSize(new Dimension(160, 35));
f_cashScrutiny.setMinimumSize(new Dimension(160, 35));
gbc.gridy = 2;
panel.add(f_cashScrutiny, gbc);
//
f_inputsOutputs = createButtonAction("InputsOutputs", null);
f_inputsOutputs.setPreferredSize(new Dimension(160, 35));
f_inputsOutputs.setMaximumSize(new Dimension(160, 35));
f_inputsOutputs.setMinimumSize(new Dimension(160, 35));
gbc.gridy = 3;
panel.add(f_inputsOutputs, gbc);
//
f_tickets = createButtonAction("Tickets", null);
f_tickets.setPreferredSize(new Dimension(160, 35));
f_tickets.setMaximumSize(new Dimension(160, 35));
f_tickets.setMinimumSize(new Dimension(160, 35));
gbc.gridy = 4;
panel.add(f_tickets, gbc);
//
f_pos = createButtonAction("End", null);
f_pos.setPreferredSize(new Dimension(160, 35));
f_pos.setMaximumSize(new Dimension(160, 35));
f_pos.setMinimumSize(new Dimension(160, 35));
gbc.gridy = 5;
panel.add(f_pos, gbc);
// *************************** Panel to put buttons *************************
gbc.gridx = 1;
gbc.anchor = GridBagConstraints.WEST;
gbc.gridy = 0;
gbc.gridheight = 5;
buttonPanel = new CPanel(new GridBagLayout());
buttonPanel.setBorder(new TitledBorder(""));
buttonPanel.setMaximumSize(new Dimension(300, 400));
buttonPanel.setMinimumSize(new Dimension(300, 400));
buttonPanel.setPreferredSize(new Dimension(300, 400));
panel.add(buttonPanel, gbc);
// *************************** Panel for initial change *************************
gbc.gridx = 1;
gbc.anchor = GridBagConstraints.WEST;
gbc.gridy = 0;
gbc.gridheight = 5;
cInitial = new CPanel(new GridBagLayout());
cInitial.setBorder(new TitledBorder(Msg.getMsg(p_ctx, "InitialChange")));
cInitial.setVisible(false);
panel.add(cInitial, gbc);
GridBagConstraints gbc0 = new GridBagConstraints();
gbc0.anchor = GridBagConstraints.CENTER;
//
gbc0.gridx = 0;
gbc0.gridy = 0;
l_PreviousChange = new CLabel(Msg.getMsg(p_ctx, "PreviousChange"));
cInitial.add(l_PreviousChange, gbc0);
gbc0.gridx = 1;
v_PreviousChange = new VNumber("PreviousChange", false, true, false, DisplayType.Amount, "PreviousChange");
v_PreviousChange.setColumns(10, 25);
cInitial.add(v_PreviousChange, gbc0);
v_PreviousChange.setValue(Env.ZERO);
//
gbc0.gridx = 0;
gbc0.gridy = 1;
l_change = new CLabel(Msg.getMsg(p_ctx, "InitialChange"));
cInitial.add(l_change, gbc0);
gbc0.gridx = 1;
v_change = new VNumber("Change", false, false, true, DisplayType.Amount, "Change");
v_change.setColumns(10, 25);
cInitial.add(v_change, gbc0);
v_change.setValue(Env.ZERO);
gbc0.gridy = 2;
gbc0.gridx = 0;
gbc0.gridwidth = 2;
// gbc0.fill = GridBagConstraints.HORIZONTAL;
f_change = createButtonAction("SaveChange", null);
f_change.setText("Save Change");
f_change.setPreferredSize(new Dimension(160, 35));
f_change.setMaximumSize(new Dimension(160, 35));
f_change.setMinimumSize(new Dimension(160, 35));
cInitial.add(f_change, gbc0);
cInitial.setMaximumSize(new Dimension(300, 400));
cInitial.setMinimumSize(new Dimension(300, 400));
cInitial.setPreferredSize(new Dimension(300, 400));
// ****************************** Panel for cash scrutiniy ************************
gbc.gridx = 1;
gbc.anchor = GridBagConstraints.WEST;
gbc.gridy = 0;
gbc.gridheight = 5;
// gbc.weightx = .7;
cScrutiny = new CPanel(new GridBagLayout());
cScrutiny.setBorder(new TitledBorder(Msg.getMsg(p_ctx, "CashScrutiny")));
cScrutiny.setVisible(false);
panel.add(cScrutiny, gbc);
GridBagConstraints gbc1 = new GridBagConstraints();
gbc1.anchor = GridBagConstraints.CENTER;
//
gbc1.gridx = 0;
gbc1.gridy = 0;
l_previousBalance = new CLabel(Msg.getMsg(p_ctx, "PreviousBalance"));
cScrutiny.add(l_previousBalance, gbc1);
gbc1.gridx = 1;
v_previousBalance = new VNumber("PreviousBalance", false, true, false, DisplayType.Amount, "PreviousBalance");
v_previousBalance.setColumns(10, 25);
cScrutiny.add(v_previousBalance, gbc1);
v_previousBalance.setValue(Env.ZERO);
//
gbc1.gridx = 0;
gbc1.gridy = 1;
l_ActualBalance = new CLabel("Actual Balance");
cScrutiny.add(l_ActualBalance, gbc1);
gbc1.gridx = 1;
v_ActualBalance = new VNumber("ActualBalance", false, false, true, DisplayType.Amount, "ActualBalance");
v_ActualBalance.setColumns(10, 25);
v_ActualBalance.addActionListener(this);
v_ActualBalance.addInputMethodListener(this);
cScrutiny.add(v_ActualBalance, gbc1);
v_ActualBalance.setValue(Env.ZERO);
//
gbc1.gridx = 0;
gbc1.gridy = 2;
l_difference = new CLabel(Msg.getMsg(p_ctx, "Difference"));
cScrutiny.add(l_difference, gbc1);
gbc1.gridx = 1;
v_difference = new VNumber("Difference", false, true, false, DisplayType.Amount, "Difference");
v_difference.setColumns(10, 25);
cScrutiny.add(v_difference, gbc1);
v_difference.setValue(Env.ZERO);
//
gbc1.gridx = 0;
gbc1.gridy = 4;
gbc1.gridwidth = 2;
gbc1.fill = GridBagConstraints.HORIZONTAL;
f_calculateDifference = createButtonAction("AnnotateDifference", null);
f_calculateDifference.setText("Annotate Difference");
f_calculateDifference.setPreferredSize(new Dimension(160, 35));
f_calculateDifference.setMaximumSize(new Dimension(160, 35));
f_calculateDifference.setMinimumSize(new Dimension(160, 35));
cScrutiny.add(f_calculateDifference, gbc1);
cScrutiny.setMaximumSize(new Dimension(300, 400));
cScrutiny.setMinimumSize(new Dimension(300, 400));
cScrutiny.setPreferredSize(new Dimension(400, 400));
}
use of org.compiere.swing.CPanel in project lar_361 by comitsrl.
the class POSKeyboard method init.
/**
* Initialize
* @param startText
* @param POSKeyLayout_ID
*/
public void init(int POSKeyLayout_ID) {
CPanel panel = new CPanel();
getContentPane().add(panel);
// Content
panel.setLayout(new MigLayout("fill"));
if (keylayout.getPOSKeyLayoutType().equals(MPOSKeyLayout.POSKEYLAYOUTTYPE_Numberpad))
text.setHorizontalAlignment(JTextField.TRAILING);
panel.add(text, "north, growx, h 30!, wrap, gap 10 10 10 10");
PosKeyPanel keys = new PosKeyPanel(POSKeyLayout_ID, this);
panel.add(keys, "center, growx, growy");
ConfirmPanel confirm = new ConfirmPanel(true, false, true, false, false, false, false);
confirm.addActionListener(this);
Dimension buttonDim = new Dimension(50, 50);
confirm.getResetButton().setPreferredSize(buttonDim);
confirm.getOKButton().setPreferredSize(buttonDim);
confirm.getCancelButton().setPreferredSize(buttonDim);
panel.add(confirm, "south");
pack();
setLocationByPlatform(true);
text.requestFocusInWindow();
}
use of org.compiere.swing.CPanel in project lar_361 by comitsrl.
the class AInfoFiscalPrinter method jbInit.
// common
/**
* Descripción de Método
*/
private void jbInit() throws Exception {
westPanel.setLayout(westLayout);
westPanel.setName("westPanel");
westPanel.setRequestFocusEnabled(false);
infoPanel.setLayout(infoLayout);
infoPanel.setName("infoPanel");
infoPanel.setRequestFocusEnabled(false);
CPanel confirmContentPanel = new CPanel();
confirmContentPanel.setLayout(new BorderLayout());
confirmContentPanel.add(confirmPanel);
confirmContentPanel.setBorder(BorderFactory.createEmptyBorder(8, 9, 6, 0));
this.getContentPane().add(confirmContentPanel, BorderLayout.SOUTH);
this.getContentPane().add(westPanel, BorderLayout.WEST);
westPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0));
// ,new GridBagConstraints(
westPanel.add(iconLabel);
// 0,0,1,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.BOTH,new
// Insets( 10,10,10,10 ),0,0 ));
this.getContentPane().add(infoPanel, BorderLayout.CENTER);
CPanel infoMPanel = new CPanel(new GridBagLayout());
infoMPanel.add(info, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 10, 0, 10), 0, 0));
infoPanel.add(infoMPanel, BorderLayout.NORTH);
CPanel infoDetailMPanel = new CPanel(new GridBagLayout());
infoDetailMPanel.add(infoDetail, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 10, 3, 10), 0, 0));
infoPanel.add(infoDetailMPanel, BorderLayout.CENTER);
// Detail text
infoDetail.setPreferredSize(new Dimension(450, 90));
infoDetail.setRequestFocusEnabled(false);
infoDetail.setEnabled(false);
infoDetail.setOpaque(true);
infoDetail.setReadWrite(false);
infoDetail.setAutoscrolls(true);
infoDetail.setVisible(false);
//
// Confirm Panel
//
// OK --> Acción de Reimprimir
getReprintButton().setVisible(false);
getReprintButton().setText(Msg.getMsg(Env.getCtx(), "Reprint"));
getReprintButton().setIcon(Env.getImageIcon("Print24.gif"));
// Cancel --> Acción de anular factura
getVoidButton().setVisible(false);
getVoidButton().setText(Msg.getMsg(Env.getCtx(), "VoidInvoice"));
getVoidButton().setIcon(Env.getImageIcon("Delete24.gif"));
// Zoom --> Expandir/Contraer detalle de info
getExpandInfoButton().setVisible(true);
getExpandInfoButton().setIcon(Env.getImageIcon("Zoom24.gif"));
getOkButton().setVisible(false);
confirmPanel.getCancelButton().setVisible(false);
// Menu
mEMail.setIcon(Env.getImageIcon("EMailSupport16.gif"));
mEMail.setText(Msg.getMsg(Env.getCtx(), "EMailSupport"));
mEMail.addActionListener(this);
mPrintScreen.setIcon(Env.getImageIcon("PrintScreen16.gif"));
mPrintScreen.setText(Msg.getMsg(Env.getCtx(), "PrintScreen"));
mPrintScreen.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0));
mPrintScreen.addActionListener(this);
mScreenShot.setIcon(Env.getImageIcon("ScreenShot16.gif"));
mScreenShot.setText(Msg.getMsg(Env.getCtx(), "ScreenShot"));
mScreenShot.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, Event.SHIFT_MASK));
mScreenShot.addActionListener(this);
mPreference.setIcon(Env.getImageIcon("Preference16.gif"));
mPreference.setText(Msg.getMsg(Env.getCtx(), "Preference"));
mPreference.addActionListener(this);
mEnd.setIcon(Env.getImageIcon("End16.gif"));
mEnd.setText(Msg.getMsg(Env.getCtx(), "End"));
mEnd.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK));
mEnd.addActionListener(this);
this.setJMenuBar(menuBar);
menuBar.add(mFile);
mFile.add(mPrintScreen);
mFile.add(mScreenShot);
mFile.addSeparator();
mFile.add(mEMail);
if (MRole.getDefault().isShowPreference()) {
mFile.add(mPreference);
}
// mFile.addSeparator();
// mFile.add( mEnd );
//
confirmPanel.addActionListener(this);
setInfoMessage("");
}
Aggregations