protected boolean setStrokeParams ( final Context2D context , final Attributes attr , double alpha , final boolean filled ) { double width = attr . getStrokeWidth ( ) ; String color = attr . getStrokeColor ( ) ; if ( null == color ) { if ( width > 0 ) { color = LienzoCore . get ( ) . getDefaultStrokeColor ( ) ; } } else if ( width <= 0 ) { width = LienzoCore . get ( ) . getDefaultStrokeWidth ( ) ; } if ( ( null == color ) && ( width <= 0 ) ) { if ( filled ) { return false ; } color = LienzoCore . get ( ) . getDefaultStrokeColor ( ) ; width = LienzoCore . get ( ) . getDefaultStrokeWidth ( ) ; } alpha = alpha * attr . getStrokeAlpha ( ) ; if ( alpha <= 0 ) { return false ; } double offset = 0 ; if ( context . isSelection ( ) ) { color = getColorKey ( ) ; if ( null == color ) { return false ; } context . save ( ) ; offset = getSelectionStrokeOffset ( ) ; } else { context . save ( ) ; context . setGlobalAlpha ( alpha ) ; } context . setStrokeColor ( color ) ; context . setStrokeWidth ( width + offset ) ; if ( false == attr . hasExtraStrokeAttributes ( ) ) { return true ; } boolean isdashed = false ; if ( attr . isDefined ( Attribute . DASH_ARRAY ) ) { if ( LienzoCore . get ( ) . isLineDashSupported ( ) ) { final DashArray dash = attr . getDashArray ( ) ; if ( ( null != dash ) && ( dash . size ( ) > 0 ) ) { context . setLineDash ( dash ) ; if ( attr . isDefined ( Attribute . DASH_OFFSET ) ) { context . setLineDashOffset ( attr . getDashOffset ( ) ) ; } isdashed = true ; } } } if ( ( isdashed ) || ( doStrokeExtraProperties ( ) ) ) { if ( attr . isDefined ( Attribute . LINE_JOIN ) ) { context . setLineJoin ( attr . getLineJoin ( ) ) ; } if ( attr . isDefined ( Attribute . LINE_CAP ) ) { context . setLineCap ( attr . getLineCap ( ) ) ; } if ( attr . isDefined ( Attribute . MITER_LIMIT ) ) { context . setMiterLimit ( attr . getMiterLimit ( ) ) ; } } return true ; }
Sets the Shape Stroke parameters .