Package shapes

Examples of shapes.Point2DExt


    start = source.start;
    end = source.end;
   
    shape = new Line2DExt(source.shape);
    from = new Point2DExt(source.from);

    vehicleSelection = new TypeSelection<VehicleType>(source.vehicleSelection);

    SetDependencies();
  }
View Full Code Here


  public void setEndTime(int endTime) {
    this.endTime = endTime;
  }

  public void setFrom(Point2D.Float from) {
    this.from = new Point2DExt(from.x, from.y);
  }
View Full Code Here

            String[] from = coord.split(",");

            double fromx = Double.parseDouble(from[0]);
            double fromy = Double.parseDouble(from[1]);

            points.add(new Point2DExt(fromx, fromy));
          }

          l.SetShape(points);

          e.AddLane(l);
View Full Code Here

    // Create the school's shape
    shape = new Rectangle2DExt();
    shape.setFrameFromCenter(location.x, location.y, location.x + 15, location.y + 15);

    this.location = new Point2DExt(location);

    // Create the handle
    List<Handle> handles = new ArrayList<Handle>();
    handles.add(new Handle(location, "location", MotionRestriction.None));
View Full Code Here

  public School(School source) {
    super(source);

    closestEdge = source.closestEdge;

    location = new Point2DExt(source.location);
    shape = new Rectangle2DExt(source.shape);

    schoolType = source.schoolType;
    capacity = source.capacity;
    timeClosing = source.timeClosing;
View Full Code Here

    return "<html>" + "<b>School</b> " + name + "<br>" + "<b>Type:</b> " + schoolType.name() + "<br>" + "<b>Time opening:</b> " + TimeConverter.toString(timeOpening) + "<br>" + "<b>Time closing:</b> " + TimeConverter.toString(timeClosing) + "<br>" + "<b>Capacity:</b> " + String.valueOf(capacity) + "</html>";
  }

  public void handleLocationChanged(Handle h) {
    if (h.getName().equals("location")) {
      location = new Point2DExt(h.getLocation());

      shape.setFrameFromCenter(location.x, location.y, location.x + 15, location.y + 15);
    }
  }
View Full Code Here

   *            the handle's name
   * @param restriction
   *            the handle's motion restriction
   */
  public Handle(Point2D.Double location, String name, MotionRestriction restriction) {
    this.location = new Point2DExt(location);
    this.name = name;
    this.restriction = restriction;
  }
View Full Code Here

   * Constructor that creates a new handle as a copy of the specified handle
   *
   * @param source
   */
  public Handle(Handle source) {
    this.location = new Point2DExt(source.location);
    this.name = source.name;
    this.restriction = source.restriction;
  }
View Full Code Here

    name = "Accident " + String.valueOf(increment++);

    this.edge = edge;

    this.location = new Point2DExt(location);
   
    shape = new Rectangle2DExt(location.x-10,location.y-10,20,20);

    //Find the point on the edge where the accident happens relative to the edge starting point
    Point2D edgeStartingPoint = edge.getLanes().get(0).GetPoint(0);
View Full Code Here

    if (isSelected) {
      g.setColor(Color.GREEN);
    }
   
    // Draw the shape
    Line2DExt l1= new Line2DExt(new Point2DExt(location.x-10,location.y-10),new Point2DExt(location.x+10,location.y+10));
    Line2DExt l2= new Line2DExt(new Point2DExt(location.x-10,location.y+10),new Point2DExt(location.x+10,location.y-10));
   
    Stroke previousStroke = g.getStroke();
   
    g.setStroke(new BasicStroke(6,BasicStroke.CAP_ROUND,BasicStroke.JOIN_MITER));
    g.draw(l1);
View Full Code Here

TOP

Related Classes of shapes.Point2DExt

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.