diva.util.jester
Class EventParser

java.lang.Object
  extended by diva.util.jester.EventParser
All Implemented Interfaces:
ModelParser

public class EventParser
extends Object
implements ModelParser

EventParser parses an XML file representing a stream of AWT input events into an array of InputEvent objects.

Version:
$Revision: 1.3 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)
See Also:
EventWriter

Field Summary
static String CLICKCOUNT_ATTR_TAG
           
static String DTD_1
          The DTD for sketch files.
static String DTD_URL
          The URL where the DTD is stored.
static String EVENT_STREAM_TAG
           
static String ID_ATTR_TAG
           
static String KEY_EVENT_TAG
           
static String KEYCHAR_ATTR_TAG
           
static String KEYCODE_ATTR_TAG
           
static String MODIFIERS_ATTR_TAG
           
static String MOUSE_EVENT_TAG
           
static String POPUPTRIGGER_ATTR_TAG
           
static String PUBLIC_ID
          The public identity of the sketch dtd file.
static String WHEN_ATTR_TAG
           
static String X_ATTR_TAG
           
static String Y_ATTR_TAG
           
 
Constructor Summary
EventParser(Component source)
          Construct a new event parser that parses events from the input string and attributes them to the given source component.
 
Method Summary
static void main(String[] args)
          Simple test of this class.
 Object parse(Reader in)
          Parse the data in the given charater stream into a data structure and return the data structure.
 InputEvent[] parseEvents(Reader in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC_ID

public static final String PUBLIC_ID
The public identity of the sketch dtd file.

See Also:
Constant Field Values

DTD_URL

public static final String DTD_URL
The URL where the DTD is stored.

See Also:
Constant Field Values

DTD_1

public static final String DTD_1
The DTD for sketch files.

See Also:
Constant Field Values

EVENT_STREAM_TAG

public static final String EVENT_STREAM_TAG
See Also:
Constant Field Values

MOUSE_EVENT_TAG

public static final String MOUSE_EVENT_TAG
See Also:
Constant Field Values

KEY_EVENT_TAG

public static final String KEY_EVENT_TAG
See Also:
Constant Field Values

ID_ATTR_TAG

public static final String ID_ATTR_TAG
See Also:
Constant Field Values

WHEN_ATTR_TAG

public static final String WHEN_ATTR_TAG
See Also:
Constant Field Values

MODIFIERS_ATTR_TAG

public static final String MODIFIERS_ATTR_TAG
See Also:
Constant Field Values

X_ATTR_TAG

public static final String X_ATTR_TAG
See Also:
Constant Field Values

Y_ATTR_TAG

public static final String Y_ATTR_TAG
See Also:
Constant Field Values

CLICKCOUNT_ATTR_TAG

public static final String CLICKCOUNT_ATTR_TAG
See Also:
Constant Field Values

POPUPTRIGGER_ATTR_TAG

public static final String POPUPTRIGGER_ATTR_TAG
See Also:
Constant Field Values

KEYCODE_ATTR_TAG

public static final String KEYCODE_ATTR_TAG
See Also:
Constant Field Values

KEYCHAR_ATTR_TAG

public static final String KEYCHAR_ATTR_TAG
See Also:
Constant Field Values
Constructor Detail

EventParser

public EventParser(Component source)
Construct a new event parser that parses events from the input string and attributes them to the given source component.

Method Detail

parse

public Object parse(Reader in)
             throws Exception
Description copied from interface: ModelParser
Parse the data in the given charater stream into a data structure and return the data structure.

Specified by:
parse in interface ModelParser
Throws:
Exception

parseEvents

public InputEvent[] parseEvents(Reader in)
                         throws Exception
Throws:
Exception

main

public static void main(String[] args)
                 throws Exception
Simple test of this class.

Throws:
Exception


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.