예제 #1
0
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Length distance =
                pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetLength();
            Length separation =
                pInfo.getPropertyList().GetNearestSpecifiedProperty("provisional-label-separation").GetLength();

            FObj item = pInfo.getFO();

            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("label-end() called from outside an fo:list-item");
            }
            Length startIndent = item.properties.GetProperty("start-indent").GetLength();

            LinearCombinationLength labelEnd = new LinearCombinationLength();

            LengthBase bse = new LengthBase(item, pInfo.getPropertyList(),
                                            LengthBase.CONTAINING_BOX);
            PercentLength refWidth = new PercentLength(1.0, bse);

            labelEnd.AddTerm(1.0, refWidth);
            labelEnd.AddTerm(-1.0, distance);
            labelEnd.AddTerm(-1.0, startIndent);
            labelEnd.AddTerm(1.0, separation);

            labelEnd.ComputeValue();

            return(new LengthProperty(labelEnd));
        }
예제 #2
0
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Length distance =
                pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetLength();
            Length separation =
                pInfo.getPropertyList().GetNearestSpecifiedProperty("provisional-label-separation").GetLength();

            FObj item = pInfo.getFO();
            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("label-end() called from outside an fo:list-item");
            }
            Length startIndent = item.properties.GetProperty("start-indent").GetLength();

            LinearCombinationLength labelEnd = new LinearCombinationLength();

            LengthBase bse = new LengthBase(item, pInfo.getPropertyList(),
                                            LengthBase.CONTAINING_BOX);
            PercentLength refWidth = new PercentLength(1.0, bse);

            labelEnd.AddTerm(1.0, refWidth);
            labelEnd.AddTerm(-1.0, distance);
            labelEnd.AddTerm(-1.0, startIndent);
            labelEnd.AddTerm(1.0, separation);

            labelEnd.ComputeValue();

            return new LengthProperty(labelEnd);
        }
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Number d = args[0].GetNumber();

            if (d == null)
            {
                throw new PropertyException("Non number operand to proportional-column-width function");
            }
            if (!pInfo.getPropertyList().GetElement().Equals("table-column"))
            {
                throw new PropertyException("proportional-column-width function may only be used on table-column FO");
            }
            return(new LengthProperty(new TableColLength(d.DoubleValue())));
        }
예제 #4
0
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Numeric distance = pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetNumeric();

            FObj item = pInfo.getFO();
            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("body-start() called from outside an fo:list-item");
            }

            Numeric startIndent =
                item.properties.GetProperty("start-indent").GetNumeric();

            return new NumericProperty(distance.add(startIndent));
        }
예제 #5
0
        public override Property Eval(Property[] args, PropertyInfo pInfo)
        {
            Numeric distance = pInfo.getPropertyList().GetProperty("provisional-distance-between-starts").GetNumeric();

            FObj item = pInfo.getFO();

            while (item != null && !(item is ListItem))
            {
                item = item.getParent();
            }
            if (item == null)
            {
                throw new PropertyException("body-start() called from outside an fo:list-item");
            }

            Numeric startIndent =
                item.properties.GetProperty("start-indent").GetNumeric();

            return(new NumericProperty(distance.add(startIndent)));
        }