示例#1
0
 public boolean setTurnType(TurnType turnType) {
   if (turnType != this.turnType) {
     this.turnType = turnType;
     TurnPathHelper.calcTurnPath(pathForTurn, turnType, null);
     onBoundsChange(getBounds());
     return true;
   }
   return false;
 }
 private static Path getPathFromTurnType(
     List<Path> paths, int laneType, Path defaultType, float coef) {
   if (laneType == 0) {
     return defaultType;
   }
   while (paths.size() <= laneType) {
     paths.add(null);
   }
   Path p = paths.get(laneType);
   if (p != null) {
     return p;
   }
   p = new Path();
   Matrix pathTransform = new Matrix();
   pathTransform.postScale(coef, coef);
   TurnType tp = TurnType.valueOf(laneType, false);
   TurnPathHelper.calcTurnPath(p, tp, pathTransform);
   paths.set(laneType, p);
   return p;
 }