Package org.flexdock.docking

Examples of org.flexdock.docking.DockingPort


        if(docked!=null) {
            Component comp = dockable.getComponent();
            if(port.isDockingAllowed(comp, CENTER_REGION)) {
                return dock(dockable, port, CENTER_REGION, null);
            }
            DockingPort superPort = (DockingPort)SwingUtilities.getAncestorOfClass(DockingPort.class, (Component)port);
            if(superPort!=null)
                port = superPort;
            return dock(dockable, port, region, getLastNode());
        }
View Full Code Here


        Set dockables = port.getDockables();
        for(Iterator it=dockables.iterator(); lastSibling!=null && it.hasNext();) {
            Dockable d = (Dockable)it.next();
            if(d.getPersistentId().equals(lastSibling)) {
                DockingPort embedPort = d.getDockingPort();
                String embedRegion = getRegion(lastNode, d.getComponent());
                return dock(dockable, embedPort, embedRegion, ctrlNode);
            }
        }
View Full Code Here

    private void setCurrentDragOperation(DragOperation operation) {
        DragOperation current = DragManager.getCurrentDragOperation();
        if(operation==current)
            return;

        DockingPort srcPort = operation==null? current.getSourcePort(): operation.getSourcePort();
        DragManager.setCurrentDragOperation(operation);
        if(srcPort instanceof Component)
            SwingUtility.repaint((Component)srcPort);

        // TODO: We want to get rid of this code in the future.  I don't like
View Full Code Here

    }


    protected void finishDrag(Dockable dockable, DragOperation token, MouseEvent mouseEvt) {
        DockingStrategy docker = DockingManager.getDockingStrategy(dockable);
        DockingPort currentPort = DockingUtility.getParentDockingPort(dockable);
        DockingPort targetPort = token.getTargetPort();
        String region = token.getTargetRegion();

        // remove the listeners from the drag-source and all the old ones back in
        restoreCachedListeners(token);
View Full Code Here

        for (int i = 0; i < cachedListeners.length; i++)
            dragSrc.addMouseMotionListener((MouseMotionListener) cachedListeners[i]);
    }

    private static boolean isDragCanceled(Dockable dockable, MouseEvent trigger) {
        DockingPort port = DockingUtility.getParentDockingPort(dockable);
        Map dragContext = getDragContext(dockable);
        DockingEvent evt = new DockingEvent(dockable, port, null, DockingEvent.DRAG_STARTED, trigger, dragContext);
        EventManager.dispatch(evt, dockable);
        return evt.isConsumed();
    }
View Full Code Here

     */
    public static Dockable getSibling(Dockable dockable) {
        if (dockable == null)
            return null;

        DockingPort port = dockable.getDockingPort();
        String startRegion = findRegion(dockable.getComponent());
        String region = DockingUtility.flipRegion(startRegion);
        Dockable sibling = findDockable(port, dockable.getComponent(), region,
                                        startRegion);

View Full Code Here

    public static Dockable getSibling(Dockable dockable, String region) {
        if (dockable == null || !DockingManager.isValidDockingRegion(region)
                || CENTER_REGION.equals(region))
            return null;

        DockingPort port = dockable.getDockingPort();
        String startRegion = findRegion(dockable.getComponent());
        Dockable sibling = findDockable(port, dockable.getComponent(), region,
                                        startRegion);

        return sibling;
View Full Code Here

        Component docked = port.getDockedComponent();
        // if we're not a split port, then there is no concept of 'outer
        // regions'.
        // jump up a level to find the parent split port
        if (!(docked instanceof JSplitPane)) {
            DockingPort superPort = DockingManager
                                    .getDockingPort((Component) port);
            return findDockable(superPort, self, region, startRegion);
        }

        Component sibling = port.getComponent(region);
        if (sibling == self) {
            if (!(self instanceof JSplitPane)) {
                DockingPort superPort = DockingManager
                                        .getDockingPort((Component) port);

                return findDockable(superPort, self, region, startRegion);
            }
            return null;
        }

        if (sibling instanceof JSplitPane) {
            // go one level deeper
            DockingPort subPort = DockingManager.getDockingPort(sibling);
            Component other = port.getComponent(DockingUtility
                                                .flipRegion(region));
            String subRegion = findSubRegion((JSplitPane) sibling, other,
                                             region, startRegion);
            return findDockable(subPort, self, subRegion, startRegion);
        }

        // if we have no direct sibling in the specified region, the jump
        // up a level.
        if (sibling == null) {
            DockingPort superPort = DockingManager
                                    .getDockingPort((Component) port);
            self = port.getDockedComponent();
            return findDockable(superPort, self, region, startRegion);
        }
View Full Code Here

     */
    public static String findRegion(Component comp) {
        if (comp == null)
            return null;

        DockingPort port = DockingManager.getDockingPort(comp);
        Component docked = port.getDockedComponent();

        if (!(docked instanceof JSplitPane)) {
            // we didn't find a split pane, to check the grandparent dockingport
            DockingPort superPort = DockingManager
                                    .getDockingPort((Component) port);
            // if there was no grandparent DockingPort, then we're stuck with
            // the docked
            // component we already found. this can happen on the root
            // dockingport.
            docked = superPort == null ? docked : superPort
                     .getDockedComponent();
        }

        if (!(docked instanceof JSplitPane))
            return CENTER_REGION;
View Full Code Here

        if (!dragThresholdElapsed(operation))
            return false;

        // cache the old parent
        DockingPort oldPort = dockable.getDockingPort();

        // perform the drop operation.
        DockingResults results = dropComponent(dockable, port, region,
                                               operation);

        // perform post-drag operations
        DockingPort newPort = results.dropTarget;
        int evtType = results.success ? DockingEvent.DOCKING_COMPLETE
                      : DockingEvent.DOCKING_CANCELED;
        Map dragContext = DragManager.getDragContext(dockable);
        DockingEvent evt = new DockingEvent(dockable, oldPort, newPort,
                                            evtType, dragContext);
View Full Code Here

TOP

Related Classes of org.flexdock.docking.DockingPort

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.