From: Jorg J. <jj...@us...> - 2003-12-24 06:48:51
|
Update of /cvsroot/compiere/client/Src/org/compiere/pos In directory sc8-pr-cvs1:/tmp/cvs-serv12044/Src/org/compiere/pos Modified Files: PosPanel.java Added Files: MPointOfSales.java Log Message: . --- NEW FILE: MPointOfSales.java --- /****************************************************************************** * The contents of this file are subject to the Compiere License Version 1.1 * ("License"); You may not use this file except in compliance with the License * You may obtain a copy of the License at http://www.compiere.org/license.html * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * The Original Code is Compiere ERP & CRM Business Solution * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc. * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved. * Contributor(s): ______________________________________. *****************************************************************************/ package org.compiere.pos; /** * POS Parameter * * @author Jorg Janke * @version $Id: MPointOfSales.java,v 1.1 2003/12/24 06:48:48 jjanke Exp $ */ public class MPointOfSales { /** * PointOfSales Model. * Later when complete to be replaced by "real" db model * Now used to define parameters in GardenWorls */ public MPointOfSales() { super(); } private int M_Warehouse_ID = 104; /** CashBook to be used */ private int C_CashBook_ID = 102; /** SalesRep to be useed */ private int SalesRep_ID = 102; /** Default Business Partner (WalkIn) */ private int C_BPartner_ID = 112; /** Printer to be used */ private String PrinterName = ""; // add whatever is needed /** * getC_BPartner_ID * @return */ public int getC_BPartner_ID() { return C_BPartner_ID; } /** * getC_CashBook_ID * @return */ public int getC_CashBook_ID() { return C_CashBook_ID; } /** * getM_Warehouse_ID * @return */ public int getM_Warehouse_ID() { return M_Warehouse_ID; } /** * getPrinterName * @return */ public String getPrinterName() { return PrinterName; } /** * getSalesRep_ID * @return */ public int getSalesRep_ID() { return SalesRep_ID; } } Index: PosPanel.java =================================================================== RCS file: /cvsroot/compiere/client/Src/org/compiere/pos/PosPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PosPanel.java 23 Dec 2003 02:21:07 -0000 1.2 --- PosPanel.java 24 Dec 2003 06:48:48 -0000 1.3 *************** *** 16,24 **** --- 16,28 ---- import java.awt.*; import javax.swing.*; + import java.util.*; import org.compiere.swing.*; import org.compiere.apps.form.*; + import org.compiere.model.*; import org.compiere.util.*; + import sun.java2d.Disposer; + /** * Point of Sales Main Window. *************** *** 38,46 **** /** Window No */ ! private int m_WindowNo = 0; /** FormFrame */ ! private FormFrame m_frame; /** Logger */ ! private Logger log = Logger.getCLogger(getClass()); /** --- 42,56 ---- /** Window No */ ! private int m_WindowNo = 0; /** FormFrame */ ! private FormFrame m_frame; /** Logger */ ! private Logger log = Logger.getCLogger(getClass()); ! /** Context */ ! private Properties m_ctx = Env.getCtx(); ! ! /** Parameter */ ! private MPointOfSales m_pos = null; ! /** *************** *** 57,61 **** { // jbInit(); - exapmple see VCharge, etc. ! // dynInit(); frame.getContentPane().add(this, BorderLayout.CENTER); // frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); --- 67,71 ---- { // jbInit(); - exapmple see VCharge, etc. ! dynInit(); frame.getContentPane().add(this, BorderLayout.CENTER); // frame.getContentPane().add(confirmPanel, BorderLayout.SOUTH); *************** *** 67,70 **** --- 77,110 ---- } } // init + + /** + * Dispose - Free Resources + */ + public void dispose() + { + if (m_frame != null) + m_frame.dispose(); + m_frame = null; + m_ctx = null; + m_pos = null; + + } // dispose + + + + /** + * Dynamic Init + */ + private void dynInit() + { + // Get Parameter + m_pos = new MPointOfSales(); + new MBPartner (m_ctx, m_pos.getC_BPartner_ID()); + new MUser (m_ctx, m_pos.getSalesRep_ID()); + // etc. .. + + } // dynInit + + } // PosPanel |