Package org.graphstream.graph

Examples of org.graphstream.graph.Node.addAttribute()


  }

  private void renderShipment(Graph g, Shipment shipment, Label label, boolean renderShipments) {

    Node n1 = g.addNode(makeId(shipment.getId(),shipment.getPickupLocationId()));
    if(label.equals(Label.ID)) n1.addAttribute("ui.label", shipment.getId());
    n1.addAttribute("x", shipment.getPickupCoord().getX());
    n1.addAttribute("y", shipment.getPickupCoord().getY());
    n1.setAttribute("ui.class", "pickup");

    Node n2 = g.addNode(makeId(shipment.getId(),shipment.getDeliveryLocationId()));
View Full Code Here


  private void renderShipment(Graph g, Shipment shipment, Label label, boolean renderShipments) {

    Node n1 = g.addNode(makeId(shipment.getId(),shipment.getPickupLocationId()));
    if(label.equals(Label.ID)) n1.addAttribute("ui.label", shipment.getId());
    n1.addAttribute("x", shipment.getPickupCoord().getX());
    n1.addAttribute("y", shipment.getPickupCoord().getY());
    n1.setAttribute("ui.class", "pickup");

    Node n2 = g.addNode(makeId(shipment.getId(),shipment.getDeliveryLocationId()));
    if(label.equals(Label.ID)) n2.addAttribute("ui.label", shipment.getId());
View Full Code Here

  private void renderShipment(Graph g, Shipment shipment, Label label, boolean renderShipments) {

    Node n1 = g.addNode(makeId(shipment.getId(),shipment.getPickupLocationId()));
    if(label.equals(Label.ID)) n1.addAttribute("ui.label", shipment.getId());
    n1.addAttribute("x", shipment.getPickupCoord().getX());
    n1.addAttribute("y", shipment.getPickupCoord().getY());
    n1.setAttribute("ui.class", "pickup");

    Node n2 = g.addNode(makeId(shipment.getId(),shipment.getDeliveryLocationId()));
    if(label.equals(Label.ID)) n2.addAttribute("ui.label", shipment.getId());
    n2.addAttribute("x", shipment.getDeliveryCoord().getX());
View Full Code Here

    n1.addAttribute("x", shipment.getPickupCoord().getX());
    n1.addAttribute("y", shipment.getPickupCoord().getY());
    n1.setAttribute("ui.class", "pickup");

    Node n2 = g.addNode(makeId(shipment.getId(),shipment.getDeliveryLocationId()));
    if(label.equals(Label.ID)) n2.addAttribute("ui.label", shipment.getId());
    n2.addAttribute("x", shipment.getDeliveryCoord().getX());
    n2.addAttribute("y", shipment.getDeliveryCoord().getY());
    n2.setAttribute("ui.class", "delivery");

    if(renderShipments){
View Full Code Here

    n1.addAttribute("y", shipment.getPickupCoord().getY());
    n1.setAttribute("ui.class", "pickup");

    Node n2 = g.addNode(makeId(shipment.getId(),shipment.getDeliveryLocationId()));
    if(label.equals(Label.ID)) n2.addAttribute("ui.label", shipment.getId());
    n2.addAttribute("x", shipment.getDeliveryCoord().getX());
    n2.addAttribute("y", shipment.getDeliveryCoord().getY());
    n2.setAttribute("ui.class", "delivery");

    if(renderShipments){
      Edge s = g.addEdge(shipment.getId(), makeId(shipment.getId(),shipment.getPickupLocationId()),
View Full Code Here

    n1.setAttribute("ui.class", "pickup");

    Node n2 = g.addNode(makeId(shipment.getId(),shipment.getDeliveryLocationId()));
    if(label.equals(Label.ID)) n2.addAttribute("ui.label", shipment.getId());
    n2.addAttribute("x", shipment.getDeliveryCoord().getX());
    n2.addAttribute("y", shipment.getDeliveryCoord().getY());
    n2.setAttribute("ui.class", "delivery");

    if(renderShipments){
      Edge s = g.addEdge(shipment.getId(), makeId(shipment.getId(),shipment.getPickupLocationId()),
          makeId(shipment.getId(),shipment.getDeliveryLocationId()), true);
View Full Code Here

    }
    }

  private void renderService(Graph g, Service service, Label label) {
    Node n = g.addNode(makeId(service.getId(),service.getLocationId()));
    if(label.equals(Label.ID)) n.addAttribute("ui.label", service.getId());
    n.addAttribute("x", service.getCoord().getX());
    n.addAttribute("y", service.getCoord().getY());
    if(service.getType().equals("pickup")) n.setAttribute("ui.class", "pickup");
    if(service.getType().equals("delivery")) n.setAttribute("ui.class", "delivery");
  }
View Full Code Here

    }

  private void renderService(Graph g, Service service, Label label) {
    Node n = g.addNode(makeId(service.getId(),service.getLocationId()));
    if(label.equals(Label.ID)) n.addAttribute("ui.label", service.getId());
    n.addAttribute("x", service.getCoord().getX());
    n.addAttribute("y", service.getCoord().getY());
    if(service.getType().equals("pickup")) n.setAttribute("ui.class", "pickup");
    if(service.getType().equals("delivery")) n.setAttribute("ui.class", "delivery");
  }
View Full Code Here

  private void renderService(Graph g, Service service, Label label) {
    Node n = g.addNode(makeId(service.getId(),service.getLocationId()));
    if(label.equals(Label.ID)) n.addAttribute("ui.label", service.getId());
    n.addAttribute("x", service.getCoord().getX());
    n.addAttribute("y", service.getCoord().getY());
    if(service.getType().equals("pickup")) n.setAttribute("ui.class", "pickup");
    if(service.getType().equals("delivery")) n.setAttribute("ui.class", "delivery");
  }

  private String makeId(String id, String locationId) {
View Full Code Here

  private void renderVehicle(Graph g, Vehicle vehicle, Label label) {
    String nodeId = makeId(vehicle.getId(),vehicle.getStartLocationId());
    if(vehicle.getType() instanceof PenaltyVehicleType) nodeId = makeId("pen_"+vehicle.getId(),vehicle.getStartLocationId());
    Node vehicleStart = g.addNode(nodeId);
    if(label.equals(Label.ID)) vehicleStart.addAttribute("ui.label", "depot");
//    if(label.equals(Label.ACTIVITY)) n.addAttribute("ui.label", "start");
    vehicleStart.addAttribute("x", vehicle.getStartLocationCoordinate().getX());
    vehicleStart.addAttribute("y", vehicle.getStartLocationCoordinate().getY());
    vehicleStart.setAttribute("ui.class", "depot");
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.