Package info.clearthought.layout

Examples of info.clearthought.layout.TableLayoutConstraints


                    Component[] components = contentPane.getComponents();
                    int finalCol = (index * 2 + 2);

                    Map<Integer, Double> olds = new Hashtable<Integer, Double>();
                    for (Component component : components) {
                        TableLayoutConstraints constraints = contentPaneLayout.getConstraints(component);
                        if (constraints.col1 >= finalCol) {
                            int newCol1 = constraints.col1 + 2;
                            contentPaneLayout.setConstraints(component,
                                                             new TableLayoutConstraints(
                                                                     newCol1 + ",1,"
                                                             ));

                            olds.put(newCol1, contentPaneLayout.getColumn(newCol1));
                            Double colSize = olds.get(constraints.col1);
                            if (colSize == null)
                                colSize = contentPaneLayout.getColumn(constraints.col1);

                            contentPaneLayout.setColumn(newCol1, colSize);
                        }
                    }
                    contentPaneLayout.setColumn(finalCol, width);
                    contentPane.add(anchorLabel, (index * 2 + 2) + ",1,");
                } else
                    contentPane.add(anchorLabel, (contentPaneLayout.getNumColumn() - 1) + ",1,");
            } else {
                int height = Math.max(anchorLabel.getHeight(),
                                      Math.max(anchorLabel.getPreferredSize().height,
                                               anchorLabel.getSize().height)) + 12;

                contentPaneLayout.insertRow(contentPaneLayout.getNumRow(), contentPaneLayout.getNumRow() > 0 ? 5 : 1);
                contentPaneLayout.insertRow(contentPaneLayout.getNumRow(), height);

                if (index >= 0) {
                    Component[] components = contentPane.getComponents();
                    int finalRow = (index * 2 + 2);


                    Map<Integer, Double> olds = new Hashtable<Integer, Double>();
                    for (Component component : components) {
                        TableLayoutConstraints constraints = contentPaneLayout.getConstraints(component);

                        if (constraints.row1 >= finalRow) {
                            int newRow1 = constraints.row1 + 2;
                            contentPaneLayout.setConstraints(component,
                                                             new TableLayoutConstraints(
                                                                     "1," + newRow1
                                                             ));

                            olds.put(newRow1, contentPaneLayout.getRow(newRow1));
                            Double rowSize = olds.get(constraints.row1);
View Full Code Here


        public void propertyChange(PropertyChangeEvent evt) {
            ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();
            JLabel anchorLabel = descriptor.getAnchorLabel();
            if (anchorLabel != null) {
                TableLayoutConstraints constraints = contentPaneLayout.getConstraints(anchorLabel);

                if (horizontal) {
                    int width = anchorLabel.getPreferredSize().width + 6;

                    contentPaneLayout.setColumn(constraints.col1, width);
View Full Code Here

        firePropertyChangeEvent("temporarilyVisible", old, temporarilyVisible);
    }

    public int getRepresentativeAnchorIndex(Component representativeAnchor) {
        TableLayoutConstraints constraints = getRepresentativeAnchorConstraints(representativeAnchor);
        if (constraints == null)
            return -1;

        if (horizontal)
            return (constraints.col1 / 2) - 1;
View Full Code Here

            else if (index != -1) {
                // Verify for locked index
                Component[] components = toolWindowBarContainer.getComponents();

                for (Component component : components) {
                    TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);

                    if (constraints.col1 >= finalCol) {
                        if (((RepresentativeAnchorWrapper) component).getDockableDescriptor().isAnchorPositionLocked()) {
                            finalCol += 2;
                            index++;
                        }
                    }
                }
            }

            if (index >= 0) {
                Component[] components = toolWindowBarContainer.getComponents();

                Map<Integer, Double> olds = new Hashtable<Integer, Double>();
                for (Component component : components) {

                    TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);
                    if (constraints.col1 >= finalCol) {
                        int newCol1 = constraints.col1 + 2;
                        toolWindowBarContainerLayout.setConstraints(component,
                                                                    new TableLayoutConstraints(
                                                                            newCol1 + ",1,"
                                                                    ));

                        olds.put(newCol1, toolWindowBarContainerLayout.getColumn(newCol1));
                        Double colSize = olds.get(constraints.col1);
                        if (colSize == null)
                            colSize = toolWindowBarContainerLayout.getColumn(constraints.col1);

                        toolWindowBarContainerLayout.setColumn(newCol1, colSize);
                    }
                }

                toolWindowBarContainerLayout.setColumn(finalCol, TableLayout.PREFERRED);

                toolWindowBarContainer.add(representativeAnchor, (index * 2 + 2) + ",1");
            } else
                toolWindowBarContainer.add(representativeAnchor, (toolWindowBarContainerLayout.getNumColumn() - 1) + ",1");
        } else {
            toolWindowBarContainerLayout.insertRow(toolWindowBarContainerLayout.getNumRow(),
                                                   toolWindowBarContainerLayout.getNumRow() > 0 ? 5 : 1);
            toolWindowBarContainerLayout.insertRow(toolWindowBarContainerLayout.getNumRow(),
                                                   TableLayout.PREFERRED);

            // validate index...
            int finalRow = (index * 2 + 2);
            if (finalRow >= toolWindowBarContainerLayout.getNumRow())
                index = -1;
            else if (index != -1) {
                // Verify for locked index
                Component[] components = toolWindowBarContainer.getComponents();

                for (Component component : components) {
                    TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);

                    if (constraints.row1 >= finalRow) {
                        if (((RepresentativeAnchorWrapper) component).getDockableDescriptor().isAnchorPositionLocked()) {
                            finalRow += 2;
                            index++;
                        }
                    }
                }
            }

            if (index >= 0) {
                Component[] components = toolWindowBarContainer.getComponents();

                Map<Integer, Double> olds = new Hashtable<Integer, Double>();
                for (Component component : components) {

                    TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);

                    if (constraints.row1 >= finalRow) {
                        int newRow1 = constraints.row1 + 2;
                        toolWindowBarContainerLayout.setConstraints(component,
                                                                    new TableLayoutConstraints(
                                                                            "1," + newRow1
                                                                    ));

                        olds.put(newRow1, toolWindowBarContainerLayout.getRow(newRow1));
                        Double rowSize = olds.get(constraints.row1);
View Full Code Here

                representativeAnchor = component;
                break;
            }
        }

        TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(representativeAnchor);
        if (constraints == null)
            return;

        // Remove
        if (dockableDescriptor.isAvailableCountable())
View Full Code Here

        public void propertyChange(PropertyChangeEvent evt) {
            ToolWindowDescriptor descriptor = manager.getDescriptor((ToolWindow) evt.getSource());

            JLabel representativeAnchor = descriptor.getRepresentativeAnchor();
            if (representativeAnchor != null) {
                TableLayoutConstraints constraints = getRepresentativeAnchorConstraints(representativeAnchor);

                if (horizontal) {
                    int width = representativeAnchor.getPreferredSize().width + 6;

                    toolWindowBarContainerLayout.setColumn(constraints.col1, width);
View Full Code Here

                        break;
                }
                SwingUtil.repaint(toolWindowBarContainer);
            } else if ("endDrag".equals(evt.getPropertyName())) {
                TableLayout layout = (TableLayout) toolWindowBarContainer.getLayout();
                TableLayoutConstraints constraints = getRepresentativeAnchorConstraints((Component) evt.getSource());

                switch (anchor) {
                    case LEFT:
                    case RIGHT:
                        if (constraints != null)
View Full Code Here

        int nextTabCol = -1;
        for (Component component : tabContainer.getComponents()) {
            if (component instanceof TabButton) {
                TabButton tabButton = (TabButton) component;
                if (tabButton.tab == toolWindowTab) {
                    TableLayoutConstraints constraints = containerLayout.getConstraints(tabButton);
                    tabContainer.remove(tabButton);
                    tabButton.removePropertyChangeListener(this);

                    nextTabCol = constraints.col1;
                    int col = constraints.col1 - 1;
                    containerLayout.deleteColumn(col);
                    containerLayout.deleteColumn(col);
                    containerLayout.deleteColumn(col);
                    break;
                }
            }
        }

        SwingUtil.repaint(tabContainer);

        if (nextTabCol != -1)
            for (Component component : tabContainer.getComponents()) {
                if (component instanceof TabButton) {
                    TabButton tabButton = (TabButton) component;
                    TableLayoutConstraints constraints = containerLayout.getConstraints(tabButton);

                    if (constraints.col1 == nextTabCol)
                        return tabButton.tab;
                }
            }
View Full Code Here

        int nextTabCol = -1;
        for (Component component : tabContainer.getComponents()) {
            if (component instanceof ToolWindowTabButton) {
                ToolWindowTabButton tabButton = (ToolWindowTabButton) component;
                if (tabButton.getToolWindowTab() == toolWindowTab) {
                    TableLayoutConstraints constraints = containerLayout.getConstraints(component);
                    nextTabCol = constraints.col1 + 3;
                    break;
                }
            }

        }

        if (nextTabCol != -1) {
            for (Component component : tabContainer.getComponents()) {
                if (component instanceof ToolWindowTabButton) {
                    ToolWindowTabButton tabButton = (ToolWindowTabButton) component;
                    TableLayoutConstraints constraints = containerLayout.getConstraints(tabButton);

                    if (constraints.col1 == nextTabCol)
                        return tabButton.getToolWindowTab();
                }
            }
View Full Code Here

        for (Component component : tabContainer.getComponents()) {
            if (component instanceof ToolWindowTabButton) {
                ToolWindowTabButton tabButton = (ToolWindowTabButton) component;

                if (tabButton.getToolWindowTab() == toolWindowTab) {
                    TableLayoutConstraints constraints = containerLayout.getConstraints(component);
                    tabButton.setUI(null);
                    tabContainer.remove(component);

                    if (flag)
                        toolWindowTab.removePropertyChangeListener(propertyChangeBridge);
View Full Code Here

TOP

Related Classes of info.clearthought.layout.TableLayoutConstraints

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.