KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > metadata > range > swing > range > AbstractRangeDetails


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.range.swing.range;
20
21 import java.awt.*;
22 import java.util.*;
23
24 import javax.swing.*;
25
26 import org.openharmonise.vfs.metadata.*;
27 import org.openharmonise.vfs.metadata.value.*;
28
29
30 /**
31  * @author Matthew Large
32  * @version $Revision: 1.1 $
33  *
34  */

35 public abstract class AbstractRangeDetails extends JPanel {
36
37     private PropertyInstance m_propInst = null;
38     private String JavaDoc m_sTitle = null;
39     
40     private ArrayList m_listeners = new ArrayList();
41
42     /**
43      *
44      */

45     protected AbstractRangeDetails(PropertyInstance propInst, String JavaDoc sTitle) {
46         super();
47         this.m_propInst = propInst;
48         this.m_sTitle = sTitle;
49         this.setup();
50     }
51     
52     private void setup() {
53     }
54
55     /**
56      * @param arg0
57      */

58     private AbstractRangeDetails(boolean arg0) {
59         super(arg0);
60     }
61     
62     protected PropertyInstance getPropertyInstance() {
63         return this.m_propInst;
64     }
65
66     /**
67      * @param arg0
68      */

69     private AbstractRangeDetails(LayoutManager arg0) {
70         super(arg0);
71     }
72
73     /**
74      * @param arg0
75      * @param arg1
76      */

77     private AbstractRangeDetails(LayoutManager arg0, boolean arg1) {
78         super(arg0, arg1);
79     }
80
81     public Dimension getPreferredSize() {
82         return new Dimension(400, 350);
83     }
84     
85     public void addRangeDetailsListener(RangeDetailsListener listener) {
86         this.m_listeners.add(listener);
87     }
88     
89     public void removeRangeDetailsListener(RangeDetailsListener listener) {
90         this.m_listeners.remove(listener);
91     }
92     
93     protected void fireRangeDetailsChanged(RangeValue value) {
94         Iterator itor = this.m_listeners.iterator();
95         while (itor.hasNext()) {
96             RangeDetailsListener element = (RangeDetailsListener) itor.next();
97             element.rangeDetailsChange(value);
98         }
99     }
100
101     /* (non-Javadoc)
102      * @see java.awt.LayoutManager#addLayoutComponent(java.lang.String, java.awt.Component)
103      */

104     public void addLayoutComponent(String JavaDoc arg0, Component arg1) {
105     }
106
107     /* (non-Javadoc)
108      * @see java.awt.LayoutManager#minimumLayoutSize(java.awt.Container)
109      */

110     public Dimension minimumLayoutSize(Container arg0) {
111         return this.getPreferredSize();
112     }
113
114     /* (non-Javadoc)
115      * @see java.awt.LayoutManager#preferredLayoutSize(java.awt.Container)
116      */

117     public Dimension preferredLayoutSize(Container arg0) {
118         return this.getPreferredSize();
119     }
120
121     /* (non-Javadoc)
122      * @see java.awt.LayoutManager#removeLayoutComponent(java.awt.Component)
123      */

124     public void removeLayoutComponent(Component arg0) {
125     }
126
127 }
128
Popular Tags