Examples of SplitPane


Examples of org.apache.pivot.wtk.SplitPane

        int previousWidth = getWidth();
        int previousHeight = getHeight();

        super.setSize(width, height);

        SplitPane splitPane = (SplitPane)getComponent();
        Orientation orientation = splitPane.getOrientation();

        if (splitPane.getResizeMode() == SplitPane.ResizeMode.PRIMARY_REGION
            && ((previousWidth != width && orientation == Orientation.HORIZONTAL)
            || (previousHeight != height && orientation == Orientation.VERTICAL))) {
            SplitPane.Region primaryRegion = splitPane.getPrimaryRegion();
            float splitRatio = splitPane.getSplitRatio();

            if (orientation == Orientation.HORIZONTAL) {
                int splitLocation = (int)(splitRatio * previousWidth);

                if (primaryRegion == SplitPane.Region.BOTTOM_RIGHT) {
                    // Move the split location to maintain size on the right
                    splitLocation += (width - previousWidth);
                }

                splitRatio = (float)limitSplitLocation(splitLocation) / width;
            } else {
                int splitLocation = (int)(splitRatio * previousHeight);

                if (primaryRegion == SplitPane.Region.BOTTOM_RIGHT) {
                    // Move the split location to maintain size on the bottom
                    splitLocation += (height - previousHeight);
                }

                splitRatio = (float)limitSplitLocation(splitLocation) / height;
            }

            splitPane.setSplitRatio(splitRatio);
        }
    }
View Full Code Here

Examples of org.apache.pivot.wtk.SplitPane

    @Override
    public void layout() {
        int width = getWidth();
        int height = getHeight();

        SplitPane splitPane = (SplitPane)getComponent();

        float splitRatio = splitPane.getSplitRatio();
        Component topLeft = splitPane.getTopLeft();
        Component bottomRight = splitPane.getBottomRight();

        if (splitPane.getOrientation() == Orientation.HORIZONTAL) {
            int splitLocation = limitSplitLocation((int)(splitRatio * width));
            int rightStart = splitLocation + splitterThickness;
            splitter.setLocation(splitLocation, 0);
            splitter.setSize(splitterThickness, height);

View Full Code Here

Examples of org.apache.pivot.wtk.SplitPane

        // No-op
    }

    private void updateSplitterCursor() {
        Cursor cursor = Cursor.DEFAULT;
        SplitPane splitPane = (SplitPane)getComponent();

        if (!splitPane.isLocked()) {
            switch (splitPane.getOrientation()) {
                case HORIZONTAL: {
                    switch (splitPane.getPrimaryRegion()) {
                        case TOP_LEFT:
                            cursor = Cursor.RESIZE_EAST;
                            break;
                        case BOTTOM_RIGHT:
                            cursor = Cursor.RESIZE_WEST;
                            break;
                    }

                    break;
                }

                case VERTICAL: {
                    switch (splitPane.getPrimaryRegion()) {
                        case TOP_LEFT:
                            cursor = Cursor.RESIZE_SOUTH;
                            break;
                        case BOTTOM_RIGHT:
                            cursor = Cursor.RESIZE_NORTH;
View Full Code Here

Examples of org.apache.pivot.wtk.SplitPane

        splitter.setCursor(cursor);
    }

    private int limitSplitLocation(int splitLocation) {
        SplitPane splitPane = (SplitPane)getComponent();

        Component topLeft = splitPane.getTopLeft();
        Component bottomRight = splitPane.getBottomRight();

        int lower, upper;

        if (splitPane.getOrientation() == Orientation.HORIZONTAL) {
            lower = 0;
            upper = Math.max(getWidth() - splitterThickness, 0);

            if (topLeft  != null) {
                int leftLimit = topLeft.getMinimumWidth();
View Full Code Here

Examples of org.apache.pivot.wtk.SplitPane

            // No-op
        }

        @Override
        public void paint(Graphics2D graphics) {
            SplitPane splitPane = (SplitPane)TerraSplitPaneSkin.this.getComponent();

            Orientation orientation = splitPane.getOrientation();

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

            int imageWidth, imageHeight;
View Full Code Here

Examples of org.apache.pivot.wtk.SplitPane

        @Override
        public boolean mouseMove(Component component, int x, int y) {
            boolean consumed = super.mouseMove(component, x, y);

            if (Mouse.getCapturer() == component) {
                SplitPane splitPane = (SplitPane)TerraSplitPaneSkin.this.getComponent();
                Orientation orientation = splitPane.getOrientation();

                // Calculate the would-be new split location
                int splitLocation;
                float splitRatio;
                if (orientation == Orientation.HORIZONTAL) {
                    splitLocation = limitSplitLocation(component.getX() + x - dragOffset);
                    splitRatio = (float)splitLocation / splitPane.getWidth();
                } else {
                    splitLocation = limitSplitLocation(component.getY() + y - dragOffset);
                    splitRatio = (float)splitLocation / splitPane.getHeight();
                }

                if (shadow == null) {
                    // Update the split location immediately
                    splitPane.setSplitRatio(splitRatio);
                } else {
                    // Move the shadow to the split location
                    if (orientation == Orientation.HORIZONTAL) {
                        shadow.setLocation(splitLocation, 0);
                    } else {
View Full Code Here

Examples of org.apache.pivot.wtk.SplitPane

        @Override
        public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
            boolean consumed = super.mouseDown(component, button, x, y);

            SplitPane splitPane = (SplitPane)TerraSplitPaneSkin.this.getComponent();

            if (button == Mouse.Button.LEFT
                && !splitPane.isLocked()) {
                Orientation orientation = splitPane.getOrientation();

                if (useShadow) {
                    // Add the shadow to the split pane and lay it out
                    shadow = new SplitterShadow();
                    splitPane.add(shadow);

                    if (orientation == Orientation.HORIZONTAL) {
                        shadow.setLocation(component.getX(), 0);
                    } else {
                        shadow.setLocation(0, component.getY());
View Full Code Here

Examples of org.apache.pivot.wtk.SplitPane

            boolean consumed = super.mouseUp(component, button, x, y);

            if (button == Mouse.Button.LEFT
                && Mouse.getCapturer() == component) {
                if (shadow != null) {
                    SplitPane splitPane = (SplitPane)TerraSplitPaneSkin.this.getComponent();

                    // Update the split location and remove the shadow
                    int splitLocation;
                    float splitRatio;
                    if (splitPane.getOrientation() == Orientation.HORIZONTAL) {
                        splitLocation = shadow.getX();
                        splitRatio = (float)splitLocation / splitPane.getWidth();
                    } else {
                        splitLocation = shadow.getY();
                        splitRatio = (float)splitLocation / splitPane.getHeight();
                    }

                    splitPane.setSplitRatio(splitRatio);

                    splitPane.remove(shadow);
                    shadow = null;
                }

                Mouse.release();
            }
View Full Code Here

Examples of org.onemind.swingweb.client.gwt.widget.SplitPane

        super(client);
    }

    protected Object createComponentInstance(Object parent, DomNode element)
    {
        SplitPane sp = new SplitPane();
        return sp;
    }
View Full Code Here

Examples of org.onemind.swingweb.client.gwt.widget.SplitPane

        return sp;
    }

    protected void handleChildren(AbstractClient rootHandler, IContainer c, DomNode element)
    {
        SplitPane sp = (SplitPane) c;
        List firstChild = getChildrenByTag(element, "firstComponent");
        if (firstChild.size() > 0)
        {
            DomNode childNode = (DomNode) firstChild.get(0);
            Widget w = (Widget) rootHandler.handle(c, getFirstChildElement(childNode));
            sp.setFirstComponent(w);
        }
        List secondChild = getChildrenByTag(element, "secondComponent");
        if (secondChild.size() > 0)
        {
            DomNode childNode = (DomNode) secondChild.get(0);
            Widget w = (Widget) rootHandler.handle(c, getFirstChildElement(childNode));
            sp.setSecondComponent(w);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.