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


Java SvgPaint类代码示例

本文整理汇总了Java中com.caverock.androidsvg.SVG.SvgPaint的典型用法代码示例。如果您正苦于以下问题:Java SvgPaint类的具体用法?Java SvgPaint怎么用?Java SvgPaint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: parsePaintSpecifier

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private static SvgPaint parsePaintSpecifier(String val, String attrName)
		throws SAXException {
	if (val.startsWith("url(")) {
		int closeBracket = val.indexOf(")");
		if (closeBracket == -1)
			throw new SAXException("Bad " + attrName
					+ " attribute. Unterminated url() reference");

		String href = val.substring(4, closeBracket).trim();
		SvgPaint fallback = null;

		val = val.substring(closeBracket + 1).trim();
		if (val.length() > 0)
			fallback = parseColourSpecifer(val);
		return new PaintReference(href, fallback);

	}
	return parseColourSpecifer(val);
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:20,代码来源:SVGParser.java

示例2: setPaintColour

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private void setPaintColour(RendererState state, boolean isFill,
		SvgPaint paint) {
	float paintOpacity = (isFill) ? state.style.fillOpacity
			: state.style.strokeOpacity;
	int col;
	if (paint instanceof SVG.Colour) {
		col = ((SVG.Colour) paint).colour;
	} else if (paint instanceof CurrentColor) {
		col = state.style.color.colour;
	} else {
		return;
	}
	col = clamp255(paintOpacity) << 24 | col;
	if (isFill)
		state.fillPaint.setColor(col);
	else
		state.strokePaint.setColor(col);
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:19,代码来源:SVGAndroidRenderer.java

示例3: parsePaintSpecifier

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private static SvgPaint parsePaintSpecifier(String val, String attrName) throws SAXException {
    if (val.startsWith("url(")) {
        int closeBracket = val.indexOf(")");
        if (closeBracket == -1)
            throw new SAXException("Bad " + attrName + " attribute. Unterminated url() reference");

        String href = val.substring(4, closeBracket).trim();
        SvgPaint fallback = null;

        val = val.substring(closeBracket + 1).trim();
        if (val.length() > 0)
            fallback = parseColourSpecifer(val);
        return new PaintReference(href, fallback);

    }
    return parseColourSpecifer(val);
}
 
开发者ID:StepicOrg,项目名称:stepik-android,代码行数:18,代码来源:SVGParser.java

示例4: setPaintColour

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private void setPaintColour(RendererState state, boolean isFill, SvgPaint paint) {
    float paintOpacity = (isFill) ? state.style.fillOpacity : state.style.strokeOpacity;
    int col;
    if (paint instanceof SVG.Colour) {
        col = ((SVG.Colour) paint).colour;
    } else if (paint instanceof CurrentColor) {
        col = state.style.color.colour;
    } else {
        return;
    }
    col = clamp255(paintOpacity) << 24 | col;
    if (isFill)
        state.fillPaint.setColor(col);
    else
        state.strokePaint.setColor(col);
}
 
开发者ID:StepicOrg,项目名称:stepik-android,代码行数:17,代码来源:SVGAndroidRenderer.java

示例5: parsePaintSpecifier

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private static SvgPaint parsePaintSpecifier(String val, String attrName) throws SVGParseException
{
   if (val.startsWith("url("))
   {
      int  closeBracket = val.indexOf(")"); 
      if (closeBracket == -1)
         throw new SVGParseException("Bad "+attrName+" attribute. Unterminated url() reference");

      String    href = val.substring(4, closeBracket).trim();
      SvgPaint  fallback = null;

      val = val.substring(closeBracket+1).trim();
      if (val.length() > 0)
         fallback = parseColourSpecifer(val);
      return new PaintReference(href, fallback);

   }
   return parseColourSpecifer(val);
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:20,代码来源:SVGParser.java

示例6: setPaintColour

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private void  setPaintColour(RendererState state, boolean isFill, SvgPaint paint)
{
   float  paintOpacity = (isFill) ? state.style.fillOpacity : state.style.strokeOpacity;
   int    col;
   if (paint instanceof SVG.Colour) {
      col = ((SVG.Colour) paint).colour;
   } else if (paint instanceof CurrentColor) {
      col = state.style.color.colour;
   } else {
      return;
   }
   col = colourWithOpacity(col, paintOpacity);
   if (isFill)
      state.fillPaint.setColor(col);
   else
      state.strokePaint.setColor(col);
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:18,代码来源:SVGAndroidRenderer.java

示例7: parseColourSpecifer

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private static SvgPaint parseColourSpecifer(String val) throws SAXException {
	if (val.equals(NONE)) {
		return null;
	} else if (val.equals(CURRENTCOLOR)) {
		return CurrentColor.getInstance();
	} else {
		return parseColour(val);
	}
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:10,代码来源:SVGParser.java

示例8: parseColourSpecifer

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private static SvgPaint parseColourSpecifer(String val) throws SAXException {
    if (val.equals(NONE)) {
        return null;
    } else if (val.equals(CURRENTCOLOR)) {
        return CurrentColor.getInstance();
    } else {
        return parseColour(val);
    }
}
 
开发者ID:StepicOrg,项目名称:stepik-android,代码行数:10,代码来源:SVGParser.java

示例9: parseColourSpecifer

import com.caverock.androidsvg.SVG.SvgPaint; //导入依赖的package包/类
private static SvgPaint parseColourSpecifer(String val) throws SVGParseException
{
   switch (val) {
      case NONE:
         return null;
      case CURRENTCOLOR:
         return CurrentColor.getInstance();
      default:
         return parseColour(val);
   }
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:12,代码来源:SVGParser.java


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