• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ParseException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createValue

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Creates a new AnimatableValue from a string.
 */
public AnimatableValue createValue(AnimationTarget target, String ns,
                                   String ln, boolean isCSS, String s) {
    try {
        short pcInterp = target.getPercentageInterpretation
            (ns, ln, isCSS);
        parser.parse(s);
        return new AnimatableLengthListValue
            (target, producer.getLengthTypeArray(),
             producer.getLengthValueArray(),
             pcInterp);
    } catch (ParseException e) {
        // XXX Do something better than returning null.
        return null;
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:19,代码来源:SVGAnimationEngine.java


示例2: parse

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Parse a String value as an SVGAngle.
 */
protected void parse(String s) {
    try {
        AngleParser angleParser = new AngleParser();
        angleParser.setAngleHandler(new DefaultAngleHandler() {
            public void angleValue(float v) throws ParseException {
                value = v;
            }
            public void deg() throws ParseException {
                setUnitType(SVG_ANGLETYPE_DEG);
            }
            public void rad() throws ParseException {
                setUnitType(SVG_ANGLETYPE_RAD);
            }
            public void grad() throws ParseException {
                setUnitType(SVG_ANGLETYPE_GRAD);
            }
        });
        setUnitType(SVG_ANGLETYPE_UNSPECIFIED);
        angleParser.parse(s);
    } catch (ParseException e) {
        setUnitType(SVG_ANGLETYPE_UNKNOWN);
        value = 0;
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:28,代码来源:SVGOMAngle.java


示例3: parsePathShape

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
public static Shape parsePathShape(String svgPathShape)
{
	try
	{
		AWTPathProducer pathProducer = new AWTPathProducer();
		PathParser pathParser = new PathParser();
		pathParser.setPathHandler(pathProducer);
		pathParser.parse(svgPathShape);
		return pathProducer.getShape();
	}
	catch (ParseException ex)
	{
		// Fallback to default square shape if shape is incorrect
		return new Rectangle2D.Float(0, 0, 1, 1);
	}
}
 
开发者ID:valsr,项目名称:SweetHome3D,代码行数:17,代码来源:ModelManager.java


示例4: string2

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Scans a double quoted string.
 */
protected int string2() throws IOException {
    start = position;
    loop: for (;;) {
        switch (nextChar()) {
        case -1:
            throw new ParseException("eof",
                                     reader.getLine(),
                                     reader.getColumn());
        case '"':
            break loop;
        }
    }
    nextChar();
    return STRING;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:19,代码来源:XPathSubsetContentSelector.java


示例5: parseDur

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Parses a new 'dur' attribute.
 */
protected void parseDur(String dur) {
    if (dur.equals(SMIL_MEDIA_VALUE)) {
        durMedia = true;
        simpleDur = UNRESOLVED;
    } else {
        durMedia = false;
        if (dur.length() == 0 || dur.equals(SMIL_INDEFINITE_VALUE)) {
            simpleDur = INDEFINITE;
        } else {
            try {
                simpleDur = parseClockValue(dur, false);
            } catch (ParseException e) {
                throw createException
                    ("attribute.malformed",
                     new Object[] { null, SMIL_DUR_ATTRIBUTE });
            }
            if (simpleDur < 0) {
                simpleDur = INDEFINITE;
            }
        }
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:26,代码来源:TimedElement.java


示例6: parseValues

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
protected AnimatableValue[] parseValues(String s) {
    try {
        LengthPairListParser lplp = new LengthPairListParser();
        LengthArrayProducer lap = new LengthArrayProducer();
        lplp.setLengthListHandler(lap);
        lplp.parse(s);
        short[] types = lap.getLengthTypeArray();
        float[] values = lap.getLengthValueArray();
        AnimatableValue[] ret = new AnimatableValue[types.length / 2];
        for (int i = 0; i < types.length; i += 2) {
            float x = animationTarget.svgToUserSpace
                (values[i], types[i], AnimationTarget.PERCENTAGE_VIEWPORT_WIDTH);
            float y = animationTarget.svgToUserSpace
                (values[i + 1], types[i + 1], AnimationTarget.PERCENTAGE_VIEWPORT_HEIGHT);
            ret[i / 2] = new AnimatableMotionPointValue(animationTarget, x, y, 0);
        }
        return ret;
    } catch (ParseException pEx ) {
        throw new BridgeException
            (ctx, element, pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
             new Object[] { SVG_VALUES_ATTRIBUTE, s });
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:24,代码来源:SVGAnimateMotionElementBridge.java


示例7: parseMax

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Parses a new 'max' attribute.
 */
protected void parseMax(String max) {
    if (max.equals(SMIL_MEDIA_VALUE)) {
        this.max = INDEFINITE;
        maxMedia = true;
    } else {
        maxMedia = false;
        if (max.length() == 0 || max.equals(SMIL_INDEFINITE_VALUE)) {
            this.max = INDEFINITE;
        } else {
            try {
                this.max = parseClockValue(max, false);
            } catch (ParseException ex) {
            	this.max = INDEFINITE;
            }
            if (this.max < 0) {
                this.max = 0;
            }
        }
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:24,代码来源:TimedElement.java


示例8: parseRepeatDur

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Parses a new 'repeatDur' attribute.
 */
protected void parseRepeatDur(String repeatDur) {
    try {
        if (repeatDur.length() == 0) {
            this.repeatDur = UNRESOLVED;
        } else if (repeatDur.equals(SMIL_INDEFINITE_VALUE)) {
            this.repeatDur = INDEFINITE;
        } else {
            this.repeatDur = parseClockValue(repeatDur, false);
        }
    } catch (ParseException ex) {
        throw createException
            ("attribute.malformed",
             new Object[] { null, SMIL_REPEAT_DUR_ATTRIBUTE });
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:19,代码来源:TimedElement.java


示例9: handleOption

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
public void handleOption(String optionValue, final SVGConverter c) {
    try {
        ClockParser p = new ClockParser(false);
        p.setClockHandler(new ClockHandler() {
            public void clockValue(float v) {
                handleOption(v, c);
            }
        });
        p.parse(optionValue);
    } catch (ParseException e) {
        throw new IllegalArgumentException();
    }
}
 
开发者ID:etomica,项目名称:etomica,代码行数:14,代码来源:Main.java


示例10: convertTransform

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Returns an AffineTransform according to the specified parameters.
 *
 * @param e the element that defines the transform
 * @param attr the name of the attribute that represents the transform
 * @param transform the transform to parse
 * @param ctx the BridgeContext to use for error information
 */
public static AffineTransform convertTransform(Element e,
                                               String attr,
                                               String transform,
                                               BridgeContext ctx) {
    try {
        return AWTTransformProducer.createAffineTransform(transform);
    } catch (ParseException pEx) {
        throw new BridgeException(ctx, e, pEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
                                  new Object[] {attr, transform, pEx });
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:SVGUtilities.java


示例11: doParse

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Parse the attribute associated with this SVGNumberList.
 * @param value attribute value
 * @param handler list handler
 */
protected void doParse(String value, ListHandler handler)
    throws ParseException{

    NumberListParser NumberListParser = new NumberListParser();
    NumberListBuilder builder = new NumberListBuilder(handler);

    NumberListParser.setNumberListHandler(builder);
    NumberListParser.parse(value);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:15,代码来源:AbstractSVGNumberList.java


示例12: curvetoCubicSmoothRel

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Implements {@link
 * org.apache.batik.parser.PathHandler#curvetoCubicSmoothRel(float,float,float,float)}.
 */
public void curvetoCubicSmoothRel(float x2, float y2,
                                  float x, float y) throws ParseException {
    listHandler.item(new SVGPathSegCurvetoCubicSmoothItem
        (SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,PATHSEG_CURVETO_CUBIC_SMOOTH_REL_LETTER,
         x2,y2,x,y));
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:AbstractSVGPathSegList.java


示例13: revalidate

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Initializes the list, if needed.
 */
protected void revalidate() {
    if (valid) {
        return;
    }

    valid = true;
    missing = false;
    malformed = false;

    String s = getValueAsString();
    if (s == null) {
        missing = true;
        return;
    }
    try {
        ListBuilder builder = new ListBuilder(this);

        doParse(s, builder);

        if (builder.getList() != null) {
            clear(itemList);
        }
        itemList = builder.getList();
    } catch (ParseException e) {
        itemList = new ArrayList(1);
        malformed = true;
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:32,代码来源:SVGOMAnimatedPoints.java


示例14: arcAbs

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Implements {@link
 * org.apache.batik.parser.PathHandler#arcAbs(float,float,float,boolean,boolean,float,float)}.
 */
public void arcAbs(float rx, float ry,
                   float xAxisRotation,
                   boolean largeArcFlag, boolean sweepFlag,
                   float x, float y) throws ParseException {
    listHandler.item(new SVGPathSegArcItem
        (SVGPathSeg.PATHSEG_ARC_ABS,PATHSEG_ARC_ABS_LETTER,
         rx,ry,xAxisRotation,largeArcFlag,sweepFlag,x,y));
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:AbstractSVGPathSegList.java


示例15: parseBegin

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Parses a new 'begin' attribute.
 */
protected void parseBegin(String begin) {
    try {
        if (begin.length() == 0) {
            begin = SMIL_BEGIN_DEFAULT_VALUE;
        }
        beginTimes = TimingSpecifierListProducer.parseTimingSpecifierList
            (TimedElement.this, true, begin,
             root.useSVG11AccessKeys, root.useSVG12AccessKeys);
    } catch (ParseException ex) {
        throw createException
            ("attribute.malformed",
             new Object[] { null, SMIL_BEGIN_ATTRIBUTE });
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:18,代码来源:TimedElement.java


示例16: arcRel

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Implements {@link
 * org.apache.batik.parser.PathHandler#arcRel(float,float,float,boolean,boolean,float,float)}.
 */
public void arcRel(float rx, float ry,
                   float xAxisRotation,
                   boolean largeArcFlag, boolean sweepFlag,
                   float x, float y) throws ParseException {
    listHandler.item(new SVGPathSegArcItem
        (SVGPathSeg.PATHSEG_ARC_REL,PATHSEG_ARC_REL_LETTER,
         rx,ry,xAxisRotation,largeArcFlag,sweepFlag,x,y));
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:AbstractSVGPathSegList.java


示例17: svgToObjectBoundingBox

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Returns the specified value with the specified direction in
 * objectBoundingBox units.
 *
 * @param s the value
 * @param attr the attribute name that represents the value
 * @param d the direction of the value
 * @param ctx the context used to resolve relative value
 */
public static float svgToObjectBoundingBox(String s,
                                           String attr,
                                           short d,
                                           Context ctx) {
    try {
        return org.apache.batik.parser.UnitProcessor.
            svgToObjectBoundingBox(s, attr, d, ctx);
    } catch (ParseException pEx ) {
        throw new BridgeException
            (getBridgeContext(ctx), ctx.getElement(),
             pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
             new Object[] {attr, s, pEx });
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:24,代码来源:UnitProcessor.java


示例18: svgToUserSpace

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Returns the specified coordinate with the specified direction
 * in user units.
 *
 * @param s the 'other' coordinate
 * @param attr the attribute name that represents the length
 * @param d the direction of the coordinate
 * @param ctx the context used to resolve relative value
 */
public static float svgToUserSpace(String s,
                                   String attr,
                                   short d,
                                   Context ctx) {
    try {
        return org.apache.batik.parser.UnitProcessor.
            svgToUserSpace(s, attr, d, ctx);
    } catch (ParseException pEx ) {
        throw new BridgeException
            (getBridgeContext(ctx), ctx.getElement(),
             pEx, ErrorConstants.ERR_ATTRIBUTE_VALUE_MALFORMED,
             new Object[] {attr, s, pEx, });
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:24,代码来源:UnitProcessor.java


示例19: viewBox

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Invoked when 'viewBox(x,y,width,height)' has been parsed.
 * @param x the viewbox x coordinate
 * @param y the viewbox y coordinate
 * @param width the viewbox width
 * @param height the viewbox height
 * @exception ParseException if an error occured while processing the
 *                           fragment identifier
 */
public void viewBox(float x, float y, float width, float height)
    throws ParseException {

    hasViewBox = true;
    viewBox = new float[4];
    viewBox[0] = x;
    viewBox[1] = y;
    viewBox[2] = width;
    viewBox[3] = height;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:20,代码来源:ViewBox.java


示例20: curvetoQuadraticRel

import org.apache.batik.parser.ParseException; //导入依赖的package包/类
/**
 * Implements {@link
 * org.apache.batik.parser.PathHandler#curvetoQuadraticRel(float,float,float,float)}.
 */
public void curvetoQuadraticRel(float x1, float y1,
                                float x, float y) throws ParseException {
    listHandler.item(new SVGPathSegCurvetoQuadraticItem
        (SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,PATHSEG_CURVETO_QUADRATIC_REL_LETTER,
         x1,y1,x,y));
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:11,代码来源:AbstractSVGPathSegList.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Folder类代码示例发布时间:2022-05-23
下一篇:
Java SynchronizedInterner类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap