Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/nonpublic/external/MouseController.java

Diff revisions: vs.
  @@ -1,66 +1,66 @@
1 - // This Source Code is Copyright & Licenced as indicated below
2 - package org.litesoft.GWT.client.widgets.nonpublic.external;
3 - /*
4 - * Copyright 2007 Mat Gessel <mat.gessel@gmail.com>
5 - *
6 - * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 - * use this file except in compliance with the License. You may obtain a copy of
8 - * the License at
9 - *
10 - * http://www.apache.org/licenses/LICENSE-2.0
11 - *
12 - * Unless required by applicable law or agreed to in writing, software
13 - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 - * License for the specific language governing permissions and limitations under
16 - * the License.
17 - */
18 -
19 - import com.google.gwt.user.client.*;
20 - import com.google.gwt.user.client.ui.*;
21 -
22 - /**
23 - * A controller which converts native DOM mouse events to framework
24 - * {@link MouseEvent}s.
25 - */
26 - public class MouseController extends ControllerAdaptor {
27 - private final MouseHandler m_handler;
28 -
29 - public MouseController( int eventBits, Class id, MouseHandler handler ) {
30 - super( eventBits, id );
31 - m_handler = handler;
32 - }
33 -
34 - @Override
35 - public void onBrowserEvent( Widget widget, Event event ) {
36 - processEvent( widget, event );
37 - }
38 -
39 - protected void processEvent( Widget widget, Event event ) {
40 - switch ( DOM.eventGetType( event ) ) {
41 - case Event.ONMOUSEDOWN:
42 - onMouseDown( new MouseEvent( widget, event ) );
43 - break;
44 -
45 - case Event.ONMOUSEMOVE:
46 - onMouseMove( new MouseEvent( widget, event ) );
47 - break;
48 -
49 - case Event.ONMOUSEUP:
50 - onMouseUp( new MouseEvent( widget, event ) );
51 - break;
52 - }
53 - }
54 -
55 - protected void onMouseDown( MouseEvent e ) {
56 - m_handler.onMouseDown( e );
57 - }
58 -
59 - protected void onMouseMove( MouseEvent e ) {
60 - m_handler.onMouseMove( e );
61 - }
62 -
63 - protected void onMouseUp( MouseEvent e ) {
64 - m_handler.onMouseUp( e );
65 - }
66 - }
1 + // This Source Code is Copyright & Licenced as indicated below
2 + package org.litesoft.GWT.client.widgets.nonpublic.external;
3 + /*
4 + * Copyright 2007 Mat Gessel <mat.gessel@gmail.com>
5 + *
6 + * Licensed under the Apache License, Version 2.0 (the "License"); you may not
7 + * use this file except in compliance with the License. You may obtain a copy of
8 + * the License at
9 + *
10 + * http://www.apache.org/licenses/LICENSE-2.0
11 + *
12 + * Unless required by applicable law or agreed to in writing, software
13 + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 + * License for the specific language governing permissions and limitations under
16 + * the License.
17 + */
18 +
19 + import com.google.gwt.user.client.*;
20 + import com.google.gwt.user.client.ui.*;
21 +
22 + /**
23 + * A controller which converts native DOM mouse events to framework
24 + * {@link MouseEvent}s.
25 + */
26 + public class MouseController extends ControllerAdaptor {
27 + private final MouseHandler m_handler;
28 +
29 + public MouseController( int eventBits, Class id, MouseHandler handler ) {
30 + super( eventBits, id );
31 + m_handler = handler;
32 + }
33 +
34 + @Override
35 + public void onBrowserEvent( Widget widget, Event event ) {
36 + processEvent( widget, event );
37 + }
38 +
39 + protected void processEvent( Widget widget, Event event ) {
40 + switch ( DOM.eventGetType( event ) ) {
41 + case Event.ONMOUSEDOWN:
42 + onMouseDown( new MouseEvent( widget, event ) );
43 + break;
44 +
45 + case Event.ONMOUSEMOVE:
46 + onMouseMove( new MouseEvent( widget, event ) );
47 + break;
48 +
49 + case Event.ONMOUSEUP:
50 + onMouseUp( new MouseEvent( widget, event ) );
51 + break;
52 + }
53 + }
54 +
55 + protected void onMouseDown( MouseEvent e ) {
56 + m_handler.onMouseDown( e );
57 + }
58 +
59 + protected void onMouseMove( MouseEvent e ) {
60 + m_handler.onMouseMove( e );
61 + }
62 +
63 + protected void onMouseUp( MouseEvent e ) {
64 + m_handler.onMouseUp( e );
65 + }
66 + }