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: 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 {
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 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: }
|