Examples of Length


Examples of org.apache.fop.datatypes.Length

                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

Examples of org.apache.fop.datatypes.Length

            if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer)
                    && ((Integer) widthRaw).intValue() > ((Integer) heightRaw).intValue()) {
                attrib.set(RtfPage.LANDSCAPE);
            }

            Length pageTop = pagemaster.getCommonMarginBlock().marginTop;
            Length pageBottom = pagemaster.getCommonMarginBlock().marginBottom;
            Length pageLeft = pagemaster.getCommonMarginBlock().marginLeft;
            Length pageRight = pagemaster.getCommonMarginBlock().marginRight;

            Length bodyTop = pageTop;
            Length bodyBottom = pageBottom;
            Length bodyLeft = pageLeft;
            Length bodyRight = pageRight;

            if (body != null) {
                // Should perhaps be replaced by full reference-area handling.
                CommonMarginBlock bodyMargin = body.getCommonMarginBlock();
                bodyTop = (Length) NumericOp.addition(pageTop, bodyMargin.marginTop);
                bodyBottom = (Length) NumericOp.addition(pageBottom, bodyMargin.marginBottom);
                bodyLeft = (Length) NumericOp.addition(pageLeft, bodyMargin.marginLeft);
                bodyRight = (Length) NumericOp.addition(pageRight, bodyMargin.marginRight);
            }

            attrib.setTwips(RtfPage.MARGIN_TOP, bodyTop);
            attrib.setTwips(RtfPage.MARGIN_BOTTOM, bodyBottom);
            attrib.setTwips(RtfPage.MARGIN_LEFT, bodyLeft);
            attrib.setTwips(RtfPage.MARGIN_RIGHT, bodyRight);

            //region-before attributes
            Length beforeTop = pageTop;
            if (before != null) {
                beforeTop = (Length) NumericOp.addition(pageTop, before.getExtent());
            }
            attrib.setTwips(RtfPage.HEADERY, beforeTop);

            //region-after attributes
            Length afterBottom = pageBottom;
            if (after != null) {
                afterBottom = (Length) NumericOp.addition(pageBottom, after.getExtent());
            }
            attrib.setTwips(RtfPage.FOOTERY, afterBottom);
        } catch (Exception e) {
View Full Code Here

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

Examples of org.apache.fop.datatypes.Length

        /* 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(percentBaseContext);
                if (colWidth instanceof TableColLength) {
                    factors += ((TableColLength) colWidth).getTableUnits();
                }
            }
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.jsr283.qom.Length

    /**
     * Test case for {@link QueryObjectModelFactory#length(PropertyValue)}
     */
    public void testLength() throws RepositoryException {
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        Length len = qomFactory.length(propValue);
        assertNotNull("Property value must not be null", len.getPropertyValue());
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.commons.query.jsr283.qom.Length

    /**
     * Test case for {@link QueryObjectModelFactory#length(PropertyValue)}
     */
    public void testLength() throws RepositoryException {
        PropertyValue propValue = qomFactory.propertyValue(propertyName1);
        Length len = qomFactory.length(propValue);
        assertNotNull("Property value must not be null", len.getPropertyValue());
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.Length

{
    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {
        Length annotation = metaDataEntry.getValue(Length.class);
        LengthValidator lengthValidator = (LengthValidator)facesContext.getApplication()
                                            .createValidator("javax.faces.Length");

        lengthValidator.setMinimum(annotation.minimum());
        lengthValidator.setMaximum(annotation.maximum());

        lengthValidator.validate(facesContext, uiComponent, convertedObject);
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.Length

public class LengthMetaDataTransformer  extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        Length annotation = metaDataEntry.getValue(Length.class);

        int minimum = annotation.minimum();

        if(minimum != 0)
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH, minimum);
        }
        else
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH_DEFAULT, minimum);
        }

        int maximum = annotation.maximum();
        if(maximum != Integer.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.MAX_LENGTH, maximum);
        }
        else
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.css2.value.Length

   * @return
   */
  private int getInsetProperty(String propertyName) {
    Object obj = this.getStyleProperty(propertyName);
    if (obj instanceof Length) {
      Length l = (Length) obj;
      if (l.isPercentage()) {
        return 0; // FIXME:
      }
            return l.getValue();
    }

    return 0;
  }
View Full Code Here

Examples of org.elevenbits.westvleteren.model.item.Length

    protected void tearDown() throws Exception {
      manager = null;
    }

    public void testAddAndRemoveLength() throws Exception {
      Length length = new Length(new BigDecimal("135"));
      length = manager.saveLength(length);
      assertNotNull(length.getId());
      if (log.isDebugEnabled()) {
        log.debug("Length created: " + length);
      }     
      Integer id = length.getId();
      manager.removeLength(length);
      try {
        length = manager.getLength(id);
            fail("'badlengthname' found in database, failing test...");
      } catch (ObjectRetrievalFailureException orfe) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.