Package pivot.wtk

Examples of pivot.wtk.Component$ComponentMouseButtonListenerList


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

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

                if (child != null) {
                    if (child.isDisplayable()) {
                        child.setLocation(componentX, componentY);

                        int columnSpan = TablePane.getColumnSpan(child);
                        int childWidth = (columnSpan - 1) * horizontalSpacing;
                        for (int k = 0; k < columnSpan && j + k < columnCount; k++) {
                            childWidth += columnWidths[j + k];
                        }

                        int rowSpan = TablePane.getRowSpan(child);
                        int childHeight = (rowSpan - 1) * verticalSpacing;
                        for (int k = 0; k < rowSpan && i + k < rowCount; k++) {
                            childHeight += rowHeights[i + k];
                        }

                        // Set the component's size
                        child.setSize(Math.max(childWidth, 0), Math.max(childHeight, 0));

                        // Show the component
                        child.setVisible(true);
                    } else {
                        // Hide the component
                        child.setVisible(false);
                    }
                }

                componentX += (columnWidths[j] + horizontalSpacing);
            }
View Full Code Here


            // cells. We'll only instantiate gridClip if we find such cells
            Area gridClip = null;

            for (int i = 0, componentY = padding.top; i < rowCount; i++) {
                for (int j = 0, componentX = padding.left; j < columnCount; j++) {
                    Component component = tablePane.getCellComponent(i, j);

                    if (component != null) {
                        int rowSpan = TablePane.getRowSpan(component);
                        int columnSpan = TablePane.getColumnSpan(component);
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.isDisplayable()
                    && TablePane.getColumnSpan(component) == 1) {
                    int rowHeight = -1;

                    if (rowHeights != null) {
                        rowHeight = rowHeights[i];
                    } else if (!row.isRelative()) {
                        rowHeight = row.getHeight();
                    }

                    preferredWidth = Math.max(preferredWidth,
                        component.getPreferredWidth(rowHeight));
                }
            }
        }

        return preferredWidth;
View Full Code Here

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

        int preferredHeight = 0;

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

            if (component != null
                && component.isDisplayable()
                && TablePane.getRowSpan(component) == 1) {
                TablePane.Column column = columns.get(i);
                int columnWidth = -1;

                if (columnWidths != null) {
                    columnWidth = columnWidths[i];
                } else if (!column.isRelative()) {
                    columnWidth = column.getWidth();
                }

                preferredHeight = Math.max(preferredHeight,
                    component.getPreferredHeight(columnWidth));
            }
        }

        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.isDisplayable()) {
                    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

                        int spannedDefaultWidthCellCount = 0;
                        int spannedRelativeWeight = 0;
                        int spannedWidth = 0;

                        for (int k = 0; k < columnSpan && j + k < columnCount; k++) {
                            if (defaultWidthColumns[j + k]) {
                                spannedDefaultWidthCellCount++;
                            }

                            if (columnWidths[j + k] < 0) {
                                spannedRelativeWeight += -columnWidths[j + k];
                            } else {
                                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 (spannedRelativeWeight == 0
                            && spannedDefaultWidthCellCount > 0) {
                            int rowHeight = -1;

                            if (rowHeights != null) {
                                rowHeight = rowHeights[i];
                            } else if (!row.isRelative()) {
                                rowHeight = row.getHeight();
                            }

                            int componentPreferredWidth = component.getPreferredWidth(rowHeight);

                            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.isDisplayable()) {
                    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

                        int spannedDefaultHeightCellCount = 0;
                        int spannedRelativeWeight = 0;
                        int spannedHeight = 0;

                        for (int k = 0; k < rowSpan && i + k < rowCount; k++) {
                            if (defaultHeightRows[i + k]) {
                                spannedDefaultHeightCellCount++;
                            }

                            if (rowHeights[i + k] < 0) {
                                spannedRelativeWeight += -rowHeights[i + k];
                            } else {
                                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 (spannedRelativeWeight == 0
                            && spannedDefaultHeightCellCount > 0) {
                            TablePane.Column column = columns.get(j);
                            int columnWidth = -1;

                            if (columnWidths != null) {
                                columnWidth = columnWidths[j];
                            } else if (!column.isRelative()) {
                                columnWidth = column.getWidth();
                            }

                            int componentPreferredHeight =
                                component.getPreferredHeight(columnWidth);

                            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 (display != null) {
                    int width = getWidth();
                    int height = getHeight();

                    Component content = listViewPopup.getContent();

                    // Ensure that the popup remains within the bounds of the display
                    Point buttonLocation = listButton.mapPointToAncestor(display, 0, 0);

                    Dimensions displaySize = display.getSize();
                    Dimensions popupSize = content.getPreferredSize();

                    int x = buttonLocation.x;
                    if (popupSize.width > width
                        && x + popupSize.width > displaySize.width) {
                        x = buttonLocation.x + width - popupSize.width;
View Full Code Here

        if (expandTransition == null) {
          preferredWidth = 2;

            Expander expander = (Expander)getComponent();
            Component content = expander.getContent();

            int titleBarPreferredWidth = titleBarFlowPane.getPreferredWidth(-1);
            int contentPreferredWidth = 0;

            if (content != null) {
                int contentHeightConstraint = -1;

                if (height >= 0) {
                    int reservedHeight = 2 + padding.top + padding.bottom
                        + titleBarFlowPane.getPreferredHeight(-1);

                    if (expander.isExpanded()) {
                        // Title bar border is only drawn when expander is expanded
                        reservedHeight += 1;
                    }

                    contentHeightConstraint = Math.max(height - reservedHeight, 0);
                }

                contentPreferredWidth = padding.left + padding.right
                    + content.getPreferredWidth(contentHeightConstraint);
            }

            preferredWidth += Math.max(titleBarPreferredWidth, contentPreferredWidth);
        } else {
          preferredWidth = getWidth();
View Full Code Here

        Expander expander = (Expander)getComponent();
        if (expander.isExpanded()) {
            // Title bar border is only drawn when expander is expanded
            preferredHeight += 1;

            Component content = expander.getContent();
            if (content != null) {
                int contentWidthConstraint = -1;

                if (width >= 0) {
                    int reservedWidth = 2 + padding.left + padding.right;
                    contentWidthConstraint = Math.max(width - reservedWidth, 0);
                }

                if (expandTransition == null) {
                    preferredHeight += (padding.top + padding.bottom
                        + content.getPreferredHeight(contentWidthConstraint));
                } else {
                    float scale = expandTransition.getScale();
                    preferredHeight += (int)(scale * (float)(padding.top + padding.bottom
                    + content.getHeight()));
                }
            }
        }

        return preferredHeight;
View Full Code Here

            this.getPreferredHeight(-1));
    }

    public void layout() {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        int width = getWidth();
        int height = getHeight();

        int titleBarHeight;
        if (expandTransition == null) {
            titleBarHeight = titleBarFlowPane.getPreferredHeight(-1);
            titleBarFlowPane.setSize(Math.max(width - 2, 0), titleBarHeight);
            titleBarFlowPane.setLocation(1, 1);
        } else {
          titleBarHeight = titleBarFlowPane.getHeight();
        }

        if (content != null) {
            if (expander.isExpanded()) {
                content.setVisible(true);

                int reservedWidth = 2 + padding.left + padding.right;
                int contentWidth = Math.max(width - reservedWidth, 0);

                int reservedHeight = 3 + padding.top + padding.bottom + titleBarHeight;
                int contentHeight = Math.max(height - reservedHeight, 0);

                if (expandTransition == null) {
                  content.setSize(contentWidth, contentHeight);
                } else {
                  if (!expandTransition.isRunning()) {
                      content.setSize(contentWidth, content.getPreferredHeight(contentWidth));
                  }

                  expandTransition.clipDecorator.setWidth(contentWidth);
                  expandTransition.clipDecorator.setHeight(contentHeight);
                }

                int contentX = 1 + padding.left;
                int contentY = 2 + padding.top + titleBarHeight;

                content.setLocation(contentX, contentY);
            } else {
                content.setVisible(false);
            }
        }
    }
View Full Code Here

TOP

Related Classes of pivot.wtk.Component$ComponentMouseButtonListenerList

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.