private String convertColorToString( final BorderEdge borderEdge ) { final Color o = borderEdge.getColor(); if ( o == null ) { return null; } return ColorValueConverter.colorToString( o ); }
/** * Converts the attribute to a string. * * @param o * the attribute ({@link Integer} expected). * @return A string representing the {@link Integer} value. */ public String toAttributeValue( final Object o ) throws BeanException { if ( o == null ) { return null; } if ( !( o instanceof Color ) ) { throw new BeanException( "Failed to convert object of type " + o.getClass() + ": Not a Color." ); } final Color c = (Color) o; return colorToString( c ); }
bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "color", ColorValueConverter.colorToString( value ) ); bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "fill-color", ColorValueConverter.colorToString( value ) );
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() ) ) ); 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() ) ) ); 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() ) ) ); 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() ) ) ); if ( backgroundColor != null ) { attributeList.setAttribute( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "background-color", ColorValueConverter.colorToString( backgroundColor ) );
attList.setAttribute( null, "background-color", ColorValueConverter.colorToString( color ) ); 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-left-color", ColorValueConverter.colorToString( left.getColor() ) ); attList.setAttribute( null, "border-left-width", String.valueOf( StrictGeomUtility.toExternalValue( left .getWidth() ) ) ); 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-right-color", ColorValueConverter.colorToString( right.getColor() ) ); attList.setAttribute( null, "border-right-width", String.valueOf( StrictGeomUtility.toExternalValue( right .getWidth() ) ) );
final Color value = (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); bandStyleAtts .setAttribute( BundleNamespaces.STYLE, "background-color", ColorValueConverter.colorToString( value ) ); if ( ObjectUtilities.equal( top, left ) && ObjectUtilities.equal( top, right ) && ObjectUtilities.equal( top, bottom ) ) { bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "border-color", ColorValueConverter.colorToString( top ) ); } else { bandStyleAtts .setAttribute( BundleNamespaces.STYLE, "border-top-color", ColorValueConverter.colorToString( top ) ); bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "border-left-color", ColorValueConverter .colorToString( left ) ); bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "border-bottom-color", ColorValueConverter .colorToString( bottom ) ); bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "border-right-color", ColorValueConverter .colorToString( right ) ); final Color value = (Color) style.getStyleProperty( ElementStyleKeys.BORDER_TOP_COLOR ); bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "border-top-color", ColorValueConverter .colorToString( value ) ); .colorToString( value ) ); .colorToString( value ) ); .colorToString( value ) ); final Color value = (Color) style.getStyleProperty( ElementStyleKeys.BORDER_BREAK_COLOR ); bandStyleAtts.setAttribute( BundleNamespaces.STYLE, "border-break-color", ColorValueConverter
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() ) ) ); 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() ) ) ); 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() ) ) ); 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() ) ) ); if ( backgroundColor != null ) { attributeList.setAttribute( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "background-color", ColorValueConverter.colorToString( backgroundColor ) ); if ( color != null ) {
if ( backgroundColor != null ) { attributeList.setAttribute( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "background-color", ColorValueConverter.colorToString( backgroundColor ) ); if ( color != null ) { attributeList.setAttribute( XmlDocumentWriter.LAYOUT_OUTPUT_NAMESPACE, "color", ColorValueConverter.colorToString( color ) );