Java Code Examples for org.w3c.css.sac.LexicalUnit#SAC_RECT_FUNCTION

The following examples show how to use org.w3c.css.sac.LexicalUnit#SAC_RECT_FUNCTION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CropReadHandler.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
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;
}
 
Example 2
Source File: OverflowClipReadHandler.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
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;
}
 
Example 3
Source File: CSSValueFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static boolean isFunctionValue( LexicalUnit unit ) {
  final short lexicalUnitType = unit.getLexicalUnitType();
  return ( lexicalUnitType == LexicalUnit.SAC_FUNCTION ||
    lexicalUnitType == LexicalUnit.SAC_COUNTER_FUNCTION ||
    lexicalUnitType == LexicalUnit.SAC_COUNTERS_FUNCTION ||
    lexicalUnitType == LexicalUnit.SAC_RGBCOLOR ||
    lexicalUnitType == LexicalUnit.SAC_RECT_FUNCTION );
}