Examples of Leaf


Examples of org.jdesktop.swingx.MultiSplitLayout.Leaf

    /** Creates a new instance of DefaultSplitPaneLayout */
    public DefaultSplitPaneModel() {
        Split row = new Split();
        Split col = new Split();
        col.setRowLayout(false);
        setChildren(new Leaf(LEFT), new Divider(), col);
        col.setChildren(new Leaf(TOP), new Divider(), new Leaf(BOTTOM));
    }
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.multisplit.MultiSplitLayout.Leaf


                                        if (step1Failed) {
                                            // Create two leafs

                                            Leaf newleaf = new DockableLeaf(leafName, dockable.getId());
                                            newleaf.setWeight(0.5);

                                            // Creat the split
                                            Split newSplit = new Split();
                                            newSplit.setBounds(leaf.getBounds());
                                            newSplit.setRowLayout((aggregationPosition == AggregationPosition.LEFT || aggregationPosition == AggregationPosition.RIGHT));
                                            newSplit.setWeight(leaf.getWeight());
                                            leaf.getParent().removeNode(leaf);
                                            switch (aggregationPosition) {
                                                case LEFT:
                                                case TOP:
                                                    newSplit.setChildren(Arrays.asList(newleaf,
                                                            new Divider(),
                                                            leaf));
                                                    break;
                                                default:
                                                    newSplit.setChildren(Arrays.asList(leaf,
                                                            new Divider(),
                                                            newleaf));
                                                    break;
                                            }

                                            leaf.setWeight(0.5);

                                            // Switch the leaf with the new split
                                            parentChildren.set(startIndex, newSplit);
                                            parent.setChildren(parentChildren);
                                        }
                                    }

                                    stack.clear();
                                    break;
                                }
                            } else if (child instanceof Split) {
                                stack.push((Split) child);
                            }
                        }
                    }

                    if (!multiSplitPane.getMultiSplitLayout().getFloatingDividers())
                        multiSplitPane.getMultiSplitLayout().setFloatingDividers(true);
                } else {
                    leafName = getNextLeanName();
                    boolean rowLayout = (aggregationPosition == AggregationPosition.LEFT || aggregationPosition == AggregationPosition.RIGHT);

                    if (splitRoot.isRowLayout() == rowLayout) {
                        List<Node> children = splitRoot.getChildren();

                        switch (aggregationPosition) {
                            case LEFT:
                            case TOP:
                                children.add(0, new DockableLeaf(leafName, dockable.getId()));
                                children.add(1, new Divider());
                                break;
                            case RIGHT:
                            case BOTTOM:
                                children.add(new Divider());
                                children.add(new DockableLeaf(leafName, dockable.getId()));
                                break;
                        }

                        forceWeight(children);

                        splitRoot.setChildren(children);
                    } else {
                        Split newRoot = new Split();
                        newRoot.setRowLayout(rowLayout);
                        newRoot.setBounds(multiSplitPaneModelRoot.getBounds());

                        Leaf leaf = new DockableLeaf(leafName, dockable.getId());
                        leaf.setWeight(0.5);
                        multiSplitPaneModelRoot.setWeight(0.5);

                        List<Node> children = null;
                        switch (aggregationPosition) {
                            case LEFT:
View Full Code Here

Examples of org.noos.xing.mydoggy.plaf.ui.cmp.multisplit.MultiSplitLayout.Leaf

                        for (int i = 0; i < children.size(); i++) {
                            Node child = children.get(i);

                            if (child instanceof Leaf) {
                                Leaf leaf = (Leaf) child;

                                String leafName = leaf.getName();

                                if (leafName.equals(leafKey)) {
                                    // Analyze parent
                                    children.remove(i);

                                    // Analyze children now...
                                    if (children.size() == 2) {
                                        Split grandpa = split.getParent();

                                        if (grandpa == null) {
                                            multiSplitPaneModelRoot = getFirstNotDivider(children);
                                            multiSplitPaneModelRoot.setParent(null);

                                            // Prepare dockableConstraint
                                            AggregationPosition position;
                                            if (children.get(0) == multiSplitPaneModelRoot) {
                                                position = (split.isRowLayout()) ? AggregationPosition.RIGHT : AggregationPosition.BOTTOM;
                                            } else
                                                position = (split.isRowLayout()) ? AggregationPosition.LEFT : AggregationPosition.TOP;
                                            dockableConstraint = new DockableConstraint(multiSplitPaneModelRoot,
                                                    position,
                                                    -1);

                                            setChild = false;
                                        } else {
                                            List<Node> grenpaChildren = grandpa.getChildren();

                                            if (children.get(0) instanceof Divider) {
                                                grenpaChildren.set(grenpaChildren.indexOf(split),
                                                        children.get(1));

                                                // Prepare dockableConstraint
                                                dockableConstraint = new DockableConstraint(children.get(1),
                                                        (split.isRowLayout()) ? AggregationPosition.LEFT : AggregationPosition.TOP,
                                                        -1);
                                            } else {
                                                grenpaChildren.set(grenpaChildren.indexOf(split),
                                                        children.get(0));

                                                // Prepare dockableConstraint
                                                dockableConstraint = new DockableConstraint(children.get(0),
                                                        (split.isRowLayout()) ? AggregationPosition.RIGHT : AggregationPosition.BOTTOM,
                                                        -1);
                                            }
                                            grandpa.setChildren(grenpaChildren);
                                            setChild = false;
                                        }
                                    } else {
                                        // Remove the divider
                                        if (i < children.size()) {
                                            children.remove(i);
                                            dockableConstraint = new DockableConstraint(children.get(i),
                                                    (split.isRowLayout()) ? AggregationPosition.LEFT : AggregationPosition.TOP,
                                                    -1);
                                        } else {
                                            children.remove(i - 1);
                                            dockableConstraint = new DockableConstraint(children.get(i - 2),
                                                    (split.isRowLayout()) ? AggregationPosition.RIGHT : AggregationPosition.BOTTOM,
                                                    -1);
                                        }
                                        i--;
                                    }
                                } else {
                                    // We have to rename the leaf if the name is not valid.
                                    Integer keyValue = Integer.parseInt(leafName);
                                    if (keyValue > leafValue) {
                                        String newKey = "" + (keyValue - 1);
                                        leaf.setName(newKey);
                                    }
                                }
                            } else if (child instanceof Split) {
                                stack.push((Split) child);
                            }
View Full Code Here

Examples of org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Leaf

        for (int i = k; i <= N-1; ++i) {
            if (i != k) {
                ch.add(new Divider());
            }
            Leaf l = new Leaf("L"+i);
            l.setWeight(1.0 / numPanels);
            ch.add(l);
        }

        if (numPanels == 1) {
            Node model = ch.get(0);
View Full Code Here

Examples of org.zeroexchange.web.navigation.menu.model.Leaf

            @Override
            protected void populateItem(ListItem item) {
                MenuItem menuItem = (MenuItem) item.getModelObject();
               
                Leaf leaf = menuItem.getFirstLeaf();
                if(leaf != null) {
                    Class<Page> pageClass = leaf.getPageClass();
                    try {
                        Link link = linkFactory.getLink("leftMenuLink", new PageTarget(pageClass));
                        link.add(new Label("leftMenuSign", menuService.getTitle(menuItem)).setEscapeModelStrings(false));
                        item.add(link);
                    } catch (BusinessLogicException e) {
View Full Code Here

Examples of quickml.supervised.classifier.decisionTree.tree.Leaf

        return classifications;
    }

    @Override
    public double getProbability(AttributesMap attributes, Serializable classification) {
        Leaf leaf = node.getLeaf(attributes);
        return leaf.getProbability(classification);
    }
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.