@Test public void testSetStyleSheetWithNullableColor() { StyleSheet style = mock( StyleSheet.class ); doReturn( null ).when( style ).getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); doReturn( null ).when( style ).getStyleProperty( ElementStyleKeys.PAINT ); doReturn( null ).when( style ).getStyleProperty( SparklineStyleKeys.LAST_COLOR ); doReturn( null ).when( style ).getStyleProperty( SparklineStyleKeys.HIGH_COLOR ); wrapper.setStyleSheet( style ); verify( sparkline, never() ).setHighColor( any( Color.class ) ); verify( sparkline, never() ).setBackground( any( Color.class ) ); verify( sparkline, never() ).setColor( any( Color.class ) ); verify( sparkline, never() ).setMediumColor( any( Color.class ) ); verify( sparkline, never() ).setLowColor( any( Color.class ) ); }
public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { final Color backgroundColor = (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); if ( backgroundColor != null ) { getPieGraphDrawable().setBackground( backgroundColor ); } final Color color = (Color) style.getStyleProperty( ElementStyleKeys.PAINT ); if ( color != null ) { getPieGraphDrawable().setColor( color ); } final Color lowColor = (Color) style.getStyleProperty( SparklineStyleKeys.LOW_COLOR ); if ( lowColor != null ) { getPieGraphDrawable().setLowColor( lowColor ); } final Color mediumColor = (Color) style.getStyleProperty( SparklineStyleKeys.MEDIUM_COLOR ); if ( mediumColor != null ) { getPieGraphDrawable().setMediumColor( mediumColor ); } final Color highColor = (Color) style.getStyleProperty( SparklineStyleKeys.HIGH_COLOR ); if ( highColor != null ) { getPieGraphDrawable().setHighColor( highColor ); } } }
PieSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { final Color backgroundColor = (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); if ( backgroundColor != null ) { getPieGraphDrawable().setBackground( backgroundColor ); } final Color color = (Color) style.getStyleProperty( ElementStyleKeys.PAINT ); if ( color != null ) { getPieGraphDrawable().setColor( color ); } final Color lowColor = (Color) style.getStyleProperty( SparklineStyleKeys.LOW_COLOR ); if ( lowColor != null ) { getPieGraphDrawable().setLowColor( lowColor ); } final Color mediumColor = (Color) style.getStyleProperty( SparklineStyleKeys.MEDIUM_COLOR ); if ( mediumColor != null ) { getPieGraphDrawable().setMediumColor( mediumColor ); } final Color highColor = (Color) style.getStyleProperty( SparklineStyleKeys.HIGH_COLOR ); if ( highColor != null ) { getPieGraphDrawable().setHighColor( highColor ); } } } }
PieSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { final Color backgroundColor = (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); if ( backgroundColor != null ) { getPieGraphDrawable().setBackground( backgroundColor ); } final Color color = (Color) style.getStyleProperty( ElementStyleKeys.PAINT ); if ( color != null ) { getPieGraphDrawable().setColor( color ); } final Color lowColor = (Color) style.getStyleProperty( SparklineStyleKeys.LOW_COLOR ); if ( lowColor != null ) { getPieGraphDrawable().setLowColor( lowColor ); } final Color mediumColor = (Color) style.getStyleProperty( SparklineStyleKeys.MEDIUM_COLOR ); if ( mediumColor != null ) { getPieGraphDrawable().setMediumColor( mediumColor ); } final Color highColor = (Color) style.getStyleProperty( SparklineStyleKeys.HIGH_COLOR ); if ( highColor != null ) { getPieGraphDrawable().setHighColor( highColor ); } } } PieSparklinesWrapper( final PieGraphDrawable sparkline ); }
PieSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { final Color backgroundColor = (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); if ( backgroundColor != null ) { getPieGraphDrawable().setBackground( backgroundColor ); } final Color color = (Color) style.getStyleProperty( ElementStyleKeys.PAINT ); if ( color != null ) { getPieGraphDrawable().setColor( color ); } final Color lowColor = (Color) style.getStyleProperty( SparklineStyleKeys.LOW_COLOR ); if ( lowColor != null ) { getPieGraphDrawable().setLowColor( lowColor ); } final Color mediumColor = (Color) style.getStyleProperty( SparklineStyleKeys.MEDIUM_COLOR ); if ( mediumColor != null ) { getPieGraphDrawable().setMediumColor( mediumColor ); } final Color highColor = (Color) style.getStyleProperty( SparklineStyleKeys.HIGH_COLOR ); if ( highColor != null ) { getPieGraphDrawable().setHighColor( highColor ); } } } PieSparklinesWrapper( final PieGraphDrawable sparkline ); void setConfiguration( final Configuration config ); void setStyleSheet( final StyleSheet style ); void setResourceBundleFactory( final ResourceBundleFactory bundleFactory ); ImageMap getImageMap( final Rectangle2D bounds ); boolean isPreserveAspectRatio(); Dimension getPreferredSize(); void draw( final Graphics2D g2, final Rectangle2D bounds ); }
PieSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { final Color backgroundColor = (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); if ( backgroundColor != null ) { getPieGraphDrawable().setBackground( backgroundColor ); } final Color color = (Color) style.getStyleProperty( ElementStyleKeys.PAINT ); if ( color != null ) { getPieGraphDrawable().setColor( color ); } final Color lowColor = (Color) style.getStyleProperty( SparklineStyleKeys.LOW_COLOR ); if ( lowColor != null ) { getPieGraphDrawable().setLowColor( lowColor ); } final Color mediumColor = (Color) style.getStyleProperty( SparklineStyleKeys.MEDIUM_COLOR ); if ( mediumColor != null ) { getPieGraphDrawable().setMediumColor( mediumColor ); } final Color highColor = (Color) style.getStyleProperty( SparklineStyleKeys.HIGH_COLOR ); if ( highColor != null ) { getPieGraphDrawable().setHighColor( highColor ); } } } PieSparklinesWrapper( final PieGraphDrawable sparkline ); void setConfiguration( final Configuration config ); void setStyleSheet( final StyleSheet style ); void setResourceBundleFactory( final ResourceBundleFactory bundleFactory ); ImageMap getImageMap( final Rectangle2D bounds ); boolean isPreserveAspectRatio(); Dimension getPreferredSize(); void draw( final Graphics2D g2, final Rectangle2D bounds );  }