if ( ch != null && ch.getRGB( ) != -1 )
if ( dstyle != null ) { String color = dstyle.getBackgroundColor( ); int r = Integer.valueOf( color.substring( 4, color.indexOf( "," ) ).trim( ) ).intValue( ); int g = Integer.valueOf( color.substring( color.indexOf( "," ) + 1, color.indexOf( ",", color.indexOf( "," ) + 1 ) ).trim( ) ).intValue( ); int b = Integer.valueOf( color.substring( color.lastIndexOf( "," ) + 1, color.length( ) - 1 ).trim( ) ).intValue( ); ss.setBackgroundColor( ColorDefinitionImpl.create( r, g, b ) ); } else if ( ch != null && ch.getRGB( ) != -1 )
	public IStyle getStyle( Chart model, StyledComponent name )	{		SimpleStyle ss = null;		if ( cache == null || !useCache )		{			StyleHandle style = handle.getPrivateStyle( );			ss = new SimpleStyle( );			String fname = style.getFontFamilyHandle( ).getStringValue( );			int fsize = getFontSizeIntValue( handle );			boolean fbold = getFontWeight( style.getFontWeight( ) ) >= 700;			boolean fitalic = DesignChoiceConstants.FONT_STYLE_ITALIC.equals( style.getFontStyle( ) );			boolean funder = DesignChoiceConstants.TEXT_UNDERLINE_UNDERLINE.equals( style.getTextUnderline( ) );			boolean fstrike = DesignChoiceConstants.TEXT_LINE_THROUGH_LINE_THROUGH.equals( style.getTextLineThrough( ) );			HorizontalAlignment ha = HorizontalAlignment.LEFT_LITERAL;			if ( DesignChoiceConstants.TEXT_ALIGN_CENTER.equals( style.getTextAlign( ) ) )			{				ha = HorizontalAlignment.CENTER_LITERAL;			}			else if ( DesignChoiceConstants.TEXT_ALIGN_RIGHT.equals( style.getTextAlign( ) ) )			{				ha = HorizontalAlignment.RIGHT_LITERAL;			}			VerticalAlignment va = VerticalAlignment.TOP_LITERAL;			if ( DesignChoiceConstants.VERTICAL_ALIGN_MIDDLE.equals( style.getVerticalAlign( ) ) )			{				va = VerticalAlignment.CENTER_LITERAL;			}			else if ( DesignChoiceConstants.VERTICAL_ALIGN_BOTTOM.equals( style.getVerticalAlign( ) ) )			{				va = VerticalAlignment.BOTTOM_LITERAL;			}			TextAlignment ta = TextAlignmentImpl.create( );			ta.setHorizontalAlignment( ha );			ta.setVerticalAlignment( va );			FontDefinition fd = FontDefinitionImpl.create( fname,					fsize,					fbold,					fitalic,					funder,					fstrike,					true,					0,					ta );			ss.setFont( fd );			ColorHandle ch = style.getColor( );			if ( ch != null && ch.getRGB( ) != -1 )			{				int rgb = ch.getRGB( );				ColorDefinition cd = ColorDefinitionImpl.create( ( rgb >> 16 ) & 0xff,						( rgb >> 8 ) & 0xff,						rgb & 0xff );				ss.setColor( cd );			}			else			{				ss.setColor( ColorDefinitionImpl.BLACK( ) );			}			ch = style.getBackgroundColor( );			if ( ch != null && ch.getRGB( ) != -1 )			{				int rgb = ch.getRGB( );				ColorDefinition cd = ColorDefinitionImpl.create( ( rgb >> 16 ) & 0xff,						( rgb >> 8 ) & 0xff,						rgb & 0xff );				ss.setBackgroundColor( cd );			}			if ( style.getBackgroundImage( ) != null					&& style.getBackgroundImage( ).length( ) > 0 )			{				String urlString = style.getBackgroundImage( );				try				{					new URL( urlString );					ss.setBackgroundImage( ImageImpl.create( urlString ) );				}				catch ( Exception _ )				{					// try with "file" prefix					urlString = "file:///" + urlString; //$NON-NLS-1$					try					{						new URL( urlString );						ss.setBackgroundImage( ImageImpl.create( urlString ) );					}					catch ( Exception __ )					{						logger.log( _ );					}				}			}			double pt = convertToPixel( style.getPaddingTop( ) );			double pb = convertToPixel( style.getPaddingBottom( ) );			double pl = convertToPixel( style.getPaddingLeft( ) );			double pr = convertToPixel( style.getPaddingRight( ) );			ss.setPadding( InsetsImpl.create( pt, pl, pb, pr ) );			if ( useCache )			{				cache = ss;			}		}		if ( useCache )		{			ss = cache.copy( );		}		return ss;	}