Examples of CSSNumericValue


Examples of org.jfree.layouting.input.style.values.CSSNumericValue

            throws IOException, ReportProcessingException
    {
        firstCellSeen = false;
        expectedTableRowCount -= 1;
        final String rowStyle = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME);
        final CSSNumericValue rowHeight = computeRowHeight(rowStyle);
        // LOGGER.debug("Adding row-Style: " + rowStyle + " " + rowHeight);
        sectionHeight.add(rowHeight);

//    if (expectedTableRowCount > 0)
//    {
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

        {
            finishBuffering();
            return;
        }

        final CSSNumericValue result = sectionHeight.getResult();
        if (role == OfficeDocumentReportTarget.ROLE_PAGE_HEADER)
        {
            final PageContext pageContext = getCurrentContext();
            pageContext.setHeader(applyColumnsToPageBand(finishBuffering(), pageContext.getActiveColumns()).getXmlBuffer(), result);
        }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

            {
                outputStream.close();
                storage.closeOutputRepository();
            }

            final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0);
            final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);
            final OfficeImage officeImage = new OfficeImage("Pictures/" + name, widthVal, heightVal);
            imageCache.put(imageKey, officeImage);
            return officeImage;
        }
        catch (IOException e)
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

                }
                final byte[] data = bout.toByteArray();
                final Dimension dims = imageService.getImageSize(data);
                final String mimeType = imageService.getMimeType(data);

                final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0);
                final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);

                final String filename = copyToOutputRepository(mimeType, source, data);
                final OfficeImage officeImage = new OfficeImage(filename, widthVal, heightVal);
                imageCache.put(source, officeImage);
                return officeImage;
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

            }
            final byte[] data = bout.toByteArray();

            final Dimension dims = imageService.getImageSize(data);
            final String mimeType = imageService.getMimeType(data);
            final CSSNumericValue widthVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getWidth() / 100.0);
            final CSSNumericValue heightVal = CSSNumericValue.createValue(CSSNumericType.MM, dims.getHeight() / 100.0);

            if (preserveIRI)
            {
                final OfficeImage retval = new OfficeImage(url.toString(), widthVal, heightVal);
                imageCache.put(url, retval);
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

    {
      final ImageElementContext imageContext = (ImageElementContext)
          attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "image-context");

      // When scaling, we have to create an image-style.
      final CSSNumericValue width = image.getWidth(); // always in 100th of a mm
      final CSSNumericValue height = image.getHeight(); // always in 100th of a mm

      Log.debug("Image " + imageData + " Width: " + width + ", Height: " + height);
      if (width == null || height == null)
      {
        return;
      }

      CSSNumericValue imageAreaWidthVal;
      CSSNumericValue imageAreaHeightVal;
      String styleName = null;
      if (imageContext != null)
      {
        imageAreaWidthVal = computeImageWidth(imageContext);
        imageAreaHeightVal = computeImageHeight(imageContext);

        if (imageAreaWidthVal == null || imageAreaHeightVal == null)
        {
          Log.debug("Image data returned from context is invalid. Maybe this is not an image?");
          return;
        }
        else
        {
          // compute the clip-area ..
          final CSSNumericValue normalizedImageWidth =
              CSSValueResolverUtility.convertLength(width, imageAreaWidthVal.getType());
          final CSSNumericValue normalizedImageHeight =
              CSSValueResolverUtility.convertLength(height, imageAreaHeightVal.getType());

          final boolean scale = "true".equals(attrs.getAttribute(OfficeNamespaces.INTERNAL_NS, "scale"));
          if (scale == false && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0)
          {
            final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue();
            final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
            if (clipWidth > 0 && clipHeight > 0)
            {
              final OfficeStyle imageStyle = deriveStyle("graphic", "Graphics");
              final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, "graphic-properties");
              final StringBuffer buffer = new StringBuffer();
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

    final LengthCalculator calculator = new LengthCalculator();
    final String[] strings = imageElementContext.getColStyles();
    for (int i = 0; i < strings.length; i++)
    {
      final String styleName = strings[i];
      final CSSNumericValue value = computeColumnWidth(styleName);
      if (value != null)
      {
        calculator.add(value);
      }
    }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

    final LengthCalculator calculator = new LengthCalculator();
    final String[] strings = imageElementContext.getRowStyles();
    for (int i = 0; i < strings.length; i++)
    {
      final String styleName = strings[i];
      final CSSNumericValue value = computeRowHeight(styleName);
      if (value != null)
      {
        calculator.add(value);
      }
    }
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

        if (image != null)
        {
            final ImageElementContext imageContext = (ImageElementContext) attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, "image-context");

            // When scaling, we have to create an image-style.
            final CSSNumericValue width = image.getWidth(); // always in 100th of a mm

            final CSSNumericValue height = image.getHeight(); // always in 100th of a mm

            LOGGER.debug("Image " + imageData + " Width: " + width + ", Height: " + height);
            if (width == null || height == null)
            {
                return;
            }

            CSSNumericValue imageAreaWidthVal;
            CSSNumericValue imageAreaHeightVal;
            CSSNumericValue posX = CSSNumericValue.createValue(CSSNumericType.CM, 0.0);
            CSSNumericValue posY = CSSNumericValue.createValue(CSSNumericType.CM, 0.0);

            String styleName = null;
            if (imageContext != null)
            {
                imageAreaWidthVal = computeImageWidth(imageContext);
                imageAreaHeightVal = computeImageHeight(imageContext);

                if (imageAreaWidthVal == null || imageAreaHeightVal == null)
                {
                    LOGGER.debug("Image data returned from context is invalid. Maybe this is not an image?");
                    return;
                }
                else
                {
                    // compute the clip-area ..
                    final CSSNumericValue normalizedImageWidth =
                            CSSValueResolverUtility.convertLength(width, imageAreaWidthVal.getType());
                    final CSSNumericValue normalizedImageHeight =
                            CSSValueResolverUtility.convertLength(height, imageAreaHeightVal.getType());

                    final String scale = (String)attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE);
                    if ( OfficeToken.NONE.equals(scale) && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0)
                    {
                        final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue();
                        final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue();
                        if (clipWidth > 0 && clipHeight > 0)
                        {
                            final OfficeStyle imageStyle = deriveStyle(OfficeToken.GRAPHIC, OfficeToken.GRAPHICS);
                            final Element graphProperties = produceFirstChild(imageStyle, OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES);
                            final StringBuffer buffer = new StringBuffer();
View Full Code Here

Examples of org.jfree.layouting.input.style.values.CSSNumericValue

        final LengthCalculator calculator = new LengthCalculator();
        final String[] strings = imageElementContext.getColStyles();
        for (int i = 0; i < strings.length; i++)
        {
            final String styleName = strings[i];
            final CSSNumericValue value = computeColumnWidth(styleName);
            if (value != null)
            {
                calculator.add(value);
            }
        }
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.