private void assignProducedCssValue(final MarginTop marginTop,
            final MarginRight marginRight, final MarginBottom marginBottom,
            final MarginLeft marginLeft) {

        final String marginTopCssValue = marginTop.getCssValue();
        final String marginRightCssValue = marginRight.getCssValue();
        final String marginBottomCssValue = marginBottom.getCssValue();
        final String marginLeftCssValue = marginLeft.getCssValue();

        if (marginTopCssValue.equals(marginRightCssValue)
                && marginRightCssValue.equals(marginBottomCssValue)
                && marginBottomCssValue.equals(marginLeftCssValue)) {

            cssValue = marginTopCssValue;

            final StateChangeInformer<CssProperty> stateChangeInformer = getStateChangeInformer();
            if (stateChangeInformer != null) {
                stateChangeInformer.stateChanged(this);
            }
        } else if (marginTopCssValue.equals(marginBottomCssValue)
                && marginRightCssValue.equals(marginLeftCssValue)) {

            final StringBuilder cssValueBuilder = new StringBuilder(
                    marginTopCssValue);
            cssValueBuilder.append(' ').append(marginRightCssValue);

            cssValue = cssValueBuilder.toString();

            final StateChangeInformer<CssProperty> stateChangeInformer = getStateChangeInformer();
            if (stateChangeInformer != null) {
                stateChangeInformer.stateChanged(this);
            }

        } else if (marginRightCssValue.equals(marginLeftCssValue)) {
            final StringBuilder cssValueBuilder = new StringBuilder(
                    marginTopCssValue);
            cssValueBuilder.append(' ').append(marginRightCssValue).append(' ')
                    .append(marginBottomCssValue);

            cssValue = cssValueBuilder.toString();

            final StateChangeInformer<CssProperty> stateChangeInformer = getStateChangeInformer();
            if (stateChangeInformer != null) {
                stateChangeInformer.stateChanged(this);
            }
        } else {
            cssValue = new StringBuilder(marginTopCssValue).append(' ')
                    .append(marginRightCssValue).append(' ')
                    .append(marginBottomCssValue).append(' ')
                    .append(marginLeftCssValue).toString();

            final StateChangeInformer<CssProperty> stateChangeInformer = getStateChangeInformer();
            if (stateChangeInformer != null) {
                stateChangeInformer.stateChanged(this);
            }
        }
    }
private void assignProducedCssValue ( final MarginTop marginTop , final MarginRight marginRight , final MarginBottom marginBottom , final MarginLeft marginLeft ) { final String marginTopCssValue = marginTop . getCssValue ( ) ; final String marginRightCssValue = marginRight . getCssValue ( ) ; final String marginBottomCssValue = marginBottom . getCssValue ( ) ; final String marginLeftCssValue = marginLeft . getCssValue ( ) ; if ( marginTopCssValue . equals ( marginRightCssValue ) && marginRightCssValue . equals ( marginBottomCssValue ) && marginBottomCssValue . equals ( marginLeftCssValue ) ) { cssValue = marginTopCssValue ; final StateChangeInformer < CssProperty > stateChangeInformer = getStateChangeInformer ( ) ; if ( stateChangeInformer != null ) { stateChangeInformer . stateChanged ( this ) ; } } else if ( marginTopCssValue . equals ( marginBottomCssValue ) && marginRightCssValue . equals ( marginLeftCssValue ) ) { final StringBuilder cssValueBuilder = new StringBuilder ( marginTopCssValue ) ; cssValueBuilder . append ( ' ' ) . append ( marginRightCssValue ) ; cssValue = cssValueBuilder . toString ( ) ; final StateChangeInformer < CssProperty > stateChangeInformer = getStateChangeInformer ( ) ; if ( stateChangeInformer != null ) { stateChangeInformer . stateChanged ( this ) ; } } else if ( marginRightCssValue . equals ( marginLeftCssValue ) ) { final StringBuilder cssValueBuilder = new StringBuilder ( marginTopCssValue ) ; cssValueBuilder . append ( ' ' ) . append ( marginRightCssValue ) . append ( ' ' ) . append ( marginBottomCssValue ) ; cssValue = cssValueBuilder . toString ( ) ; final StateChangeInformer < CssProperty > stateChangeInformer = getStateChangeInformer ( ) ; if ( stateChangeInformer != null ) { stateChangeInformer . stateChanged ( this ) ; } } else { cssValue = new StringBuilder ( marginTopCssValue ) . append ( ' ' ) . append ( marginRightCssValue ) . append ( ' ' ) . append ( marginBottomCssValue ) . append ( ' ' ) . append ( marginLeftCssValue ) . toString ( ) ; final StateChangeInformer < CssProperty > stateChangeInformer = getStateChangeInformer ( ) ; if ( stateChangeInformer != null ) { stateChangeInformer . stateChanged ( this ) ; } } }
@author WFF
@since 1.0.0