Package es.uma.ama.maudeWorkstationGUI.ui.graph

Examples of es.uma.ama.maudeWorkstationGUI.ui.graph.Graph$Node


public class OsmDataBuilder {

  public static Node buildSampleNode(long id) {
    List<Tag> tags = Arrays.asList(new Tag[] { new Tag("highway", "traffic_signals") });
    CommonEntityData entityData = new CommonEntityData(id, 0, new Date(), new OsmUser(1, "nco"), 1l, tags);
    return new Node(entityData, 1.0d, 2.0d);
  }
View Full Code Here


    Point point;
   
    geom = (PGgeometry) rs.getObject("geom");
    point = (Point) geom.getGeometry();
   
    return new Node(mapCommonEntityData(rs), point.y, point.x);
  }
View Full Code Here

    TimestampContainer timestamp;
    OsmUser user;
    long changesetId;
    double latitude;
    double longitude;
    Node node;
   
    id = Long.parseLong(reader.getAttributeValue(null, ATTRIBUTE_NAME_ID));
    version = Integer.parseInt(reader.getAttributeValue(null, ATTRIBUTE_NAME_VERSION));
    timestamp = parseTimestamp(reader.getAttributeValue(null, ATTRIBUTE_NAME_TIMESTAMP));
    changesetId = Long.parseLong(reader.getAttributeValue(null, ATTRIBUTE_NAME_CHANGESET_ID));
    user = readUser();
    changesetId = readChangesetId();
    latitude = Double.parseDouble(reader.getAttributeValue(null, ATTRIBUTE_NAME_LATITUDE));
    longitude = Double.parseDouble(reader.getAttributeValue(null, ATTRIBUTE_NAME_LONGITUDE));
   
    node = new Node(new CommonEntityData(id, version, timestamp, user, changesetId), latitude, longitude);
   
    reader.nextTag();
    while (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
      if (reader.getLocalName().equals(ELEMENT_NAME_TAG)) {
        node.getTags().add(readTag());
      } else {
        readUnknownElement();
      }
    }
   
View Full Code Here

  @Test
  public void computeBoundNoUpstreamBound() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundComputer bc = new BoundComputer("NewBound");
    bc.setSink(inspector);
    bc.process(new NodeContainer(new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    bc.process(new NodeContainer(new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 1), 2, 2)));
    bc.complete();
    bc.release();

    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
    Assert.assertEquals(new Bound(2, 1, 2, 1, "NewBound"), ec.getEntity());
View Full Code Here

  @Test
  public void computeBoundWithUpstreamBound() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundComputer bc = new BoundComputer("NewBound");
    bc.setSink(inspector);
    bc.process(new NodeContainer(new Node(new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    bc.process(new NodeContainer(new Node(new CommonEntityData(2, 2, new Date(), OsmUser.NONE, 1), 2, 2)));
    bc.complete();
    bc.release();

    Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
    EntityContainer ec = iterator.next();
View Full Code Here

 
  /**
   * {@inheritDoc}
   */
  public void process(NodeContainer nodeContainer) {
    Node node;
   
    node = nodeContainer.getEntity();
   
    nodeWriter.writeField(node.getId());
    nodeWriter.writeField(node.getVersion());
    nodeWriter.writeField(node.getUser().getId());
    nodeWriter.writeField(node.getTimestamp());
    nodeWriter.writeField(node.getChangesetId());
    nodeWriter.writeField(buildTags(node));
    nodeWriter.writeField(pointBuilder.createPoint(node.getLatitude(), node.getLongitude()));
    nodeWriter.endRecord();
   
    if (enableBboxBuilder || enableLinestringBuilder) {
      wayGeometryBuilder.addNodeLocation(node);
    }
View Full Code Here

   */
  @Override
  public void process(CommonEntityData data, ResultSet resultSet) throws SQLException {
    double latitude;
    double longitude;
    Node node;
   
    latitude = FixedPrecisionCoordinateConvertor.convertToDouble(resultSet.getInt("latitude"));
        longitude = FixedPrecisionCoordinateConvertor.convertToDouble(resultSet.getInt("longitude"));
   
        node = new Node(data, latitude, longitude);
       
        listener.process(node, resultSet);
  }
View Full Code Here

  public void removeExistingBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundSetter setter = new BoundSetter(null);
    setter.setSink(inspector);
    setter.process(new BoundContainer(new Bound("Test")));
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

  @Test
  public void removeNoBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundSetter setter = new BoundSetter(null);
    setter.setSink(inspector);
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

    SinkEntityInspector inspector = new SinkEntityInspector();
    Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
    BoundSetter setter = new BoundSetter(newBound);
    setter.setSink(inspector);
    setter.process(new BoundContainer(new Bound("Test")));
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
View Full Code Here

TOP

Related Classes of es.uma.ama.maudeWorkstationGUI.ui.graph.Graph$Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.