java.lang.Object
org.jhotdraw8.css.function.AbstractCssFunction<T>
org.jhotdraw8.css.function.AbstractMathCssFunction<T>
org.jhotdraw8.css.function.CalcCssFunction<T>
- Type Parameters:
T- the element type of the DOM
- All Implemented Interfaces:
CssFunction<T>
- Direct Known Subclasses:
RoundCssFunction
Processes the
calc() function.
calc = "calc(", calc-sum, ")" ;
calc-sum = calc-product , { [ '+' | '-' ] , calc-product } ;
calc-product = calc-value , { '*' , calc-value | '/' , calc-number-value } ;
calc-value = number | dimension | percentage | '(' , calc-sum , ')' ;
calc-number-sum = calc-number-product , { [ '+' | '-' ] calc-number-product } ;
calc-number-product = calc-number-value> , { '*' , calc-number-value | '/' , calc-number-value } ;
calc-number-value = number | calc-number-sum ;
In addition, white space is required on both sides of the '+' and '-' operators.
(The '*' and '/' operaters can be used without white space around them.)
References:
- CSS Values and Units Module Level 4. Paragraph 10.1. Basic Arithmetic: calc()
- csswg.org
- CSS Values and Units Module Level 4. Paragraph 10.8. Syntax
- csswg.org
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets localized help text about this function.voidprocess(T element, CssTokenizer tt, SelectorModel<T> model, CssFunctionProcessor<T> functionProcessor, Consumer<CssToken> out, Deque<CssFunction<T>> recursionStack) Processes the function.Methods inherited from class org.jhotdraw8.css.function.AbstractMathCssFunction
parseCalcProduct, parseCalcSum, parseCalcValue, produceNumberPercentageOrDimensionMethods inherited from class org.jhotdraw8.css.function.AbstractCssFunction
getName
-
Field Details
-
NAME
Function name.- See Also:
-
-
Constructor Details
-
CalcCssFunction
public CalcCssFunction() -
CalcCssFunction
-
-
Method Details
-
process
public void process(T element, CssTokenizer tt, SelectorModel<T> model, CssFunctionProcessor<T> functionProcessor, Consumer<CssToken> out, Deque<CssFunction<T>> recursionStack) throws IOException, ParseException Description copied from interface:CssFunctionProcesses the function.- Parameters:
element- the DOM elementtt- the tokenizer providing the unprocessed tokensmodel- the selector modelfunctionProcessor- the function processorout- the consumer for the processed tokensrecursionStack- the recursion stack- Throws:
IOException- on IO failureParseException- on parsing failure
-
getHelpText
Description copied from interface:CssFunctionGets localized help text about this function.- Returns:
- localized help text
-