Package com.kitfox.svg.xml

Examples of com.kitfox.svg.xml.StyleAttribute


    public boolean getStyle(StyleAttribute attrib, boolean recursive) throws SVGException
    {
        String styName = attrib.getName();

        //Check for local inline styles
        StyleAttribute styAttr = (StyleAttribute)inlineStyles.get(styName);

        attrib.setStringValue(styAttr == null ? "" : styAttr.getStringValue());

        //Return if we've found a non animated style
        if (styAttr != null)
        {
            return true;
        }


        //Check for presentation attribute
        StyleAttribute presAttr = (StyleAttribute)presAttribs.get(styName);

        attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());

        //Return if we've found a presentation attribute instead
        if (presAttr != null)
        {
            return true;
View Full Code Here


    public boolean getPres(StyleAttribute attrib) throws SVGException
    {
        String presName = attrib.getName();

        //Make sure we have a coresponding presentation attribute
        StyleAttribute presAttr = (StyleAttribute) presAttribs.get(presName);

        //Copy presentation value directly
        attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());

        //Return if we found presentation attribute
        if (presAttr != null)
        {
            return true;
View Full Code Here

    public boolean updateTime(double curTime) throws SVGException
    {
//        if (trackManager.getNumTracks() == 0) return false;

        //Get current values for parameters
        StyleAttribute sty = new StyleAttribute();
        boolean stateChange = false;

        if (getPres(sty.setName("x")))
        {
            float newVal = sty.getFloatValueWithUnits();
            if (newVal != x)
            {
                x = newVal;
                stateChange = true;
            }
        }

        if (getPres(sty.setName("y")))
        {
            float newVal = sty.getFloatValueWithUnits();
            if (newVal != y)
            {
                y = newVal;
                stateChange = true;
            }
        }

        if (getPres(sty.setName("width")))
        {
            float newVal = sty.getFloatValueWithUnits();
            if (newVal != width)
            {
                width = newVal;
                stateChange = true;
            }
        }

        if (getPres(sty.setName("height")))
        {
            float newVal = sty.getFloatValueWithUnits();
            if (newVal != height)
            {
                height = newVal;
                stateChange = true;
            }
        }

        try
        {
            if (getPres(sty.setName("xlink:href")))
            {
                URI src = sty.getURIValue(getXMLBase());
                URL newVal = src.toURL();

                if (!newVal.equals(href))
                {
                    href = newVal;
View Full Code Here

   
    protected void build() throws SVGException
    {
        super.build();
       
        StyleAttribute sty = new StyleAttribute();
       
        if (getPres(sty.setName("xlink:href")))
        {
            href = sty.getURIValue(getXMLBase());
        }
       
        if (getPres(sty.setName("xlink:title")))
        {
            title = sty.getStringValue();
        }
    }
View Full Code Here

    {
        boolean changeState = super.updateTime(curTime);
//        if (trackManager.getNumTracks() == 0) return false;

        //Get current values for parameters
        StyleAttribute sty = new StyleAttribute();
       
        if (getPres(sty.setName("xlink:href")))
        {
            href = sty.getURIValue(getXMLBase());
        }
       
        if (getPres(sty.setName("xlink:title")))
        {
            title = sty.getStringValue();
        }
       
        return changeState;
    }
View Full Code Here

    protected void build() throws SVGException
    {
        super.build();

        StyleAttribute sty = new StyleAttribute();

        if (getPres(sty.setName("type")))
        {
            type = sty.getStringValue();
        }
    }
View Full Code Here

    protected void build() throws SVGException
    {
        super.build();

        StyleAttribute sty = new StyleAttribute();

        if (getPres(sty.setName("x")))
        {
            x = sty.getFloatList();
        }

        if (getPres(sty.setName("y")))
        {
            y = sty.getFloatList();
        }

        if (getPres(sty.setName("dx")))
        {
            dx = sty.getFloatList();
        }

        if (getPres(sty.setName("dy")))
        {
            dy = sty.getFloatList();
        }

        if (getPres(sty.setName("rotate")))
        {
            rotate = sty.getFloatList();
            for (int i = 0; i < this.rotate.length; i++)
            {
                rotate[i] = (float) Math.toRadians(this.rotate[i]);
            }
View Full Code Here

        } else if (dy != null)
        {
            cursorY += dy[0];
        }

        StyleAttribute sty = new StyleAttribute();

        String fontFamily = null;
        if (getStyle(sty.setName("font-family")))
        {
            fontFamily = sty.getStringValue();
        }


        float fontSize = 12f;
        if (getStyle(sty.setName("font-size")))
        {
            fontSize = sty.getFloatValueWithUnits();
        }

        float letterSpacing = 0;
        if (getStyle(sty.setName("letter-spacing")))
        {
            letterSpacing = sty.getFloatValueWithUnits();
        }


        //Get font
        Font font = diagram.getUniverse().getFont(fontFamily);
View Full Code Here

        {
            cursorX += dx[0];
            cursorY += dy[0];
        }

        StyleAttribute sty = new StyleAttribute();

        String fontFamily = null;
        if (getPres(sty.setName("font-family")))
        {
            fontFamily = sty.getStringValue();
        }


        float fontSize = 12f;
        if (getPres(sty.setName("font-size")))
        {
            fontSize = sty.getFloatValueWithUnits();
        }

        //Get font
        Font font = diagram.getUniverse().getFont(fontFamily);
        if (font == null)
View Full Code Here

    protected void build() throws SVGException
    {
        super.build();

        StyleAttribute sty = new StyleAttribute();

        if (getPres(sty.setName("vector-effect")))
        {
            if ("non-scaling-stroke".equals(sty.getStringValue()))
            {
                vectorEffect = VECTOR_EFFECT_NON_SCALING_STROKE;
            } else
            {
                vectorEffect = VECTOR_EFFECT_NONE;
View Full Code Here

TOP

Related Classes of com.kitfox.svg.xml.StyleAttribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.