Examples of FXGNode


Examples of com.adobe.fxg.dom.FXGNode

            parser.registerElementNode(2.0, FXG_NAMESPACE, FXG_RICHTEXT_ELEMENT, FlexRichTextNode.class);

            try
            {
                // Parse FXG to a DOM
                FXGNode node = parser.parse(source.getInputStream(), source.getNameForReporting());
                context.setAttribute(FXG_DOM_ROOT, node);

                QName topLevelQName = getQNameFromSource(source);
                unit.topLevelDefinitions.add(topLevelQName);
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

        {
            Source generatedSource = null;
            Source originalSource = unit.getSource();

            // Determine whether we need to introduce text class dependencies
            FXGNode rootNode = (FXGNode)unit.getContext().getAttribute(FXG_DOM_ROOT);
            boolean hasTextGraphic = false;
            String baseClassName = null;
            double version = 1.0;

            if (rootNode instanceof FlexGraphicNode)
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

         * used in the document).
         */
        private FXGSymbolClass transcodeFXG(CompilationUnit unit,
                String packageName, String className, TypeTable typeTable)
        {
            FXGNode rootNode = (FXGNode)unit.getContext().getAttribute(FXG_DOM_ROOT);

            FlexFXG2SWFTranscoder transcoder = new FlexFXG2SWFTranscoder(typeTable);
            PathResolver pathResolver = unit.getSource().getPathResolver();
            FlexResourceResolver resolver = new FlexResourceResolver(pathResolver);
            transcoder.setResourceResolver(resolver);
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

        // Record starting position
        startLine = locator.getLineNumber();
        startColumn = locator.getColumnNumber();

        // Check the current parent
        FXGNode parent = null;
        if (stack.size() > 0)
            parent = stack.peek();

        // Switch to special GroupDefinitionNode for Definition child
        if (isFXGNamespace(uri))
        {
            if (parent instanceof DefinitionNode && FXG_GROUP_ELEMENT.equals(localName))
                localName = FXG_GROUP_DEFINITION_ELEMENT;
        }

        // Create a node for this element
        FXGNode node = createNode(uri, localName);
       
        if (node == null)
        {
            if (root != null)
            {
                if (root.isVersionGreaterThanCompiler())
                {
                    // Warning: Minor version of this FXG file is greater than minor
                    // version supported by this compiler. Log a warning for an
                    // unknown element.
                    FXGLog.getLogger().log(FXGLogger.WARN, "UnknownElement", null, documentName, startLine, startColumn, localName, versionHandler.getVersion().asString());
                    unknownElement = localName;
                    return;
                }else
                {
                    throw new FXGException(startLine, startColumn, "UnknownElementInVersion", root.getFileVersion().asString(), localName);                   
                }
            }
            else
            {
                throw new FXGException(startLine, startColumn, "InvalidFXGRootNode");
            }
        }

        // Provide access to the root document node used for querying version
        // for non-root elements
        if (root != null)
        {
            node.setDocumentNode(root);
        }
       
        // Set node name if it is a delegate node. This allows proper error
        // message to be reported.
        if (node instanceof DelegateNode)
        {
            DelegateNode propertyNode = (DelegateNode)node;
            propertyNode.setName(localName);
        }
       
        // Set attributes on the current node
        for (int i = 0; i < attributes.getLength(); i++)
        {
            String attributeURI = attributes.getURI(i);
            if (attributeURI == null || attributeURI == "" ||
                isFXGNamespace(attributeURI) ||
                isApacheFlexNamespace(attributeURI))
            {
                String attributeName = attributes.getLocalName(i);
                String attributeValue = attributes.getValue(i);
                node.setAttribute(attributeName, attributeValue);
            }
        }

        // Associate child with parent node (and handle any special
        // relationships)
        if (parent != null)
        {
            if (node instanceof DelegateNode)
            {
                DelegateNode propertyNode = (DelegateNode)node;
                propertyNode.setDelegate(parent);
            }
            else
            {
                parent.addChild(node);
            }
        }
        else if (node instanceof GraphicNode)
        {
            root = (GraphicNode)node;
            // Provide access to the root document node
            node.setDocumentNode(root);
            if (root.getVersion() == null)
            {
                // Exception: <Graphic> doesn't have the required attribute
                // "version".
                throw new FXGException(startLine, startColumn, "MissingVersionAttribute");
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

    public void characters(char[] ch, int start, int length)
            throws SAXException
    {
        if (stack != null && stack.size() > 0 && !inSkippedElement() && (unknownElement == null))
        {
            FXGNode node = stack.peek();
            String content = new String(ch, start, length);

            if (!(node instanceof PreserveWhiteSpaceNode))
            {
                content = content.trim();
            }
           
            if (content.length() > 0)
            {
                CDATANode cdata = new CDATANode();
                cdata.content = content;
                assignNodeLocation(cdata);
                node.addChild(cdata);
            }
        }

        // Reset starting position
        startLine = locator.getLineNumber();
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

     * @param localName - the name of the element
     * @return FXGNode instance if
     */
    protected FXGNode createNode(String uri, String localName)
    {
        FXGNode node = null;

        try
        {
            Map<String, Class<? extends FXGNode>> elementNodes = getElementNodes(uri);
            if (elementNodes != null)
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

            saxFactory.setValidating(false);
            saxFactory.setNamespaceAware(true);
            SAXParser parser = saxFactory.newSAXParser();
            parser.parse(stream, scanner);

            FXGNode node = scanner.getRootNode();
            return node;
        }
        catch (ParserConfigurationException ex)
        {
            throw new FXGException(scanner.getStartLine(), scanner.getStartColumn(), "ErrorParsingFXG", ex.getLocalizedMessage(), ex);
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

            parser.registerElementNode(2.0, FXG_NAMESPACE, FXG_RICHTEXT_ELEMENT, FlexRichTextNode.class);

            try
            {
                // Parse FXG to a DOM
                FXGNode node = parser.parse(source.getInputStream(), source.getNameForReporting());
                context.setAttribute(FXG_DOM_ROOT, node);

                QName topLevelQName = getQNameFromSource(source);
                unit.topLevelDefinitions.add(topLevelQName);
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

        {
            Source generatedSource = null;
            Source originalSource = unit.getSource();

            // Determine whether we need to introduce text class dependencies
            FXGNode rootNode = (FXGNode)unit.getContext().getAttribute(FXG_DOM_ROOT);
            boolean hasTextGraphic = false;
            double version = 1.0;

            if (rootNode instanceof FlexGraphicNode)
            {
View Full Code Here

Examples of com.adobe.fxg.dom.FXGNode

         * used in the document).
         */
        private FXGSymbolClass transcodeFXG(CompilationUnit unit,
                String packageName, String className, TypeTable typeTable)
        {
            FXGNode rootNode = (FXGNode)unit.getContext().getAttribute(FXG_DOM_ROOT);

            FlexFXG2SWFTranscoder transcoder = new FlexFXG2SWFTranscoder(typeTable);
            PathResolver pathResolver = unit.getSource().getPathResolver();
            FlexResourceResolver resolver = new FlexResourceResolver(pathResolver);
            transcoder.setResourceResolver(resolver);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.