Package pivot.wtk

Examples of pivot.wtk.SplitPane


    @Override
    public void install(Component component) {
        super.install(component);

        SplitPane splitPane = (SplitPane)component;
        splitPane.getSplitPaneListeners().add(this);

        splitPane.add(splitter);
        updateSplitterCursor();
    }
View Full Code Here


        updateSplitterCursor();
    }

    @Override
    public void uninstall() {
        SplitPane splitPane = (SplitPane)getComponent();
        splitPane.getSplitPaneListeners().remove(this);

        splitPane.remove(splitter);

        super.uninstall();
    }
View Full Code Here

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

        SplitPane splitPane = (SplitPane)getComponent();
        int splitLocation = splitPane.getSplitLocation();
        Component leftComponent = splitPane.getTopLeftComponent();
        Component rightComponent = splitPane.getBottomRightComponent();

        int rightStart = splitLocation + splitterThickness;

        if (splitPane.getOrientation() == Orientation.HORIZONTAL) {
            splitter.setLocation(splitLocation, 0);
            splitter.setSize(splitterThickness, height);

            if (leftComponent != null) {
                leftComponent.setLocation(0, 0);
View Full Code Here

        updateSplitterCursor();
    }

    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

        public void layout() {
            // No-op
        }

        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

        @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;
                if (orientation == Orientation.HORIZONTAL) {
                    splitLocation = component.getX() + x - dragOffset;
                } else {
                    splitLocation = component.getY() + y - dragOffset;
                }

                // Bound the split location
                splitLocation = boundSplitLocation(splitLocation);

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

        @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

            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;
                    if (splitPane.getOrientation() == Orientation.HORIZONTAL) {
                        splitLocation = shadow.getX();
                    } else {
                        splitLocation = shadow.getY();
                    }

                    splitPane.setSplitLocation(splitLocation);

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

                Mouse.release();
            }
View Full Code Here

            return consumed;
        }

        private int boundSplitLocation(int splitLocation) {
            SplitPane splitPane = (SplitPane)TerraSplitPaneSkin.this.getComponent();

            int lower = 0;
            int upper;
            if (splitPane.getOrientation() == Orientation.HORIZONTAL) {
                upper = splitPane.getWidth() - splitterThickness;
            } else {
                upper = splitPane.getHeight() - splitterThickness;
            }

            Span bounds = splitPane.getSplitBounds();
            if (bounds != null) {
                lower = Math.max(lower, bounds.getStart());
                upper = Math.min(upper, bounds.getEnd());
            }
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        SplitPane splitPane = (SplitPane)component;
        splitPane.getSplitPaneListeners().add(this);

        splitPane.add(splitter);
        updateSplitterCursor();
    }
View Full Code Here

TOP

Related Classes of pivot.wtk.SplitPane

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.