001: /*
002: *
003: *
004: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: */
026:
027: package com.sun.midp.automation;
028:
029: import java.io.*;
030:
031: /**
032: * Factory creating event's data for various types
033: * of events.
034: */
035: public final class AutoEventDataFactory {
036: /** Key event: key is pressed */
037: public static final int KEY_PRESSED = 0;
038:
039: /** Key event: key is repeated */
040: public static final int KEY_REPEATED = 1;
041:
042: /** Key event: key is released */
043: public static final int KEY_RELEASED = 2;
044:
045: /** Pen event: pen is pressed */
046: public static final int PEN_PRESSED = 3;
047:
048: /** Pen event: pen is dragged */
049: public static final int PEN_DRAGGED = 4;
050:
051: /** Pen event: pen is released */
052: public static final int PEN_RELEASED = 5;
053:
054: /**
055: * Creates event's data for key event.
056: *
057: * @param type type of event: KEY_PRESSED, KEY_REPEATED, KEY_RELEASED
058: * @param code key's code
059: *
060: * @return AutoEventData representing event's data for key event
061: */
062: public static AutoEventData createKeyEventData(int type, int code) {
063: return null;
064: }
065:
066: /**
067: * Creates event's data for input method event.
068: *
069: * @param str entered string
070: *
071: * @return AutoEventData representing event's data for IM event
072: */
073: public static AutoEventData createInputMethodEventData(String str) {
074: return null;
075: }
076:
077: /**
078: * Creates event's data for pen event.
079: *
080: * @param type type of event: PEN_PRESSED, PEN_DRAGGED, PEN_RELEASED
081: * @param x x coordinate of the pen
082: * @param y y coordinate of the pen
083: *
084: * @return AutoEventData representing event's data for pen event
085: */
086: public static AutoEventData createPenEventData(int type, int x,
087: int y) {
088: return null;
089: }
090:
091: /**
092: * Creates event's data for command event.
093: *
094: * @param type type of command event
095: * @return AutoEventData representing event's data for command event
096: */
097: public static AutoEventData createCommandEventData(int type) {
098: return null;
099: }
100:
101: /**
102: * Creates event's data from input stream
103: *
104: * @param stream stream to read data from.
105: *
106: * @return AutoEventData constructed from stream.
107: */
108: public static AutoEventData createFromStream(DataInputStream stream) {
109: return null;
110: }
111:
112: /**
113: * Private constructor to prevent user from creating an instance.
114: */
115: private AutoEventDataFactory() {
116: }
117: }
|