Examples of ItsNatDocument


Examples of org.itsnat.core.ItsNatDocument

        }
    }

    public void updateCircle()
    {
        ItsNatDocument itsNatDoc = getItsNatDocument();

        int newRadio = -1;
        String valueStr = inputRadio.getAttribute("value");
        try
        {
            newRadio = Integer.parseInt(valueStr);
        }
        catch(NumberFormatException ex)
        {
            itsNatDoc.addCodeToSend("alert('Not an integer number');");
            return;
        }

        Document childDoc;
        try
        {
            if (container instanceof HTMLObjectElement)
                childDoc = ((HTMLObjectElement)container).getContentDocument();
            else
                childDoc = ((ItsNatHTMLEmbedElement)container).getContentDocument();
        }
        catch(NoSuchMethodError ex)
        {
            // Cause: Xerces compatibility package of Tomcat 5.5
            // misses this standard DOM method in HTMLIFrameElement
            // and HTMLObjectElement interfaces
            // Don't worry, our required method is there.
            try
            {
                Method method = container.getClass().getMethod("getContentDocument",(Class<?>[])null);
                childDoc = (Document)method.invoke(container,(Object[])null);
            }
            catch(Exception ex2) { throw new RuntimeException(ex2); }
        }

        if (childDoc == null)
        {
            itsNatDoc.addCodeToSend("alert('Not loaded yet');");
            return;
        }
        ItsNatDocument childItsNatDoc = ((ItsNatNode)childDoc).getItsNatDocument(); // This method is multithread

        synchronized(childItsNatDoc) // NEEDED!!!
        {
            ChildSVGSsrcAutoBindingDocument childUserDoc =
                 (ChildSVGSsrcAutoBindingDocument)childItsNatDoc.getUserValue("user_object");
            Element circle = childUserDoc.getSelectedCircle();
            if (circle == null)
            {
                itsNatDoc.addCodeToSend("alert('No selected circle');");
                return;
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.