예제 #1
0
  /** Write an OMPoint to the Link. */
  public static void write(OMPoint point, Link link, LinkProperties props) throws IOException {

    props.setProperty(LinkPoint.LPC_POINT_OVAL, point.isOval() ? "true" : "false");
    switch (point.getRenderType()) {
      case OMPoint.RENDERTYPE_LATLON:
        LinkPoint.write(
            (float) point.getLat(), (float) point.getLon(), point.getRadius(), props, link.dos);
        break;
      case OMPoint.RENDERTYPE_XY:
        LinkPoint.write(point.getX(), point.getY(), point.getRadius(), props, link.dos);
        break;
      case OMPoint.RENDERTYPE_OFFSET:
        LinkPoint.write(
            (float) point.getLat(),
            (float) point.getLon(),
            point.getX(),
            point.getY(),
            point.getRadius(),
            props,
            link.dos);
        break;
      default:
        Debug.error("LinkPoint.write: point rendertype unknown.");
    }
  }
예제 #2
0
  /**
   * An example of how to handle LinkActionRequest.
   *
   * @param lar the LinkActionRequest, so you can get more information about the parameters of the
   *     gesture frome the client.
   * @param link the link to communicate the response back to the client.
   * @throws IOException
   */
  public void handleGesture(LinkActionRequest lar, Link link) throws IOException {

    LinkProperties properties = new LinkProperties();
    properties.setProperty(
        LPC_INFO, ("Mouse Clicked at: x = " + lar.getX() + ", y = " + lar.getY()));

    LinkActionList lal = new LinkActionList(link, properties);
    //        int descriptor = lar.getDescriptor();

    String gid = lar.getProperties().getProperty(LPC_GRAPHICID);
    if (gid == null) {
      System.out.println("Deselecting graphics");
      lal.deselectGraphics();
    } else {
      System.out.println("Selecting graphic");
      lal.modifyGraphic(LinkActionList.MODIFY_SELECT_GRAPHIC_MASK, lar.getProperties());
    }

    lal.end(Link.END_TOTAL);
  }