KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > contrib > ivan_codarin > IvanBackgroudColor


1 /*
2  * $Header: /cvsroot/jdbforms/dbforms/examples/bookstore/WEB-INF/src/contrib/ivan_codarin/IvanBackgroudColor.java,v 1.1 2004/10/16 09:25:54 hkollmann Exp $
3  * $Revision: 1.1 $
4  * $Date: 2004/10/16 09:25:54 $
5  *
6  * DbForms - a Rapid Application Development Framework
7  * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */

23
24 /*
25  * Created on Jul 4, 2004
26  *
27  * Test per bean
28  */

29 package contrib.ivan_codarin;
30
31
32 /**
33  * @author ivan.codarin@amm.uniud.it
34  *
35  * Simple class to create background color.
36  */

37 public class IvanBackgroudColor {
38    private String JavaDoc BG_DARK;
39    private String JavaDoc BG_LIGHT;
40    private String JavaDoc bgColor;
41    private int idNumber;
42
43    /**
44     * @param ID_Number
45     */

46    public IvanBackgroudColor() {
47       BG_LIGHT = "#EEEEEE";
48       BG_DARK = "#666666";
49    }
50
51    /**
52     * @return Returns the bgColor.
53     */

54    public String JavaDoc getBgColor() {
55       if ((this.idNumber % 2) == 1) {
56          this.bgColor = BG_DARK;
57       } else {
58          this.bgColor = BG_LIGHT;
59       }
60
61       return bgColor;
62    }
63
64
65    /**
66     * @param idNumber
67     * The idNumber to set.
68     */

69    public void setIdNumber(int idNumber) {
70       this.idNumber = idNumber;
71    }
72
73
74    /**
75     * @return Returns the idNumber.
76     */

77    public int getIdNumber() {
78       return idNumber;
79    }
80 }
81
Popular Tags