com.bbn.openmap.layer.link
Class LinkActionRequest

java.lang.Object
  extended by com.bbn.openmap.layer.link.LinkActionRequest
All Implemented Interfaces:
LinkActionConstants, LinkPropertiesConstants

public class LinkActionRequest
extends java.lang.Object
implements LinkActionConstants, LinkPropertiesConstants

Class used to send a gesture to a server. In this case, a gesture can be a mouse click event, a mouse event, or a key event. This class defines how such notification is formatted and sent. The client can use the static write methods to put the object on the link, and the server creates an instance of this object to read the object off the link, and find out what the fields were.


Field Summary
protected  int clickCount
          The click count of the mouse event.
protected  int descriptor
          The mask describing the event.
protected  java.lang.String id
          Graphic ID of an object selected by a gesture.
protected  char key
          The character of the key that was pressed in a key event.
protected  float lat
          The latitide location of the mouse event, in decimal degrees.
protected  float lon
          The longitude location of the mouse event, in decimal degrees.
protected  int modifiers
          The modifier of the event, that describes any keys that may have been pressed while the event occurred.
protected  LinkProperties properties
          The properties object that contains any pertinent arguments.
protected static float version
          Version Number of request format.
protected  int x
          The horizontal screen location of the mouse event, in pixels.
protected  int y
          The vertical screen location of the mouse event, in pixels.
 
Fields inherited from interface com.bbn.openmap.layer.link.LinkActionConstants
ACTION_GRAPHICS, ACTION_GUI, ACTION_MAP, CLIENT_NOTIFICATION_MASK, GRAPHIC_ID_MASK, KEY_PRESSED_MASK, KEY_RELEASED_MASK, MODIFY_DELETE_GRAPHIC_MASK, MODIFY_DESELECT_GRAPHIC_MASK, MODIFY_DESELECTALL_GRAPHIC_MASK, MODIFY_LOWER_GRAPHIC_MASK, MODIFY_RAISE_GRAPHIC_MASK, MODIFY_SELECT_GRAPHIC_MASK, MOUSE_CLICKED_MASK, MOUSE_DRAGGED_MASK, MOUSE_ENTERED_MASK, MOUSE_EXITED_MASK, MOUSE_MOVED_MASK, MOUSE_PRESSED_MASK, MOUSE_RELEASED_MASK, SERVER_NOTIFICATION_MASK, UPDATE_ADD_GRAPHIC_MASK, UPDATE_GRAPHIC_MASK
 
Fields inherited from interface com.bbn.openmap.layer.link.LinkPropertiesConstants
LPC_BACKWARD_DIAG_PATTERN, LPC_CENTER_LAT, LPC_CENTER_LONG, LPC_CLEAR_PROPERTIES, LPC_CLEAR_PROPERTIES_CHAR, LPC_CROSS_PATTERN, LPC_DASH, LPC_DASH_DOT, LPC_DASH_DOT_DOT, LPC_DIAG_CROSS_PATTERN, LPC_DOT, LPC_FILLCOLOR, LPC_FILLPATTERN, LPC_FORWARD_DIAG_PATTERN, LPC_GRAPHICID, LPC_HEIGHT, LPC_HIGHLIGHTCOLOR, LPC_HORIZONTAL_PATTERN, LPC_HTML, LPC_INFO, LPC_LATMAX, LPC_LATMIN, LPC_LINECOLOR, LPC_LINESTYLE, LPC_LINEWIDTH, LPC_LINKRASTERIMAGEURL, LPC_LINKROTATION, LPC_LINKTEXTBASELINE, LPC_LINKTEXTFONT, LPC_LINKTEXTSTRING, LPC_LONG_DASH, LPC_LONMAX, LPC_LONMIN, LPC_MESSAGE, LPC_OLD_FILLCOLOR, LPC_OLD_FILLPATTERN, LPC_OLD_HIGHLIGHTCOLOR, LPC_OLD_LINECOLOR, LPC_OLD_LINESTYLE, LPC_OLD_LINEWIDTH, LPC_OLD_LINKTEXTFONT, LPC_OLD_LINKTEXTSTRING, LPC_PROJECTION, LPC_PROPERY_MANAGEMENT_POLICY, LPC_PROPERY_MANAGEMENT_POLICY_CHAR, LPC_REUSE_PROPERTIES, LPC_REUSE_PROPERTIES_CHAR, LPC_SCALE, LPC_SOLID, LPC_SOLID_PATTERN, LPC_TIME, LPC_URL, LPC_VERTICAL_PATTERN, LPC_WIDTH
 
Constructor Summary
LinkActionRequest(Link link)
           
LinkActionRequest(Link link, int descriptor, java.lang.String sectionEnder)
          Constructor used by a server to let the client know what types of gestures the server can receive.
 
Method Summary
 int getDescriptor()
          Get the masked int that describes the gesture.
 java.lang.String getGraphicID()
          If this is null, it means that the gesture occurred on the map background and is not affiliated with a particular graphic.
 char getKey()
          Get the keyboard key that was pressed from a key gesture.
 float getLat()
          Get latitude of mouse gesture, in decimal degrees.
 java.lang.String getLinkStatus()
          After reading the gesture response, this returns the section ending string terminating the gesture section, either Link.END_TOTAL or Link.END_SECTION.
 float getLon()
          Get longitude of mouse gesture, in decimal degrees.
 int getModifiers()
          Get the masked int that describes any modifing keys pressed with the gesture.
 LinkProperties getProperties()
          Get the key-value args sent with the gesture.
 java.lang.String getType()
           
 int getX()
          Get horizontal pixel location of mouse gesture, from left side of map.
 int getY()
          Get vertical pixel location of mouse gesture, from top of map.
protected  boolean isClientNotification()
          Returns true if the query is to let the client know what gestures the server is interested in receiving.
protected  boolean isKeyEvent()
          Returns true if the query is representing a key event.
 java.lang.String read(Link link)
          Read the link and pull off the gesture, filling in the fields of this object.
 java.lang.String toString()
           
static void write(int descriptor, java.awt.event.KeyEvent ke, LinkProperties props, Link link)
          Write a KeyEvent on the link to the server.
static void write(int descriptor, java.awt.event.MouseEvent me, float latPoint, float lonPoint, LinkProperties props, Link link)
          Write a MouseEvent on the link to the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

protected int x
The horizontal screen location of the mouse event, in pixels.


y

protected int y
The vertical screen location of the mouse event, in pixels.


lat

protected float lat
The latitide location of the mouse event, in decimal degrees.


lon

protected float lon
The longitude location of the mouse event, in decimal degrees.


clickCount

protected int clickCount
The click count of the mouse event.


modifiers

protected int modifiers
The modifier of the event, that describes any keys that may have been pressed while the event occurred.


key

protected char key
The character of the key that was pressed in a key event.


descriptor

protected int descriptor
The mask describing the event.


id

protected java.lang.String id
Graphic ID of an object selected by a gesture.


properties

protected LinkProperties properties
The properties object that contains any pertinent arguments.


version

protected static float version
Version Number of request format.

Constructor Detail

LinkActionRequest

public LinkActionRequest(Link link)
                  throws java.io.IOException
Throws:
java.io.IOException

LinkActionRequest

public LinkActionRequest(Link link,
                         int descriptor,
                         java.lang.String sectionEnder)
                  throws java.io.IOException
Constructor used by a server to let the client know what types of gestures the server can receive. This constructor automatically writes out the header and descriptor to the link. It does not call the link.end() method to end the transmission, since this will probably be sent along with other sections in a communication to the client.

Parameters:
link - the link to write to.
descriptor - a masked integer (see constants) describing the event to receive.
sectionEnder - the endType string to use for this description, either Link.END_TOTAL if this is the last section to the client, or END_SECTION if there are more sections following.
Throws:
java.io.IOException
Method Detail

getType

public java.lang.String getType()

getLinkStatus

public java.lang.String getLinkStatus()
After reading the gesture response, this returns the section ending string terminating the gesture section, either Link.END_TOTAL or Link.END_SECTION.

Returns:
either Link.END_TOTAL or Link.END_SECTION.

write

public static void write(int descriptor,
                         java.awt.event.MouseEvent me,
                         float latPoint,
                         float lonPoint,
                         LinkProperties props,
                         Link link)
                  throws java.io.IOException
Write a MouseEvent on the link to the server.

Parameters:
descriptor - the MASK that describes the event.
me - the MouseEvent
latPoint - the latitude of the mouse event.
lonPoint - the longitude of the mouse event.
props - an array of strings representing key-value pairs.
link - the link to write the gesture to.
Throws:
java.io.IOException

write

public static void write(int descriptor,
                         java.awt.event.KeyEvent ke,
                         LinkProperties props,
                         Link link)
                  throws java.io.IOException
Write a KeyEvent on the link to the server.

Parameters:
descriptor - the MASK that describes the event.
ke - the KeyEvent
props - Properties representing attributes.
link - the Link to write the gesture to.
Throws:
java.io.IOException

read

public java.lang.String read(Link link)
                      throws java.io.IOException
Read the link and pull off the gesture, filling in the fields of this object.

Parameters:
link - the link to read from.
Returns:
Link.END_TOTAL or Link.END_SECTION
Throws:
java.io.IOException

getLat

public float getLat()
Get latitude of mouse gesture, in decimal degrees.


getLon

public float getLon()
Get longitude of mouse gesture, in decimal degrees.


getX

public int getX()
Get horizontal pixel location of mouse gesture, from left side of map.


getY

public int getY()
Get vertical pixel location of mouse gesture, from top of map.


getKey

public char getKey()
Get the keyboard key that was pressed from a key gesture.


getDescriptor

public int getDescriptor()
Get the masked int that describes the gesture.


getGraphicID

public java.lang.String getGraphicID()
If this is null, it means that the gesture occurred on the map background and is not affiliated with a particular graphic. Otherwise, the graphic ID string is returned for the affiliated graphic.


getModifiers

public int getModifiers()
Get the masked int that describes any modifing keys pressed with the gesture.


getProperties

public LinkProperties getProperties()
Get the key-value args sent with the gesture.


isClientNotification

protected boolean isClientNotification()
Returns true if the query is to let the client know what gestures the server is interested in receiving.


isKeyEvent

protected boolean isKeyEvent()
Returns true if the query is representing a key event.


toString

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


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details