case LexicalUnit.SAC_COUNTERS_FUNCTION: case LexicalUnit.SAC_FUNCTION: { if (value.getFunctionName().equals(VALUE_FUNCTION_NAME)) { } else if (value.getFunctionName().equals(LITERAL_FUNCTION_NAME)) { List<Value> parameters = new ArrayList<Value>(); extractValueOf(parameters, value.getParameters()); return new FunctionValue(value.getFunctionName(), new ListValue(parameters));
private Value parseColorFunction(LexicalUnit lu, Value v) { String functionName = lu.getFunctionName(); if (functionName.equalsIgnoreCase(ICCColor.ICC_COLOR_FUNCTION)) { return createICCColorValue(lu, v); } return parseColor12Function(lu, v); }
private Value parseColorFunction(LexicalUnit lu, Value v) { String functionName = lu.getFunctionName(); if (functionName.equalsIgnoreCase(ICCColor.ICC_COLOR_FUNCTION)) { return createICCColorValue(lu, v); } return parseColor12Function(lu, v); }
private Value parseColorFunction(LexicalUnit lu, Value v) { String functionName = lu.getFunctionName(); if (functionName.equalsIgnoreCase(ICCColor.ICC_COLOR_FUNCTION)) { return createICCColorValue(lu, v); } return parseColor12Function(lu, v); }
static CssColor readColor( LexicalUnit unit ) { CssColor result = null; short type = unit.getLexicalUnitType(); if( type == LexicalUnit.SAC_RGBCOLOR ) { result = readColorRgb( unit ); } else if( type == LexicalUnit.SAC_FUNCTION && "rgba".equals( unit.getFunctionName() ) ) { result = readColorRgba( unit ); } else if( type == LexicalUnit.SAC_FUNCTION && "rgb".equals( unit.getFunctionName() ) ) { throw new IllegalArgumentException( "Failed to parse rgb() function" ); } else if( type == LexicalUnit.SAC_IDENT ) { result = readColorNamed( unit ); } else if( type == LexicalUnit.SAC_INHERIT ) { result = CssColor.TRANSPARENT; } if( result == null ) { throw new IllegalArgumentException( "Failed to parse color " + toString( unit ) ); } return result; }
private Value parseColor12Function(LexicalUnit lu, Value v) { String functionName = lu.getFunctionName(); if (functionName.equalsIgnoreCase(ICCNamedColor.ICC_NAMED_COLOR_FUNCTION)) { return createICCNamedColorValue(lu, v); } else if (functionName.equalsIgnoreCase(CIELabColor.CIE_LAB_COLOR_FUNCTION)) { return createCIELabColorValue(lu, v); } else if (functionName.equalsIgnoreCase(CIELCHColor.CIE_LCH_COLOR_FUNCTION)) { return createCIELCHColorValue(lu, v); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_CMYK_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 4); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_RGB_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 3); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_GRAY_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 1); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_NCHANNEL_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 0); } return null; }
private Value parseColor12Function(LexicalUnit lu, Value v) { String functionName = lu.getFunctionName(); if (functionName.equalsIgnoreCase(ICCNamedColor.ICC_NAMED_COLOR_FUNCTION)) { return createICCNamedColorValue(lu, v); } else if (functionName.equalsIgnoreCase(CIELabColor.CIE_LAB_COLOR_FUNCTION)) { return createCIELabColorValue(lu, v); } else if (functionName.equalsIgnoreCase(CIELCHColor.CIE_LCH_COLOR_FUNCTION)) { return createCIELCHColorValue(lu, v); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_CMYK_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 4); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_RGB_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 3); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_GRAY_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 1); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_NCHANNEL_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 0); } return null; }
private Value parseColor12Function(LexicalUnit lu, Value v) { String functionName = lu.getFunctionName(); if (functionName.equalsIgnoreCase(ICCNamedColor.ICC_NAMED_COLOR_FUNCTION)) { return createICCNamedColorValue(lu, v); } else if (functionName.equalsIgnoreCase(CIELabColor.CIE_LAB_COLOR_FUNCTION)) { return createCIELabColorValue(lu, v); } else if (functionName.equalsIgnoreCase(CIELCHColor.CIE_LCH_COLOR_FUNCTION)) { return createCIELCHColorValue(lu, v); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_CMYK_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 4); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_RGB_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 3); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_GRAY_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 1); } else if (functionName.equalsIgnoreCase(DeviceColor.DEVICE_NCHANNEL_COLOR_FUNCTION)) { return createDeviceColorValue(lu, v, 0); } return null; }
static CssImage readBackgroundImage( LexicalUnit unit, ResourceLoader loader ) { CssImage result = null; short type = unit.getLexicalUnitType(); if( type == LexicalUnit.SAC_URI ) { String value = unit.getStringValue(); result = CssImage.valueOf( value, loader ); } else if( type == LexicalUnit.SAC_IDENT ) { String value = unit.getStringValue(); if( NONE.equals( value ) ) { result = CssImage.NONE; } } else if( type == LexicalUnit.SAC_FUNCTION ) { String function = unit.getFunctionName(); if( "gradient".equals( function ) ) { result = readGradient( unit ); } } if( result == null ) { throw new IllegalArgumentException( "Failed to parse image " + toString( unit ) ); } return result; }
buffer.append( "ATTR " + value.getStringValue() ); } else if( type == LexicalUnit.SAC_FUNCTION ) { buffer.append( "UNKNOWN FUNCTION " + value.getFunctionName() ); } else if( type == LexicalUnit.SAC_DIMENSION ) { buffer.append( "UNKNOWN DIMENSION " + value );
public CSSValue createValue( StyleKey name, LexicalUnit value ) { if ( value.getLexicalUnitType() == LexicalUnit.SAC_IDENT ) { final String stringValue = value.getStringValue(); if ( stringValue.equalsIgnoreCase( "auto" ) || stringValue.equalsIgnoreCase( "none" ) ) { return CSSAutoValue.getInstance(); } } else if ( value.getLexicalUnitType() == LexicalUnit.SAC_FUNCTION ) { if ( value.getFunctionName().equalsIgnoreCase( "inset-rect" ) ) { return getRectangle( CSSRectangleType.INSET_RECT, value.getParameters() ); } return null; } else if ( value.getLexicalUnitType() == LexicalUnit.SAC_RECT_FUNCTION ) { return getRectangle( CSSRectangleType.RECT, value.getParameters() ); } return null; }
&& nextUnit.getLexicalUnitType() == LexicalUnit.SAC_FUNCTION ) String function = nextUnit.getFunctionName(); if( "from".equals( function ) ) { percent = Float.valueOf( 0f );
if( type == LexicalUnit.SAC_FUNCTION && "rgba".equals( nextUnit.getFunctionName() ) ) { color = readColorRgba( nextUnit ); } else {
public CSSValue createValue( StyleKey name, LexicalUnit value ) { if ( value.getLexicalUnitType() == LexicalUnit.SAC_IDENT ) { final String stringValue = value.getStringValue(); if ( stringValue.equalsIgnoreCase( "auto" ) ) { return CSSAutoValue.getInstance(); } } else if ( value.getLexicalUnitType() == LexicalUnit.SAC_FUNCTION ) { if ( value.getFunctionName().equalsIgnoreCase( "inset-rect" ) ) { return getRectangle( CSSRectangleType.INSET_RECT, value.getParameters() ); } return null; } else if ( value.getLexicalUnitType() == LexicalUnit.SAC_RECT_FUNCTION ) { return getRectangle( CSSRectangleType.RECT, value.getParameters() ); } return null; }
String functionName = unit.getFunctionName(); if ( parameters == null ) {
if ((lu != null) && (lu.getLexicalUnitType() == LexicalUnit.SAC_FUNCTION)) { if (!lu.getFunctionName().equalsIgnoreCase("format")) { break;
if ((lu != null) && (lu.getLexicalUnitType() == LexicalUnit.SAC_FUNCTION)) { if (!lu.getFunctionName().equalsIgnoreCase("format")) { break;
switch (lu.getLexicalUnitType()) { case LexicalUnit.SAC_FUNCTION: if (!lu.getFunctionName().equalsIgnoreCase("rect")) { break;
switch (lu.getLexicalUnitType()) { case LexicalUnit.SAC_FUNCTION: if (!lu.getFunctionName().equalsIgnoreCase("rect")) { break;
switch (lu.getLexicalUnitType()) { case LexicalUnit.SAC_FUNCTION: if (!lu.getFunctionName().equalsIgnoreCase("rect")) { break;