Package org.pentaho.reporting.engine.classic.core.style

Examples of org.pentaho.reporting.engine.classic.core.style.StyleSheet


    if (box.getStaticBoxLayoutProperties().isVisible() == false)
    {
      return false;
    }

    final StyleSheet styleSheet = box.getStyleSheet();
    final Color textColor = (Color) styleSheet.getStyleProperty(ElementStyleKeys.PAINT);
    final String fontName = (String) styleSheet.getStyleProperty(TextStyleKeys.FONT);
    final short fontSize = (short) styleSheet.getIntStyleProperty(TextStyleKeys.FONTSIZE, 0);
    final boolean bold = styleSheet.getBooleanStyleProperty(TextStyleKeys.BOLD);
    final boolean italic = styleSheet.getBooleanStyleProperty(TextStyleKeys.ITALIC);
    final boolean underline = styleSheet.getBooleanStyleProperty(TextStyleKeys.UNDERLINED);
    final boolean strikethrough = styleSheet.getBooleanStyleProperty(TextStyleKeys.STRIKETHROUGH);
    final HSSFFontWrapper wrapper = new HSSFFontWrapper
        (fontName, fontSize, bold, italic, underline, strikethrough, colorProducer.getNearestColor(textColor));
    final RichTextFormat rtf = new RichTextFormat(getTextLength(), wrapper);

    // Check the style.
View Full Code Here


    if (box.getBoxDefinition().getBorder().isEmpty() == false)
    {
      return MARKER_DEFINITION;
    }

    final StyleSheet styleSheet = box.getStyleSheet();
    if (styleSheet.getStyleProperty(ElementStyleKeys.BACKGROUND_COLOR) != null)
    {
      return MARKER_DEFINITION;
    }

    if (styleSheet.getStyleProperty(ElementStyleKeys.ANCHOR_NAME) != null)
    {
      return MARKER_DEFINITION;
    }
    return null;
  }
View Full Code Here

    {
      return null;
    }
    final RenderableReplacedContentBox contentBox = (RenderableReplacedContentBox) box;

    final StyleSheet styleSheet = box.getStyleSheet();
    final RenderableReplacedContent rpc = contentBox.getContent();
    final Object rawContentObject = rpc.getRawObject();
    if (rawContentObject instanceof DrawableWrapper == false)
    {
      return null;
    }
    final DrawableWrapper wrapper = (DrawableWrapper) rawContentObject;
    final Object rawbackend = wrapper.getBackend();
    if (rawbackend instanceof ShapeDrawable == false)
    {
      return null;
    }
    final ShapeDrawable drawable = (ShapeDrawable) rawbackend;
    final Shape rawObject = drawable.getShape();

    final boolean draw = styleSheet.getBooleanStyleProperty(ElementStyleKeys.DRAW_SHAPE);
    if (draw && rawObject instanceof Line2D)
    {
      final int lineType;
      final long coordinate;
      final Line2D line = (Line2D) rawObject;

      final boolean vertical = line.getX1() == line.getX2();
      final boolean horizontal = line.getY1() == line.getY2();
      if (vertical && horizontal)
      {
        return null;
      }
      if (vertical)
      {
        lineType = SheetLayoutTableCellDefinition.LINE_HINT_VERTICAL;
        coordinate = StrictGeomUtility.toInternalValue(line.getX1()) + box.getX();
      }
      else if (horizontal)
      {
        lineType = SheetLayoutTableCellDefinition.LINE_HINT_HORIZONTAL;
        coordinate = StrictGeomUtility.toInternalValue(line.getY1()) + box.getY() + shift;
      }
      else
      {
        return null;
      }

      return new SheetLayoutTableCellDefinition(lineType, coordinate);
    }

    if (rawObject instanceof Rectangle2D ||
        (ellipseAsRectangle && rawObject instanceof Ellipse2D))
    {
      if (draw)
      {
        final BorderEdge edge = ProcessUtility.produceBorderEdge(box.getStyleSheet());
        if (edge != null)
        {
          return MARKER_DEFINITION;
        }
      }
      if (styleSheet.getBooleanStyleProperty(ElementStyleKeys.FILL_SHAPE))
      {
        return MARKER_DEFINITION;
      }

      return null;
    }

    if (rawObject instanceof RoundRectangle2D)
    {
      if (draw)
      {
        // the beast has a border ..
        final BorderEdge edge = ProcessUtility.produceBorderEdge(box.getStyleSheet());
        if (edge != null)
        {
          return MARKER_DEFINITION;
        }
      }
      if (styleSheet.getBooleanStyleProperty(ElementStyleKeys.FILL_SHAPE))
      {
        return MARKER_DEFINITION;
      }

      return null;
View Full Code Here

      if (rawContent != null)
      {
        xmlWriter.writeText(String.valueOf(rawContent));
      }

      final StyleSheet styleSheet = box.getStyleSheet();
      final String target = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TARGET);
      if (target != null)
      {
        final String window = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_WINDOW);
        final AttributeList linkAttr = new AttributeList();
        linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, HREF_ATTR, target);
        if (window != null && StringUtils.startsWithIgnoreCase(target, "javascript:") == false)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TARGET_ATTR, normalizeWindow(window));
        }
        final String title = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TITLE);
        if (title != null)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TITLE_ATTR, title);
        }
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, linkAttr, XmlWriterSupport.OPEN);
View Full Code Here

    if (box.getStaticBoxLayoutProperties().isVisible() == false)
    {
      return;
    }

    final StyleSheet styleSheet = box.getStyleSheet();
    final String target = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TARGET);
    if (target != null)
    {
      final String window = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_WINDOW);
      final AttributeList linkAttr = new AttributeList();
      linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, HREF_ATTR, target);
      if (window != null && StringUtils.startsWithIgnoreCase(target, "javascript:") == false)
      {
        linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TARGET_ATTR, normalizeWindow(window));
      }
      final String title = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TITLE);
      if (title != null)
      {
        linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TITLE_ATTR, title);
      }
View Full Code Here

      if (rawContent != null)
      {
        xmlWriter.writeText(String.valueOf(rawContent));
      }

      final StyleSheet styleSheet = box.getStyleSheet();
      if (firstElement != box)
      {
        final String anchor = (String) styleSheet.getStyleProperty(ElementStyleKeys.ANCHOR_NAME);
        if (anchor != null)
        {
          xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, "name", anchor, XmlWriterSupport.CLOSE);
        }
      }
      final String target = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TARGET);
      if (target != null)
      {
        final String window = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_WINDOW);
        final AttributeList linkAttr = new AttributeList();
        linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, HREF_ATTR, target);
        if (window != null && StringUtils.startsWithIgnoreCase(target, "javascript:") == false)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TARGET_ATTR, normalizeWindow(window));
        }
        final String title = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TITLE);
        if (title != null)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TITLE_ATTR, title);
        }
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, linkAttr, XmlWriterSupport.OPEN);
View Full Code Here

      if (rawContent != null)
      {
        xmlWriter.writeText(String.valueOf(rawContent));
      }

      final StyleSheet styleSheet = box.getStyleSheet();
      if (firstElement != box)
      {
        final String anchor = (String) styleSheet.getStyleProperty(ElementStyleKeys.ANCHOR_NAME);
        if (anchor != null)
        {
          xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, "name", anchor, XmlWriterSupport.CLOSE);
        }
      }

      final String target = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TARGET);
      if (target != null)
      {
        final String window = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_WINDOW);
        final AttributeList linkAttr = new AttributeList();
        linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, HREF_ATTR, target);
        if (window != null && StringUtils.startsWithIgnoreCase(target, "javascript:") == false)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TARGET_ATTR, normalizeWindow(window));
        }
        final String title = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TITLE);
        if (title != null)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TITLE_ATTR, title);
        }
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, linkAttr, XmlWriterSupport.OPEN);
View Full Code Here

      if (rawContent != null)
      {
        xmlWriter.writeText(String.valueOf(rawContent));
      }

      final StyleSheet styleSheet = box.getStyleSheet();
      if (firstElement != box)
      {
        final String anchor = (String) styleSheet.getStyleProperty(ElementStyleKeys.ANCHOR_NAME);
        if (anchor != null)
        {
          xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, "name", anchor, XmlWriterSupport.CLOSE);
        }
      }

      final String target = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TARGET);
      if (target != null)
      {
        final String window = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_WINDOW);
        final AttributeList linkAttr = new AttributeList();
        linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, HREF_ATTR, target);
        if (window != null && StringUtils.startsWithIgnoreCase(target, "javascript:") == false)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TARGET_ATTR, normalizeWindow(window));
        }
        final String title = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TITLE);
        if (title != null)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TITLE_ATTR, title);
        }
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, linkAttr, XmlWriterSupport.OPEN);
View Full Code Here

      if (attrs.isEmpty() == false)
      {
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, DIV_TAG, attrs, XmlWriterSupport.OPEN);
      }

      final StyleSheet styleSheet = node.getStyleSheet();
      final String anchor = (String) styleSheet.getStyleProperty(ElementStyleKeys.ANCHOR_NAME);
      if (anchor != null)
      {
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, "name", anchor, XmlWriterSupport.CLOSE);
      }

      final String target = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TARGET);
      if (target != null)
      {
        final String window = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_WINDOW);
        final AttributeList linkAttr = new AttributeList();
        linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, HREF_ATTR, target);
        if (window != null && StringUtils.startsWithIgnoreCase(target, "javascript:") == false)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TARGET_ATTR, normalizeWindow(window));
        }
        final String title = (String) styleSheet.getStyleProperty(ElementStyleKeys.HREF_TITLE);
        if (title != null)
        {
          linkAttr.setAttribute(HtmlPrinter.XHTML_NAMESPACE, TITLE_ATTR, title);
        }
        xmlWriter.writeTag(HtmlPrinter.XHTML_NAMESPACE, A_TAG, linkAttr, XmlWriterSupport.OPEN);
View Full Code Here

    final long contentWidth = content.getContentWidth();
    final long nodeWidth = rc.getWidth();
    final long contentHeight = content.getContentHeight();
    final long nodeHeight = rc.getHeight();

    final StyleSheet styleSheet = rc.getStyleSheet();
    if (styleSheet.getBooleanStyleProperty(ElementStyleKeys.SCALE))
    {
      if (styleSheet.getBooleanStyleProperty(ElementStyleKeys.KEEP_ASPECT_RATIO) &&
          (contentWidth > 0 && contentHeight > 0))
      {
        final double scaleFactor = Math.min(nodeWidth / (double) contentWidth, nodeHeight / (double) contentHeight);

        styleBuilder.append(WIDTH_STYLE, pointConverter.format
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.style.StyleSheet

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.