Package org.apache.fop.datatypes

Examples of org.apache.fop.datatypes.Length


     *
     */
    private void initializeColumnWidths() {
       
        TableColumn col;
        Length colWidth;
       
        for (int i = columns.size(); --i >= 0;) {
            if (columns.get(i) != null) {
                col = (TableColumn) columns.get(i);
                colWidth = col.getColumnWidth();
View Full Code Here


        /* calculate the total width (specified absolute/percentages),
         * and work out the total number of factors to use to distribute
         * the remaining space (if any)
         */
        for (Iterator i = colWidths.iterator(); i.hasNext();) {
            Length colWidth = (Length) i.next();
            if (colWidth != null) {
                sumCols += colWidth.getValue(tlm);
                if (colWidth instanceof TableColLength) {
                    factors +=
                        ((TableColLength) colWidth).getTableUnits();
                }
            }
View Full Code Here

        //int h = this.propertyList.get("height").getLength().mvalue();

        // use specified line-height then ignore dimension in height direction
        boolean hasLH = false; //propertyList.get("line-height").getSpecifiedValue() != null;

        Length len;

        int bpd = -1;
        int ipd = -1;
        if (hasLH) {
            bpd = fobj.getLineHeight().getOptimum(this).getLength().getValue(this);
        } else {
            // this property does not apply when the line-height applies
            // isn't the block-progression-dimension always in the same
            // direction as the line height?
            len = fobj.getBlockProgressionDimension().getOptimum(this).getLength();
            if (len.getEnum() != EN_AUTO) {
                bpd = len.getValue(this);
            } else {
                len = fobj.getHeight();
                if (len.getEnum() != EN_AUTO) {
                    bpd = len.getValue(this);
                }
            }
        }

        len = fobj.getInlineProgressionDimension().getOptimum(this).getLength();
        if (len.getEnum() != EN_AUTO) {
            ipd = len.getValue(this);
        } else {
            len = fobj.getWidth();
            if (len.getEnum() != EN_AUTO) {
                ipd = len.getValue(this);
            }
        }

        // if auto then use the intrinsic size of the content scaled
        // to the content-height and content-width
        int cwidth = -1;
        int cheight = -1;
        len = fobj.getContentWidth();
        if (len.getEnum() != EN_AUTO) {
            if (len.getEnum() == EN_SCALE_TO_FIT) {
                if (ipd != -1) {
                    cwidth = ipd;
                }
            } else {
                cwidth = len.getValue(this);
            }
        }
        len = fobj.getContentHeight();
        if (len.getEnum() != EN_AUTO) {
            if (len.getEnum() == EN_SCALE_TO_FIT) {
                if (bpd != -1) {
                    cheight = bpd;
                }
            } else {
                cheight = len.getValue(this);
            }
        }

        int scaling = fobj.getScaling();
        if ((scaling == EN_UNIFORM) || (cwidth == -1) || cheight == -1) {
View Full Code Here

   * is returned.
   */
  public Length asLength() {
    if (dim == 1) {
      if (valType == ABS_LENGTH) {
  return new Length((int)absValue);
      }
      PercentLength pclen = null;
      if ((valType & PC_LENGTH)!=0)  {
  pclen = new PercentLength(pcValue, pcBase);
        if (valType == PC_LENGTH)
View Full Code Here

            }
            if (p instanceof NumberProperty) {
                //Assume pixels (like in HTML) when there's no unit
                return FixedLength.getInstance(p.getNumeric().getNumericValue(), "px");
            }
            Length val = p.getLength();
            if (val != null) {
                return (Property) val;
            }
            /* always null ?? */
            return convertPropertyDatatype(p, propertyList, fo);
View Full Code Here

    /**
     * @return the "alignment-adjust" property
     */
    public Length getAlignmentAdjust() {
        if (alignmentAdjust.getEnum() == EN_AUTO) {
            final Length intrinsicAlignmentAdjust = this.getIntrinsicAlignmentAdjust();
            if (intrinsicAlignmentAdjust != null) {
                return intrinsicAlignmentAdjust;
            }
        }
        return alignmentAdjust;
View Full Code Here

                    break;
                case FO_TABLE_CELL:
                    TableCell cell = (TableCell) child;
                    int colNr = cell.getColumnNumber();
                    int colSpan = cell.getNumberColumnsSpanned();
                    Length colWidth = null;

                    if (cell.getWidth().getEnum() != EN_AUTO
                            && colSpan == 1) {
                        colWidth = cell.getWidth();
                    }
View Full Code Here

  if (pval != null && pval.equals("auto"))
    return new LengthProperty(Length.AUTO);
      }
      if (p instanceof LengthProperty)
  return p;
      Length val = p.getLength();
      if (val != null)
  return new LengthProperty(val);
      return convertPropertyDatatype(p, propertyList, fo);
    }
View Full Code Here

            TableBody body = (TableBody) getParent();
            if (body.isFirst(this)) {
                TableCell cell = (TableCell) child;
                int colNr = cell.getColumnNumber();
                int colSpan = cell.getNumberColumnsSpanned();
                Length colWidth = null;

                if (cell.getWidth().getEnum() != EN_AUTO
                        && colSpan == 1) {
                    colWidth = cell.getWidth();
                }
View Full Code Here

     * is returned.
     */
    public Length asLength() {
        if (dim == 1) {
            if (valType == ABS_LENGTH) {
                return new Length((int)absValue);
            }
            PercentLength pclen = null;
            if ((valType & PC_LENGTH) != 0) {
                pclen = new PercentLength(pcValue, pcBase);
                if (valType == PC_LENGTH)
View Full Code Here

TOP

Related Classes of org.apache.fop.datatypes.Length

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.