当前位置: 首页>>代码示例>>Java>>正文


Java TermColor.getValue方法代码示例

本文整理汇总了Java中cz.vutbr.web.css.TermColor.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TermColor.getValue方法的具体用法?Java TermColor.getValue怎么用?Java TermColor.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cz.vutbr.web.css.TermColor的用法示例。


在下文中一共展示了TermColor.getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBorderColor

import cz.vutbr.web.css.TermColor; //导入方法依赖的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;
}
 
开发者ID:radkovo,项目名称:CSSBoxPdf,代码行数:24,代码来源:PDFRenderer.java

示例2: writeBorderSVG

import cz.vutbr.web.css.TermColor; //导入方法依赖的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 + "\" />");  
    }
    
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:39,代码来源:ImageRenderer.java

示例3: writeBorderSVG

import cz.vutbr.web.css.TermColor; //导入方法依赖的package包/类
private void writeBorderSVG(ElementBox eb, int x1, int y1, int x2, int y2, String side, int width, int right, int down)
{
    CSSProperty.BorderColor bclr = eb.getStyle().getProperty("border-"+side+"-color");
    TermColor tclr = eb.getStyle().getValue(TermColor.class, "border-"+side+"-color");
    CSSProperty.BorderStyle bst = eb.getStyle().getProperty("border-"+side+"-style");
    if (bst != CSSProperty.BorderStyle.HIDDEN && bclr != CSSProperty.BorderColor.TRANSPARENT)
    {
        Color clr = null;
        if (tclr != null)
            clr = tclr.getValue();
        if (clr == null)
        {
            clr = eb.getVisualContext().getColor();
            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 + "\" />");  
    }
}
 
开发者ID:chrimm,项目名称:cordovastudio,代码行数:46,代码来源:SVGRenderer.java


注:本文中的cz.vutbr.web.css.TermColor.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。