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

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


  }

  private BorderEdge createEdge(final StyleSheet style, final StyleKey borderStyleKey,
                                final StyleKey borderColorKey, final StyleKey borderWidthKey)
  {
    final BorderStyle styleRight = (BorderStyle) style.getStyleProperty(borderStyleKey);
    if (styleRight == null || BorderStyle.NONE.equals(styleRight))
    {
      return BorderEdge.EMPTY;
    }
View Full Code Here


    final Stroke s = (Stroke) style.getStyleProperty(ElementStyleKeys.STROKE);
    if (s instanceof BasicStroke == false)
    {
      return false;
    }
    final BorderStyle borderStyle = StrokeUtility.translateStrokeStyle(s);
    if (BorderStyle.NONE.equals(borderStyle))
    {
      return false;
    }
    return true;
View Full Code Here

    if (s instanceof BasicStroke == false)
    {
      return null;
    }
    final BasicStroke bs = (BasicStroke) s;
    final BorderStyle borderStyle = StrokeUtility.translateStrokeStyle(s);
    if (BorderStyle.NONE.equals(borderStyle))
    {
      return null;
    }
View Full Code Here

    }
    if (style.isLocalKey(ElementStyleKeys.STROKE))
    {
      final Stroke s = (Stroke) style.getStyleProperty(ElementStyleKeys.STROKE);
      final float strokeWidth = StrokeUtility.getStrokeWidth(s);
      final BorderStyle strokeType = StrokeUtility.translateStrokeStyle(s);
      bandStyleAtts.setAttribute(BundleNamespaces.STYLE, "stroke-weight", absoluteLengthFormat.format(strokeWidth));
      bandStyleAtts.setAttribute(BundleNamespaces.STYLE, "stroke-style", strokeType.toString());
    }
    if (bandStyleAtts.isEmpty() == false)
    {
      writer.writeTag(BundleNamespaces.STYLE, "content-styles", bandStyleAtts, XmlWriterSupport.CLOSE);
    }
View Full Code Here

  }


  public String printEdgeAsCSS(final BorderEdge edge)
  {
    final BorderStyle borderStyle = edge.getBorderStyle();
    final long width = edge.getWidth();
    if (BorderStyle.NONE.equals(borderStyle) || width <= 0)
    {
      return "none";
    }

    final Object cached = cachedBorderStyle.get(edge);
    if (cached != null)
    {
      return cached.toString();
    }

    final String value =
        (pointConverter.format(HtmlPrinter.fixLengthForSafari(StrictGeomUtility.toExternalValue(width),
        safariLengthFix)) +
        "pt " + borderStyle.toString() + ' ' + HtmlColors.getColorString(edge.getColor()));
    cachedBorderStyle.put(edge, value);
    return value;
  }
View Full Code Here

    }

    final String borderStyle = atts.getValue(getUri(), "border-style");
    if (borderStyle != null)
    {
      final BorderStyle value = parseBorderStyle(borderStyle);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE, value);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_LEFT_STYLE, value);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE, value);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_STYLE, value);
    }
    final String borderStyleTop = atts.getValue(getUri(), "border-top-style");
    if (borderStyleTop != null)
    {
      final BorderStyle value = parseBorderStyle(borderStyleTop);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_TOP_STYLE, value);
    }
    final String borderStyleLeft = atts.getValue(getUri(), "border-left-style");
    if (borderStyleLeft != null)
    {
      final BorderStyle value = parseBorderStyle(borderStyleLeft);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_LEFT_STYLE, value);
    }
    final String borderStyleBottom = atts.getValue(getUri(), "border-bottom-style");
    if (borderStyleBottom != null)
    {
      final BorderStyle value = parseBorderStyle(borderStyleBottom);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_BOTTOM_STYLE, value);
    }
    final String borderStyleRight = atts.getValue(getUri(), "border-right-style");
    if (borderStyleRight != null)
    {
      final BorderStyle value = parseBorderStyle(borderStyleRight);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_RIGHT_STYLE, value);
    }
    final String borderStyleBreak = atts.getValue(getUri(), "border-break-style");
    if (borderStyleBreak != null)
    {
      final BorderStyle value = parseBorderStyle(borderStyleBreak);
      styleSheet.setStyleProperty(ElementStyleKeys.BORDER_BREAK_STYLE, value);
    }

    final String borderRadiusWidth = atts.getValue(getUri(), "border-radius-width");
    if (borderRadiusWidth != null)
View Full Code Here

        maybeBorderWidth instanceof Number == false)
    {
      return;
    }

    final BorderStyle style = (BorderStyle) maybeBorderStyle;
    final Color color = (Color) maybeBorderColor;
    final Number number = (Number) maybeBorderWidth;
    final Float width = new Float(number.floatValue());

    styleSheet.setStyleProperty(ElementStyleKeys.BORDER_TOP_WIDTH, width);
View Full Code Here

  /* (non-Javadoc)
   * @see java.beans.PropertyEditor#getAsText()
   */
  public String getAsText()
  {
    final BorderStyle borderStyle = StrokeUtility.translateStrokeStyle(value);
    final float width = value.getLineWidth();
    return borderStyle + ", " + width;
  }
View Full Code Here

    if (width < 0)
    {
      setValue(null);
      return;
    }
    BorderStyle style = BorderStyle.getBorderStyle(strings[0].trim());
    if (style == null)
    {
      style = BorderStyle.getBorderStyle(strings[1].trim());
    }
    if (style == null)
    {
      setValue(null);
    }
    else
    {
      setValue(style.createStroke(width));
    }
  }
View Full Code Here

                                                  boolean cellHasFocus)
    {
      JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
      if (value instanceof BorderStyle)
      {
        final BorderStyle style = (BorderStyle) value;
        StrokeIcon strokeIcon = new StrokeIcon(style.createStroke(2));
        label.setIcon(strokeIcon);
      }
      else
      {
        label.setIcon(null);
View Full Code Here

TOP

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

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.