01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * 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: /**
22: *
23: * @author Matthew Large
24: * @version $Revision: 1.1 $
25: *
26: */
27: public class OrderedProp implements Comparable {
28:
29: private int m_nOrder = 10000;
30:
31: private PropertyPanel m_propPanel = null;
32:
33: /**
34: *
35: */
36: public OrderedProp(int nOrder, PropertyPanel propPanel) {
37: super ();
38: this .m_nOrder = nOrder;
39: this .m_propPanel = propPanel;
40: }
41:
42: /**
43: *
44: */
45: public OrderedProp(PropertyPanel propPanel) {
46: super ();
47: this .m_propPanel = propPanel;
48: }
49:
50: public int getOrder() {
51: return this .m_nOrder;
52: }
53:
54: public PropertyPanel getPropPanel() {
55: return this .m_propPanel;
56: }
57:
58: /* (non-Javadoc)
59: * @see java.lang.Comparable#compareTo(java.lang.Object)
60: */
61: public int compareTo(Object obj) {
62: if (obj instanceof OrderedProp) {
63: OrderedProp order = (OrderedProp) obj;
64: return this .getOrder() - order.getOrder();
65: } else {
66: return 0;
67: }
68: }
69:
70: }
|