Package info.clearthought.layout

Examples of info.clearthought.layout.TableLayoutConstraints


        manager.propertyChange(new PropertyChangeEvent(this, "tempShowed", old, tempShowed));
    }

    public int getRepresentativeAnchorIndex(JLabel representativeAnchor) {
        TableLayoutConstraints constraints = contentPaneLayout.getConstraints(representativeAnchor);
        if (horizontal)
            return (constraints.col1 / 2) -1;
        else
            return (constraints.row1 / 2) -1;
    }
View Full Code Here


                    return;

                java.util.List<Component> components = Arrays.asList(contentPane.getComponents());
                Collections.sort(components, new Comparator<Component>() {
                    public int compare(Component o1, Component o2) {
                        TableLayoutConstraints c1 = contentPaneLayout.getConstraints(o1);
                        TableLayoutConstraints c2 = contentPaneLayout.getConstraints(o2);
                        if (horizontal) {
                            if (c1.col1 < c2.col1)
                                return -1;
                            else if (c1.col1 == c2.col1)
                                return 0;
View Full Code Here

                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(representativeAnchor, (index * 2 + 2) + ",1,");
            } else
                contentPane.add(representativeAnchor, (contentPaneLayout.getNumColumn() - 1) + ",1,");
        } else {
            int height = Math.max(representativeAnchor.getHeight(),
                                  Math.max(representativeAnchor.getPreferredSize().height,
                                           representativeAnchor.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 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

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

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

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

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

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

            // validate index...
            int finalRow = (index * 2 + 2);
            if (finalRow >= representativeButtonsPanelLayout.getNumRow())
                index = -1;

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

                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

                                              DockableDescriptor 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

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

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

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

    }
    if ( XHtmlBuilder.isDebugLayout())
      comp.setBorder( new LineBorder( Color.red, 2 ));
   
    if ( comp.getComponentCount() > 0 ) {
      TableLayoutConstraints constraints = new TableLayoutConstraints( insertCol, rowIdx, insertCol + colSpan, rowIdx + rowSpan );
//      Object align = attribSet.getAttribute( HTML.Attribute.ALIGN );
//      if (( align != null ) && align.toString().equals( "center" ))
//        constraints.hAlign = TableLayoutConstraints.CENTER;
     
// Attempt to force the centering     
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.