Exemplo n.º 1
0
  public FBounds layoutPattern(LayoutManager manager) {

    double height = timerEvent.getHeight() + LayoutManager.HSPACING;
    double width = timerEvent.getWidth();

    double eventX;

    if (getNestedPatterns().isEmpty()) {
      height += placeHolder.getHeight();
      width = Math.max(width, placeHolder.getWidth());

      placeHolder.setCenter(0, height / 2 - placeHolder.getHeight() / 2);

      eventX = 0;
    } else {
      Pattern p = getNestedPattern();
      FBounds pSize = p.getBounds();
      eventX = -pSize.width / 2 + manager.getOriginOffset(p).x;

      height += pSize.height;
      width = Math.max(width, pSize.width);
      manager.setPatternPosition(p, -pSize.width / 2, height / 2 - pSize.height);
    }

    timerEvent.setCenter(eventX, -height / 2 + timerEvent.getHeight() / 2);

    getBorder().setClientRectangle(-width / 2, -height / 2, width, height);
    return getBorder().getBounds();
  }
Exemplo n.º 2
0
  public void createPlaceholders(Pattern draggedPattern, Collection<PlaceHolder> placeHolders) {
    if (draggedPattern == this) return;
    if (isNestedIn(draggedPattern)) return;
    if (!(draggedPattern.getOMReference() instanceof Activity)) return;

    if (placeHolder.getPattern() != null) {
      placeHolders.add(new InnerPlaceHolder(draggedPattern));
    }
  }