Exemplo n.º 1
0
 private BusLine addBusLine(PointInfo p1, PointInfo p2) {
   if (p1.equals(p2)) {
     return null;
   }
   BusLine aBusLine = findBusLine(p1, p2);
   if (aBusLine == null) {
     aBusLine =
         new BusLine(
             p1.getPId(),
             p2.getPId(),
             p1.getAxisX(),
             p1.getAxisY(),
             p2.getAxisX(),
             p2.getAxisY(),
             StringUtil.distance(p1.getAxisX(), p1.getAxisY(), p2.getAxisX(), p2.getAxisY()),
             busSelect.getBusId(),
             busSelect.getBusNoTh(),
             busSelect.getBusNoEn(),
             busSelect.getBusPrice(),
             mainFrame.getLineType(),
             "",
             "",
             "",
             "");
     busSelect.getBusLine().add(aBusLine);
     busSelect.setEdited();
     mainFrame.onSelectBus(busSelect);
   }
   return aBusLine;
 }