예제 #1
0
  /**
   * Write a MouseEvent on the link to the server.
   *
   * @param descriptor the MASK that describes the event.
   * @param me the MouseEvent
   * @param latPoint the latitude of the mouse event.
   * @param lonPoint the longitude of the mouse event.
   * @param props an array of strings representing key-value pairs.
   * @param link the link to write the gesture to.
   */
  public static void write(
      int descriptor,
      MouseEvent me,
      float latPoint,
      float lonPoint,
      LinkProperties props,
      Link link)
      throws IOException {

    if (props.getProperty(LPC_GRAPHICID) != null) {
      descriptor = LinkUtil.setMask(descriptor, GRAPHIC_ID_MASK);
    }

    link.start(Link.ACTION_REQUEST_HEADER);
    link.dos.writeFloat(version);
    link.dos.writeInt(descriptor);
    link.dos.writeInt(me.getX());
    link.dos.writeInt(me.getY());
    link.dos.writeInt(me.getClickCount());
    link.dos.writeInt(me.getModifiers());
    link.dos.writeFloat(latPoint);
    link.dos.writeFloat(lonPoint);

    props.write(link);

    link.end(Link.END_TOTAL);
  }
예제 #2
0
  /**
   * Construct an XY point at a screen location..
   *
   * @param px1 x pixel position of the first corner relative to the window origin
   * @param py1 y pixel position of the first corner relative to the window origin
   * @param radius pixel radius of the point.
   * @param properties description of drawing attributes.
   * @param dos DataOutputStream
   * @throws IOException
   */
  public static void write(
      int px1, int py1, int radius, LinkProperties properties, DataOutputStream dos)
      throws IOException {

    dos.write(Link.POINT_HEADER.getBytes());
    dos.writeByte(GRAPHICTYPE_POINT);
    dos.writeByte(RENDERTYPE_XY);
    dos.writeInt(px1);
    dos.writeInt(py1);
    dos.writeInt(radius);
    properties.write(dos);
  }
예제 #3
0
  /**
   * Create a lat/lon point.
   *
   * @param lt latitude of north edge, decimal degrees.
   * @param ln longitude of west edge, decimal degrees.
   * @param radius pixel radius of the point.
   * @param properties description of drawing attributes.
   * @param dos DataOutputStream
   * @throws IOException
   */
  public static void write(
      float lt, float ln, int radius, LinkProperties properties, DataOutputStream dos)
      throws IOException {

    dos.write(Link.POINT_HEADER.getBytes());
    dos.writeByte(GRAPHICTYPE_POINT);
    dos.writeByte(RENDERTYPE_LATLON);
    dos.writeFloat(lt);
    dos.writeFloat(ln);
    dos.writeInt(radius);
    properties.write(dos);
  }
예제 #4
0
  /**
   * Write a KeyEvent on the link to the server.
   *
   * @param descriptor the MASK that describes the event.
   * @param ke the KeyEvent
   * @param props Properties representing attributes.
   * @param link the Link to write the gesture to.
   */
  public static void write(int descriptor, KeyEvent ke, LinkProperties props, Link link)
      throws IOException {

    link.start(Link.ACTION_REQUEST_HEADER);
    link.dos.writeFloat(version);
    link.dos.writeInt(descriptor);
    link.dos.writeChar(ke.getKeyChar());
    link.dos.writeInt(ke.getModifiers());

    props.write(link);

    link.end(Link.END_TOTAL);
  }