Example #1
0
 private List<ZoneLogic> overlappedRooms(ZoneLogic zone) {
   List<ZoneLogic> overlapped = new ArrayList<ZoneLogic>();
   Area currentZoneArea = new Area(TopologyUtils.convertToAWT(zone.getPojo().getShape()));
   for (Room r : currEnv.getRooms()) {
     if (!r.equals(selectedZone)) {
       Shape testZoneShape = TopologyUtils.convertToAWT(r.getPojo().getShape());
       Area testArea = new Area(testZoneShape);
       testArea.intersect(currentZoneArea);
       if (!testArea.isEmpty()) {
         overlapped.add(r);
       }
     }
   }
   return overlapped;
 }
Example #2
0
  /** @param selectedZone */
  @Override
  public void setSelectedZone(ZoneLogic selectedZone) {
    removeIndicators();
    addIndicator(TopologyUtils.convertToAWT(selectedZone.getPojo().getShape()));
    this.selectedZone = selectedZone;
    createHandles(selectedZone);

    // highlight the other rooms
    for (Room room : getCurrEnv().getRooms()) {
      if (room != selectedZone) {
        if (zoneColors.get(room) == null) {
          zoneColors.put(room, new Color(rand(0, 255), rand(0, 255), rand(0, 255), LOW_OPACITY));
        }
        addIndicator(TopologyUtils.convertToAWT(room.getPojo().getShape()), zoneColors.get(room));
      }
    }
  }