本文整理汇总了Java中com.caverock.androidsvg.SVG.Pattern类的典型用法代码示例。如果您正苦于以下问题:Java Pattern类的具体用法?Java Pattern怎么用?Java Pattern使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pattern类属于com.caverock.androidsvg.SVG包,在下文中一共展示了Pattern类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doFilledPath
import com.caverock.androidsvg.SVG.Pattern; //导入依赖的package包/类
private void doFilledPath(SvgElement obj, Path path)
{
// First check for pattern fill. It requires special handling.
if (state.style.fill instanceof SVG.PaintReference)
{
SVG.SvgObject ref = document.resolveIRI(((SVG.PaintReference) state.style.fill).href);
if (ref instanceof SVG.Pattern) {
SVG.Pattern pattern = (SVG.Pattern)ref;
fillWithPattern(obj, path, pattern);
return;
}
}
// Otherwise do a normal fill
canvas.drawPath(path, state.fillPaint);
}
示例2: doFilledPath
import com.caverock.androidsvg.SVG.Pattern; //导入依赖的package包/类
private void doFilledPath(SvgElement obj, Path path) {
// First check for pattern fill. It requires special handling.
if (state.style.fill instanceof SVG.PaintReference) {
SVG.SvgObject ref = document
.resolveIRI(((SVG.PaintReference) state.style.fill).href);
if (ref instanceof SVG.Pattern) {
SVG.Pattern pattern = (SVG.Pattern) ref;
fillWithPattern(obj, path, pattern);
return;
}
}
// Otherwise do a normal fill
canvas.drawPath(path, state.fillPaint);
}
示例3: doFilledPath
import com.caverock.androidsvg.SVG.Pattern; //导入依赖的package包/类
private void doFilledPath(SvgElement obj, Path path) {
// First check for pattern fill. It requires special handling.
if (state.style.fill instanceof SVG.PaintReference) {
SVG.SvgObject ref = document.resolveIRI(((SVG.PaintReference) state.style.fill).href);
if (ref instanceof SVG.Pattern) {
SVG.Pattern pattern = (SVG.Pattern) ref;
fillWithPattern(obj, path, pattern);
return;
}
}
// Otherwise do a normal fill
canvas.drawPath(path, state.fillPaint);
}
示例4: fillInChainedPatternFields
import com.caverock.androidsvg.SVG.Pattern; //导入依赖的package包/类
private void fillInChainedPatternFields(Pattern pattern, String href) {
// Locate the referenced object
SVG.SvgObject ref = pattern.document.resolveIRI(href);
if (ref == null) {
// Non-existent
warn("Pattern reference '%s' not found", href);
return;
}
if (!(ref instanceof Pattern)) {
error("Pattern href attributes must point to other pattern elements");
return;
}
if (ref == pattern) {
error("Circular reference in pattern href attribute '%s'", href);
return;
}
Pattern pRef = (Pattern) ref;
if (pattern.patternUnitsAreUser == null)
pattern.patternUnitsAreUser = pRef.patternUnitsAreUser;
if (pattern.patternContentUnitsAreUser == null)
pattern.patternContentUnitsAreUser = pRef.patternContentUnitsAreUser;
if (pattern.patternTransform == null)
pattern.patternTransform = pRef.patternTransform;
if (pattern.x == null)
pattern.x = pRef.x;
if (pattern.y == null)
pattern.y = pRef.y;
if (pattern.width == null)
pattern.width = pRef.width;
if (pattern.height == null)
pattern.height = pRef.height;
// attributes from superclasses
if (pattern.children.isEmpty())
pattern.children = pRef.children;
if (pattern.viewBox == null)
pattern.viewBox = pRef.viewBox;
if (pattern.preserveAspectRatio == null) {
pattern.preserveAspectRatio = pRef.preserveAspectRatio;
}
if (pRef.href != null)
fillInChainedPatternFields(pattern, pRef.href);
}
示例5: fillInChainedPatternFields
import com.caverock.androidsvg.SVG.Pattern; //导入依赖的package包/类
private void fillInChainedPatternFields(Pattern pattern, String href) {
// Locate the referenced object
SVG.SvgObject ref = pattern.document.resolveIRI(href);
if (ref == null) {
// Non-existent
warn("Pattern reference '%s' not found", href);
return;
}
if (!(ref instanceof Pattern)) {
error("Pattern href attributes must point to other pattern elements");
return;
}
if (ref == pattern) {
error("Circular reference in pattern href attribute '%s'", href);
return;
}
Pattern pRef = (Pattern) ref;
if (pattern.patternUnitsAreUser == null)
pattern.patternUnitsAreUser = pRef.patternUnitsAreUser;
if (pattern.patternContentUnitsAreUser == null)
pattern.patternContentUnitsAreUser = pRef.patternContentUnitsAreUser;
if (pattern.patternTransform == null)
pattern.patternTransform = pRef.patternTransform;
if (pattern.x == null)
pattern.x = pRef.x;
if (pattern.y == null)
pattern.y = pRef.y;
if (pattern.width == null)
pattern.width = pRef.width;
if (pattern.height == null)
pattern.height = pRef.height;
// attributes from superclasses
if (pattern.children.isEmpty())
pattern.children = pRef.children;
if (pattern.viewBox == null)
pattern.viewBox = pRef.viewBox;
if (pattern.preserveAspectRatio == null) {
pattern.preserveAspectRatio = pRef.preserveAspectRatio;
}
if (pRef.href != null)
fillInChainedPatternFields(pattern, pRef.href);
}
示例6: fillInChainedPatternFields
import com.caverock.androidsvg.SVG.Pattern; //导入依赖的package包/类
private void fillInChainedPatternFields(Pattern pattern, String href)
{
// Locate the referenced object
SVG.SvgObject ref = pattern.document.resolveIRI(href);
if (ref == null) {
// Non-existent
warn("Pattern reference '%s' not found", href);
return;
}
if (!(ref instanceof Pattern)) {
error("Pattern href attributes must point to other pattern elements");
return;
}
if (ref == pattern) {
error("Circular reference in pattern href attribute '%s'", href);
return;
}
Pattern pRef = (Pattern) ref;
if (pattern.patternUnitsAreUser == null)
pattern.patternUnitsAreUser = pRef.patternUnitsAreUser;
if (pattern.patternContentUnitsAreUser == null)
pattern.patternContentUnitsAreUser = pRef.patternContentUnitsAreUser;
if (pattern.patternTransform == null)
pattern.patternTransform = pRef.patternTransform;
if (pattern.x == null)
pattern.x = pRef.x;
if (pattern.y == null)
pattern.y = pRef.y;
if (pattern.width == null)
pattern.width = pRef.width;
if (pattern.height == null)
pattern.height = pRef.height;
// attributes from superclasses
if (pattern.children.isEmpty())
pattern.children = pRef.children;
if (pattern.viewBox == null)
pattern.viewBox = pRef.viewBox;
if (pattern.preserveAspectRatio == null) {
pattern.preserveAspectRatio = pRef.preserveAspectRatio;
}
if (pRef.href != null)
fillInChainedPatternFields(pattern, pRef.href);
}