Package org.pentaho.reporting.engine.classic.core.layout.model

Examples of org.pentaho.reporting.engine.classic.core.layout.model.BorderEdge


    final String borderStyleBottomText = atts.getValue(getUri(), "border-bottom-style");
    final BorderStyle borderStyleBottom = parseBorderStyle(borderStyleBottomText);
    final String borderStyleRightText = atts.getValue(getUri(), "border-right-style");
    final BorderStyle borderStyleRight = parseBorderStyle(borderStyleRightText);

    resultCell.setTop(new BorderEdge(borderStyleTop, borderColorTop, StrictGeomUtility.toInternalValue(borderWidthTop.floatValue())));
    resultCell.setLeft(new BorderEdge(borderStyleLeft, borderColorLeft, StrictGeomUtility.toInternalValue(borderWidthLeft.floatValue())));
    resultCell.setBottom(new BorderEdge(borderStyleBottom, borderColorBottom, StrictGeomUtility.toInternalValue(borderWidthBottom.floatValue())));
    resultCell.setRight(new BorderEdge(borderStyleRight, borderColorRight, StrictGeomUtility.toInternalValue(borderWidthRight.floatValue())));

    resultCell.setTopLeft(parseCornerRadius("border-top-left-radius", atts));
    resultCell.setTopRight(parseCornerRadius("border-top-right-radius", atts));
    resultCell.setBottomLeft(parseCornerRadius("border-bottom-left-radius", atts));
    resultCell.setBottomRight(parseCornerRadius("border-bottom-right-radius", atts));
View Full Code Here


    final BoxDefinition definition = box.getBoxDefinition();
    final Border border = definition.getBorder();
    final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();

    final BorderEdge top = border.getTop();
    if (BorderEdge.EMPTY.equals(top) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-color",
          ColorValueConverter.colorToString(top.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderTop())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-style",
          String.valueOf(top.getBorderStyle()));
    }

    final BorderEdge left = border.getLeft();
    if (BorderEdge.EMPTY.equals(left) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-color",
          ColorValueConverter.colorToString(left.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderLeft())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-style",
          String.valueOf(left.getBorderStyle()));
    }

    final BorderEdge bottom = border.getBottom();
    if (BorderEdge.EMPTY.equals(bottom) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-color",
          ColorValueConverter.colorToString(bottom.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderBottom())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-style",
          String.valueOf(bottom.getBorderStyle()));
    }

    final BorderEdge right = border.getRight();
    if (BorderEdge.EMPTY.equals(right) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-color",
          ColorValueConverter.colorToString(right.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderRight())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-style",
          String.valueOf(right.getBorderStyle()));
    }

    final BorderCorner topLeft = border.getTopLeft();
    if (isEmptyCorner(topLeft) == false)
    {
View Full Code Here

  private AttributeList createCellAttributes(final CellBackground border)
  {
    final AttributeList attributeList = new AttributeList();

    final BorderEdge top = border.getTop();
    if (BorderEdge.EMPTY.equals(top) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-color",
          ColorValueConverter.colorToString(top.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(top.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-style",
          String.valueOf(top.getBorderStyle()));
    }

    final BorderEdge left = border.getLeft();
    if (BorderEdge.EMPTY.equals(left) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-color",
          ColorValueConverter.colorToString(left.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(left.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-style",
          String.valueOf(left.getBorderStyle()));
    }

    final BorderEdge bottom = border.getBottom();
    if (BorderEdge.EMPTY.equals(bottom) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-color",
          ColorValueConverter.colorToString(bottom.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(bottom.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-style",
          String.valueOf(bottom.getBorderStyle()));
    }

    final BorderEdge right = border.getRight();
    if (BorderEdge.EMPTY.equals(right) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-color",
          ColorValueConverter.colorToString(right.getColor()));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(right.getWidth())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-style",
          String.valueOf(right.getBorderStyle()));
    }

    final BorderCorner topLeft = border.getTopLeft();
    if (isEmptyCorner(topLeft) == false)
    {
View Full Code Here

    {
      return null;
    }

    final Color c = (Color) style.getStyleProperty(ElementStyleKeys.PAINT);
    return new BorderEdge(borderStyle, c, StrictGeomUtility.toInternalValue(bs.getLineWidth()));
  }
View Full Code Here

    final Color backgroundColor = background.getBackgroundColor();
    if (backgroundColor != null)
    {
      cell.setBackgroundColor(backgroundColor);
    }
    final BorderEdge top = background.getTop();
    if (BorderEdge.EMPTY.equals(top) == false)
    {
      cell.setBorderColorTop(top.getColor());
      cell.setBorderWidthTop((float) StrictGeomUtility.toExternalValue(top.getWidth()));
    }

    final BorderEdge left = background.getLeft();
    if (BorderEdge.EMPTY.equals(left) == false)
    {
      cell.setBorderColorLeft(left.getColor());
      cell.setBorderWidthLeft((float) StrictGeomUtility.toExternalValue(left.getWidth()));
    }

    final BorderEdge bottom = background.getBottom();
    if (BorderEdge.EMPTY.equals(bottom) == false)
    {
      cell.setBorderColorBottom(bottom.getColor());
      cell.setBorderWidthBottom((float) StrictGeomUtility.toExternalValue(bottom.getWidth()));
    }

    final BorderEdge right = background.getRight();
    if (BorderEdge.EMPTY.equals(right) == false)
    {
      cell.setBorderColorRight(right.getColor());
      cell.setBorderWidthRight((float) StrictGeomUtility.toExternalValue(right.getWidth()));
    }
  }
View Full Code Here

    final BoxDefinition definition = box.getBoxDefinition();
    final Border border = definition.getBorder();
    final StaticBoxLayoutProperties sblp = box.getStaticBoxLayoutProperties();

    final BorderEdge top = border.getTop();
    if (BorderEdge.EMPTY.equals(top) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-color",
          convertColorToString(top));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderTop())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-top-style",
          String.valueOf(top.getBorderStyle()));
    }

    final BorderEdge left = border.getLeft();
    if (BorderEdge.EMPTY.equals(left) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-color",
          convertColorToString(left));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderLeft())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-left-style",
          String.valueOf(left.getBorderStyle()));
    }

    final BorderEdge bottom = border.getBottom();
    if (BorderEdge.EMPTY.equals(bottom) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-color",
          convertColorToString(bottom));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderBottom())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-bottom-style",
          String.valueOf(bottom.getBorderStyle()));
    }

    final BorderEdge right = border.getRight();
    if (BorderEdge.EMPTY.equals(right) == false || ignoreEmptyBorders == false)
    {
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-color",
          convertColorToString(right));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-width",
          pointConverter.format(StrictGeomUtility.toExternalValue(sblp.getBorderRight())));
      attributeList.setAttribute(XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "border-right-style",
          String.valueOf(right.getBorderStyle()));
    }

    final BorderCorner topLeft = border.getTopLeft();
    if (isEmptyCorner(topLeft) == false)
    {
View Full Code Here

      styleBuilder.clear();

      if (struct.isFailed() == false)
      {
        final Color commonBackgroundColor = struct.getColor();
        final BorderEdge top = struct.getTopEdge();
        final BorderEdge bottom = struct.getBottomEdge();
        if (commonBackgroundColor != null)
        {
          styleBuilder.append(DefaultStyleBuilder.CSSKeys.BACKGROUND_COLOR, HtmlColors.getColorString(commonBackgroundColor));
        }
        if (BorderEdge.EMPTY.equals(top) == false)
View Full Code Here

                             final BoxDefinition boxDefinition,
                             final FilterStyleBuilder filterStyleBuilder,
                             final NumberFormat pointConverter)
  {
    final Border border = boxDefinition.getBorder();
    final BorderEdge top = border.getTop();
    final BorderEdge left = border.getLeft();
    final BorderEdge bottom = border.getBottom();
    final BorderEdge right = border.getRight();
    if (top.equals(left) &&
        top.equals(right) &&
        top.equals(bottom))
    {
      if (BorderEdge.EMPTY.equals(top) == false)
View Full Code Here

      if (colorValue != null)
      {
        styleBuilder.append(DefaultStyleBuilder.CSSKeys.BACKGROUND_COLOR, HtmlColors.getColorString(colorValue));
      }

      final BorderEdge topEdge = background.getTop();
      final BorderEdge leftEdge = background.getLeft();
      final BorderEdge bottomEdge = background.getBottom();
      final BorderEdge rightEdge = background.getRight();
      if (topEdge.equals(leftEdge) &&
          topEdge.equals(rightEdge) &&
          topEdge.equals(bottomEdge))
      {
        if (BorderEdge.EMPTY.equals(topEdge) == false)
View Full Code Here

        g2d.fill(borderShape);
      }

      if (staticBoxLayoutProperties.getBorderTop() > 0)
      {
        final BorderEdge borderEdge = border.getTop();

        final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderTop());
        if (basicStroke != null)
        {
          g2d.setColor(borderEdge.getColor());
          g2d.setStroke(basicStroke);
          g2d.draw(borderShape);
        }
      }
      g2d.setColor(oldColor);
      g2d.setStroke(oldStroke);
      return;
    }


    if (backgroundColor != null)
    {
      final Shape borderShape = getBorderShape();
      g2d.setColor(backgroundColor);
      g2d.fill(borderShape);
    }

    final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
    if (sblp.getBorderTop() > 0)
    {
      final BorderEdge borderEdge = border.getTop();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderTop());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderTopShape());
      }
    }

    if (sblp.getBorderRight() > 0)
    {
      final BorderEdge borderEdge = border.getRight();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderRight());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderRightShape());
      }
    }

    if (sblp.getBorderBottom() > 0)
    {
      final BorderEdge borderEdge = border.getBottom();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderBottom());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderBottomShape());
      }
    }

    if (sblp.getBorderLeft() > 0)
    {
      final BorderEdge borderEdge = border.getLeft();
      final BasicStroke basicStroke = createStroke(borderEdge, staticBoxLayoutProperties.getBorderLeft());
      if (basicStroke != null)
      {
        g2d.setColor(borderEdge.getColor());
        g2d.setStroke(basicStroke);
        g2d.draw(getBorderLeftShape());
      }
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.model.BorderEdge

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.