本文整理汇总了Java中cz.vutbr.web.css.CSSProperty.BorderStyle方法的典型用法代码示例。如果您正苦于以下问题:Java CSSProperty.BorderStyle方法的具体用法?Java CSSProperty.BorderStyle怎么用?Java CSSProperty.BorderStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cz.vutbr.web.css.CSSProperty
的用法示例。
在下文中一共展示了CSSProperty.BorderStyle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBorderColor
import cz.vutbr.web.css.CSSProperty; //导入方法依赖的package包/类
/**
* Returns color of border
*/
private Color getBorderColor(ElementBox elem, String side) {
Color clr = null;
// gets the color value from CSS property
CSSProperty.BorderColor bclr = elem.getStyle().getProperty("border-"+side+"-color");
TermColor tclr = elem.getStyle().getValue(TermColor.class, "border-"+side+"-color");
CSSProperty.BorderStyle bst = elem.getStyle().getProperty("border-"+side+"-style");
if (bst != CSSProperty.BorderStyle.HIDDEN && bclr != CSSProperty.BorderColor.TRANSPARENT) {
if (tclr != null) clr = tclr.getValue();
if (clr == null) {
clr = elem.getVisualContext().getColor();
if (clr == null) clr = Color.BLACK;
}
}
else { clr = elem.getBgcolor(); }
return clr;
}
示例2: writeBorderSVG
import cz.vutbr.web.css.CSSProperty; //导入方法依赖的package包/类
protected void writeBorderSVG(ElementBox eb, int x1, int y1, int x2, int y2, String side, int width, int right, int down, PrintWriter out) throws IOException
{
TermColor tclr = eb.getStyle().getValue(TermColor.class, "border-"+side+"-color");
CSSProperty.BorderStyle bst = eb.getStyle().getProperty("border-"+side+"-style");
if (tclr != null && bst != CSSProperty.BorderStyle.HIDDEN)
{
Color clr = tclr.getValue();
if (clr == null) clr = Color.BLACK;
String stroke = "";
if (bst == CSSProperty.BorderStyle.SOLID)
{
stroke = "stroke-width:" + width;
}
else if (bst == CSSProperty.BorderStyle.DOTTED)
{
stroke = "stroke-width:" + width + ";stroke-dasharray:" + width + "," + width;
}
else if (bst == CSSProperty.BorderStyle.DASHED)
{
stroke = "stroke-width:" + width + ";stroke-dasharray:" + (3*width) + "," + width;
}
else if (bst == CSSProperty.BorderStyle.DOUBLE)
{
//double is not supported yet, we'll use single
stroke = "stroke-width:" + width;
}
else //default or unsupported - draw a solid line
{
stroke = "stroke-width:" + width;
}
String coords = "M " + (x1+right) + "," + (y1+down) + " L " + (x2+right) + "," + (y2+down);
String style = "fill:none;stroke:" + colorString(clr) + ";" + stroke;
out.println("<path style=\"" + style + "\" d=\"" + coords + "\" />");
}
}
示例3: CSSStroke
import cz.vutbr.web.css.CSSProperty; //导入方法依赖的package包/类
/**
* Creates a new CSS stroke.
* @param width Border width
* @param style Border css style
* @param reverse Should be true for right and bottom border - used for reversing the shape of 'double' style border.
*/
public CSSStroke(int width, CSSProperty.BorderStyle style, boolean reverse)
{
this.width = width;
this.style = style;
this.reverse = reverse;
}