Project

General

Profile

1
<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
2
<html>
3
<head>
4
<title>
5
<a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008 Overview
6
</title>
7
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
8
<script>
9
function asd() {
10
	
11
		parent.document.title="Button.js Overview";
12
	
13
}
14
</script>
15
</head>
16
<body bgcolor="white" onload="asd();">
17

    
18
<!-- ========== START OF NAVBAR ========== -->
19
<a name="navbar_top"><!-- --></a>
20
<table border="0" width="100%" cellpadding="1" cellspacing="0">
21
<tr>
22
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
23
<a name="navbar_top_firstrow"><!-- --></a>
24
<table border="0" cellpadding="0" cellspacing="3">
25
  <tr align="center" valign="top">
26
  
27
  
28
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
29
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
30
  
31

    
32
  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
33
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
34
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
35
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
36
  </tr>
37
</table>
38
</td>
39
<td bgcolor="#EEEEFF" align="right" valign="top">
40
<em>
41
<b><a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008</b></em>
42
</td>
43
</tr>
44

    
45
<tr>
46
<td bgcolor="white" class="NavBarCell2"><font size="-2">
47
&nbsp;PREV&nbsp;
48
&nbsp;NEXT</font></td>
49
<td bgcolor="white" class="NavBarCell2"><font size="-2">
50
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
51
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
52
&nbsp;&nbsp;
53
<script>
54
  <!--
55
  if(window==top) {
56
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
57
  }
58
  //-->
59
</script>
60
<noscript>
61
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
62
</noscript>
63
</font></td>
64
</tr>
65
</table>
66
<!-- =========== END OF NAVBAR =========== -->
67

    
68
<hr>
69
<center>
70
	
71
	   <h2>Button.js</h2>
72
	
73
</center>
74

    
75
	
76

    
77

    
78
<h4>Summary</h4>
79
<p>
80
	
81
		No overview generated for 'Button.js'<BR/><BR/>
82
	
83
</p>
84

    
85
<hr>
86

    
87

    
88
    <table border="1" cellpadding="3" cellspacing="0" width="100%">
89
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
90
    <td colspan=2><font size="+2">
91
    
92
        <b>Class Summary</b>
93
    
94
    </font></td>
95
    </tr>
96
    
97
    <tr bgcolor="white" class="TableRowColor">
98
    <td width="15%"><b><a href="Button.html">Button</a></b></td>
99
    <td>&nbsp;</td>
100
    </tr>
101
    
102
    </table>
103
    <hr/> 
104

    
105

    
106
<!-- ========== METHOD SUMMARY =========== -->
107

    
108
<!-- ========== END METHOD SUMMARY =========== -->
109

    
110

    
111
        <pre class="sourceview"><span class="comment">/*
112
License: LGPL as per: http://www.gnu.org/copyleft/lesser.html
113
$Id: Button.js 3052 2007-08-01 21:25:21Z ahocevar $
114
*/</span>
115
<span class="comment">
116
// Ensure this object's dependancies are loaded.</span>
117
mapbuilder.loadScript(baseDir+<span class="literal">"/widget/ButtonBase.js"</span>);
118

    
119
<span class="comment">/**
120
 * Generic Button object. Set the &lt;action&gt; property in config for
121
 * the controller method to be called when selected
122
 * <span class="attrib">@base</span> ButtonBase
123
 * <span class="attrib">@author</span> Andreas Hocevar andreas.hocevarATgmail.com
124
 * <span class="attrib">@param</span> widgetNode      The tool node from the Config XML file.
125
 * <span class="attrib">@param</span> model  The ButtonBar widget.
126
 */</span>
127
<span class="reserved">function</span> Button(widgetNode, model) {
128
  ButtonBase.apply(<span class="reserved">this</span>, new Array(widgetNode, model));
129

    
130
  <span class="comment">/**
131
   * default css cursor to use when the button is selected
132
   */</span>
133
  <span class="reserved">this</span>.cursor = <span class="literal">'default'</span>;
134

    
135
  <span class="comment">/**
136
   * Creates the OpenLayers control for this button.
137
   * This method will be called by ButtonBase when
138
   * MapPaneOL is ready to have buttons added.
139
   * The control should be defined in this method.
140
   * <span class="attrib">@type</span> function
141
   * <span class="attrib">@param</span> objRef reference to this object.
142
   * <span class="attrib">@return</span> class (not instance!) of the OL control.
143
   */</span>
144
  <span class="reserved">this</span>.createControl = <span class="reserved">function</span>(objRef) {
145
    var Control = OpenLayers.Class( OpenLayers.Control, {
146
      CLASS_NAME: <span class="literal">'mbControl.'</span>+objRef.id,
147
      type: (objRef.buttonType == <span class="literal">'RadioButton'</span>) ? OpenLayers.Control.TYPE_TOOL : OpenLayers.Control.TYPE_BUTTON,
148
<span class="comment">      // for button type      </span>
149
      trigger: <span class="reserved">function</span>() {
150
        eval(<span class="literal">'config.objects.'</span>+objRef.action);
151
      },
152
<span class="comment">      // for tool type (RadioButton)</span>
153
      activate: <span class="reserved">function</span>() {
154
        eval(<span class="literal">'config.objects.'</span>+objRef.action);
155
        <span class="reserved">this</span>.active = true;
156
        <span class="reserved">return</span> true;
157
      }
158
    });
159
    <span class="reserved">return</span> Control;
160
  }
161
  
162
  <span class="comment">/**
163
   * Optional method to instantiate the control. If a
164
   * subclass provides this method, it will be used instead
165
   * of just callint new Control() in the superclass.
166
   * This is needed when a control has to be instantiated
167
   * with parameters.
168
   * <span class="attrib">@type</span> OpenLayers.Control
169
   * <span class="attrib">@param</span> objRef reference to this object.
170
   * <span class="attrib">@param</span> {OpenLayers.Control} Control to instantiate
171
   * <span class="attrib">@return</span> instance of the OL control
172
   */</span>
173
  <span class="reserved">this</span>.instantiateControl = <span class="reserved">function</span>(objRef, Control) {
174
<span class="comment">    // return OpenLayers.Control instance</span>
175
    <span class="reserved">return</span> new Control();
176
    
177
  }
178
}
179

    
180

    
181
</pre>
182
	<hr>
183

    
184

    
185

    
186
<!-- ========== START OF NAVBAR ========== -->
187
<a name="navbar_top"><!-- --></a>
188
<table border="0" width="100%" cellpadding="1" cellspacing="0">
189
<tr>
190
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
191
<a name="navbar_top_firstrow"><!-- --></a>
192
<table border="0" cellpadding="0" cellspacing="3">
193
  <tr align="center" valign="top">
194
  
195
  
196
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
197
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
198
  
199

    
200
  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
201
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
202
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
203
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
204
  </tr>
205
</table>
206
</td>
207
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
208
<b><a href='http://mapbuilder.sourceforge.net'>Community Map Builder</a> 27 Apr 2008</b></em>
209
</td>
210
</tr>
211

    
212
<tr>
213
<td bgcolor="white" class="NavBarCell2"><font size="-2">
214
&nbsp;PREV&nbsp;
215
&nbsp;NEXT</font></td>
216
<td bgcolor="white" class="NavBarCell2"><font size="-2">
217
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
218
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
219
&nbsp;&nbsp;
220
<script>
221
  <!--
222
  if(window==top) {
223
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
224
  }
225
  //-->
226
</script>
227
<noscript>
228
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
229
</noscript>
230
</font></td>
231
</tr>
232
</table>
233
<!-- =========== END OF NAVBAR =========== -->
234

    
235
<hr>
236
<font size="-1">
237

    
238
</font>
239
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Sun Apr 27 20:30:54 2008</div>
240
</body>
241
</html>
(218-218/316)