Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Component


        for (int i = 0; i < rowCount; i++) {
            TablePane.Row row = rows.get(i);

            for (int j = 0, n = row.getLength(); j < n && j < columnCount; j++) {
                Component component = row.get(j);

                if (component != null
                    && component.isVisible()) {

                    int rowSpan = TablePane.getRowSpan(component);
                    int columnSpan = TablePane.getColumnSpan(component);

                    for (int k = 0; k < rowSpan && i + k < rowCount; k++) {
View Full Code Here


        for (int i = 0, n = rows.getLength(); i < n; i++) {
            TablePane.Row row = rows.get(i);

            if (row.getLength() > columnIndex) {
                Component component = row.get(columnIndex);

                if (component != null
                    && component.isVisible()
                    && TablePane.getColumnSpan(component) == 1) {
                    preferredWidth = Math.max(preferredWidth,
                        component.getPreferredWidth(-1));
                }
            }
        }

        return preferredWidth;
View Full Code Here

        TablePane.Row row = tablePane.getRows().get(rowIndex);

        int preferredHeight = 0;

        for (int j = 0, n = row.getLength(), m = columns.getLength(); j < n && j < m; j++) {
            Component component = row.get(j);

            if (component != null
                && component.isVisible()
                && TablePane.getRowSpan(component) == 1) {
                preferredHeight = Math.max(preferredHeight,
                    component.getPreferredHeight(columnWidths[j]));
            }
        }

        return preferredHeight;
    }
View Full Code Here

        for (int i = 0; i < rowCount; i++) {
            TablePane.Row row = rows.get(i);

            for (int j = 0, n = row.getLength(); j < n && j < columnCount; j++) {
                Component component = row.get(j);

                if (component != null
                    && component.isVisible()) {
                    int columnSpan = TablePane.getColumnSpan(component);

                    if (columnSpan > 1) {
                        // We might need to adjust column widths to accomodate
                        // this spanning cell. First, we find out if any of the
                        // spanned cells are default width and how much space
                        // we've allocated thus far for those cells

                        boolean adjustCells = true;
                        int spannedDefaultWidthCellCount = 0;
                        int spannedWidth = 0;

                        for (int k = 0; k < columnSpan && j + k < columnCount; k++) {
                            if (columnWidths[j + k] < 0) {
                                adjustCells = false;
                                break;
                            }

                            if (defaultWidthColumns[j + k]) {
                                spannedDefaultWidthCellCount++;
                            }

                            spannedWidth += columnWidths[j + k];
                        }

                        // If we span any relative-width columns, we assume
                        // that we'll achieve the desired spanning width when
                        // we divvy up the remaining space, so there's no need
                        // to make an adjustment here. This assumption is safe
                        // because our preferred width policy is to *either*
                        // divide the adjustment among the relative-width
                        // columns *or* among the default-width columns if we
                        // don't span any relative-width columns

                        if (adjustCells
                            && spannedDefaultWidthCellCount > 0) {
                            int componentPreferredWidth = component.getPreferredWidth(-1);

                            if (componentPreferredWidth > spannedWidth) {
                                // The component's preferred width is larger
                                // than the width we've allocated thus far, so
                                // an adjustment is necessary
View Full Code Here

        for (int i = 0; i < rowCount; i++) {
            TablePane.Row row = rows.get(i);

            for (int j = 0, n = row.getLength(); j < n && j < columnCount; j++) {
                Component component = row.get(j);

                if (component != null
                    && component.isVisible()) {
                    int rowSpan = TablePane.getRowSpan(component);

                    if (rowSpan > 1) {
                        // We might need to adjust row heights to accomodate
                        // this spanning cell. First, we find out if any of the
                        // spanned cells are default height and how much space
                        // we've allocated thus far for those cells

                        boolean adjustCells = true;
                        int spannedDefaultHeightCellCount = 0;
                        int spannedHeight = 0;

                        for (int k = 0; k < rowSpan && i + k < rowCount; k++) {
                            if (rowHeights[i + k] < 0) {
                                adjustCells = false;
                                break;
                            }

                            if (defaultHeightRows[i + k]) {
                                spannedDefaultHeightCellCount++;
                            }

                            spannedHeight += rowHeights[i + k];
                        }

                        // If we span any relative-height rows, we assume
                        // that we'll achieve the desired spanning height when
                        // we divvy up the remaining space, so there's no need
                        // to make an adjustment here. This assumption is safe
                        // because our preferred height policy is to *either*
                        // divide the adjustment among the relative-height
                        // rows *or* among the default-height rows if we
                        // don't span any relative-height rows

                        if (adjustCells
                            && spannedDefaultHeightCellCount > 0) {
                            int componentPreferredHeight =
                                component.getPreferredHeight(columnWidths[j]);

                            if (componentPreferredHeight > spannedHeight) {
                                // The component's preferred height is larger
                                // than the height we've allocated thus far, so
                                // an adjustment is necessary
View Full Code Here

            if (direction == null) {
                throw new IllegalArgumentException("direction is null.");
            }

            Component nextComponent = null;

            int n = container.getLength();
            if (n > 0) {
                switch (direction) {
                    case FORWARD: {
View Full Code Here

        int preferredCellWidth = 0;
        for (int i = 0; i < rowCount; i++) {
            GridPane.Row row = rows.get(i);

            for (int j = 0, n = row.getLength(); j < n && j < columnCount; j++) {
                Component component = row.get(j);

                if (component != null
                    && component.isVisible()) {
                    preferredCellWidth = Math.max(preferredCellWidth,
                        component.getPreferredWidth(cellHeight));
                }
            }
        }

        // The preferred width of the grid pane is the sum of the column
View Full Code Here

        int preferredCellHeight = 0;
        for (int i = 0; i < rowCount; i++) {
            GridPane.Row row = rows.get(i);

            for (int j = 0, n = row.getLength(); j < n && j < columnCount; j++) {
                Component component = row.get(j);

                if (component != null
                    && component.isVisible()) {
                    preferredCellHeight = Math.max(preferredCellHeight,
                        component.getPreferredHeight(cellWidth));
                }
            }
        }

        // The preferred height of the grid pane is the sum of the row
View Full Code Here

        int preferredCellWidth = 0;
        for (int i = 0; i < rowCount; i++) {
            GridPane.Row row = rows.get(i);

            for (int j = 0, n = row.getLength(); j < n && j < columnCount; j++) {
                Component component = row.get(j);

                if (component != null
                    && component.isVisible()) {
                    Dimensions d = component.getPreferredSize();
                    preferredCellHeight = Math.max(preferredCellHeight, d.height);
                    preferredCellWidth = Math.max(preferredCellWidth, d.width);
                }
            }
        }
View Full Code Here

        for (int i = 0; i < rowCount && baseline == -1; i++) {
            if (metadata.isRowVisible(i)) {
                GridPane.Row row = rows.get(i);

                for (int j = 0, n = row.getLength(); j < n && j < columnCount && baseline == -1; j++) {
                    Component component = row.get(j);

                    if (component != null
                        && component.isVisible()) {
                        baseline = component.getBaseline(cellWidth, cellHeight);

                        if (baseline != -1) {
                            baseline += rowY;
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Component

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.