Package de.ailis.jollada.model

Examples of de.ailis.jollada.model.Node


    @Test
    public void testRetainAll()
    {
        final Document document = new Document();
        final Node parent = new Node();
        document.addChild(parent);
        final Elements<Node> elements = new Nodes(parent);

        final Node child = new Node();
        child.setId("ID");
        child.setSid("SID");

        elements.add(child);
        final List<Object> toRetain = new ArrayList<Object>();
        toRetain.add(child);
        toRetain.add(new Node());
        toRetain.add("test");
        assertFalse(elements.retainAll(toRetain));
        toRetain.remove(child);
        assertTrue(elements.retainAll(toRetain));

        // Check if node was correctly detached from elements
        assertEquals(0, elements.size());
        assertNull(child.getParent());
        assertNull(child.getDocument());
        assertNull(document.getById("ID"));
        assertNull(document.getBySid("SID"));
        assertNull(parent.getBySid("SID"));
    }
View Full Code Here


     */

    @Test
    public void testDefaultConstructor()
    {
        final Node node = new Node();
        assertNull(node.getId());
        assertNull(node.getAsset());
        assertNull(node.getName());
        assertNull(node.getSid());
        assertEquals(NodeType.NODE, node.getType());
        assertEquals(0, node.getLayers().size());
        assertEquals(0, node.getCameraInstances().size());
        assertEquals(0, node.getGeometryInstances().size());
        assertEquals(0, node.getLightInstances().size());
        assertEquals(0, node.getTransforms().size());
    }
View Full Code Here

     *            The element attributes
     */

    private void enterNode(final Attributes attributes)
    {
        final Node node = new Node();
        node.setId(attributes.getValue("id"));
        node.setName(attributes.getValue("name"));
        node.setSid(attributes.getValue("sid"));
        final String type = attributes.getValue("type");
        if (type != null) node.setType(NodeType.valueOf(type));
        final String layers = attributes.getValue("layer");
        if (layers != null)
        {
            for (final String layer : layers.split("\\s+"))
                node.getLayers().add(layer);
        }

        // Append the node to the scene or its parent node.
        if (this.node == null)
            this.visualScene.getNodes().add(node);
View Full Code Here

TOP

Related Classes of de.ailis.jollada.model.Node

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.