@Test public void testSetStyleSheetWithColor() { StyleSheet style = mock( StyleSheet.class ); doReturn( Color.BLACK ).when( style ).getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ); doReturn( Color.BLUE ).when( style ).getStyleProperty( ElementStyleKeys.PAINT ); doReturn( null ).when( style ).getStyleProperty( SparklineStyleKeys.LAST_COLOR ); wrapper.setStyleSheet( style ); verify( sparkline, never() ).setLastColor( any( Color.class ) ); verify( sparkline ).setBackground( Color.BLACK ); verify( sparkline ).setColor( Color.BLUE ); }
public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { sparkline.setBackground( (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ) ); sparkline.setColor( (Color) style.getStyleProperty( ElementStyleKeys.PAINT ) ); final Color lastColor = (Color) style.getStyleProperty( SparklineStyleKeys.LAST_COLOR ); if ( lastColor != null ) { sparkline.setLastColor( lastColor ); } } }
LineSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { sparkline.setBackground( (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ) ); sparkline.setColor( (Color) style.getStyleProperty( ElementStyleKeys.PAINT ) ); final Color lastColor = (Color) style.getStyleProperty( SparklineStyleKeys.LAST_COLOR ); if ( lastColor != null ) { sparkline.setLastColor( lastColor ); } } } }
LineSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { sparkline.setBackground( (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ) ); sparkline.setColor( (Color) style.getStyleProperty( ElementStyleKeys.PAINT ) ); final Color lastColor = (Color) style.getStyleProperty( SparklineStyleKeys.LAST_COLOR ); if ( lastColor != null ) { sparkline.setLastColor( lastColor ); } } } LineSparklinesWrapper( final LineGraphDrawable sparkline ); }
LineSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { sparkline.setBackground( (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ) ); sparkline.setColor( (Color) style.getStyleProperty( ElementStyleKeys.PAINT ) ); final Color lastColor = (Color) style.getStyleProperty( SparklineStyleKeys.LAST_COLOR ); if ( lastColor != null ) { sparkline.setLastColor( lastColor ); } } } LineSparklinesWrapper( final LineGraphDrawable 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 ); }
LineSparklinesWrapper extends DrawableWrapper implements ReportDrawable { public void setStyleSheet( final StyleSheet style ) { if ( style != null ) { sparkline.setBackground( (Color) style.getStyleProperty( ElementStyleKeys.BACKGROUND_COLOR ) ); sparkline.setColor( (Color) style.getStyleProperty( ElementStyleKeys.PAINT ) ); final Color lastColor = (Color) style.getStyleProperty( SparklineStyleKeys.LAST_COLOR ); if ( lastColor != null ) { sparkline.setLastColor( lastColor ); } } } LineSparklinesWrapper( final LineGraphDrawable 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 );  }