Package org.flexdock.docking.state

Examples of org.flexdock.docking.state.LayoutNode


            FloatingGroup floatingGroup = layout.getGroup(floatingGroupId);
            Element floatingGroupElement = floatingGroupSerializer.serialize(document, floatingGroup);
            layoutElement.appendChild(floatingGroupElement);
        }

        LayoutNode layoutNode = layout.getRestorationLayout();
        //TODO should we nest restoration layout in Restoration node?
        if (layoutNode != null) {
            ISerializer layoutNodeSerializer = SerializerRegistry.getSerializer(LayoutNode.class);
            Element layoutNodeElement = layoutNodeSerializer.serialize(document, layoutNode);
            layoutElement.appendChild(layoutNodeElement);
View Full Code Here


        ISerializer layoutNodeSerializer = SerializerRegistry.getSerializer(LayoutNode.class);

        NodeList dockingPortNodeList = element.getElementsByTagName(PersistenceConstants.DOCKING_PORT_NODE_ELEMENT_NAME);
        if (dockingPortNodeList.getLength() > 0 && dockingPortNodeList.item(0) instanceof Element) {
            Element layoutNodeElement = (Element) dockingPortNodeList.item(0);
            LayoutNode restorationLayout = (LayoutNode) layoutNodeSerializer.deserialize(layoutNodeElement);
            layout.setRestorationLayout(restorationLayout);
        }

        return layout;
    }
View Full Code Here

        Object obj = node.getUserObject();
        if (node instanceof SplitNode)
            splitPaneResizeList.add(node);

        for (Enumeration en = node.children(); en.hasMoreElements();) {
            LayoutNode child = (LayoutNode) en.nextElement();
            constructLayout(child, splitPaneResizeList);
        }

        if (node instanceof SplitNode)
            reconstruct((SplitNode) node);
View Full Code Here

            port.evaluateDockingBorderStatus();
            return;
        }

        for (Enumeration en = node.children(); en.hasMoreElements();) {
            LayoutNode child = (LayoutNode) en.nextElement();
            if (child instanceof DockableNode) {
                Dockable dockable = ((DockableNode) child).getDockable();
                port.dock(dockable, CENTER_REGION);
            }
        }
View Full Code Here

    public Component getRightComponent() {
        return getChildComponent(1);
    }

    private Component getChildComponent(int indx) {
        LayoutNode child = getChild(indx);
        return child==null? null: (Component)child.getUserObject();
    }
View Full Code Here

        return nodes;
    }

    private void link(LayoutNode node, Component child) {
        if(child instanceof DockingPort) {
            LayoutNode childNode = createLayoutImpl((DockingPort)child);
            link(node, childNode);
        } else if(child instanceof JSplitPane) {
            LayoutNode childNode = createLayout((JSplitPane)child);
            link(node, childNode);
        } else if (child instanceof JTabbedPane) {
            LayoutNode[] children = createLayout((JTabbedPane)child);
            for(int i=0; i<children.length; i++)
                link(node, children[i]);
        } else {
            Dockable dockable = DockingManager.getDockable(child);
            LayoutNode childNode = createLayout(dockable);
            link(node, childNode);
        }
    }
View Full Code Here

    }

    public void cacheLayoutState(DockingPort port) {
        if(port!=null) {
            Layout layout = getLayout();
            LayoutNode node = port.exportLayout();
            layout.setRestorationLayout(node);
        }
    }
View Full Code Here

* @version $Id: AbstractLayoutNodeSerializer.java,v 1.7 2005-07-06 18:10:49 winnetou25 Exp $
*/
public abstract class AbstractLayoutNodeSerializer implements ISerializer {

    public Element serialize(Document document, Object object) {
        LayoutNode layoutNode = (LayoutNode) object;

        Element layoutNodeElement = getElement(document, object);

        ISerializer layoutNodeSerializer = SerializerRegistry.getSerializer(LayoutNode.class);
        int childCount = layoutNode.getChildCount();
        for (int i=0; i<childCount; i++) {
            MutableTreeNode childTreeNode = (MutableTreeNode) layoutNode.getChildAt(i);
            Element element = layoutNodeSerializer.serialize(document, childTreeNode);
            layoutNodeElement.appendChild(element);
        }

        return layoutNodeElement;
View Full Code Here

    }

    protected abstract Element getElement(Document document, Object o);

    public Object deserialize(Element element) {
        LayoutNode layoutNode = createLayoutNode();

        ISerializer layoutNodeSerializer = SerializerRegistry.getSerializer(LayoutNode.class);
        NodeList nodeList = element.getChildNodes();
        for (int i = 0; i<nodeList.getLength(); i++) {
            Node node = nodeList.item(i);
            if (node instanceof Element) {
                Element childElement = (Element) node;
                LayoutNode childLayoutNode = (LayoutNode) layoutNodeSerializer.deserialize(childElement);
                layoutNode.add(childLayoutNode);
            }
        }

        return layoutNode;
View Full Code Here

            // note, we're using a shallow copy of the listener list.
            // it's okay that we share listener references, since we want the
            // cloned Layout to have the same listeners.
            Layout clone = new Layout(infoMap, listeners, floatTable);
            LayoutNode restoreNode = restorationLayout==null? null: (LayoutNode)restorationLayout.clone();
            clone.restorationLayout = restoreNode;
            return clone;
        }

    }
View Full Code Here

TOP

Related Classes of org.flexdock.docking.state.LayoutNode

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.