t3.portfolios
Class PortfolioEvent

java.lang.Object
  extended by t3.portfolios.PortfolioEvent

public class PortfolioEvent
extends java.lang.Object

Author:
pjt40 Data structure class representing an event in a portfolio. The event can be generated by a PointInputDevice (eg a stylus) (a "pid" event) or by a keyboard. See PortfolioServer for more information on the event model. This class is not thread safe. Its methods should be called only from within a T3 callback or by calling portfolioserver.performActionAsynchronously(). Its public fields are all final and so cannot be modified.

Field Summary
 double DESKx
          If positionAndButtonsKnown then this is the coordinates of event in DESK space, i.e.
 double DESKxOld
          If oldPositionKnown then this is the coordinates of event in DESK space, before this event occurred.
 double DESKy
          If positionAndButtonsKnown then this is the coordinates of event in DESK space, i.e.
 double DESKyOld
          If oldPositionKnown then this is the coordinates of event in DESK space, before this event occurred.
static int EVENT_KEYBOARD_PRESSED
           
static int EVENT_KEYBOARD_RELEASED
           
static int EVENT_KEYBOARD_TYPED
           
static int EVENT_PID_CLICK
           
static int EVENT_PID_ENTER
           
static int EVENT_PID_EXIT
           
static int EVENT_PID_FDOPMODE
           
static int EVENT_PID_MOVE
           
static int EVENT_PID_PRESS
           
static int EVENT_PID_PRESSOUTSIDE
           
static int EVENT_PID_RELEASE
           
 int eventType
          Type of event.
 java.io.Serializable extra
           
 char keyboardAWTChar
          For keyboard events.
 int keyboardAWTKeyCode
          For keyboard events.
 int keyboardAWTModifiers
          For keyboard events.
 boolean oldPositionKnown
          For pid events, this is true iff the position of the pid was known before this latest event occurred.
 Person person
          The Person that generated the event.
 int pidButton
          For pid press, pressoutside, release and click events, this is the button number that caused the event.
 int pidButtons
          If positionAndButtonsKnown then this is the pid's buttons bit field.
 PointInputDevice pointInputDevice
          For pid events, this is the pid that generated the event.
 boolean positionAndButtonsKnown
          For pid events, this is true iff the position and buttons of the pid are known.
 
Constructor Summary
PortfolioEvent(int penButton, int penButtons, Person person, PointInputDevice pen, double DESKx, double DESKy, double DESKxOld, double DESKyOld, java.io.Serializable extra, int eventType, boolean positionAndButtonsKnown, boolean oldPositionKnown, int keyboardAWTKeyCode, char keyboardAWTChar, int keyboardAWTModifiers)
          Creates a new data structure to store the specified data.
 
Method Summary
 double getPORTx(Portfolio p)
          If positionAndButtonsKnown then this returns the x coordinate of the event relative to the specified portfolio's PORT space.
 double getPORTxOld(Portfolio p)
          If oldPositionKnown then this returns the x coordinate of the pid before the event happened, relative to the specified portfolio's PORT space.
 double getPORTy(Portfolio p)
          If positionAndButtonsKnown then this returns the y coordinate of the event relative to the specified portfolio's PORT space.
 double getPORTyOld(Portfolio p)
          If oldPositionKnown then this returns the y coordinate of the pid before the event happened, relative to the specified portfolio's PORT space.
 int getTILEx(Portfolio p)
          If positionAndButtonsKnown then this returns the x coordinate of the event relative to the specified portfolio's TILE space.
 int getTILExOld(Portfolio p)
          If oldPositionKnown then this returns the x coordinate of the pid before the event happened, relative to the specified portfolio's TILE space.
 int getTILEy(Portfolio p)
          If positionAndButtonsKnown then this returns the y coordinate of the event relative to the specified portfolio's TILE space.
 int getTILEyOld(Portfolio p)
          If oldPositionKnown then this returns the y coordinate of the pid before the event happened, relative to the specified portfolio's TILE space.
 boolean isOldPointOnTile(Portfolio p)
          If oldPositionKnown then this returns true iff the coordinates of the pid before the event happened lie on the specified portfolio's tile.
 boolean isPointOnTile(Portfolio p)
          If positionAndButtonsKnown then this returns iff the coordinates of the event lie on the specified portfolio's tile.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EVENT_PID_PRESS

public static final int EVENT_PID_PRESS
See Also:
Constant Field Values

EVENT_PID_RELEASE

public static final int EVENT_PID_RELEASE
See Also:
Constant Field Values

EVENT_PID_CLICK

public static final int EVENT_PID_CLICK
See Also:
Constant Field Values

EVENT_PID_MOVE

public static final int EVENT_PID_MOVE
See Also:
Constant Field Values

EVENT_PID_ENTER

public static final int EVENT_PID_ENTER
See Also:
Constant Field Values

EVENT_PID_EXIT

public static final int EVENT_PID_EXIT
See Also:
Constant Field Values

EVENT_KEYBOARD_PRESSED

public static final int EVENT_KEYBOARD_PRESSED
See Also:
Constant Field Values

EVENT_KEYBOARD_RELEASED

public static final int EVENT_KEYBOARD_RELEASED
See Also:
Constant Field Values

EVENT_KEYBOARD_TYPED

public static final int EVENT_KEYBOARD_TYPED
See Also:
Constant Field Values

EVENT_PID_FDOPMODE

public static final int EVENT_PID_FDOPMODE
See Also:
Constant Field Values

EVENT_PID_PRESSOUTSIDE

public static final int EVENT_PID_PRESSOUTSIDE
See Also:
Constant Field Values

eventType

public final int eventType
Type of event.


person

public final Person person
The Person that generated the event.


pointInputDevice

public final PointInputDevice pointInputDevice
For pid events, this is the pid that generated the event. For non-pid events this is null.


positionAndButtonsKnown

public final boolean positionAndButtonsKnown
For pid events, this is true iff the position and buttons of the pid are known. For non-pid events this will be false.

It will always be true for pid press, pressoutside, pid release, pid click, pid move and pid enter events. It might be true for pid exit events.


oldPositionKnown

public final boolean oldPositionKnown
For pid events, this is true iff the position of the pid was known before this latest event occurred. For non-pid events this will be false. *


DESKx

public final double DESKx
If positionAndButtonsKnown then this is the coordinates of event in DESK space, i.e. in the coordinate space of the display surface.


DESKy

public final double DESKy
If positionAndButtonsKnown then this is the coordinates of event in DESK space, i.e. in the coordinate space of the display surface.


extra

public final java.io.Serializable extra

DESKxOld

public final double DESKxOld
If oldPositionKnown then this is the coordinates of event in DESK space, before this event occurred.


DESKyOld

public final double DESKyOld
If oldPositionKnown then this is the coordinates of event in DESK space, before this event occurred.


pidButton

public final int pidButton
For pid press, pressoutside, release and click events, this is the button number that caused the event. For fdop mode events, this is the button number that you entered fdop mode with.


pidButtons

public final int pidButtons
If positionAndButtonsKnown then this is the pid's buttons bit field.


keyboardAWTKeyCode

public final int keyboardAWTKeyCode
For keyboard events.


keyboardAWTChar

public final char keyboardAWTChar
For keyboard events.


keyboardAWTModifiers

public final int keyboardAWTModifiers
For keyboard events.

Constructor Detail

PortfolioEvent

public PortfolioEvent(int penButton,
                      int penButtons,
                      Person person,
                      PointInputDevice pen,
                      double DESKx,
                      double DESKy,
                      double DESKxOld,
                      double DESKyOld,
                      java.io.Serializable extra,
                      int eventType,
                      boolean positionAndButtonsKnown,
                      boolean oldPositionKnown,
                      int keyboardAWTKeyCode,
                      char keyboardAWTChar,
                      int keyboardAWTModifiers)
Creates a new data structure to store the specified data.

Parameters:
penButton -
penButtons -
client -
pen -
DESKx -
DESKy -
DESKxOld -
DESKyOld -
eventType -
positionAndButtonsKnown -
oldPositionKnown -
keyboardAWTKeyCode -
keyboardAWTChar -
keyboardAWTModifiers -
Method Detail

getPORTx

public final double getPORTx(Portfolio p)
If positionAndButtonsKnown then this returns the x coordinate of the event relative to the specified portfolio's PORT space. Results are cached.

Parameters:
p -
Returns:

getPORTy

public final double getPORTy(Portfolio p)
If positionAndButtonsKnown then this returns the y coordinate of the event relative to the specified portfolio's PORT space. Results are cached.

Parameters:
p -
Returns:

getPORTxOld

public final double getPORTxOld(Portfolio p)
If oldPositionKnown then this returns the x coordinate of the pid before the event happened, relative to the specified portfolio's PORT space. Results are cached.

Parameters:
p -
Returns:

getPORTyOld

public final double getPORTyOld(Portfolio p)
If oldPositionKnown then this returns the y coordinate of the pid before the event happened, relative to the specified portfolio's PORT space. Results are cached.

Parameters:
p -
Returns:

isPointOnTile

public final boolean isPointOnTile(Portfolio p)
If positionAndButtonsKnown then this returns iff the coordinates of the event lie on the specified portfolio's tile. Results are cached.

Parameters:
p -
Returns:

isOldPointOnTile

public final boolean isOldPointOnTile(Portfolio p)
If oldPositionKnown then this returns true iff the coordinates of the pid before the event happened lie on the specified portfolio's tile. Results are cached.

Parameters:
p -
Returns:

getTILEx

public final int getTILEx(Portfolio p)
If positionAndButtonsKnown then this returns the x coordinate of the event relative to the specified portfolio's TILE space. Results are cached.

Parameters:
p -
Returns:

getTILEy

public final int getTILEy(Portfolio p)
If positionAndButtonsKnown then this returns the y coordinate of the event relative to the specified portfolio's TILE space. Results are cached.

Parameters:
p -
Returns:

getTILExOld

public final int getTILExOld(Portfolio p)
If oldPositionKnown then this returns the x coordinate of the pid before the event happened, relative to the specified portfolio's TILE space. Results are cached. Of course, the result is not guaranteed to lie within the portfolio's tile.

Parameters:
p -
Returns:

getTILEyOld

public final int getTILEyOld(Portfolio p)
If oldPositionKnown then this returns the y coordinate of the pid before the event happened, relative to the specified portfolio's TILE space. Results are cached. Of course, the result is not guaranteed to lie within the portfolio's tile.

Parameters:
p -
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object