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

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


        if (background.getBackgroundColor() != null)
        {
          this.color = colorProducer.getNearestColor(background.getBackgroundColor());
          this.xColor = background.getBackgroundColor();
        }
        final BorderEdge bottom = background.getBottom();
        this.colorBottom = colorProducer.getNearestColor(bottom.getColor());
        this.xColorBottom = bottom.getColor();
        this.borderStrokeBottom = HSSFCellStyleProducer.translateStroke(bottom.getBorderStyle(), bottom.getWidth());

        final BorderEdge left = background.getLeft();
        this.colorLeft = colorProducer.getNearestColor(left.getColor());
        this.xColorLeft = left.getColor();
        this.borderStrokeLeft = HSSFCellStyleProducer.translateStroke(left.getBorderStyle(), left.getWidth());

        final BorderEdge top = background.getTop();
        this.colorTop = colorProducer.getNearestColor(top.getColor());
        this.xColorTop = top.getColor();
        this.borderStrokeTop = HSSFCellStyleProducer.translateStroke(top.getBorderStyle(), top.getWidth());

        final BorderEdge right = background.getRight();
        this.colorRight = colorProducer.getNearestColor(right.getColor());
        this.xColorRight = right.getColor();
        this.borderStrokeRight = HSSFCellStyleProducer.translateStroke(right.getBorderStyle(), right.getWidth());
      }

      if (contentStyle != null)
      {
        final Color textColor = (Color) contentStyle.getStyleProperty(ElementStyleKeys.PAINT);
View Full Code Here


                                                      final SheetLayout sheetLayout,
                                                      final int row,
                                                      final TableContentProducer tableContentProducer)
  {
    Color color = null;
    BorderEdge topEdge = BorderEdge.EMPTY;
    BorderEdge bottomEdge = BorderEdge.EMPTY;

    final int columnCount = sheetLayout.getColumnCount();
    for (int col = 0; col < columnCount; col += 1)
    {
      final CellMarker.SectionType sectionType = tableContentProducer.getSectionType(row, col);
View Full Code Here

      }
      if (retval == null)
      {
        retval = new CellBackground();
      }
      final BorderEdge edge = ProcessUtility.produceBorderEdge(styleSheet);
      if (edge == null)
      {
        return;
      }
      if (vertical)
      {
        if (line.getX1() == 0)
        {
          if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
          {
            retval.setLeft(edge);
          }
          else if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
          {
            final RenderBox nodeParent = node.getParent();
            if (nodeParent != null && (nodeParent.getX() + nodeParent.getWidth()) == (nodeX + nodeWidth))
            {
              retval.setRight(edge);
            }
          }
        }
        else
        {
          if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
          {
            retval.setRight(edge);
          }
        }
      }
      else
      {
        if (line.getY1() == 0)
        {
          if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
          {
            retval.setTop(edge);
          }
          else if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
          {
            final RenderBox nodeParent = node.getParent();
            if (nodeParent != null && (nodeParent.getY() + nodeParent.getHeight()) == (nodeY + nodeHeight))
            {
              retval.setBottom(edge);
            }
          }
        }
        else
        {
          if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
          {
            retval.setBottom(edge);
          }
        }
      }
      return;
    }


    final boolean fill = styleSheet.getBooleanStyleProperty(ElementStyleKeys.FILL_SHAPE);
    if (draw == false && fill == false)
    {
      return;
    }

    if (shape instanceof Rectangle2D ||
        (ellipseAsRectangle && shape instanceof Ellipse2D))
    {
      if (retval == null)
      {
        retval = new CellBackground();
      }

      if (draw)
      {
        // the beast has a border ..
        final BorderEdge edge = ProcessUtility.produceBorderEdge(styleSheet);
        if (edge != null)
        {
          if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
          {
            retval.setTop(edge);
          }
          if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
          {
            retval.setLeft(edge);
          }
          if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
          {
            retval.setBottom(edge);
          }
          if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
          {
            retval.setRight(edge);
          }
        }
      }
      if (fill && ((backgroundHint & BACKGROUND_AREA) == BACKGROUND_AREA))
      {

        final Color color = (Color) styleSheet.getStyleProperty(ElementStyleKeys.FILL_COLOR);
        if (color != null)
        {
          retval.addBackground(color);
        }
        else
        {
          retval.addBackground((Color) styleSheet.getStyleProperty(ElementStyleKeys.PAINT));
        }
      }
      return;
    }

    if (shape instanceof RoundRectangle2D)
    {
      final RoundRectangle2D rr = (RoundRectangle2D) shape;
      if (retval == null)
      {
        retval = new CellBackground();
      }

      if (draw)
      {
        // the beast has a border ..
        final BorderEdge edge = ProcessUtility.produceBorderEdge(styleSheet);
        if (edge != null)
        {
          if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
          {
            retval.setTop(edge);
View Full Code Here

      return retval;
    }

    if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
    {
      final BorderEdge borderEdgeTop = border.getTop();
      if (borderEdgeTop.isEmpty() == false)
      {
        if (retval == null)
        {
          retval = new CellBackground();
        }
        retval.setTop(borderEdgeTop);
      }
    }

    if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
    {
      final BorderEdge borderEdgeLeft = border.getLeft();
      if (borderEdgeLeft.isEmpty() == false)
      {
        if (retval == null)
        {
          retval = new CellBackground();
        }
        retval.setLeft(borderEdgeLeft);
      }
    }

    if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
    {
      final BorderEdge borderEdgeBottom = border.getBottom();
      if (borderEdgeBottom.isEmpty() == false)
      {
        if (retval == null)
        {
          retval = new CellBackground();
        }
        retval.setBottom(borderEdgeBottom);
      }
    }

    if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
    {
      final BorderEdge borderEdgeRight = border.getRight();
      if (borderEdgeRight.isEmpty() == false)
      {
        if (retval == null)
        {
          retval = new CellBackground();
        }
View Full Code Here

    topLeft = new BorderCorner(0, 0);
    topRight = new BorderCorner(0, 0);
    bottomLeft = new BorderCorner(0, 0);
    bottomRight = new BorderCorner(0, 0);

    right = new BorderEdge(BorderStyle.NONE, Color.BLACK, 0);
    top = new BorderEdge(BorderStyle.NONE, Color.BLACK, 0);
    left = new BorderEdge(BorderStyle.NONE, Color.BLACK, 0);
    bottom = new BorderEdge(BorderStyle.NONE, Color.BLACK, 0);
  }
View Full Code Here

    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;
        }
      }
View Full Code Here

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

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

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

//          if (bg.getVerticalAlignment() != null)
//          {
//            attList.setAttribute(null, "vertical-alignment", String.valueOf(bg.getVerticalAlignment()));
//          }
//
    final BorderEdge top = bg.getTop();
    if (top != null && BorderEdge.EMPTY.equals(top) == false)
    {
      attList.setAttribute(null, "border-top-color",
          ColorValueConverter.colorToString(top.getColor()));
      attList.setAttribute(null, "border-top-width",
          String.valueOf(StrictGeomUtility.toExternalValue(top.getWidth())));
      attList.setAttribute(null, "border-top-style",
          String.valueOf(top.getBorderStyle()));
    }

    final BorderEdge left = bg.getLeft();
    if (left != null && BorderEdge.EMPTY.equals(left) == false)
    {
      attList.setAttribute(null, "border-left-color",
          ColorValueConverter.colorToString(left.getColor()));
      attList.setAttribute(null, "border-left-width",
          String.valueOf(StrictGeomUtility.toExternalValue(left.getWidth())));
      attList.setAttribute(null, "border-left-style",
          String.valueOf(left.getBorderStyle()));
    }

    final BorderEdge bottom = bg.getBottom();
    if (bottom != null && BorderEdge.EMPTY.equals(bottom) == false)
    {
      attList.setAttribute(null, "border-bottom-color",
          ColorValueConverter.colorToString(bottom.getColor()));
      attList.setAttribute(null, "border-bottom-width",
          String.valueOf(StrictGeomUtility.toExternalValue(bottom.getWidth())));
      attList.setAttribute(null, "border-bottom-style",
          String.valueOf(bottom.getBorderStyle()));
    }

    final BorderEdge right = bg.getRight();
    if (right != null && BorderEdge.EMPTY.equals(right) == false)
    {
      attList.setAttribute(null, "border-right-color",
          ColorValueConverter.colorToString(right.getColor()));
      attList.setAttribute(null, "border-right-width",
          String.valueOf(StrictGeomUtility.toExternalValue(right.getWidth())));
      attList.setAttribute(null, "border-right-style",
          String.valueOf(right.getBorderStyle()));
    }

    final BorderCorner topLeft = bg.getTopLeft();
    if (topLeft != null && BorderCorner.EMPTY.equals(topLeft) == false)
    {
View Full Code Here

    box.setPaddingBottom(Math.max(0, StrictGeomUtility.toInternalValue
        (style.getDoubleStyleProperty(ElementStyleKeys.PADDING_BOTTOM, 0))));
    box.setPaddingRight(Math.max(0, StrictGeomUtility.toInternalValue
        (style.getDoubleStyleProperty(ElementStyleKeys.PADDING_RIGHT, 0))));

    final BorderEdge edgeTop = createEdge(style, ElementStyleKeys.BORDER_TOP_STYLE,
        ElementStyleKeys.BORDER_TOP_COLOR, ElementStyleKeys.BORDER_TOP_WIDTH);
    final BorderEdge edgeLeft = createEdge(style, ElementStyleKeys.BORDER_LEFT_STYLE,
        ElementStyleKeys.BORDER_LEFT_COLOR, ElementStyleKeys.BORDER_LEFT_WIDTH);
    final BorderEdge edgeBottom = createEdge(style, ElementStyleKeys.BORDER_BOTTOM_STYLE,
        ElementStyleKeys.BORDER_BOTTOM_COLOR, ElementStyleKeys.BORDER_BOTTOM_WIDTH);
    final BorderEdge edgeRight = createEdge(style, ElementStyleKeys.BORDER_RIGHT_STYLE,
        ElementStyleKeys.BORDER_RIGHT_COLOR, ElementStyleKeys.BORDER_RIGHT_WIDTH);
    final BorderEdge edgeBreak = createEdge(style, ElementStyleKeys.BORDER_BREAK_STYLE,
        ElementStyleKeys.BORDER_BREAK_COLOR, ElementStyleKeys.BORDER_BREAK_WIDTH);

    if (BorderEdge.EMPTY.equals(edgeBottom) &&
        BorderEdge.EMPTY.equals(edgeLeft) &&
        BorderEdge.EMPTY.equals(edgeBreak) &&
View Full Code Here

    if (color == null || width <= 0)
    {
      return BorderEdge.EMPTY;
    }

    return new BorderEdge(styleRight, color, StrictGeomUtility.toInternalValue(width));
  }
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.