/** * Creates an empty block style definition. * @return */ protected NodeData createBlockStyle() { NodeData ret = CSSFactory.createNodeData(); TermFactory tf = CSSFactory.getTermFactory(); ret.push(createDeclaration("display", tf.createIdent("block"))); return ret; }
@Override public Object visitIdent_list_item(Ident_list_itemContext ctx) { boolean dash = false; if (ctx.INVALID_STATEMENT() != null) { log.debug("VP - ident invalid"); return null; } if (ctx.MINUS() != null) { dash = true; } if (ctx.IDENT() != null) { log.debug("VP - ident item"); return tf.createIdent(extractTextUnescaped(ctx.IDENT().getText()), dash); } else return null; }
return false; //no values set else if (sz[1] == null) sz[1] = tf.createIdent("auto"); else //if used two elements, inform master iteration.inc();
return false; //no values set else if (sz[1] == null) sz[1] = tf.createIdent("auto"); else //if used two elements, inform master iteration.inc();
return false; //no values set else if (sz[1] == null) sz[1] = tf.createIdent("auto"); else //if used two elements, inform master iteration.inc();
} else if (ctx.IDENT() != null) { log.debug("FA - ident"); funct_args_stack.peek().term = tf.createIdent(extractTextUnescaped(ctx.IDENT().getText())); } else if (ctx.PERCENTAGE() != null) { log.debug("FA - percentage");
} else if (ctx.IDENT() != null) { log.debug("VP - ident"); funct_args_stack.peek().term = tf.createIdent(extractTextUnescaped(ctx.IDENT().getText())); } else if (ctx.PERCENTAGE() != null) { log.debug("VP - percentage");
} else if (ctx.IDENT() != null) { log.debug("VP - ident"); terms_stack.peek().term = tf.createIdent(extractTextUnescaped(ctx.IDENT().getText()), terms_stack.peek().dash); } else if (ctx.HASH() != null) { log.debug("VP - hash");
} else if (ctx.IDENT() != null) { log.debug("VP - ident"); terms_stack.peek().term = tf.createIdent(extractTextUnescaped(ctx.IDENT().getText()), terms_stack.peek().dash); } else if (ctx.HASH() != null) { log.debug("VP - hash");
allowedFamilies, tf.createIdent(name));
allowedFamilies, tf.createIdent(name));
allowedFamilies, tf.createIdent(name));
allowedFamilies, tf.createIdent(name));
@Override public Term<?> getSpecifiedValue(String name) { Term<?> ret = getValue(name, true); if (ret == null) ret = css.getDefaultValue(name); if (ret != null) { if (ret instanceof TermColor && ((TermColor) ret).getKeyword() == Keyword.CURRENT_COLOR) { //clone the value fot setting the current color final TermFactory tf = CSSFactory.getTermFactory(); ret = tf.createColor(tf.createIdent("currentColor")); //set the current color value TermColor cvalue = getValue(TermColor.class, "color", true); if (cvalue == null) cvalue = (TermColor) css.getDefaultValue("color"); ((TermColor) ret).setValue(cvalue.getValue()); } } return ret; }
@Override public Term<?> getSpecifiedValue(String name) { Term<?> ret = getValue(name, true); if (ret == null) ret = css.getDefaultValue(name); if (ret != null) { if (ret instanceof TermColor && ((TermColor) ret).getKeyword() == Keyword.CURRENT_COLOR) { //clone the value fot setting the current color final TermFactory tf = CSSFactory.getTermFactory(); ret = tf.createColor(tf.createIdent("currentColor")); //set the current color value TermColor cvalue = getValue(TermColor.class, "color", true); if (cvalue == null) cvalue = (TermColor) css.getDefaultValue("color"); ((TermColor) ret).setValue(cvalue.getValue()); } } return ret; }
ret.push(createDeclaration("position", tf.createIdent("relative"))); ret.push(createDeclaration("border-width", tf.createLength(1f, Unit.px))); ret.push(createDeclaration("border-style", tf.createIdent("solid"))); ret.push(createDeclaration("border-color", tf.createColor(0, 0, 255))); ret.push(createDeclaration("margin", tf.createLength(0.5f, Unit.em)));
protected NodeData createLineStyle(float x1, float y1, float x2, float y2) { HtmlDivLine line = new HtmlDivLine(x1, y1, x2, y2); String bside = line.getBorderSide(); NodeData ret = CSSFactory.createNodeData(); TermFactory tf = CSSFactory.getTermFactory(); ret.push(createDeclaration("position", tf.createIdent("absolute"))); ret.push(createDeclaration("position", tf.createIdent("absolute"))); ret.push(createDeclaration("left", tf.createLength(line.getLeft(), unit))); ret.push(createDeclaration("top", tf.createLength(line.getTop(), unit))); ret.push(createDeclaration("width", tf.createLength(line.getWidth(), unit))); ret.push(createDeclaration("height", tf.createLength((float) line.getHeight(), unit))); ret.push(createDeclaration(bside + "-width", tf.createLength(line.getLineStrokeWidth(), unit))); ret.push(createDeclaration(bside + "-style", tf.createIdent("solid"))); String color = colorString(getGraphicsState().getStrokingColor()); ret.push(createDeclaration(bside + "-color", tf.createColor(color))); if (line.getAngleDegrees() != 0) { TermFunction rotate = tf.createFunction(); rotate.setFunctionName("rotate").add(tf.createAngle(String.valueOf(line.getAngleDegrees()), Unit.deg, 1)); ret.push(createDeclaration("transform", rotate)); } return ret; }
ret.push(createDeclaration("position", tf.createIdent("absolute"))); ret.push(createDeclaration("overflow", tf.createIdent("hidden"))); ret.push(createDeclaration("left", tf.createLength(style.getLeft(), unit))); ret.push(createDeclaration("top", tf.createLength(style.getTop(), unit))); ret.push(createDeclaration("font-weight", tf.createIdent(style.getFontWeight()))); if (style.getFontStyle() != null) ret.push(createDeclaration("font-style", tf.createIdent(style.getFontStyle()))); if (style.getWordSpacing() != 0) ret.push(createDeclaration("word-spacing", tf.createLength((float) style.getWordSpacing(), unit)));
ret.push(createDeclaration("position", tf.createIdent("absolute"))); ret.push(createDeclaration("left", tf.createLength(x, unit))); ret.push(createDeclaration("top", tf.createLength(y, unit))); ret.push(createDeclaration("border-style", tf.createIdent("solid"))); String color = colorString(getGraphicsState().getStrokingColor()); ret.push(createDeclaration("border-color", tf.createColor(color)));
if (Grid.AUTO_FLOW.equals(property)) { if (beforeSlash) { autoFlowDecl.add(tf.createIdent("row")); } else { autoFlowDecl.add(tf.createIdent("column"));