Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SVEvent.java
Go to the documentation of this file.
1 // Copyright 2007 Google Inc. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); You may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
6 // applicable law or agreed to in writing, software distributed under the
7 // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8 // OF ANY KIND, either express or implied. See the License for the specific
9 // language governing permissions and limitations under the License.
10
11 package com.google.scrollview.events;
12
13 import com.google.scrollview.ui.SVWindow;
14
21 public class SVEvent {
22 SVEventType type; // What kind of event.
23 SVWindow window; // Window event relates to.
24 int x; // Coords of click or selection.
25 int y;
26 int xSize; // Size of selection.
27 int ySize;
28 int commandId;
29 String parameter; // Any string that might have been passed as argument.
30
43 public SVEvent(SVEventType t, SVWindow w, int x1, int y1, int x2, int y2,
44 String p) {
45 type = t;
46 window = w;
47 x = x1;
48 y = y1;
49 xSize = x2;
50 ySize = y2;
51 commandId = 0;
52 parameter = p;
53 }
54
65 public SVEvent(SVEventType eventtype, SVWindow svWindow, int commandid,
66 String value) {
67 type = eventtype;
68 window = svWindow;
69
70 parameter = value;
71 x = 0;
72 y = 0;
73 xSize = 0;
74 ySize = 0;
75 commandId = commandid;
76 }
77
82 @Override
83 public String toString() {
84 return (window.hash + "," + type.ordinal() + "," + x + "," + y + ","
85 + xSize + "," + ySize + "," + commandId + "," + parameter);
86 }
87 }