Examples of ItsNatTreeUI


Examples of org.itsnat.comp.tree.ItsNatTreeUI

    }

    public void expandCollapse(TreeExpansionEvent event,boolean expand)
    {
        TreePath path = event.getPath();
        ItsNatTreeUI compUI = comp.getItsNatTreeUI();
        ItsNatTreeCellUI nodeInfo = compUI.getItsNatTreeCellUIFromTreePath(path);
        if (nodeInfo == null) return; // parentPath is root and rootless mode
        updateTreeUIExpandCollapse(nodeInfo,path,expand);
    }
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

    public boolean isVisible(TreePath path)
    {
        TreePath parentPath = path.getParentPath();
        if (parentPath == null) return true;
       
        ItsNatTreeUI compUI = comp.getItsNatTreeUI();
        ItsNatTreeCellUI parentNodeInfo = compUI.getItsNatTreeCellUIFromTreePath(parentPath);
        if (parentNodeInfo == null) return true; // path is root and rootless mode
        return parentNodeInfo.isExpanded();
    }
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

        }
    }

    public void updateVisibilityOfNode(TreePath path,boolean visible)
    {
        ItsNatTreeUI compUI = comp.getItsNatTreeUI();
        ItsNatTreeCellUI nodeInfo = compUI.getItsNatTreeCellUIFromTreePath(path);
        if (nodeInfo == null) return; // parentPath is root and rootless mode
        updateVisibilityOfNode(nodeInfo,path,visible);
    }
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

    }

    public void expandCollapse(TreeExpansionEvent event,boolean expand)
    {
        TreePath path = event.getPath();
        ItsNatTreeUI compUI = comp.getItsNatTreeUI();
        ItsNatTreeCellUI nodeInfo = compUI.getItsNatTreeCellUIFromTreePath(path);
        if (nodeInfo == null) return; // path is root and rootless mode
        updateTreeUIExpandCollapse(nodeInfo,path,expand);
    }
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

    {
        // Hide/show child nodes
        TreeModel dataModel = comp.getTreeModel();
        Object parentNode = path.getLastPathComponent();
        int len = dataModel.getChildCount(parentNode);
        ItsNatTreeUI compUI = comp.getItsNatTreeUI();
        for(int i = 0; i < len; i++)
        {
            Object childNode = dataModel.getChild(parentNode,i);
            TreePath childPath = path.pathByAddingChild(childNode);
            ItsNatTreeCellUI childNodeInfo = compUI.getItsNatTreeCellUIFromTreePath(childPath);
            Element childElem = childNodeInfo.getParentElement();

            String display;
            if (childrenVisible)
                removeStyleProperty(childElem,"display"); // Show
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

        }
    }

    private void openEditor(TreePath path)
    {
        ItsNatTreeUI compUI = getItsNatTree().getItsNatTreeUIImpl();
        ItsNatTreeCellUI cellInfo = (ItsNatTreeCellUI)compUI.getItsNatTreeCellUIFromTreePath(path);
        if (cellInfo == null) throw new ItsNatException("This tree node cannot be edited, may be is the root node in a rootless tree");
        openEditor(path,cellInfo.getRow(),cellInfo);
    }
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

        openEditor(path,cellInfo.getRow(),cellInfo);
    }

    private void openEditor(int row)
    {
        ItsNatTreeUI compUI = getItsNatTree().getItsNatTreeUIImpl();
        ItsNatTreeCellUI cellInfo = (ItsNatTreeCellUI)compUI.getItsNatTreeCellUIFromRow(row);
        openEditor(cellInfo.getTreePath(),row,cellInfo);
    }
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

    protected void openEditor(Event evt)
    {
        Node nodeClicked = (Node)evt.getTarget(); // Puede ser un nodo interior del elemento pulsado

        ItsNatTreeUI compUI = getItsNatTree().getItsNatTreeUIImpl();
        ItsNatTreeCellUI cellInfo = (ItsNatTreeCellUI)compUI.getItsNatTreeCellUIFromNode(nodeClicked);
        if (cellInfo != null) // Se ha pulsado un elemento verdaderamente
        {
            if (DOMUtilInternal.isChildOrSame(nodeClicked,cellInfo.getLabelElement(),cellInfo.getParentElement()))
            {
                // Se ha pulsado el nodo contenido (el handle y el icon no valen para editar)
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

        String type = evt.getType();
        if (type.equals("click") || type.equals("dblclick") || type.equals("mouseup"))
        {
            Node nodeClicked = (Node) evt.getTarget(); // Puede ser un nodo interior del elemento pulsado

            ItsNatTreeUI compUI = getItsNatTreeUIImpl();
            ItsNatTreeCellUI nodeInfo = compUI.getItsNatTreeCellUIFromNode(nodeClicked);
            if (nodeInfo != null)
            {
                // Vemos qu� parte se ha pulsado
                Element parentElem = nodeInfo.getParentElement(); // para acelerar la b�squeda
View Full Code Here

Examples of org.itsnat.comp.tree.ItsNatTreeUI

        return selectionUsesKeyboard;
    }

    public Element[] getContentElementList(int fromRow,int toRow)
    {
        ItsNatTreeUI compUI = getItsNatTreeUIImpl();
        int len = toRow - fromRow + 1;
        Element[] elemList = new Element[len * 3]; // handle, icon, label
        for(int row = fromRow; row <= toRow; row++)
        {
            ItsNatTreeCellUI cellUI = compUI.getItsNatTreeCellUIFromRow(row);
            if (cellUI == null) continue; // por ejemplo en el caso rootless ser� null para row = 0

            int pos = (row - fromRow) * 3;
            elemList[pos] = cellUI.getHandleElement();
            elemList[pos + 1] = cellUI.getIconElement();
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.