Exemplo n.º 1
0
 /**
  * @param obj
  * @return
  */
 protected Shape getCachedShape(EnvObjectLogic obj) {
   if (cachedShapes.containsKey(obj.getPojo().getUUID())) {
     return cachedShapes.get(obj.getPojo().getUUID());
   } else {
     return applyShapeModifiers(obj);
   }
 }
Exemplo n.º 2
0
  private Shape applyShapeModifiers(EnvObjectLogic object) {
    EnvObject obj = object.getPojo();
    int x = obj.getCurrentRepresentation().getOffset().getX();
    int y = obj.getCurrentRepresentation().getOffset().getY();
    Shape shape = TopologyUtils.convertToAWT(obj.getShape());
    shape = getTranslatedShape(shape, new Point(x, y));
    shape = getRotatedShape(shape, obj.getCurrentRepresentation().getRotation());
    cachedShapes.put(object.getPojo().getUUID(), shape);

    return shape;
  }