use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.
the class WCollect method zkInit.
/**
* Instance Window and fill fields
* @return void
*/
private void zkInit() {
//
mainPanel = new Panel();
Borderlayout mainLayout = new Borderlayout();
layout = GridFactory.newGridLayout();
eastlayout = GridFactory.newGridLayout();
// Panels
centerPanel = new Panel();
Panel eastPanel = new Panel();
mainPanel.appendChild(mainLayout);
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
//
north = new North();
north.setStyle("border: none; ");
mainLayout.appendChild(north);
north.appendChild(eastPanel);
eastPanel.appendChild(eastlayout);
eastlayout.setWidth("100%");
eastlayout.setHeight("100%");
rows = eastlayout.newRows();
row = rows.newRow();
row.appendChild(new Space());
Label fsLabel = new Label(Msg.translate(p_ctx, "PayAmt") + ":");
fsLabel.setStyle(FONT_SIZE + FONT_BOLD);
fPayAmt = new Label();
// fPayAmt.setText(getPrePayAmt().toString());
row.appendChild(fsLabel.rightAlign());
row.appendChild(fPayAmt.rightAlign());
fPayAmt.setStyle(FONT_SIZE);
row = rows.newRow();
row.appendChild(new Space());
// Add Payment Amount
Label lOpenAmt = new Label(Msg.translate(p_ctx, "OpenAmt") + ":");
lOpenAmt.setStyle(FONT_SIZE + FONT_BOLD);
row.appendChild(lOpenAmt.rightAlign());
fOpenAmt = new Label();
fOpenAmt.setStyle(FONT_SIZE);
row.appendChild(fOpenAmt.rightAlign());
fReturnAmt = new Label();
lReturnAmt = new Label(Msg.translate(p_ctx, "AmountReturned") + ":");
lReturnAmt.setStyle(FONT_SIZE + FONT_BOLD);
fReturnAmt.setStyle(FONT_SIZE);
row = rows.newRow();
row.appendChild(new Space());
fReturnAmt = new Label();
lReturnAmt = new Label(Msg.translate(p_ctx, "AmountReturned") + ":");
lReturnAmt.setStyle(FONT_SIZE + FONT_BOLD);
fReturnAmt.setStyle(FONT_SIZE);
row.appendChild(lReturnAmt.rightAlign());
row.appendChild(fReturnAmt.rightAlign());
fReturnAmt.addEventListener("onFocus", this);
row = rows.newRow();
row.appendChild(new Space());
fsPaidAmtLabel = new Label(Msg.translate(p_ctx, "PaidAmt") + ":");
fsPaidAmtLabel.setStyle(FONT_SIZE + FONT_BOLD);
fPaidAmt = new Label();
row.appendChild(fsPaidAmtLabel.rightAlign());
row.appendChild(fPaidAmt.rightAlign());
fPaidAmt.setStyle(FONT_SIZE);
// Button Plus
bPlus = createButtonAction("Plus", KeyStroke.getKeyStroke(KeyEvent.VK_F3, Event.F3));
row = rows.newRow();
row.appendChild(new Space());
row.appendChild(new Space());
row.appendChild(bPlus);
confirm = new ConfirmPanel(true);
confirm.addActionListener(this);
confirm.getOKButton().setWidth("55px");
confirm.getOKButton().setHeight("55px");
confirm.getButton(ConfirmPanel.A_CANCEL).setWidth("55px");
confirm.getButton(ConfirmPanel.A_CANCEL).setHeight("55px");
row.appendChild(confirm);
row.setHeight("60px");
Center center = new Center();
center.setStyle("border: none; overflow-y:auto;overflow-x:hidden;");
mainLayout.appendChild(center);
center.appendChild(centerPanel);
centerPanel.appendChild(layout);
layout.setWidth("100%");
layout.setHeight("100%");
layout.setStyle("overflow:auto;");
rows = layout.newRows();
row = rows.newRow();
row.setWidth("100%");
// Completed Standard Order: only prepayment possible
if (posPanel.getTotalLines().compareTo(Env.ZERO) == 1 && posPanel.isCompleted() && posPanel.isStandardOrder()) {
//fIsPrePayOrder.setEnabled(false);
// fIsCreditOrder.setEnabled(false);
//fIsPrePayOrder.setSelected(true);
} else // Not completed Order
if (posPanel.getTotalLines().compareTo(Env.ZERO) == 1 && !posPanel.isCompleted()) {
if (posPanel.isStandardOrder()) /*|| pos.isWarehouseOrder()*/
{
// Standard Order or Warehouse Order: no Credit Order, no prepayment
//fIsPrePayOrder.setEnabled(false);
//fIsPrePayOrder.setSelected(false);
// fIsCreditOrder.setEnabled(false);
// fIsCreditOrder.setSelected(false);
} else {
//fIsPrePayOrder.setEnabled(true);
// fIsCreditOrder.setEnabled(true);
}
} else {
//fIsPrePayOrder.setEnabled(false);
// fIsCreditOrder.setEnabled(false);
// if(posPanel.isCompleted() &&
// posPanel.getM_Order().isInvoiced() &&
// posPanel.getOpenAmt().compareTo(Env.ZERO)==1) {
// fIsCreditOrder.setSelected(true);
// }
}
}
use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.
the class WPOSInfoProduct method setValuesFromProduct.
/**
* setValuesFromProduct
* @param productId
* @param imageId
*/
public void setValuesFromProduct(int productId, BigDecimal quantity, int imageId, int priceListId, int partnerId) {
if (productId <= 0) {
initialValue();
return;
}
// Refresh Values
ProductInfo productInfo = new ProductInfo(productId, quantity, imageId, priceListId, partnerId);
labelPriceName.setText(Msg.parseTranslation(ctx, "@PriceStd@ , @PriceList@ ") + posPanel.getCurSymbol());
labelValue.setText(productInfo.value);
labelPrice.setText(posPanel.getNumberFormat().format(productInfo.priceStd));
labelPriceList.setText(posPanel.getNumberFormat().format(productInfo.priceList));
labelName.setText(productInfo.name);
labelUOMSymbol.setText(productInfo.uomSymbol);
labelProductCategory.setText(productInfo.productCategoryName);
labelProductTax.setText(productInfo.productTaxCategory);
labelDescription.setText(productInfo.description);
posPanel.updateProductPlaceholder(productInfo.name);
if (productInfo.imageData != null) {
North nt = new North();
Borderlayout mainLayout = new Borderlayout();
AImage img = null;
byte[] data = productInfo.imageData;
if (data != null && data.length > 0) {
try {
img = new AImage(null, data);
} catch (Exception e) {
}
}
Image bImg = new Image();
bImg.setContent(img);
bImg.setWidth("100%");
bImg.setHeight("100px");
nt.appendChild(bImg);
buttonImage.setClass("z-button");
mainLayout.appendChild(nt);
mainLayout.setStyle("background-color: transparent");
nt.setStyle("background-color: transparent");
buttonImage.getChildren().clear();
buttonImage.appendChild(mainLayout);
buttonImage.invalidate();
infoProductLayout.invalidate();
labelLayout.invalidate();
buttonPanel.invalidate();
} else {
buttonImage.getChildren().clear();
buttonImage.invalidate();
}
}
use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.
the class WPOS method setMPOS.
// dynInit
/**
* Set MPOS
* @return true if found/set
*/
private void setMPOS() {
int salesRep_ID = Env.getAD_User_ID(getCtx());
setPOS(salesRep_ID);
if (getM_POS() != null) {
validLocator();
return;
}
int orgId = Env.getAD_Org_ID(getCtx());
poss = getPOSByOrganization(orgId);
// Select POS
String msg = Msg.getMsg(ctx, "SelectPOS");
selection = new Window();
Panel mainPanel = new Panel();
Panel panel = new Panel();
selection.setTitle(msg);
Borderlayout mainLayout = new Borderlayout();
Grid layout = GridFactory.newGridLayout();
selection.appendChild(panel);
selection.setWidth("200px");
selection.setHeight("140px");
// North
Panel centerPanel = new Panel();
mainPanel.appendChild(mainLayout);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
//
Center center = new Center();
center.setStyle("border: none");
mainLayout.appendChild(center);
center.appendChild(centerPanel);
centerPanel.appendChild(layout);
layout.setWidth("100%");
layout.setHeight("100%");
selection.appendChild(mainPanel);
Rows rows = null;
Row row = null;
rows = layout.newRows();
row = rows.newRow();
for (MPOS pos : poss) {
listTerminal.addItem(pos.getKeyNamePair());
}
okButton.addActionListener(this);
cancelButton.addEventListener("onClick", this);
okButton.setWidth("45px");
okButton.setHeight("45px");
cancelButton.setWidth("45px");
cancelButton.setHeight("45px");
listTerminal.setHeight("45px");
listTerminal.setStyle("height:45px;" + WPOS.FONTSIZEMEDIUM);
row.setSpans("2");
row.appendChild(listTerminal);
row.setHeight("45px");
row = rows.newRow();
confirm = new ConfirmPanel(true);
confirm.addActionListener(this);
confirm.getOKButton().setWidth("55px");
confirm.getOKButton().setHeight("55px");
confirm.getButton(ConfirmPanel.A_CANCEL).setWidth("55px");
confirm.getButton(ConfirmPanel.A_CANCEL).setHeight("55px");
row.appendChild(confirm);
row.setHeight("55px");
AEnv.showWindow(selection);
}
use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.
the class WPOS method dynInit.
// init
/**************************************************************************
* Dynamic Init.
* PosPanel has a GridBagLayout.
* The Sub Panels return their position
*/
private boolean dynInit() {
setMPOS();
userPinListener = new WPOSUserPinListener(this);
//Delay 5 seconds by default
userPinTimer = new Timer((getPINEntryTimeout() + 5) * 1000);
userPinTimer.addEventListener(Events.ON_TIMER, userPinListener);
userPinListener.setTimer(userPinTimer);
userPinTimer.setRunning(false);
Borderlayout mainLayout = new Borderlayout();
actionPanel = new WPOSActionPanel(this);
documentPanel = new WPOSDocumentPanel(this);
orderLinePanel = new WPOSOrderLinePanel(this);
infoProductPanel = new WPOSInfoProduct(this);
quantityPanel = new WPOSQuantityPanel(this);
East east = new East();
Center center = new Center();
West westPanel = new West();
South southPanel = new South();
Borderlayout fullPanel = new Borderlayout();
Borderlayout mediumPanel = new Borderlayout();
statusBar.appendChild(userPinTimer);
southPanel.appendChild(statusBar);
center.setStyle("border: none; width:40%");
center.appendChild(fullPanel);
mainLayout.appendChild(center);
center.setStyle("border: none; height:auto%;");
fullPanel.setWidth("100%");
fullPanel.setHeight("auto");
fullPanel.setStyle("overflow:hidden;height:auto;");
westPanel.appendChild(this.actionPanel);
east.appendChild(documentPanel);
this.actionPanel.appendChild(infoProductPanel.getPanel());
if (IsShowLineControl())
this.actionPanel.appendChild(quantityPanel.getPanel());
this.actionPanel.appendChild(orderLinePanel);
east.setSplittable(true);
east.setStyle("border: none; min-width:44%; width:44%");
fullPanel.appendChild(westPanel);
Center centerPanel = new Center();
fullPanel.appendChild(centerPanel);
centerPanel.appendChild(mediumPanel);
// FR [ 44 ] Change Button location
westPanel.setStyle("display:inline-block;border: none; width:100%; height:auto;float:left;overflow:hidden;");
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
mainLayout.appendChild(east);
mainLayout.appendChild(southPanel);
form.appendChild(mainLayout);
// Seek to last
if (hasRecord()) {
lastRecord();
}
refreshPanel();
form.setHeight("100%");
return true;
}
use of org.adempiere.webui.component.Borderlayout in project adempiere by adempiere.
the class WPOSKeyboard method init.
/**
* Initialize
* @param startText
* @param POSKeyLayout_ID
*/
public void init(int POSKeyLayout_ID) {
Panel panel = new Panel();
appendChild(panel);
// Content
Panel mainPanel = new Panel();
Borderlayout mainLayout = new Borderlayout();
Grid productLayout = GridFactory.newGridLayout();
appendChild(panel);
// North
Panel northPanel = new Panel();
mainPanel.appendChild(mainLayout);
mainPanel.setStyle("width: 100%; height: 100%; padding: 0; margin: 0");
mainLayout.setHeight("100%");
mainLayout.setWidth("100%");
Center center = new Center();
//
North north = new North();
north.setStyle("border: none");
mainLayout.appendChild(north);
north.appendChild(northPanel);
northPanel.appendChild(productLayout);
productLayout.setWidth("100%");
appendChild(mainPanel);
Rows rows = null;
Row row = null;
rows = productLayout.newRows();
row = rows.newRow();
String txtCalcId = txtCalc.getId();
row.appendChild(txtCalc);
txtCalc.setName("number");
txtCalc.setWidth("92%");
WPOSKeyPanel keys = new WPOSKeyPanel(POSKeyLayout_ID, this, txtCalcId, keyBoardType);
center = new Center();
center.setStyle("border: none");
keys.setWidth("100%");
keys.setHeight("99%");
center.appendChild(keys);
mainLayout.appendChild(center);
South south = new South();
ConfirmPanel confirm = new ConfirmPanel(true, false, true, false, false, false, false);
confirm.addActionListener(this);
south.appendChild(confirm);
mainLayout.appendChild(south);
}
Aggregations