KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > metadata > swing > OrderedNamedProp


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.him.metadata.swing;
20
21 import org.openharmonise.him.metadata.range.swing.propertyhandling.*;
22
23 /**
24  *
25  * @author Matthew Large
26  * @version $Revision: 1.1 $
27  *
28  */

29 public class OrderedNamedProp implements Comparable JavaDoc {
30
31     private int m_nOrder = 10000;
32     
33     private PropNamePanel m_propPanel = null;
34
35     /**
36      *
37      */

38     public OrderedNamedProp(int nOrder, PropNamePanel propPanel) {
39         super();
40         this.m_nOrder = nOrder;
41         this.m_propPanel = propPanel;
42     }
43
44     /**
45      *
46      */

47     public OrderedNamedProp(PropNamePanel propPanel) {
48         super();
49         this.m_propPanel = propPanel;
50     }
51     
52     public int getOrder() {
53         return this.m_nOrder;
54     }
55     
56     public PropNamePanel getPropPanel() {
57         return this.m_propPanel;
58     }
59
60     /* (non-Javadoc)
61      * @see java.lang.Comparable#compareTo(java.lang.Object)
62      */

63     public int compareTo(Object JavaDoc obj) {
64         if(obj instanceof OrderedNamedProp) {
65             OrderedNamedProp order = (OrderedNamedProp) obj;
66             return this.getOrder()-order.getOrder();
67         } else {
68             return 0;
69         }
70     }
71
72 }
Popular Tags