Package info.clearthought.layout

Examples of info.clearthought.layout.TableLayoutConstraints


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

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

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

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

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

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


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

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

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


    protected void removeRepresentativeAnchor(JComponent representativeAnchor, ToolWindowDescriptor descriptor) {
        if (representativeAnchor == null)
            return;

        int toDelete;
        TableLayoutConstraints constraints = representativeButtonsPanelLayout.getConstraints(representativeAnchor);
        if (constraints == null)
            return;

        // Remove
        availableTools--;
View Full Code Here

        public void propertyChange(PropertyChangeEvent evt) {
            ToolWindowDescriptor descriptor = (ToolWindowDescriptor) evt.getSource();
            JLabel representativeAnchor = descriptor.getRepresentativeAnchor();
            if (representativeAnchor != null) {
                TableLayoutConstraints constraints = representativeButtonsPanelLayout.getConstraints(representativeAnchor);

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

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

                        Component[] components = contentPane.getComponents();
                        int finalCol = (anchor.getIndex() * 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, (anchor.getIndex() * 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 (anchor.getIndex() >= 0) {
                        Component[] components = contentPane.getComponents();
                        int finalRow = (anchor.getIndex() * 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

        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);

                    if (flag)
                        tabButton.removePropertyChangeListener(propertyChangeBridge);

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

        SwingUtil.repaint(tabContainer);

        ToolWindowTab firstTab = null;
        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;

                    if (constraints.col1 == 2)
View Full Code Here

                int nextTabCol = containerLayout.getConstraints(selecTabButton).col1 + 3;

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

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

                int nextTabCol = containerLayout.getConstraints(selecTabButton).col1 - 3;

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

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

                        Component[] components = contentPane.getComponents();
                        int finalCol = (anchor.getIndex() * 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, (anchor.getIndex() * 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 (anchor.getIndex() >= 0) {
                        Component[] components = contentPane.getComponents();
                        int finalRow = (anchor.getIndex() * 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

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.