KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > planetamessenger > mos > engine > JLookAndFeelInfo


1 /*
2     =========================================================================
3     Package engine - Implements the engine package.
4
5     This module is developed and maintained by PlanetaMessenger.org.
6     Specs, New and updated versions can be found in
7     http://www.planetamessenger.org
8     If you want contact the Team please send a email to Project Manager
9     Leidson Campos Alves Ferreira at leidson@planetamessenger.org
10
11     Copyright (C) since 2001 by PlanetaMessenger.org
12
13     This program is free software; you can redistribute it and/or modify
14     it under the terms of the GNU General Public License as published by
15     the Free Software Foundation; either version 2 of the License, or
16     (at your option) any later version.
17
18     This program is distributed in the hope that it will be useful,
19     but WITHOUT ANY WARRANTY; without even the implied warranty of
20     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21     GNU General Public License for more details.
22
23     You should have received a copy of the GNU General Public License
24     along with this program; if not, write to the Free Software
25     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27     =========================================================================
28 */

29 /**
30  *
31  * $Id: JLookAndFeelInfo.java,v 1.4 2007/01/28 17:39:20 popolony2k Exp $
32  * $Author: popolony2k $
33  * $Name: $
34  * $Revision: 1.4 $
35  * $State: Exp $
36  *
37  */

38
39 package org.planetamessenger.mos.engine;
40
41
42 public class JLookAndFeelInfo extends javax.swing.UIManager.LookAndFeelInfo {
43   
44   String JavaDoc strClassName;
45   String JavaDoc strFileName;
46   String JavaDoc strVendor;
47   String JavaDoc strName;
48   String JavaDoc strVersion;
49   
50   
51   /**
52    * Constructor. Initializes all class
53    * data.
54    */

55   public JLookAndFeelInfo() {
56
57     super( "", "" );
58     strClassName = "";
59     strFileName = "";
60     strVendor = "";
61     strName = "";
62     strVersion = "";
63   }
64   
65   /**
66    * Return the look and feel class name.
67    * @param strClassName The look and feel Class name;
68    */

69   public void setClassName( String JavaDoc strClassName ) {
70     
71     this.strClassName = strClassName;
72   }
73   
74   /**
75    * Return the class name.
76    */

77   public String JavaDoc getClassName() {
78    
79     return strClassName;
80   }
81   
82   /**
83    * Return the look and feel file name.
84    * @param strFileName The look and feel file name;
85    */

86   public void setFileName( String JavaDoc strFileName ) {
87     
88     this.strFileName = strFileName;
89   }
90   
91   /**
92    * Return the file name.
93    */

94   public String JavaDoc getFileName() {
95    
96     return strFileName;
97   }
98   
99   /**
100    * Return the look and feel vendor.
101    * @param strVendor The look and feel Vendor;
102    */

103   public void setVendor( String JavaDoc strVendor ) {
104     
105     this.strVendor = strVendor;
106   }
107   
108   /**
109    * Return the class name.
110    */

111   public String JavaDoc getVendor() {
112    
113     return strVendor;
114   }
115   
116   /**
117    * Return the look and feel name.
118    * @param strName The Look and feel name;
119    */

120   public void setName( String JavaDoc strName ) {
121     
122     this.strName = strName;
123   }
124   
125   /**
126    * Return the look and feel name.
127    */

128   public String JavaDoc getName() {
129    
130     return strName;
131   }
132   
133   /**
134    * Return the look and feel version.
135    * @param strVersion The version;
136    */

137   public void setVersion( String JavaDoc strVersion ) {
138     
139     this.strVersion = strVersion;
140   }
141   
142   /**
143    * Return the look and feel version.
144    */

145   public String JavaDoc getVersion() {
146    
147     return strVersion;
148   }
149   
150   /**
151    * Override the default toString() method.
152    */

153   public String JavaDoc toString() {
154     
155     return getName();
156   }
157   
158   /**
159    * Override the default equals method.
160    * Compares 2 JLookAndFeelInfo objects.
161    * @param object The object to be compared with
162    * current class object.
163    */

164   public boolean equals( Object JavaDoc object ) {
165    
166     if( object instanceof JLookAndFeelInfo ) {
167       JLookAndFeelInfo anotherObject = ( JLookAndFeelInfo ) object;
168       
169       
170       if( ( anotherObject.getClassName().compareTo( getClassName() ) == 0 ) &&
171           ( anotherObject.getFileName().compareTo( getFileName() ) == 0 ) )
172         return true;
173     }
174     
175     return false;
176   }
177 }
178
179 // JLookAndFeel class
Popular Tags