tesseract
3.03
|
00001 // Copyright 2007 Google Inc. All Rights Reserved. 00002 // 00003 // Licensed under the Apache License, Version 2.0 (the "License"); You may not 00004 // use this file except in compliance with the License. You may obtain a copy of 00005 // the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by 00006 // applicable law or agreed to in writing, software distributed under the 00007 // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 00008 // OF ANY KIND, either express or implied. See the License for the specific 00009 // language governing permissions and limitations under the License. 00010 00011 package com.google.scrollview.events; 00012 00013 import com.google.scrollview.ui.SVWindow; 00014 00021 public class SVEvent { 00022 SVEventType type; // What kind of event. 00023 SVWindow window; // Window event relates to. 00024 int x; // Coords of click or selection. 00025 int y; 00026 int xSize; // Size of selection. 00027 int ySize; 00028 int commandId; 00029 String parameter; // Any string that might have been passed as argument. 00030 00043 public SVEvent(SVEventType t, SVWindow w, int x1, int y1, int x2, int y2, 00044 String p) { 00045 type = t; 00046 window = w; 00047 x = x1; 00048 y = y1; 00049 xSize = x2; 00050 ySize = y2; 00051 commandId = 0; 00052 parameter = p; 00053 } 00054 00065 public SVEvent(SVEventType eventtype, SVWindow svWindow, int commandid, 00066 String value) { 00067 type = eventtype; 00068 window = svWindow; 00069 00070 parameter = value; 00071 x = 0; 00072 y = 0; 00073 xSize = 0; 00074 ySize = 0; 00075 commandId = commandid; 00076 } 00077 00082 @Override 00083 public String toString() { 00084 return (window.hash + "," + type.ordinal() + "," + x + "," + y + "," 00085 + xSize + "," + ySize + "," + commandId + "," + parameter); 00086 } 00087 }