Package org.flexdock.docking

Examples of org.flexdock.docking.Dockable


     */
    public boolean dock(Component comp, String region) {
        if (comp == null || region == null)
            return false;

        Dockable dockable = DockingManager.getDockable(comp);
        if (dockable == null)
            dockable = DockingManager.registerDockable(comp);

        return dock(dockable, region);
    }
View Full Code Here


    }

    private void addTab(JTabbedPane tabs, Component comp) {
        String tabText = getValidTabTitle(tabs, comp);
        tabs.add(comp, tabText);
        Dockable d = DockingManager.getDockable(comp);
        if (d == null)
            return;

        Icon icon = d.getDockingProperties().getTabIcon();
        int indx = tabs.getTabCount() - 1;
        tabs.setIconAt(indx, icon);
    }
View Full Code Here

     * @param evt
     *            the {@code DockingEvent} to respond to.
     * @see DockingListener#dockingComplete(DockingEvent)
     */
    public void dockingComplete(DockingEvent evt) {
        Dockable dockable = evt.getDockable();
        if (dockable == null || !isShowing() || evt.getNewDockingPort() != this)
            return;

        ActiveDockableTracker
        .requestDockableActivation(dockable.getComponent());
    }
View Full Code Here

        }

        for (Enumeration en = node.children(); en.hasMoreElements();) {
            LayoutNode child = (LayoutNode) en.nextElement();
            if (child instanceof DockableNode) {
                Dockable dockable = ((DockableNode) child).getDockable();
                port.dock(dockable, CENTER_REGION);
            }
        }
    }
View Full Code Here

    public void dragStarted(DockingEvent evt) {
        super.dragStarted(evt);

        Component dragSrc = (Component)evt.getTriggerSource();
        Dockable dockable = (Dockable)evt.getSource();

        boolean listenerEnabled = getFrameDragSources(dockable).contains(dragSrc);
        dragListener.setEnabled(listenerEnabled);
        if(listenerEnabled) {
            evt.consume();
View Full Code Here

            frame = null;
        }
    }

    protected void toggleListeners(Component comp, boolean add) {
        Dockable dockable = DockingManager.getDockable(comp);
        if(add)
            installListeners(dockable);
        else
            uninstallListeners(dockable);
    }
View Full Code Here

            newVal = ((JTabbedPane)newVal).getSelectedComponent();
        activateComponent(newVal);
    }

    private void activateComponent(Component c) {
        Dockable dockable = DockingUtility.getAncestorDockable(c);
        if(dockable==null)
            return;

        ActiveDockableTracker tracker = ActiveDockableTracker.getTracker(dockable.getComponent());
        if(tracker!=null) {
            tracker.setActive(dockable);
        }
    }
View Full Code Here

    public void stateChanged(ChangeEvent e) {
        Object obj = e.getSource();
        if(obj instanceof JTabbedPane) {
            JTabbedPane pane = (JTabbedPane)obj;
            Component c = pane.getSelectedComponent();
            Dockable dockable = DockingManager.getDockable(c);
            if(dockable!=null) {
                activateComponent(dockable.getComponent());
                udpateTabChangeFocus(dockable);
            }
        }
    }
View Full Code Here

        }
    }

    private void udpateTabChangeFocus(final Dockable dockable) {
        KeyboardFocusManager mgr = KeyboardFocusManager.getCurrentKeyboardFocusManager();
        Dockable focusParent = DockingUtility.getAncestorDockable(mgr.getFocusOwner());
        if(focusParent==null || focusParent==dockable)
            return;

        // the current focusParent-dockable is different than the currently active dockable.
        // we'll need to update the focus component
View Full Code Here

    public DockingPath() {
        nodes = new ArrayList();
    }

    public static DockingPath create(String dockableId) {
        Dockable dockable = findDockable(dockableId);
        return create(dockable);
    }
View Full Code Here

TOP

Related Classes of org.flexdock.docking.Dockable

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.