KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > print > layout > LocationElement


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2002 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.print.layout;
15
16 import java.awt.*;
17 import java.util.*;
18
19 import org.compiere.model.*;
20
21 /**
22  * Location Element.
23  * Prints Addresses
24  *
25  * @author Jorg Janke
26  * @version $Id: LocationElement.java,v 1.2 2002/08/26 05:24:20 jjanke Exp $
27  */

28 public class LocationElement extends GridElement
29 {
30     /**
31      * Construvtor
32      * @param ctx context
33      * @param C_Location_ID location
34      * @param font font
35      * @param color color
36      */

37     public LocationElement(Properties ctx, int C_Location_ID, Font font, Paint color)
38     {
39         super(4,1);
40         setGap(0,0);
41         MLocation ml = new MLocation (ctx, 0);
42         if (ml.containsKey(new Integer JavaDoc(C_Location_ID))) // loads it
43
{
44             setData(0, 0, ml.getAddress1(), font, color);
45             setData(1, 0, ml.getAddress2(), font, color);
46             setData(2, 0, ml.getCityRegionPostal(), font, color);
47             setData(3, 0, ml.getCountry(true), font, color);
48         }
49     } // LocationElement
50
} // LocationElement
Popular Tags