@Test public void testApplyStyle() { ElementStyleSheet style = mock( ElementStyleSheet.class ); elemFactory.applyStyle( style ); verify( style, never() ).setStyleProperty( any( StyleKey.class ), anyObject() ); elemFactory.setHighColor( Color.BLUE ); elemFactory.setLowColor( Color.RED ); elemFactory.setMediumColor( Color.YELLOW ); elemFactory.applyStyle( style ); verify( style ).setStyleProperty( SparklineStyleKeys.HIGH_COLOR, elemFactory.getHighColor() ); verify( style ).setStyleProperty( SparklineStyleKeys.LOW_COLOR, elemFactory.getLowColor() ); verify( style ).setStyleProperty( SparklineStyleKeys.MEDIUM_COLOR, elemFactory.getMediumColor() ); }
protected void applyStyle( final ElementStyleSheet style ) { super.applyStyle( style ); if ( highColor != null ) { style.setStyleProperty( SparklineStyleKeys.HIGH_COLOR, getHighColor() ); } if ( lowColor != null ) { style.setStyleProperty( SparklineStyleKeys.LOW_COLOR, getLowColor() ); } if ( mediumColor != null ) { style.setStyleProperty( SparklineStyleKeys.MEDIUM_COLOR, getMediumColor() ); } }
PieSparklineElementFactory extends AbstractContentElementFactory { protected void applyStyle( final ElementStyleSheet style ) { super.applyStyle( style ); if ( highColor != null ) { style.setStyleProperty( SparklineStyleKeys.HIGH_COLOR, getHighColor() ); } if ( lowColor != null ) { style.setStyleProperty( SparklineStyleKeys.LOW_COLOR, getLowColor() ); } if ( mediumColor != null ) { style.setStyleProperty( SparklineStyleKeys.MEDIUM_COLOR, getMediumColor() ); } } }
PieSparklineElementFactory extends AbstractContentElementFactory { protected void applyStyle( final ElementStyleSheet style ) { super.applyStyle( style ); if ( highColor != null ) { style.setStyleProperty( SparklineStyleKeys.HIGH_COLOR, getHighColor() ); } if ( lowColor != null ) { style.setStyleProperty( SparklineStyleKeys.LOW_COLOR, getLowColor() ); } if ( mediumColor != null ) { style.setStyleProperty( SparklineStyleKeys.MEDIUM_COLOR, getMediumColor() ); } } PieSparklineElementFactory(); }
PieSparklineElementFactory extends AbstractContentElementFactory { protected void applyStyle( final ElementStyleSheet style ) { super.applyStyle( style ); if ( highColor != null ) { style.setStyleProperty( SparklineStyleKeys.HIGH_COLOR, getHighColor() ); } if ( lowColor != null ) { style.setStyleProperty( SparklineStyleKeys.LOW_COLOR, getLowColor() ); } if ( mediumColor != null ) { style.setStyleProperty( SparklineStyleKeys.MEDIUM_COLOR, getMediumColor() ); } } PieSparklineElementFactory(); Object getContent(); void setContent( final Object content ); Object getNullValue(); void setNullValue( final Object nullValue ); String getFormula(); void setFormula( final String formula ); Color getHighColor(); void setHighColor( final Color highColor ); Color getLowColor(); void setLowColor( final Color lowColor ); Color getMediumColor(); void setMediumColor( Color mediumColor ); Integer getStartAngle(); void setStartAngle( final Integer startAngle ); Double getHighSlice(); void setHighSlice( Double highSlice ); Double getMediumSlice(); void setMediumSlice( Double mediumSlice ); Double getLowSlice(); void setLowSlice( Double lowSlice ); Boolean getCounterClockwise(); void setCounterClockwise( Boolean counterClockwise ); String getFieldname(); void setFieldname( final String fieldname ); Element createElement(); }
PieSparklineElementFactory extends AbstractContentElementFactory { protected void applyStyle( final ElementStyleSheet style ) { super.applyStyle( style ); if ( highColor != null ) { style.setStyleProperty( SparklineStyleKeys.HIGH_COLOR, getHighColor() ); } if ( lowColor != null ) { style.setStyleProperty( SparklineStyleKeys.LOW_COLOR, getLowColor() ); } if ( mediumColor != null ) { style.setStyleProperty( SparklineStyleKeys.MEDIUM_COLOR, getMediumColor() ); } } PieSparklineElementFactory(); Object getContent(); void setContent( final Object content ); Object getNullValue(); void setNullValue( final Object nullValue ); String getFormula(); void setFormula( final String formula ); Color getHighColor(); void setHighColor( final Color highColor ); Color getLowColor(); void setLowColor( final Color lowColor ); Color getMediumColor(); void setMediumColor( Color mediumColor ); Integer getStartAngle(); void setStartAngle( final Integer startAngle ); Double getHighSlice(); void setHighSlice( Double highSlice ); Double getMediumSlice(); void setMediumSlice( Double mediumSlice ); Double getLowSlice(); void setLowSlice( Double lowSlice ); Boolean getCounterClockwise(); void setCounterClockwise( Boolean counterClockwise ); String getFieldname(); void setFieldname( final String fieldname ); Element createElement();  }