Ejemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 public InlineArea get(final LayoutContext context) {
   // Create a zero-width, zero-height dummy area so this node can
   // participate in the ID handling. Otherwise, addId() wouldn't
   // be called. The area must also be added to the tree, because
   // determination of the X,Y position is done in the renderer.
   final InlineArea area = new InlineArea();
   if (this.fobj.hasId()) {
     TraitSetter.setProducerID(area, this.fobj.getId());
   }
   return area;
 }
Ejemplo n.º 2
0
  /**
   * Return an Area which can contain the passed childArea. The childArea may not yet have any
   * content, but it has essential traits set. In general, if the LayoutManager already has an Area
   * it simply returns it. Otherwise, it makes a new Area of the appropriate class. It gets a parent
   * area for its area by calling its parent LM. Finally, based on the dimensions of the parent
   * area, it initializes its own area. This includes setting the content IPD and the maximum BPD.
   *
   * @param childArea the child area
   * @return the parent area of the child
   */
  @Override
  public Area getParentArea(final Area childArea) {
    if (this.curBlockArea == null) {
      this.curBlockArea = new Block();
      // Set up dimensions
      // Must get dimensions from parent area
      /* Area parentArea = */ this.parentLayoutManager.getParentArea(this.curBlockArea);

      TraitSetter.setProducerID(this.curBlockArea, getTable().getId());

      this.curBlockArea.setIPD(getContentAreaIPD());

      setCurrentArea(this.curBlockArea);
    }
    return this.curBlockArea;
  }
Ejemplo n.º 3
0
 /**
  * Add the area for this layout manager. This adds the dummy area to the parent, *if* it has an id
  * - otherwise it serves no purpose.
  *
  * @param posIter the position iterator
  * @param context the layout context for adding the area
  */
 @Override
 public void addAreas(final PositionIterator posIter, final LayoutContext context) {
   if (this.fobj.hasId()) {
     addId();
     if (this.parentLayoutManager instanceof BlockStackingLayoutManager
         && !(this.parentLayoutManager instanceof BlockLayoutManager)) {
       final Block helperBlock = new Block();
       TraitSetter.setProducerID(helperBlock, this.fobj.getId());
       this.parentLayoutManager.addChildArea(helperBlock);
     } else {
       final InlineArea area = getEffectiveArea();
       this.parentLayoutManager.addChildArea(area);
     }
   }
   while (posIter.hasNext()) {
     posIter.next();
   }
 }